binance_openapi/codegen.rs
1
2 #![allow(dead_code, deprecated)]
3 #![allow(clippy::needless_lifetimes, clippy::too_many_arguments, clippy::from_str_radix_10, clippy::vec_init_then_push)]
4
5 use crate::datetimerfc3339::*;
6 #[allow(unused_imports)]
7pub use progenitor_client::{ByteStream, Error, ResponseValue};
8#[allow(unused_imports)]
9use progenitor_client::{encode_path, RequestBuilderExt};
10#[allow(unused_imports)]
11use reqwest::header::{HeaderMap, HeaderValue};
12/// Types used as operation parameters and responses.
13#[allow(clippy::all)]
14pub mod types {
15 use serde::{Deserialize, Serialize};
16 #[allow(unused_imports)]
17 use std::convert::TryFrom;
18 /// Error types.
19 pub mod error {
20 /// Error from a TryFrom or FromStr implementation.
21 pub struct ConversionError(std::borrow::Cow<'static, str>);
22 impl std::error::Error for ConversionError {}
23 impl std::fmt::Display for ConversionError {
24 fn fmt(
25 &self,
26 f: &mut std::fmt::Formatter<'_>,
27 ) -> Result<(), std::fmt::Error> {
28 std::fmt::Display::fmt(&self.0, f)
29 }
30 }
31 impl std::fmt::Debug for ConversionError {
32 fn fmt(
33 &self,
34 f: &mut std::fmt::Formatter<'_>,
35 ) -> Result<(), std::fmt::Error> {
36 std::fmt::Debug::fmt(&self.0, f)
37 }
38 }
39 impl From<&'static str> for ConversionError {
40 fn from(value: &'static str) -> Self {
41 Self(value.into())
42 }
43 }
44 impl From<String> for ConversionError {
45 fn from(value: String) -> Self {
46 Self(value.into())
47 }
48 }
49 }
50 ///Account
51 ///
52 /// <details><summary>JSON schema</summary>
53 ///
54 /// ```json
55 ///{
56 /// "type": "object",
57 /// "required": [
58 /// "accountType",
59 /// "balances",
60 /// "brokered",
61 /// "buyerCommission",
62 /// "canDeposit",
63 /// "canTrade",
64 /// "canWithdraw",
65 /// "commissionRates",
66 /// "makerCommission",
67 /// "permissions",
68 /// "preventSor",
69 /// "requireSelfTradePrevention",
70 /// "sellerCommission",
71 /// "takerCommission",
72 /// "uid",
73 /// "updateTime"
74 /// ],
75 /// "properties": {
76 /// "accountType": {
77 /// "examples": [
78 /// "SPOT"
79 /// ],
80 /// "type": "string"
81 /// },
82 /// "balances": {
83 /// "type": "array",
84 /// "items": {
85 /// "type": "object",
86 /// "required": [
87 /// "asset",
88 /// "free",
89 /// "locked"
90 /// ],
91 /// "properties": {
92 /// "asset": {
93 /// "examples": [
94 /// "BTC"
95 /// ],
96 /// "type": "string"
97 /// },
98 /// "free": {
99 /// "examples": [
100 /// "4723846.89208129"
101 /// ],
102 /// "type": "string"
103 /// },
104 /// "locked": {
105 /// "examples": [
106 /// "0.00000000"
107 /// ],
108 /// "type": "string"
109 /// }
110 /// }
111 /// }
112 /// },
113 /// "brokered": {
114 /// "examples": [
115 /// false
116 /// ],
117 /// "type": "boolean"
118 /// },
119 /// "buyerCommission": {
120 /// "examples": [
121 /// 0
122 /// ],
123 /// "type": "integer",
124 /// "format": "int64"
125 /// },
126 /// "canDeposit": {
127 /// "type": "boolean"
128 /// },
129 /// "canTrade": {
130 /// "type": "boolean"
131 /// },
132 /// "canWithdraw": {
133 /// "type": "boolean"
134 /// },
135 /// "commissionRates": {
136 /// "type": "object",
137 /// "required": [
138 /// "buyer",
139 /// "maker",
140 /// "seller",
141 /// "taker"
142 /// ],
143 /// "properties": {
144 /// "buyer": {
145 /// "examples": [
146 /// "0.00000000"
147 /// ],
148 /// "type": "string"
149 /// },
150 /// "maker": {
151 /// "examples": [
152 /// "0.00150000"
153 /// ],
154 /// "type": "string"
155 /// },
156 /// "seller": {
157 /// "examples": [
158 /// "0.00000000"
159 /// ],
160 /// "type": "string"
161 /// },
162 /// "taker": {
163 /// "examples": [
164 /// "0.00150000"
165 /// ],
166 /// "type": "string"
167 /// }
168 /// }
169 /// },
170 /// "makerCommission": {
171 /// "examples": [
172 /// 15
173 /// ],
174 /// "type": "integer",
175 /// "format": "int64"
176 /// },
177 /// "permissions": {
178 /// "type": "array",
179 /// "items": {
180 /// "examples": [
181 /// "SPOT"
182 /// ],
183 /// "type": "string"
184 /// }
185 /// },
186 /// "preventSor": {
187 /// "examples": [
188 /// false
189 /// ],
190 /// "type": "boolean"
191 /// },
192 /// "requireSelfTradePrevention": {
193 /// "examples": [
194 /// false
195 /// ],
196 /// "type": "boolean"
197 /// },
198 /// "sellerCommission": {
199 /// "examples": [
200 /// 0
201 /// ],
202 /// "type": "integer",
203 /// "format": "int64"
204 /// },
205 /// "takerCommission": {
206 /// "examples": [
207 /// 15
208 /// ],
209 /// "type": "integer",
210 /// "format": "int64"
211 /// },
212 /// "uid": {
213 /// "examples": [
214 /// 354937868
215 /// ],
216 /// "type": "integer",
217 /// "format": "int64"
218 /// },
219 /// "updateTime": {
220 /// "examples": [
221 /// 123456789
222 /// ],
223 /// "type": "integer",
224 /// "format": "int64"
225 /// }
226 /// }
227 ///}
228 /// ```
229 /// </details>
230 #[derive(Clone, Debug, Deserialize, Serialize)]
231 pub struct Account {
232 #[serde(rename = "accountType")]
233 pub account_type: String,
234 pub balances: Vec<AccountBalancesItem>,
235 pub brokered: bool,
236 #[serde(rename = "buyerCommission")]
237 pub buyer_commission: i64,
238 #[serde(rename = "canDeposit")]
239 pub can_deposit: bool,
240 #[serde(rename = "canTrade")]
241 pub can_trade: bool,
242 #[serde(rename = "canWithdraw")]
243 pub can_withdraw: bool,
244 #[serde(rename = "commissionRates")]
245 pub commission_rates: AccountCommissionRates,
246 #[serde(rename = "makerCommission")]
247 pub maker_commission: i64,
248 pub permissions: Vec<String>,
249 #[serde(rename = "preventSor")]
250 pub prevent_sor: bool,
251 #[serde(rename = "requireSelfTradePrevention")]
252 pub require_self_trade_prevention: bool,
253 #[serde(rename = "sellerCommission")]
254 pub seller_commission: i64,
255 #[serde(rename = "takerCommission")]
256 pub taker_commission: i64,
257 pub uid: i64,
258 #[serde(rename = "updateTime")]
259 pub update_time: i64,
260 }
261 impl From<&Account> for Account {
262 fn from(value: &Account) -> Self {
263 value.clone()
264 }
265 }
266 ///AccountApiRestrictionsResponse
267 ///
268 /// <details><summary>JSON schema</summary>
269 ///
270 /// ```json
271 ///{
272 /// "type": "object",
273 /// "required": [
274 /// "createTime",
275 /// "enableFutures",
276 /// "enableInternalTransfer",
277 /// "enableMargin",
278 /// "enableReading",
279 /// "enableSpotAndMarginTrading",
280 /// "enableVanillaOptions",
281 /// "enableWithdrawals",
282 /// "ipRestrict",
283 /// "permitsUniversalTransfer",
284 /// "tradingAuthorityExpirationTime"
285 /// ],
286 /// "properties": {
287 /// "createTime": {
288 /// "examples": [
289 /// 1623840271000
290 /// ],
291 /// "type": "integer",
292 /// "format": "int64"
293 /// },
294 /// "enableFutures": {
295 /// "description": "API Key created before your futures account opened does not support futures API service",
296 /// "examples": [
297 /// false
298 /// ],
299 /// "type": "boolean"
300 /// },
301 /// "enableInternalTransfer": {
302 /// "description": "This option authorizes this key to transfer funds between your master account and your sub account instantly",
303 /// "type": "boolean"
304 /// },
305 /// "enableMargin": {
306 /// "description": "This option can be adjusted after the Cross Margin account transfer is completed",
307 /// "examples": [
308 /// false
309 /// ],
310 /// "type": "boolean"
311 /// },
312 /// "enablePortfolioMarginTrading": {
313 /// "description": "API Key created before your activate portfolio margin does not support portfolio margin API service",
314 /// "examples": [
315 /// false
316 /// ],
317 /// "type": "boolean"
318 /// },
319 /// "enableReading": {
320 /// "examples": [
321 /// true
322 /// ],
323 /// "type": "boolean"
324 /// },
325 /// "enableSpotAndMarginTrading": {
326 /// "examples": [
327 /// false
328 /// ],
329 /// "type": "boolean"
330 /// },
331 /// "enableVanillaOptions": {
332 /// "description": "Authorizes this key to Vanilla options trading",
333 /// "examples": [
334 /// false
335 /// ],
336 /// "type": "boolean"
337 /// },
338 /// "enableWithdrawals": {
339 /// "description": "This option allows you to withdraw via API. You must apply the IP Access Restriction filter in order to enable withdrawals",
340 /// "examples": [
341 /// false
342 /// ],
343 /// "type": "boolean"
344 /// },
345 /// "ipRestrict": {
346 /// "examples": [
347 /// false
348 /// ],
349 /// "type": "boolean"
350 /// },
351 /// "permitsUniversalTransfer": {
352 /// "description": "Authorizes this key to be used for a dedicated universal transfer API to transfer multiple supported currencies. Each business's own transfer API rights are not affected by this authorization",
353 /// "type": "boolean"
354 /// },
355 /// "tradingAuthorityExpirationTime": {
356 /// "description": "Expiration time for spot and margin trading permission",
357 /// "examples": [
358 /// 1628985600000
359 /// ],
360 /// "type": "integer",
361 /// "format": "int64"
362 /// }
363 /// }
364 ///}
365 /// ```
366 /// </details>
367 #[derive(Clone, Debug, Deserialize, Serialize)]
368 pub struct AccountApiRestrictionsResponse {
369 #[serde(rename = "createTime")]
370 pub create_time: i64,
371 ///API Key created before your futures account opened does not support futures API service
372 #[serde(rename = "enableFutures")]
373 pub enable_futures: bool,
374 ///This option authorizes this key to transfer funds between your master account and your sub account instantly
375 #[serde(rename = "enableInternalTransfer")]
376 pub enable_internal_transfer: bool,
377 ///This option can be adjusted after the Cross Margin account transfer is completed
378 #[serde(rename = "enableMargin")]
379 pub enable_margin: bool,
380 ///API Key created before your activate portfolio margin does not support portfolio margin API service
381 #[serde(
382 rename = "enablePortfolioMarginTrading",
383 default,
384 skip_serializing_if = "Option::is_none"
385 )]
386 pub enable_portfolio_margin_trading: Option<bool>,
387 #[serde(rename = "enableReading")]
388 pub enable_reading: bool,
389 #[serde(rename = "enableSpotAndMarginTrading")]
390 pub enable_spot_and_margin_trading: bool,
391 ///Authorizes this key to Vanilla options trading
392 #[serde(rename = "enableVanillaOptions")]
393 pub enable_vanilla_options: bool,
394 ///This option allows you to withdraw via API. You must apply the IP Access Restriction filter in order to enable withdrawals
395 #[serde(rename = "enableWithdrawals")]
396 pub enable_withdrawals: bool,
397 #[serde(rename = "ipRestrict")]
398 pub ip_restrict: bool,
399 ///Authorizes this key to be used for a dedicated universal transfer API to transfer multiple supported currencies. Each business's own transfer API rights are not affected by this authorization
400 #[serde(rename = "permitsUniversalTransfer")]
401 pub permits_universal_transfer: bool,
402 ///Expiration time for spot and margin trading permission
403 #[serde(rename = "tradingAuthorityExpirationTime")]
404 pub trading_authority_expiration_time: i64,
405 }
406 impl From<&AccountApiRestrictionsResponse> for AccountApiRestrictionsResponse {
407 fn from(value: &AccountApiRestrictionsResponse) -> Self {
408 value.clone()
409 }
410 }
411 ///AccountApiTradingStatusResponse
412 ///
413 /// <details><summary>JSON schema</summary>
414 ///
415 /// ```json
416 ///{
417 /// "type": "object",
418 /// "required": [
419 /// "data"
420 /// ],
421 /// "properties": {
422 /// "data": {
423 /// "type": "object",
424 /// "required": [
425 /// "indicators",
426 /// "isLocked",
427 /// "plannedRecoverTime",
428 /// "triggerCondition",
429 /// "updateTime"
430 /// ],
431 /// "properties": {
432 /// "indicators": {
433 /// "description": "The indicators updated every 30 seconds",
434 /// "type": "object",
435 /// "required": [
436 /// "BTCUSDT"
437 /// ],
438 /// "properties": {
439 /// "BTCUSDT": {
440 /// "type": "array",
441 /// "items": {
442 /// "type": "object",
443 /// "required": [
444 /// "c",
445 /// "i",
446 /// "t",
447 /// "v"
448 /// ],
449 /// "properties": {
450 /// "c": {
451 /// "description": "Count of all orders",
452 /// "examples": [
453 /// 20
454 /// ],
455 /// "type": "integer",
456 /// "format": "int64"
457 /// },
458 /// "i": {
459 /// "description": "Unfilled Ratio (UFR)",
460 /// "examples": [
461 /// "UFR"
462 /// ],
463 /// "type": "string"
464 /// },
465 /// "t": {
466 /// "description": "Trigger UFR value",
467 /// "examples": [
468 /// 0.99
469 /// ],
470 /// "type": "number",
471 /// "format": "float"
472 /// },
473 /// "v": {
474 /// "description": "Current UFR value",
475 /// "examples": [
476 /// 0.05
477 /// ],
478 /// "type": "number",
479 /// "format": "float"
480 /// }
481 /// }
482 /// }
483 /// }
484 /// }
485 /// },
486 /// "isLocked": {
487 /// "description": "API trading function is locked or not",
488 /// "examples": [
489 /// false
490 /// ],
491 /// "type": "boolean"
492 /// },
493 /// "plannedRecoverTime": {
494 /// "description": "If API trading function is locked, this is the planned recover time",
495 /// "examples": [
496 /// 0
497 /// ],
498 /// "type": "integer",
499 /// "format": "int64"
500 /// },
501 /// "triggerCondition": {
502 /// "type": "object",
503 /// "required": [
504 /// "GCR",
505 /// "IFER",
506 /// "UFR"
507 /// ],
508 /// "properties": {
509 /// "GCR": {
510 /// "description": "Number of GTC orders",
511 /// "examples": [
512 /// 150
513 /// ],
514 /// "type": "integer",
515 /// "format": "int64"
516 /// },
517 /// "IFER": {
518 /// "description": "Number of FOK/IOC orders",
519 /// "examples": [
520 /// 150
521 /// ],
522 /// "type": "integer",
523 /// "format": "int64"
524 /// },
525 /// "UFR": {
526 /// "description": "Number of orders",
527 /// "examples": [
528 /// 300
529 /// ],
530 /// "type": "integer",
531 /// "format": "int64"
532 /// }
533 /// }
534 /// },
535 /// "updateTime": {
536 /// "examples": [
537 /// 1547630471725
538 /// ],
539 /// "type": "integer",
540 /// "format": "int64"
541 /// }
542 /// }
543 /// }
544 /// }
545 ///}
546 /// ```
547 /// </details>
548 #[derive(Clone, Debug, Deserialize, Serialize)]
549 pub struct AccountApiTradingStatusResponse {
550 pub data: AccountApiTradingStatusResponseData,
551 }
552 impl From<&AccountApiTradingStatusResponse> for AccountApiTradingStatusResponse {
553 fn from(value: &AccountApiTradingStatusResponse) -> Self {
554 value.clone()
555 }
556 }
557 ///AccountApiTradingStatusResponseData
558 ///
559 /// <details><summary>JSON schema</summary>
560 ///
561 /// ```json
562 ///{
563 /// "type": "object",
564 /// "required": [
565 /// "indicators",
566 /// "isLocked",
567 /// "plannedRecoverTime",
568 /// "triggerCondition",
569 /// "updateTime"
570 /// ],
571 /// "properties": {
572 /// "indicators": {
573 /// "description": "The indicators updated every 30 seconds",
574 /// "type": "object",
575 /// "required": [
576 /// "BTCUSDT"
577 /// ],
578 /// "properties": {
579 /// "BTCUSDT": {
580 /// "type": "array",
581 /// "items": {
582 /// "type": "object",
583 /// "required": [
584 /// "c",
585 /// "i",
586 /// "t",
587 /// "v"
588 /// ],
589 /// "properties": {
590 /// "c": {
591 /// "description": "Count of all orders",
592 /// "examples": [
593 /// 20
594 /// ],
595 /// "type": "integer",
596 /// "format": "int64"
597 /// },
598 /// "i": {
599 /// "description": "Unfilled Ratio (UFR)",
600 /// "examples": [
601 /// "UFR"
602 /// ],
603 /// "type": "string"
604 /// },
605 /// "t": {
606 /// "description": "Trigger UFR value",
607 /// "examples": [
608 /// 0.99
609 /// ],
610 /// "type": "number",
611 /// "format": "float"
612 /// },
613 /// "v": {
614 /// "description": "Current UFR value",
615 /// "examples": [
616 /// 0.05
617 /// ],
618 /// "type": "number",
619 /// "format": "float"
620 /// }
621 /// }
622 /// }
623 /// }
624 /// }
625 /// },
626 /// "isLocked": {
627 /// "description": "API trading function is locked or not",
628 /// "examples": [
629 /// false
630 /// ],
631 /// "type": "boolean"
632 /// },
633 /// "plannedRecoverTime": {
634 /// "description": "If API trading function is locked, this is the planned recover time",
635 /// "examples": [
636 /// 0
637 /// ],
638 /// "type": "integer",
639 /// "format": "int64"
640 /// },
641 /// "triggerCondition": {
642 /// "type": "object",
643 /// "required": [
644 /// "GCR",
645 /// "IFER",
646 /// "UFR"
647 /// ],
648 /// "properties": {
649 /// "GCR": {
650 /// "description": "Number of GTC orders",
651 /// "examples": [
652 /// 150
653 /// ],
654 /// "type": "integer",
655 /// "format": "int64"
656 /// },
657 /// "IFER": {
658 /// "description": "Number of FOK/IOC orders",
659 /// "examples": [
660 /// 150
661 /// ],
662 /// "type": "integer",
663 /// "format": "int64"
664 /// },
665 /// "UFR": {
666 /// "description": "Number of orders",
667 /// "examples": [
668 /// 300
669 /// ],
670 /// "type": "integer",
671 /// "format": "int64"
672 /// }
673 /// }
674 /// },
675 /// "updateTime": {
676 /// "examples": [
677 /// 1547630471725
678 /// ],
679 /// "type": "integer",
680 /// "format": "int64"
681 /// }
682 /// }
683 ///}
684 /// ```
685 /// </details>
686 #[derive(Clone, Debug, Deserialize, Serialize)]
687 pub struct AccountApiTradingStatusResponseData {
688 pub indicators: AccountApiTradingStatusResponseDataIndicators,
689 ///API trading function is locked or not
690 #[serde(rename = "isLocked")]
691 pub is_locked: bool,
692 ///If API trading function is locked, this is the planned recover time
693 #[serde(rename = "plannedRecoverTime")]
694 pub planned_recover_time: i64,
695 #[serde(rename = "triggerCondition")]
696 pub trigger_condition: AccountApiTradingStatusResponseDataTriggerCondition,
697 #[serde(rename = "updateTime")]
698 pub update_time: i64,
699 }
700 impl From<&AccountApiTradingStatusResponseData>
701 for AccountApiTradingStatusResponseData {
702 fn from(value: &AccountApiTradingStatusResponseData) -> Self {
703 value.clone()
704 }
705 }
706 ///The indicators updated every 30 seconds
707 ///
708 /// <details><summary>JSON schema</summary>
709 ///
710 /// ```json
711 ///{
712 /// "description": "The indicators updated every 30 seconds",
713 /// "type": "object",
714 /// "required": [
715 /// "BTCUSDT"
716 /// ],
717 /// "properties": {
718 /// "BTCUSDT": {
719 /// "type": "array",
720 /// "items": {
721 /// "type": "object",
722 /// "required": [
723 /// "c",
724 /// "i",
725 /// "t",
726 /// "v"
727 /// ],
728 /// "properties": {
729 /// "c": {
730 /// "description": "Count of all orders",
731 /// "examples": [
732 /// 20
733 /// ],
734 /// "type": "integer",
735 /// "format": "int64"
736 /// },
737 /// "i": {
738 /// "description": "Unfilled Ratio (UFR)",
739 /// "examples": [
740 /// "UFR"
741 /// ],
742 /// "type": "string"
743 /// },
744 /// "t": {
745 /// "description": "Trigger UFR value",
746 /// "examples": [
747 /// 0.99
748 /// ],
749 /// "type": "number",
750 /// "format": "float"
751 /// },
752 /// "v": {
753 /// "description": "Current UFR value",
754 /// "examples": [
755 /// 0.05
756 /// ],
757 /// "type": "number",
758 /// "format": "float"
759 /// }
760 /// }
761 /// }
762 /// }
763 /// }
764 ///}
765 /// ```
766 /// </details>
767 #[derive(Clone, Debug, Deserialize, Serialize)]
768 pub struct AccountApiTradingStatusResponseDataIndicators {
769 #[serde(rename = "BTCUSDT")]
770 pub btcusdt: Vec<AccountApiTradingStatusResponseDataIndicatorsBtcusdtItem>,
771 }
772 impl From<&AccountApiTradingStatusResponseDataIndicators>
773 for AccountApiTradingStatusResponseDataIndicators {
774 fn from(value: &AccountApiTradingStatusResponseDataIndicators) -> Self {
775 value.clone()
776 }
777 }
778 ///AccountApiTradingStatusResponseDataIndicatorsBtcusdtItem
779 ///
780 /// <details><summary>JSON schema</summary>
781 ///
782 /// ```json
783 ///{
784 /// "type": "object",
785 /// "required": [
786 /// "c",
787 /// "i",
788 /// "t",
789 /// "v"
790 /// ],
791 /// "properties": {
792 /// "c": {
793 /// "description": "Count of all orders",
794 /// "examples": [
795 /// 20
796 /// ],
797 /// "type": "integer",
798 /// "format": "int64"
799 /// },
800 /// "i": {
801 /// "description": "Unfilled Ratio (UFR)",
802 /// "examples": [
803 /// "UFR"
804 /// ],
805 /// "type": "string"
806 /// },
807 /// "t": {
808 /// "description": "Trigger UFR value",
809 /// "examples": [
810 /// 0.99
811 /// ],
812 /// "type": "number",
813 /// "format": "float"
814 /// },
815 /// "v": {
816 /// "description": "Current UFR value",
817 /// "examples": [
818 /// 0.05
819 /// ],
820 /// "type": "number",
821 /// "format": "float"
822 /// }
823 /// }
824 ///}
825 /// ```
826 /// </details>
827 #[derive(Clone, Debug, Deserialize, Serialize)]
828 pub struct AccountApiTradingStatusResponseDataIndicatorsBtcusdtItem {
829 ///Count of all orders
830 pub c: i64,
831 ///Unfilled Ratio (UFR)
832 pub i: String,
833 pub t: f32,
834 pub v: f32,
835 }
836 impl From<&AccountApiTradingStatusResponseDataIndicatorsBtcusdtItem>
837 for AccountApiTradingStatusResponseDataIndicatorsBtcusdtItem {
838 fn from(
839 value: &AccountApiTradingStatusResponseDataIndicatorsBtcusdtItem,
840 ) -> Self {
841 value.clone()
842 }
843 }
844 ///AccountApiTradingStatusResponseDataTriggerCondition
845 ///
846 /// <details><summary>JSON schema</summary>
847 ///
848 /// ```json
849 ///{
850 /// "type": "object",
851 /// "required": [
852 /// "GCR",
853 /// "IFER",
854 /// "UFR"
855 /// ],
856 /// "properties": {
857 /// "GCR": {
858 /// "description": "Number of GTC orders",
859 /// "examples": [
860 /// 150
861 /// ],
862 /// "type": "integer",
863 /// "format": "int64"
864 /// },
865 /// "IFER": {
866 /// "description": "Number of FOK/IOC orders",
867 /// "examples": [
868 /// 150
869 /// ],
870 /// "type": "integer",
871 /// "format": "int64"
872 /// },
873 /// "UFR": {
874 /// "description": "Number of orders",
875 /// "examples": [
876 /// 300
877 /// ],
878 /// "type": "integer",
879 /// "format": "int64"
880 /// }
881 /// }
882 ///}
883 /// ```
884 /// </details>
885 #[derive(Clone, Debug, Deserialize, Serialize)]
886 pub struct AccountApiTradingStatusResponseDataTriggerCondition {
887 ///Number of GTC orders
888 #[serde(rename = "GCR")]
889 pub gcr: i64,
890 ///Number of FOK/IOC orders
891 #[serde(rename = "IFER")]
892 pub ifer: i64,
893 ///Number of orders
894 #[serde(rename = "UFR")]
895 pub ufr: i64,
896 }
897 impl From<&AccountApiTradingStatusResponseDataTriggerCondition>
898 for AccountApiTradingStatusResponseDataTriggerCondition {
899 fn from(value: &AccountApiTradingStatusResponseDataTriggerCondition) -> Self {
900 value.clone()
901 }
902 }
903 ///AccountBalancesItem
904 ///
905 /// <details><summary>JSON schema</summary>
906 ///
907 /// ```json
908 ///{
909 /// "type": "object",
910 /// "required": [
911 /// "asset",
912 /// "free",
913 /// "locked"
914 /// ],
915 /// "properties": {
916 /// "asset": {
917 /// "examples": [
918 /// "BTC"
919 /// ],
920 /// "type": "string"
921 /// },
922 /// "free": {
923 /// "examples": [
924 /// "4723846.89208129"
925 /// ],
926 /// "type": "string"
927 /// },
928 /// "locked": {
929 /// "examples": [
930 /// "0.00000000"
931 /// ],
932 /// "type": "string"
933 /// }
934 /// }
935 ///}
936 /// ```
937 /// </details>
938 #[derive(Clone, Debug, Deserialize, Serialize)]
939 pub struct AccountBalancesItem {
940 pub asset: String,
941 pub free: String,
942 pub locked: String,
943 }
944 impl From<&AccountBalancesItem> for AccountBalancesItem {
945 fn from(value: &AccountBalancesItem) -> Self {
946 value.clone()
947 }
948 }
949 ///AccountCommissionRates
950 ///
951 /// <details><summary>JSON schema</summary>
952 ///
953 /// ```json
954 ///{
955 /// "type": "object",
956 /// "required": [
957 /// "buyer",
958 /// "maker",
959 /// "seller",
960 /// "taker"
961 /// ],
962 /// "properties": {
963 /// "buyer": {
964 /// "examples": [
965 /// "0.00000000"
966 /// ],
967 /// "type": "string"
968 /// },
969 /// "maker": {
970 /// "examples": [
971 /// "0.00150000"
972 /// ],
973 /// "type": "string"
974 /// },
975 /// "seller": {
976 /// "examples": [
977 /// "0.00000000"
978 /// ],
979 /// "type": "string"
980 /// },
981 /// "taker": {
982 /// "examples": [
983 /// "0.00150000"
984 /// ],
985 /// "type": "string"
986 /// }
987 /// }
988 ///}
989 /// ```
990 /// </details>
991 #[derive(Clone, Debug, Deserialize, Serialize)]
992 pub struct AccountCommissionRates {
993 pub buyer: String,
994 pub maker: String,
995 pub seller: String,
996 pub taker: String,
997 }
998 impl From<&AccountCommissionRates> for AccountCommissionRates {
999 fn from(value: &AccountCommissionRates) -> Self {
1000 value.clone()
1001 }
1002 }
1003 ///AccountSnapshotResponse
1004 ///
1005 /// <details><summary>JSON schema</summary>
1006 ///
1007 /// ```json
1008 ///{
1009 /// "oneOf": [
1010 /// {
1011 /// "$ref": "#/components/schemas/snapshotSpot"
1012 /// },
1013 /// {
1014 /// "$ref": "#/components/schemas/snapshotMargin"
1015 /// },
1016 /// {
1017 /// "$ref": "#/components/schemas/snapshotFutures"
1018 /// }
1019 /// ]
1020 ///}
1021 /// ```
1022 /// </details>
1023 #[derive(Clone, Debug, Deserialize, Serialize)]
1024 #[serde(untagged)]
1025 pub enum AccountSnapshotResponse {
1026 Spot(SnapshotSpot),
1027 Margin(SnapshotMargin),
1028 Futures(SnapshotFutures),
1029 }
1030 impl From<&AccountSnapshotResponse> for AccountSnapshotResponse {
1031 fn from(value: &AccountSnapshotResponse) -> Self {
1032 value.clone()
1033 }
1034 }
1035 impl From<SnapshotSpot> for AccountSnapshotResponse {
1036 fn from(value: SnapshotSpot) -> Self {
1037 Self::Spot(value)
1038 }
1039 }
1040 impl From<SnapshotMargin> for AccountSnapshotResponse {
1041 fn from(value: SnapshotMargin) -> Self {
1042 Self::Margin(value)
1043 }
1044 }
1045 impl From<SnapshotFutures> for AccountSnapshotResponse {
1046 fn from(value: SnapshotFutures) -> Self {
1047 Self::Futures(value)
1048 }
1049 }
1050 ///AccountSnapshotType
1051 ///
1052 /// <details><summary>JSON schema</summary>
1053 ///
1054 /// ```json
1055 ///{
1056 /// "type": "string",
1057 /// "enum": [
1058 /// "SPOT",
1059 /// "MARGIN",
1060 /// "FUTURES"
1061 /// ]
1062 ///}
1063 /// ```
1064 /// </details>
1065 #[derive(
1066 Clone,
1067 Copy,
1068 Debug,
1069 Deserialize,
1070 Eq,
1071 Hash,
1072 Ord,
1073 PartialEq,
1074 PartialOrd,
1075 Serialize
1076 )]
1077 pub enum AccountSnapshotType {
1078 #[serde(rename = "SPOT")]
1079 Spot,
1080 #[serde(rename = "MARGIN")]
1081 Margin,
1082 #[serde(rename = "FUTURES")]
1083 Futures,
1084 }
1085 impl From<&AccountSnapshotType> for AccountSnapshotType {
1086 fn from(value: &AccountSnapshotType) -> Self {
1087 value.clone()
1088 }
1089 }
1090 impl ToString for AccountSnapshotType {
1091 fn to_string(&self) -> String {
1092 match *self {
1093 Self::Spot => "SPOT".to_string(),
1094 Self::Margin => "MARGIN".to_string(),
1095 Self::Futures => "FUTURES".to_string(),
1096 }
1097 }
1098 }
1099 impl std::str::FromStr for AccountSnapshotType {
1100 type Err = self::error::ConversionError;
1101 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
1102 match value {
1103 "SPOT" => Ok(Self::Spot),
1104 "MARGIN" => Ok(Self::Margin),
1105 "FUTURES" => Ok(Self::Futures),
1106 _ => Err("invalid value".into()),
1107 }
1108 }
1109 }
1110 impl std::convert::TryFrom<&str> for AccountSnapshotType {
1111 type Error = self::error::ConversionError;
1112 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
1113 value.parse()
1114 }
1115 }
1116 impl std::convert::TryFrom<&String> for AccountSnapshotType {
1117 type Error = self::error::ConversionError;
1118 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
1119 value.parse()
1120 }
1121 }
1122 impl std::convert::TryFrom<String> for AccountSnapshotType {
1123 type Error = self::error::ConversionError;
1124 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
1125 value.parse()
1126 }
1127 }
1128 ///AccountStatusResponse
1129 ///
1130 /// <details><summary>JSON schema</summary>
1131 ///
1132 /// ```json
1133 ///{
1134 /// "type": "object",
1135 /// "required": [
1136 /// "data"
1137 /// ],
1138 /// "properties": {
1139 /// "data": {
1140 /// "examples": [
1141 /// "Normal"
1142 /// ],
1143 /// "type": "string"
1144 /// }
1145 /// }
1146 ///}
1147 /// ```
1148 /// </details>
1149 #[derive(Clone, Debug, Deserialize, Serialize)]
1150 pub struct AccountStatusResponse {
1151 pub data: String,
1152 }
1153 impl From<&AccountStatusResponse> for AccountStatusResponse {
1154 fn from(value: &AccountStatusResponse) -> Self {
1155 value.clone()
1156 }
1157 }
1158 ///AggTrade
1159 ///
1160 /// <details><summary>JSON schema</summary>
1161 ///
1162 /// ```json
1163 ///{
1164 /// "type": "object",
1165 /// "required": [
1166 /// "M",
1167 /// "T",
1168 /// "a",
1169 /// "f",
1170 /// "l",
1171 /// "maker",
1172 /// "p",
1173 /// "q"
1174 /// ],
1175 /// "properties": {
1176 /// "M": {
1177 /// "description": "Was the trade the best price match?",
1178 /// "type": "boolean"
1179 /// },
1180 /// "T": {
1181 /// "description": "Timestamp",
1182 /// "examples": [
1183 /// 1498793709153
1184 /// ],
1185 /// "type": "boolean"
1186 /// },
1187 /// "a": {
1188 /// "description": "Aggregate tradeId",
1189 /// "examples": [
1190 /// 26129
1191 /// ],
1192 /// "type": "integer",
1193 /// "format": "int64"
1194 /// },
1195 /// "f": {
1196 /// "description": "First tradeId",
1197 /// "examples": [
1198 /// 27781
1199 /// ],
1200 /// "type": "integer",
1201 /// "format": "int64"
1202 /// },
1203 /// "l": {
1204 /// "description": "Last tradeId",
1205 /// "examples": [
1206 /// 27781
1207 /// ],
1208 /// "type": "integer",
1209 /// "format": "int64"
1210 /// },
1211 /// "maker": {
1212 /// "description": "Was the buyer the maker?",
1213 /// "type": "boolean"
1214 /// },
1215 /// "p": {
1216 /// "description": "Price",
1217 /// "examples": [
1218 /// "0.01633102"
1219 /// ],
1220 /// "type": "string"
1221 /// },
1222 /// "q": {
1223 /// "description": "Quantity",
1224 /// "examples": [
1225 /// "4.70443515"
1226 /// ],
1227 /// "type": "string"
1228 /// }
1229 /// }
1230 ///}
1231 /// ```
1232 /// </details>
1233 #[derive(Clone, Debug, Deserialize, Serialize)]
1234 pub struct AggTrade {
1235 ///Aggregate tradeId
1236 pub a: i64,
1237 ///First tradeId
1238 pub f: i64,
1239 ///Last tradeId
1240 pub l: i64,
1241 ///Was the trade the best price match?
1242 #[serde(rename = "M")]
1243 pub m: bool,
1244 ///Was the buyer the maker?
1245 pub maker: bool,
1246 ///Price
1247 pub p: String,
1248 ///Quantity
1249 pub q: String,
1250 ///Timestamp
1251 #[serde(rename = "T")]
1252 pub t: bool,
1253 }
1254 impl From<&AggTrade> for AggTrade {
1255 fn from(value: &AggTrade) -> Self {
1256 value.clone()
1257 }
1258 }
1259 ///AlgoFuturesHistoricalOrdersResponse
1260 ///
1261 /// <details><summary>JSON schema</summary>
1262 ///
1263 /// ```json
1264 ///{
1265 /// "type": "object",
1266 /// "required": [
1267 /// "orders",
1268 /// "total"
1269 /// ],
1270 /// "properties": {
1271 /// "orders": {
1272 /// "type": "array",
1273 /// "items": {
1274 /// "type": "object",
1275 /// "required": [
1276 /// "algoId",
1277 /// "algoStatus",
1278 /// "algoType",
1279 /// "avgPrice",
1280 /// "bookTime",
1281 /// "clientAlgoId",
1282 /// "endTime",
1283 /// "executedAmt",
1284 /// "executedQty",
1285 /// "positionSide",
1286 /// "side",
1287 /// "symbol",
1288 /// "totalQty",
1289 /// "urgency"
1290 /// ],
1291 /// "properties": {
1292 /// "algoId": {
1293 /// "examples": [
1294 /// 14517
1295 /// ],
1296 /// "type": "integer",
1297 /// "format": "int64"
1298 /// },
1299 /// "algoStatus": {
1300 /// "examples": [
1301 /// "WORKING"
1302 /// ],
1303 /// "type": "string"
1304 /// },
1305 /// "algoType": {
1306 /// "examples": [
1307 /// "VP"
1308 /// ],
1309 /// "type": "string"
1310 /// },
1311 /// "avgPrice": {
1312 /// "examples": [
1313 /// "0.00"
1314 /// ],
1315 /// "type": "string"
1316 /// },
1317 /// "bookTime": {
1318 /// "examples": [
1319 /// 1649756817004
1320 /// ],
1321 /// "type": "integer",
1322 /// "format": "int64"
1323 /// },
1324 /// "clientAlgoId": {
1325 /// "examples": [
1326 /// "d7096549481642f8a0bb69e9e2e31f2e"
1327 /// ],
1328 /// "type": "string"
1329 /// },
1330 /// "endTime": {
1331 /// "examples": [
1332 /// 1649757088101
1333 /// ],
1334 /// "type": "integer",
1335 /// "format": "int64"
1336 /// },
1337 /// "executedAmt": {
1338 /// "examples": [
1339 /// "0.00000000"
1340 /// ],
1341 /// "type": "string"
1342 /// },
1343 /// "executedQty": {
1344 /// "examples": [
1345 /// "0.000"
1346 /// ],
1347 /// "type": "string"
1348 /// },
1349 /// "positionSide": {
1350 /// "examples": [
1351 /// "SHORT"
1352 /// ],
1353 /// "type": "string"
1354 /// },
1355 /// "side": {
1356 /// "examples": [
1357 /// "SELL"
1358 /// ],
1359 /// "type": "string"
1360 /// },
1361 /// "symbol": {
1362 /// "examples": [
1363 /// "ETHUSDT"
1364 /// ],
1365 /// "type": "string"
1366 /// },
1367 /// "totalQty": {
1368 /// "examples": [
1369 /// "5.00"
1370 /// ],
1371 /// "type": "string"
1372 /// },
1373 /// "urgency": {
1374 /// "examples": [
1375 /// "LOW"
1376 /// ],
1377 /// "type": "string"
1378 /// }
1379 /// }
1380 /// }
1381 /// },
1382 /// "total": {
1383 /// "examples": [
1384 /// 1
1385 /// ],
1386 /// "type": "integer",
1387 /// "format": "int32"
1388 /// }
1389 /// }
1390 ///}
1391 /// ```
1392 /// </details>
1393 #[derive(Clone, Debug, Deserialize, Serialize)]
1394 pub struct AlgoFuturesHistoricalOrdersResponse {
1395 pub orders: Vec<AlgoFuturesHistoricalOrdersResponseOrdersItem>,
1396 pub total: i32,
1397 }
1398 impl From<&AlgoFuturesHistoricalOrdersResponse>
1399 for AlgoFuturesHistoricalOrdersResponse {
1400 fn from(value: &AlgoFuturesHistoricalOrdersResponse) -> Self {
1401 value.clone()
1402 }
1403 }
1404 ///AlgoFuturesHistoricalOrdersResponseOrdersItem
1405 ///
1406 /// <details><summary>JSON schema</summary>
1407 ///
1408 /// ```json
1409 ///{
1410 /// "type": "object",
1411 /// "required": [
1412 /// "algoId",
1413 /// "algoStatus",
1414 /// "algoType",
1415 /// "avgPrice",
1416 /// "bookTime",
1417 /// "clientAlgoId",
1418 /// "endTime",
1419 /// "executedAmt",
1420 /// "executedQty",
1421 /// "positionSide",
1422 /// "side",
1423 /// "symbol",
1424 /// "totalQty",
1425 /// "urgency"
1426 /// ],
1427 /// "properties": {
1428 /// "algoId": {
1429 /// "examples": [
1430 /// 14517
1431 /// ],
1432 /// "type": "integer",
1433 /// "format": "int64"
1434 /// },
1435 /// "algoStatus": {
1436 /// "examples": [
1437 /// "WORKING"
1438 /// ],
1439 /// "type": "string"
1440 /// },
1441 /// "algoType": {
1442 /// "examples": [
1443 /// "VP"
1444 /// ],
1445 /// "type": "string"
1446 /// },
1447 /// "avgPrice": {
1448 /// "examples": [
1449 /// "0.00"
1450 /// ],
1451 /// "type": "string"
1452 /// },
1453 /// "bookTime": {
1454 /// "examples": [
1455 /// 1649756817004
1456 /// ],
1457 /// "type": "integer",
1458 /// "format": "int64"
1459 /// },
1460 /// "clientAlgoId": {
1461 /// "examples": [
1462 /// "d7096549481642f8a0bb69e9e2e31f2e"
1463 /// ],
1464 /// "type": "string"
1465 /// },
1466 /// "endTime": {
1467 /// "examples": [
1468 /// 1649757088101
1469 /// ],
1470 /// "type": "integer",
1471 /// "format": "int64"
1472 /// },
1473 /// "executedAmt": {
1474 /// "examples": [
1475 /// "0.00000000"
1476 /// ],
1477 /// "type": "string"
1478 /// },
1479 /// "executedQty": {
1480 /// "examples": [
1481 /// "0.000"
1482 /// ],
1483 /// "type": "string"
1484 /// },
1485 /// "positionSide": {
1486 /// "examples": [
1487 /// "SHORT"
1488 /// ],
1489 /// "type": "string"
1490 /// },
1491 /// "side": {
1492 /// "examples": [
1493 /// "SELL"
1494 /// ],
1495 /// "type": "string"
1496 /// },
1497 /// "symbol": {
1498 /// "examples": [
1499 /// "ETHUSDT"
1500 /// ],
1501 /// "type": "string"
1502 /// },
1503 /// "totalQty": {
1504 /// "examples": [
1505 /// "5.00"
1506 /// ],
1507 /// "type": "string"
1508 /// },
1509 /// "urgency": {
1510 /// "examples": [
1511 /// "LOW"
1512 /// ],
1513 /// "type": "string"
1514 /// }
1515 /// }
1516 ///}
1517 /// ```
1518 /// </details>
1519 #[derive(Clone, Debug, Deserialize, Serialize)]
1520 pub struct AlgoFuturesHistoricalOrdersResponseOrdersItem {
1521 #[serde(rename = "algoId")]
1522 pub algo_id: i64,
1523 #[serde(rename = "algoStatus")]
1524 pub algo_status: String,
1525 #[serde(rename = "algoType")]
1526 pub algo_type: String,
1527 #[serde(rename = "avgPrice")]
1528 pub avg_price: String,
1529 #[serde(rename = "bookTime")]
1530 pub book_time: i64,
1531 #[serde(rename = "clientAlgoId")]
1532 pub client_algo_id: String,
1533 #[serde(rename = "endTime")]
1534 pub end_time: i64,
1535 #[serde(rename = "executedAmt")]
1536 pub executed_amt: String,
1537 #[serde(rename = "executedQty")]
1538 pub executed_qty: String,
1539 #[serde(rename = "positionSide")]
1540 pub position_side: String,
1541 pub side: String,
1542 pub symbol: String,
1543 #[serde(rename = "totalQty")]
1544 pub total_qty: String,
1545 pub urgency: String,
1546 }
1547 impl From<&AlgoFuturesHistoricalOrdersResponseOrdersItem>
1548 for AlgoFuturesHistoricalOrdersResponseOrdersItem {
1549 fn from(value: &AlgoFuturesHistoricalOrdersResponseOrdersItem) -> Self {
1550 value.clone()
1551 }
1552 }
1553 ///AlgoFuturesHistoricalOrdersSide
1554 ///
1555 /// <details><summary>JSON schema</summary>
1556 ///
1557 /// ```json
1558 ///{
1559 /// "examples": [
1560 /// "SELL"
1561 /// ],
1562 /// "type": "string",
1563 /// "enum": [
1564 /// "SELL",
1565 /// "BUY"
1566 /// ]
1567 ///}
1568 /// ```
1569 /// </details>
1570 #[derive(
1571 Clone,
1572 Copy,
1573 Debug,
1574 Deserialize,
1575 Eq,
1576 Hash,
1577 Ord,
1578 PartialEq,
1579 PartialOrd,
1580 Serialize
1581 )]
1582 pub enum AlgoFuturesHistoricalOrdersSide {
1583 #[serde(rename = "SELL")]
1584 Sell,
1585 #[serde(rename = "BUY")]
1586 Buy,
1587 }
1588 impl From<&AlgoFuturesHistoricalOrdersSide> for AlgoFuturesHistoricalOrdersSide {
1589 fn from(value: &AlgoFuturesHistoricalOrdersSide) -> Self {
1590 value.clone()
1591 }
1592 }
1593 impl ToString for AlgoFuturesHistoricalOrdersSide {
1594 fn to_string(&self) -> String {
1595 match *self {
1596 Self::Sell => "SELL".to_string(),
1597 Self::Buy => "BUY".to_string(),
1598 }
1599 }
1600 }
1601 impl std::str::FromStr for AlgoFuturesHistoricalOrdersSide {
1602 type Err = self::error::ConversionError;
1603 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
1604 match value {
1605 "SELL" => Ok(Self::Sell),
1606 "BUY" => Ok(Self::Buy),
1607 _ => Err("invalid value".into()),
1608 }
1609 }
1610 }
1611 impl std::convert::TryFrom<&str> for AlgoFuturesHistoricalOrdersSide {
1612 type Error = self::error::ConversionError;
1613 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
1614 value.parse()
1615 }
1616 }
1617 impl std::convert::TryFrom<&String> for AlgoFuturesHistoricalOrdersSide {
1618 type Error = self::error::ConversionError;
1619 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
1620 value.parse()
1621 }
1622 }
1623 impl std::convert::TryFrom<String> for AlgoFuturesHistoricalOrdersSide {
1624 type Error = self::error::ConversionError;
1625 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
1626 value.parse()
1627 }
1628 }
1629 ///AlgoFuturesNewOrderTwapPositionSide
1630 ///
1631 /// <details><summary>JSON schema</summary>
1632 ///
1633 /// ```json
1634 ///{
1635 /// "examples": [
1636 /// "BOTH"
1637 /// ],
1638 /// "type": "string",
1639 /// "enum": [
1640 /// "BOTH",
1641 /// "LONG",
1642 /// "SHORT"
1643 /// ]
1644 ///}
1645 /// ```
1646 /// </details>
1647 #[derive(
1648 Clone,
1649 Copy,
1650 Debug,
1651 Deserialize,
1652 Eq,
1653 Hash,
1654 Ord,
1655 PartialEq,
1656 PartialOrd,
1657 Serialize
1658 )]
1659 pub enum AlgoFuturesNewOrderTwapPositionSide {
1660 #[serde(rename = "BOTH")]
1661 Both,
1662 #[serde(rename = "LONG")]
1663 Long,
1664 #[serde(rename = "SHORT")]
1665 Short,
1666 }
1667 impl From<&AlgoFuturesNewOrderTwapPositionSide>
1668 for AlgoFuturesNewOrderTwapPositionSide {
1669 fn from(value: &AlgoFuturesNewOrderTwapPositionSide) -> Self {
1670 value.clone()
1671 }
1672 }
1673 impl ToString for AlgoFuturesNewOrderTwapPositionSide {
1674 fn to_string(&self) -> String {
1675 match *self {
1676 Self::Both => "BOTH".to_string(),
1677 Self::Long => "LONG".to_string(),
1678 Self::Short => "SHORT".to_string(),
1679 }
1680 }
1681 }
1682 impl std::str::FromStr for AlgoFuturesNewOrderTwapPositionSide {
1683 type Err = self::error::ConversionError;
1684 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
1685 match value {
1686 "BOTH" => Ok(Self::Both),
1687 "LONG" => Ok(Self::Long),
1688 "SHORT" => Ok(Self::Short),
1689 _ => Err("invalid value".into()),
1690 }
1691 }
1692 }
1693 impl std::convert::TryFrom<&str> for AlgoFuturesNewOrderTwapPositionSide {
1694 type Error = self::error::ConversionError;
1695 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
1696 value.parse()
1697 }
1698 }
1699 impl std::convert::TryFrom<&String> for AlgoFuturesNewOrderTwapPositionSide {
1700 type Error = self::error::ConversionError;
1701 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
1702 value.parse()
1703 }
1704 }
1705 impl std::convert::TryFrom<String> for AlgoFuturesNewOrderTwapPositionSide {
1706 type Error = self::error::ConversionError;
1707 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
1708 value.parse()
1709 }
1710 }
1711 ///AlgoFuturesNewOrderTwapResponse
1712 ///
1713 /// <details><summary>JSON schema</summary>
1714 ///
1715 /// ```json
1716 ///{
1717 /// "type": "object",
1718 /// "required": [
1719 /// "clientAlgoId",
1720 /// "code",
1721 /// "msg",
1722 /// "success"
1723 /// ],
1724 /// "properties": {
1725 /// "clientAlgoId": {
1726 /// "examples": [
1727 /// "00358ce6a268403398bd34eaa36dffe7"
1728 /// ],
1729 /// "type": "string"
1730 /// },
1731 /// "code": {
1732 /// "examples": [
1733 /// 0
1734 /// ],
1735 /// "type": "integer",
1736 /// "format": "int64"
1737 /// },
1738 /// "msg": {
1739 /// "examples": [
1740 /// "OK"
1741 /// ],
1742 /// "type": "string"
1743 /// },
1744 /// "success": {
1745 /// "examples": [
1746 /// true
1747 /// ],
1748 /// "type": "boolean"
1749 /// }
1750 /// }
1751 ///}
1752 /// ```
1753 /// </details>
1754 #[derive(Clone, Debug, Deserialize, Serialize)]
1755 pub struct AlgoFuturesNewOrderTwapResponse {
1756 #[serde(rename = "clientAlgoId")]
1757 pub client_algo_id: String,
1758 pub code: i64,
1759 pub msg: String,
1760 pub success: bool,
1761 }
1762 impl From<&AlgoFuturesNewOrderTwapResponse> for AlgoFuturesNewOrderTwapResponse {
1763 fn from(value: &AlgoFuturesNewOrderTwapResponse) -> Self {
1764 value.clone()
1765 }
1766 }
1767 ///AlgoFuturesNewOrderTwapSide
1768 ///
1769 /// <details><summary>JSON schema</summary>
1770 ///
1771 /// ```json
1772 ///{
1773 /// "examples": [
1774 /// "SELL"
1775 /// ],
1776 /// "type": "string",
1777 /// "enum": [
1778 /// "SELL",
1779 /// "BUY"
1780 /// ]
1781 ///}
1782 /// ```
1783 /// </details>
1784 #[derive(
1785 Clone,
1786 Copy,
1787 Debug,
1788 Deserialize,
1789 Eq,
1790 Hash,
1791 Ord,
1792 PartialEq,
1793 PartialOrd,
1794 Serialize
1795 )]
1796 pub enum AlgoFuturesNewOrderTwapSide {
1797 #[serde(rename = "SELL")]
1798 Sell,
1799 #[serde(rename = "BUY")]
1800 Buy,
1801 }
1802 impl From<&AlgoFuturesNewOrderTwapSide> for AlgoFuturesNewOrderTwapSide {
1803 fn from(value: &AlgoFuturesNewOrderTwapSide) -> Self {
1804 value.clone()
1805 }
1806 }
1807 impl ToString for AlgoFuturesNewOrderTwapSide {
1808 fn to_string(&self) -> String {
1809 match *self {
1810 Self::Sell => "SELL".to_string(),
1811 Self::Buy => "BUY".to_string(),
1812 }
1813 }
1814 }
1815 impl std::str::FromStr for AlgoFuturesNewOrderTwapSide {
1816 type Err = self::error::ConversionError;
1817 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
1818 match value {
1819 "SELL" => Ok(Self::Sell),
1820 "BUY" => Ok(Self::Buy),
1821 _ => Err("invalid value".into()),
1822 }
1823 }
1824 }
1825 impl std::convert::TryFrom<&str> for AlgoFuturesNewOrderTwapSide {
1826 type Error = self::error::ConversionError;
1827 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
1828 value.parse()
1829 }
1830 }
1831 impl std::convert::TryFrom<&String> for AlgoFuturesNewOrderTwapSide {
1832 type Error = self::error::ConversionError;
1833 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
1834 value.parse()
1835 }
1836 }
1837 impl std::convert::TryFrom<String> for AlgoFuturesNewOrderTwapSide {
1838 type Error = self::error::ConversionError;
1839 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
1840 value.parse()
1841 }
1842 }
1843 ///AlgoFuturesNewOrderVpPositionSide
1844 ///
1845 /// <details><summary>JSON schema</summary>
1846 ///
1847 /// ```json
1848 ///{
1849 /// "examples": [
1850 /// "BOTH"
1851 /// ],
1852 /// "type": "string",
1853 /// "enum": [
1854 /// "BOTH",
1855 /// "LONG",
1856 /// "SHORT"
1857 /// ]
1858 ///}
1859 /// ```
1860 /// </details>
1861 #[derive(
1862 Clone,
1863 Copy,
1864 Debug,
1865 Deserialize,
1866 Eq,
1867 Hash,
1868 Ord,
1869 PartialEq,
1870 PartialOrd,
1871 Serialize
1872 )]
1873 pub enum AlgoFuturesNewOrderVpPositionSide {
1874 #[serde(rename = "BOTH")]
1875 Both,
1876 #[serde(rename = "LONG")]
1877 Long,
1878 #[serde(rename = "SHORT")]
1879 Short,
1880 }
1881 impl From<&AlgoFuturesNewOrderVpPositionSide> for AlgoFuturesNewOrderVpPositionSide {
1882 fn from(value: &AlgoFuturesNewOrderVpPositionSide) -> Self {
1883 value.clone()
1884 }
1885 }
1886 impl ToString for AlgoFuturesNewOrderVpPositionSide {
1887 fn to_string(&self) -> String {
1888 match *self {
1889 Self::Both => "BOTH".to_string(),
1890 Self::Long => "LONG".to_string(),
1891 Self::Short => "SHORT".to_string(),
1892 }
1893 }
1894 }
1895 impl std::str::FromStr for AlgoFuturesNewOrderVpPositionSide {
1896 type Err = self::error::ConversionError;
1897 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
1898 match value {
1899 "BOTH" => Ok(Self::Both),
1900 "LONG" => Ok(Self::Long),
1901 "SHORT" => Ok(Self::Short),
1902 _ => Err("invalid value".into()),
1903 }
1904 }
1905 }
1906 impl std::convert::TryFrom<&str> for AlgoFuturesNewOrderVpPositionSide {
1907 type Error = self::error::ConversionError;
1908 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
1909 value.parse()
1910 }
1911 }
1912 impl std::convert::TryFrom<&String> for AlgoFuturesNewOrderVpPositionSide {
1913 type Error = self::error::ConversionError;
1914 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
1915 value.parse()
1916 }
1917 }
1918 impl std::convert::TryFrom<String> for AlgoFuturesNewOrderVpPositionSide {
1919 type Error = self::error::ConversionError;
1920 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
1921 value.parse()
1922 }
1923 }
1924 ///AlgoFuturesNewOrderVpResponse
1925 ///
1926 /// <details><summary>JSON schema</summary>
1927 ///
1928 /// ```json
1929 ///{
1930 /// "type": "object",
1931 /// "required": [
1932 /// "clientAlgoId",
1933 /// "code",
1934 /// "msg",
1935 /// "success"
1936 /// ],
1937 /// "properties": {
1938 /// "clientAlgoId": {
1939 /// "examples": [
1940 /// "00358ce6a268403398bd34eaa36dffe7"
1941 /// ],
1942 /// "type": "string"
1943 /// },
1944 /// "code": {
1945 /// "examples": [
1946 /// 0
1947 /// ],
1948 /// "type": "integer",
1949 /// "format": "int64"
1950 /// },
1951 /// "msg": {
1952 /// "examples": [
1953 /// "OK"
1954 /// ],
1955 /// "type": "string"
1956 /// },
1957 /// "success": {
1958 /// "examples": [
1959 /// true
1960 /// ],
1961 /// "type": "boolean"
1962 /// }
1963 /// }
1964 ///}
1965 /// ```
1966 /// </details>
1967 #[derive(Clone, Debug, Deserialize, Serialize)]
1968 pub struct AlgoFuturesNewOrderVpResponse {
1969 #[serde(rename = "clientAlgoId")]
1970 pub client_algo_id: String,
1971 pub code: i64,
1972 pub msg: String,
1973 pub success: bool,
1974 }
1975 impl From<&AlgoFuturesNewOrderVpResponse> for AlgoFuturesNewOrderVpResponse {
1976 fn from(value: &AlgoFuturesNewOrderVpResponse) -> Self {
1977 value.clone()
1978 }
1979 }
1980 ///AlgoFuturesNewOrderVpSide
1981 ///
1982 /// <details><summary>JSON schema</summary>
1983 ///
1984 /// ```json
1985 ///{
1986 /// "examples": [
1987 /// "SELL"
1988 /// ],
1989 /// "type": "string",
1990 /// "enum": [
1991 /// "SELL",
1992 /// "BUY"
1993 /// ]
1994 ///}
1995 /// ```
1996 /// </details>
1997 #[derive(
1998 Clone,
1999 Copy,
2000 Debug,
2001 Deserialize,
2002 Eq,
2003 Hash,
2004 Ord,
2005 PartialEq,
2006 PartialOrd,
2007 Serialize
2008 )]
2009 pub enum AlgoFuturesNewOrderVpSide {
2010 #[serde(rename = "SELL")]
2011 Sell,
2012 #[serde(rename = "BUY")]
2013 Buy,
2014 }
2015 impl From<&AlgoFuturesNewOrderVpSide> for AlgoFuturesNewOrderVpSide {
2016 fn from(value: &AlgoFuturesNewOrderVpSide) -> Self {
2017 value.clone()
2018 }
2019 }
2020 impl ToString for AlgoFuturesNewOrderVpSide {
2021 fn to_string(&self) -> String {
2022 match *self {
2023 Self::Sell => "SELL".to_string(),
2024 Self::Buy => "BUY".to_string(),
2025 }
2026 }
2027 }
2028 impl std::str::FromStr for AlgoFuturesNewOrderVpSide {
2029 type Err = self::error::ConversionError;
2030 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
2031 match value {
2032 "SELL" => Ok(Self::Sell),
2033 "BUY" => Ok(Self::Buy),
2034 _ => Err("invalid value".into()),
2035 }
2036 }
2037 }
2038 impl std::convert::TryFrom<&str> for AlgoFuturesNewOrderVpSide {
2039 type Error = self::error::ConversionError;
2040 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
2041 value.parse()
2042 }
2043 }
2044 impl std::convert::TryFrom<&String> for AlgoFuturesNewOrderVpSide {
2045 type Error = self::error::ConversionError;
2046 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
2047 value.parse()
2048 }
2049 }
2050 impl std::convert::TryFrom<String> for AlgoFuturesNewOrderVpSide {
2051 type Error = self::error::ConversionError;
2052 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
2053 value.parse()
2054 }
2055 }
2056 ///AlgoFuturesNewOrderVpUrgency
2057 ///
2058 /// <details><summary>JSON schema</summary>
2059 ///
2060 /// ```json
2061 ///{
2062 /// "examples": [
2063 /// "LOW"
2064 /// ],
2065 /// "type": "string",
2066 /// "enum": [
2067 /// "LOW",
2068 /// "MEDIUM",
2069 /// "HIGH"
2070 /// ]
2071 ///}
2072 /// ```
2073 /// </details>
2074 #[derive(
2075 Clone,
2076 Copy,
2077 Debug,
2078 Deserialize,
2079 Eq,
2080 Hash,
2081 Ord,
2082 PartialEq,
2083 PartialOrd,
2084 Serialize
2085 )]
2086 pub enum AlgoFuturesNewOrderVpUrgency {
2087 #[serde(rename = "LOW")]
2088 Low,
2089 #[serde(rename = "MEDIUM")]
2090 Medium,
2091 #[serde(rename = "HIGH")]
2092 High,
2093 }
2094 impl From<&AlgoFuturesNewOrderVpUrgency> for AlgoFuturesNewOrderVpUrgency {
2095 fn from(value: &AlgoFuturesNewOrderVpUrgency) -> Self {
2096 value.clone()
2097 }
2098 }
2099 impl ToString for AlgoFuturesNewOrderVpUrgency {
2100 fn to_string(&self) -> String {
2101 match *self {
2102 Self::Low => "LOW".to_string(),
2103 Self::Medium => "MEDIUM".to_string(),
2104 Self::High => "HIGH".to_string(),
2105 }
2106 }
2107 }
2108 impl std::str::FromStr for AlgoFuturesNewOrderVpUrgency {
2109 type Err = self::error::ConversionError;
2110 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
2111 match value {
2112 "LOW" => Ok(Self::Low),
2113 "MEDIUM" => Ok(Self::Medium),
2114 "HIGH" => Ok(Self::High),
2115 _ => Err("invalid value".into()),
2116 }
2117 }
2118 }
2119 impl std::convert::TryFrom<&str> for AlgoFuturesNewOrderVpUrgency {
2120 type Error = self::error::ConversionError;
2121 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
2122 value.parse()
2123 }
2124 }
2125 impl std::convert::TryFrom<&String> for AlgoFuturesNewOrderVpUrgency {
2126 type Error = self::error::ConversionError;
2127 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
2128 value.parse()
2129 }
2130 }
2131 impl std::convert::TryFrom<String> for AlgoFuturesNewOrderVpUrgency {
2132 type Error = self::error::ConversionError;
2133 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
2134 value.parse()
2135 }
2136 }
2137 ///AlgoFuturesOpenOrdersResponse
2138 ///
2139 /// <details><summary>JSON schema</summary>
2140 ///
2141 /// ```json
2142 ///{
2143 /// "type": "object",
2144 /// "required": [
2145 /// "total"
2146 /// ],
2147 /// "properties": {
2148 /// "orders": {
2149 /// "type": "array",
2150 /// "items": {
2151 /// "type": "object",
2152 /// "required": [
2153 /// "algoId",
2154 /// "algoStatus",
2155 /// "algoType",
2156 /// "avgPrice",
2157 /// "bookTime",
2158 /// "clientAlgoId",
2159 /// "endTime",
2160 /// "executedAmt",
2161 /// "executedQty",
2162 /// "positionSide",
2163 /// "side",
2164 /// "symbol",
2165 /// "totalQty",
2166 /// "urgency"
2167 /// ],
2168 /// "properties": {
2169 /// "algoId": {
2170 /// "examples": [
2171 /// 14517
2172 /// ],
2173 /// "type": "integer",
2174 /// "format": "int64"
2175 /// },
2176 /// "algoStatus": {
2177 /// "examples": [
2178 /// "WORKING"
2179 /// ],
2180 /// "type": "string"
2181 /// },
2182 /// "algoType": {
2183 /// "examples": [
2184 /// "VP"
2185 /// ],
2186 /// "type": "string"
2187 /// },
2188 /// "avgPrice": {
2189 /// "examples": [
2190 /// "0.00"
2191 /// ],
2192 /// "type": "string"
2193 /// },
2194 /// "bookTime": {
2195 /// "examples": [
2196 /// 1649756817004
2197 /// ],
2198 /// "type": "integer",
2199 /// "format": "int64"
2200 /// },
2201 /// "clientAlgoId": {
2202 /// "examples": [
2203 /// "d7096549481642f8a0bb69e9e2e31f2e"
2204 /// ],
2205 /// "type": "string"
2206 /// },
2207 /// "endTime": {
2208 /// "examples": [
2209 /// 0
2210 /// ],
2211 /// "type": "integer",
2212 /// "format": "int64"
2213 /// },
2214 /// "executedAmt": {
2215 /// "examples": [
2216 /// "0.00000000"
2217 /// ],
2218 /// "type": "string"
2219 /// },
2220 /// "executedQty": {
2221 /// "examples": [
2222 /// "0.000"
2223 /// ],
2224 /// "type": "string"
2225 /// },
2226 /// "positionSide": {
2227 /// "examples": [
2228 /// "SHORT"
2229 /// ],
2230 /// "type": "string"
2231 /// },
2232 /// "side": {
2233 /// "examples": [
2234 /// "SELL"
2235 /// ],
2236 /// "type": "string"
2237 /// },
2238 /// "symbol": {
2239 /// "examples": [
2240 /// "ETHUSDT"
2241 /// ],
2242 /// "type": "string"
2243 /// },
2244 /// "totalQty": {
2245 /// "examples": [
2246 /// "5.00"
2247 /// ],
2248 /// "type": "string"
2249 /// },
2250 /// "urgency": {
2251 /// "examples": [
2252 /// "LOW"
2253 /// ],
2254 /// "type": "string"
2255 /// }
2256 /// }
2257 /// }
2258 /// },
2259 /// "total": {
2260 /// "examples": [
2261 /// 1
2262 /// ],
2263 /// "type": "integer",
2264 /// "format": "int32"
2265 /// }
2266 /// }
2267 ///}
2268 /// ```
2269 /// </details>
2270 #[derive(Clone, Debug, Deserialize, Serialize)]
2271 pub struct AlgoFuturesOpenOrdersResponse {
2272 #[serde(default, skip_serializing_if = "Vec::is_empty")]
2273 pub orders: Vec<AlgoFuturesOpenOrdersResponseOrdersItem>,
2274 pub total: i32,
2275 }
2276 impl From<&AlgoFuturesOpenOrdersResponse> for AlgoFuturesOpenOrdersResponse {
2277 fn from(value: &AlgoFuturesOpenOrdersResponse) -> Self {
2278 value.clone()
2279 }
2280 }
2281 ///AlgoFuturesOpenOrdersResponseOrdersItem
2282 ///
2283 /// <details><summary>JSON schema</summary>
2284 ///
2285 /// ```json
2286 ///{
2287 /// "type": "object",
2288 /// "required": [
2289 /// "algoId",
2290 /// "algoStatus",
2291 /// "algoType",
2292 /// "avgPrice",
2293 /// "bookTime",
2294 /// "clientAlgoId",
2295 /// "endTime",
2296 /// "executedAmt",
2297 /// "executedQty",
2298 /// "positionSide",
2299 /// "side",
2300 /// "symbol",
2301 /// "totalQty",
2302 /// "urgency"
2303 /// ],
2304 /// "properties": {
2305 /// "algoId": {
2306 /// "examples": [
2307 /// 14517
2308 /// ],
2309 /// "type": "integer",
2310 /// "format": "int64"
2311 /// },
2312 /// "algoStatus": {
2313 /// "examples": [
2314 /// "WORKING"
2315 /// ],
2316 /// "type": "string"
2317 /// },
2318 /// "algoType": {
2319 /// "examples": [
2320 /// "VP"
2321 /// ],
2322 /// "type": "string"
2323 /// },
2324 /// "avgPrice": {
2325 /// "examples": [
2326 /// "0.00"
2327 /// ],
2328 /// "type": "string"
2329 /// },
2330 /// "bookTime": {
2331 /// "examples": [
2332 /// 1649756817004
2333 /// ],
2334 /// "type": "integer",
2335 /// "format": "int64"
2336 /// },
2337 /// "clientAlgoId": {
2338 /// "examples": [
2339 /// "d7096549481642f8a0bb69e9e2e31f2e"
2340 /// ],
2341 /// "type": "string"
2342 /// },
2343 /// "endTime": {
2344 /// "examples": [
2345 /// 0
2346 /// ],
2347 /// "type": "integer",
2348 /// "format": "int64"
2349 /// },
2350 /// "executedAmt": {
2351 /// "examples": [
2352 /// "0.00000000"
2353 /// ],
2354 /// "type": "string"
2355 /// },
2356 /// "executedQty": {
2357 /// "examples": [
2358 /// "0.000"
2359 /// ],
2360 /// "type": "string"
2361 /// },
2362 /// "positionSide": {
2363 /// "examples": [
2364 /// "SHORT"
2365 /// ],
2366 /// "type": "string"
2367 /// },
2368 /// "side": {
2369 /// "examples": [
2370 /// "SELL"
2371 /// ],
2372 /// "type": "string"
2373 /// },
2374 /// "symbol": {
2375 /// "examples": [
2376 /// "ETHUSDT"
2377 /// ],
2378 /// "type": "string"
2379 /// },
2380 /// "totalQty": {
2381 /// "examples": [
2382 /// "5.00"
2383 /// ],
2384 /// "type": "string"
2385 /// },
2386 /// "urgency": {
2387 /// "examples": [
2388 /// "LOW"
2389 /// ],
2390 /// "type": "string"
2391 /// }
2392 /// }
2393 ///}
2394 /// ```
2395 /// </details>
2396 #[derive(Clone, Debug, Deserialize, Serialize)]
2397 pub struct AlgoFuturesOpenOrdersResponseOrdersItem {
2398 #[serde(rename = "algoId")]
2399 pub algo_id: i64,
2400 #[serde(rename = "algoStatus")]
2401 pub algo_status: String,
2402 #[serde(rename = "algoType")]
2403 pub algo_type: String,
2404 #[serde(rename = "avgPrice")]
2405 pub avg_price: String,
2406 #[serde(rename = "bookTime")]
2407 pub book_time: i64,
2408 #[serde(rename = "clientAlgoId")]
2409 pub client_algo_id: String,
2410 #[serde(rename = "endTime")]
2411 pub end_time: i64,
2412 #[serde(rename = "executedAmt")]
2413 pub executed_amt: String,
2414 #[serde(rename = "executedQty")]
2415 pub executed_qty: String,
2416 #[serde(rename = "positionSide")]
2417 pub position_side: String,
2418 pub side: String,
2419 pub symbol: String,
2420 #[serde(rename = "totalQty")]
2421 pub total_qty: String,
2422 pub urgency: String,
2423 }
2424 impl From<&AlgoFuturesOpenOrdersResponseOrdersItem>
2425 for AlgoFuturesOpenOrdersResponseOrdersItem {
2426 fn from(value: &AlgoFuturesOpenOrdersResponseOrdersItem) -> Self {
2427 value.clone()
2428 }
2429 }
2430 ///AlgoFuturesSubOrdersResponse
2431 ///
2432 /// <details><summary>JSON schema</summary>
2433 ///
2434 /// ```json
2435 ///{
2436 /// "type": "object",
2437 /// "required": [
2438 /// "executedAmt",
2439 /// "executedQty",
2440 /// "subOrders",
2441 /// "total"
2442 /// ],
2443 /// "properties": {
2444 /// "executedAmt": {
2445 /// "examples": [
2446 /// "3229.44000000"
2447 /// ],
2448 /// "type": "string"
2449 /// },
2450 /// "executedQty": {
2451 /// "examples": [
2452 /// "1.000"
2453 /// ],
2454 /// "type": "string"
2455 /// },
2456 /// "subOrders": {
2457 /// "type": "array",
2458 /// "items": {
2459 /// "type": "object",
2460 /// "required": [
2461 /// "algoId",
2462 /// "avgPrice",
2463 /// "bookTime",
2464 /// "executedAmt",
2465 /// "feeAmt",
2466 /// "feeAsset",
2467 /// "orderId",
2468 /// "orderStatus",
2469 /// "origQty",
2470 /// "side",
2471 /// "subId",
2472 /// "symbol",
2473 /// "timeInForce"
2474 /// ],
2475 /// "properties": {
2476 /// "algoId": {
2477 /// "examples": [
2478 /// 13723
2479 /// ],
2480 /// "type": "integer",
2481 /// "format": "int64"
2482 /// },
2483 /// "avgPrice": {
2484 /// "examples": [
2485 /// "3229.44"
2486 /// ],
2487 /// "type": "string"
2488 /// },
2489 /// "bookTime": {
2490 /// "examples": [
2491 /// 1649756817004
2492 /// ],
2493 /// "type": "integer",
2494 /// "format": "int64"
2495 /// },
2496 /// "executedAmt": {
2497 /// "examples": [
2498 /// "3229.44000000"
2499 /// ],
2500 /// "type": "string"
2501 /// },
2502 /// "executedQty": {
2503 /// "examples": [
2504 /// "1.000"
2505 /// ],
2506 /// "type": "string"
2507 /// },
2508 /// "feeAmt": {
2509 /// "examples": [
2510 /// "-1.61471999"
2511 /// ],
2512 /// "type": "string"
2513 /// },
2514 /// "feeAsset": {
2515 /// "examples": [
2516 /// "USDT"
2517 /// ],
2518 /// "type": "string"
2519 /// },
2520 /// "orderId": {
2521 /// "examples": [
2522 /// 8389765519993908929
2523 /// ],
2524 /// "type": "integer",
2525 /// "format": "int64"
2526 /// },
2527 /// "orderStatus": {
2528 /// "examples": [
2529 /// "FILLED"
2530 /// ],
2531 /// "type": "string"
2532 /// },
2533 /// "origQty": {
2534 /// "examples": [
2535 /// "1.000"
2536 /// ],
2537 /// "type": "string"
2538 /// },
2539 /// "side": {
2540 /// "examples": [
2541 /// "SELL"
2542 /// ],
2543 /// "type": "string"
2544 /// },
2545 /// "subId": {
2546 /// "examples": [
2547 /// 1
2548 /// ],
2549 /// "type": "integer",
2550 /// "format": "int64"
2551 /// },
2552 /// "symbol": {
2553 /// "examples": [
2554 /// "ETHUSDT"
2555 /// ],
2556 /// "type": "string"
2557 /// },
2558 /// "timeInForce": {
2559 /// "examples": [
2560 /// "IMMEDIATE_OR_CANCEL"
2561 /// ],
2562 /// "type": "string"
2563 /// }
2564 /// }
2565 /// }
2566 /// },
2567 /// "total": {
2568 /// "examples": [
2569 /// 1
2570 /// ],
2571 /// "type": "integer",
2572 /// "format": "int32"
2573 /// }
2574 /// }
2575 ///}
2576 /// ```
2577 /// </details>
2578 #[derive(Clone, Debug, Deserialize, Serialize)]
2579 pub struct AlgoFuturesSubOrdersResponse {
2580 #[serde(rename = "executedAmt")]
2581 pub executed_amt: String,
2582 #[serde(rename = "executedQty")]
2583 pub executed_qty: String,
2584 #[serde(rename = "subOrders")]
2585 pub sub_orders: Vec<AlgoFuturesSubOrdersResponseSubOrdersItem>,
2586 pub total: i32,
2587 }
2588 impl From<&AlgoFuturesSubOrdersResponse> for AlgoFuturesSubOrdersResponse {
2589 fn from(value: &AlgoFuturesSubOrdersResponse) -> Self {
2590 value.clone()
2591 }
2592 }
2593 ///AlgoFuturesSubOrdersResponseSubOrdersItem
2594 ///
2595 /// <details><summary>JSON schema</summary>
2596 ///
2597 /// ```json
2598 ///{
2599 /// "type": "object",
2600 /// "required": [
2601 /// "algoId",
2602 /// "avgPrice",
2603 /// "bookTime",
2604 /// "executedAmt",
2605 /// "feeAmt",
2606 /// "feeAsset",
2607 /// "orderId",
2608 /// "orderStatus",
2609 /// "origQty",
2610 /// "side",
2611 /// "subId",
2612 /// "symbol",
2613 /// "timeInForce"
2614 /// ],
2615 /// "properties": {
2616 /// "algoId": {
2617 /// "examples": [
2618 /// 13723
2619 /// ],
2620 /// "type": "integer",
2621 /// "format": "int64"
2622 /// },
2623 /// "avgPrice": {
2624 /// "examples": [
2625 /// "3229.44"
2626 /// ],
2627 /// "type": "string"
2628 /// },
2629 /// "bookTime": {
2630 /// "examples": [
2631 /// 1649756817004
2632 /// ],
2633 /// "type": "integer",
2634 /// "format": "int64"
2635 /// },
2636 /// "executedAmt": {
2637 /// "examples": [
2638 /// "3229.44000000"
2639 /// ],
2640 /// "type": "string"
2641 /// },
2642 /// "executedQty": {
2643 /// "examples": [
2644 /// "1.000"
2645 /// ],
2646 /// "type": "string"
2647 /// },
2648 /// "feeAmt": {
2649 /// "examples": [
2650 /// "-1.61471999"
2651 /// ],
2652 /// "type": "string"
2653 /// },
2654 /// "feeAsset": {
2655 /// "examples": [
2656 /// "USDT"
2657 /// ],
2658 /// "type": "string"
2659 /// },
2660 /// "orderId": {
2661 /// "examples": [
2662 /// 8389765519993908929
2663 /// ],
2664 /// "type": "integer",
2665 /// "format": "int64"
2666 /// },
2667 /// "orderStatus": {
2668 /// "examples": [
2669 /// "FILLED"
2670 /// ],
2671 /// "type": "string"
2672 /// },
2673 /// "origQty": {
2674 /// "examples": [
2675 /// "1.000"
2676 /// ],
2677 /// "type": "string"
2678 /// },
2679 /// "side": {
2680 /// "examples": [
2681 /// "SELL"
2682 /// ],
2683 /// "type": "string"
2684 /// },
2685 /// "subId": {
2686 /// "examples": [
2687 /// 1
2688 /// ],
2689 /// "type": "integer",
2690 /// "format": "int64"
2691 /// },
2692 /// "symbol": {
2693 /// "examples": [
2694 /// "ETHUSDT"
2695 /// ],
2696 /// "type": "string"
2697 /// },
2698 /// "timeInForce": {
2699 /// "examples": [
2700 /// "IMMEDIATE_OR_CANCEL"
2701 /// ],
2702 /// "type": "string"
2703 /// }
2704 /// }
2705 ///}
2706 /// ```
2707 /// </details>
2708 #[derive(Clone, Debug, Deserialize, Serialize)]
2709 pub struct AlgoFuturesSubOrdersResponseSubOrdersItem {
2710 #[serde(rename = "algoId")]
2711 pub algo_id: i64,
2712 #[serde(rename = "avgPrice")]
2713 pub avg_price: String,
2714 #[serde(rename = "bookTime")]
2715 pub book_time: i64,
2716 #[serde(rename = "executedAmt")]
2717 pub executed_amt: String,
2718 #[serde(
2719 rename = "executedQty",
2720 default,
2721 skip_serializing_if = "Option::is_none"
2722 )]
2723 pub executed_qty: Option<String>,
2724 #[serde(rename = "feeAmt")]
2725 pub fee_amt: String,
2726 #[serde(rename = "feeAsset")]
2727 pub fee_asset: String,
2728 #[serde(rename = "orderId")]
2729 pub order_id: i64,
2730 #[serde(rename = "orderStatus")]
2731 pub order_status: String,
2732 #[serde(rename = "origQty")]
2733 pub orig_qty: String,
2734 pub side: String,
2735 #[serde(rename = "subId")]
2736 pub sub_id: i64,
2737 pub symbol: String,
2738 #[serde(rename = "timeInForce")]
2739 pub time_in_force: String,
2740 }
2741 impl From<&AlgoFuturesSubOrdersResponseSubOrdersItem>
2742 for AlgoFuturesSubOrdersResponseSubOrdersItem {
2743 fn from(value: &AlgoFuturesSubOrdersResponseSubOrdersItem) -> Self {
2744 value.clone()
2745 }
2746 }
2747 ///AlgoSpotHistoricalOrdersResponse
2748 ///
2749 /// <details><summary>JSON schema</summary>
2750 ///
2751 /// ```json
2752 ///{
2753 /// "type": "object",
2754 /// "required": [
2755 /// "orders",
2756 /// "total"
2757 /// ],
2758 /// "properties": {
2759 /// "orders": {
2760 /// "type": "array",
2761 /// "items": {
2762 /// "type": "object",
2763 /// "required": [
2764 /// "algoId",
2765 /// "algoStatus",
2766 /// "algoType",
2767 /// "avgPrice",
2768 /// "bookTime",
2769 /// "clientAlgoId",
2770 /// "endTime",
2771 /// "executedAmt",
2772 /// "executedQty",
2773 /// "side",
2774 /// "symbol",
2775 /// "totalQty",
2776 /// "urgency"
2777 /// ],
2778 /// "properties": {
2779 /// "algoId": {
2780 /// "examples": [
2781 /// 14517
2782 /// ],
2783 /// "type": "integer"
2784 /// },
2785 /// "algoStatus": {
2786 /// "examples": [
2787 /// "WORKING"
2788 /// ],
2789 /// "type": "string"
2790 /// },
2791 /// "algoType": {
2792 /// "examples": [
2793 /// "VP"
2794 /// ],
2795 /// "type": "string"
2796 /// },
2797 /// "avgPrice": {
2798 /// "examples": [
2799 /// "0.00"
2800 /// ],
2801 /// "type": "string"
2802 /// },
2803 /// "bookTime": {
2804 /// "examples": [
2805 /// 1649756817004
2806 /// ],
2807 /// "type": "integer",
2808 /// "format": "int64"
2809 /// },
2810 /// "clientAlgoId": {
2811 /// "examples": [
2812 /// "d7096549481642f8a0bb69e9e2e31f2e"
2813 /// ],
2814 /// "type": "string"
2815 /// },
2816 /// "endTime": {
2817 /// "examples": [
2818 /// 1649756817004
2819 /// ],
2820 /// "type": "integer",
2821 /// "format": "int64"
2822 /// },
2823 /// "executedAmt": {
2824 /// "examples": [
2825 /// "0.000"
2826 /// ],
2827 /// "type": "string"
2828 /// },
2829 /// "executedQty": {
2830 /// "examples": [
2831 /// "0.000"
2832 /// ],
2833 /// "type": "string"
2834 /// },
2835 /// "side": {
2836 /// "examples": [
2837 /// "SELL"
2838 /// ],
2839 /// "type": "string"
2840 /// },
2841 /// "symbol": {
2842 /// "examples": [
2843 /// "ETHUSDT"
2844 /// ],
2845 /// "type": "string"
2846 /// },
2847 /// "totalQty": {
2848 /// "examples": [
2849 /// "5.000"
2850 /// ],
2851 /// "type": "string"
2852 /// },
2853 /// "urgency": {
2854 /// "examples": [
2855 /// "LOW"
2856 /// ],
2857 /// "type": "string"
2858 /// }
2859 /// }
2860 /// }
2861 /// },
2862 /// "total": {
2863 /// "examples": [
2864 /// 1
2865 /// ],
2866 /// "type": "integer",
2867 /// "format": "int64"
2868 /// }
2869 /// }
2870 ///}
2871 /// ```
2872 /// </details>
2873 #[derive(Clone, Debug, Deserialize, Serialize)]
2874 pub struct AlgoSpotHistoricalOrdersResponse {
2875 pub orders: Vec<AlgoSpotHistoricalOrdersResponseOrdersItem>,
2876 pub total: i64,
2877 }
2878 impl From<&AlgoSpotHistoricalOrdersResponse> for AlgoSpotHistoricalOrdersResponse {
2879 fn from(value: &AlgoSpotHistoricalOrdersResponse) -> Self {
2880 value.clone()
2881 }
2882 }
2883 ///AlgoSpotHistoricalOrdersResponseOrdersItem
2884 ///
2885 /// <details><summary>JSON schema</summary>
2886 ///
2887 /// ```json
2888 ///{
2889 /// "type": "object",
2890 /// "required": [
2891 /// "algoId",
2892 /// "algoStatus",
2893 /// "algoType",
2894 /// "avgPrice",
2895 /// "bookTime",
2896 /// "clientAlgoId",
2897 /// "endTime",
2898 /// "executedAmt",
2899 /// "executedQty",
2900 /// "side",
2901 /// "symbol",
2902 /// "totalQty",
2903 /// "urgency"
2904 /// ],
2905 /// "properties": {
2906 /// "algoId": {
2907 /// "examples": [
2908 /// 14517
2909 /// ],
2910 /// "type": "integer"
2911 /// },
2912 /// "algoStatus": {
2913 /// "examples": [
2914 /// "WORKING"
2915 /// ],
2916 /// "type": "string"
2917 /// },
2918 /// "algoType": {
2919 /// "examples": [
2920 /// "VP"
2921 /// ],
2922 /// "type": "string"
2923 /// },
2924 /// "avgPrice": {
2925 /// "examples": [
2926 /// "0.00"
2927 /// ],
2928 /// "type": "string"
2929 /// },
2930 /// "bookTime": {
2931 /// "examples": [
2932 /// 1649756817004
2933 /// ],
2934 /// "type": "integer",
2935 /// "format": "int64"
2936 /// },
2937 /// "clientAlgoId": {
2938 /// "examples": [
2939 /// "d7096549481642f8a0bb69e9e2e31f2e"
2940 /// ],
2941 /// "type": "string"
2942 /// },
2943 /// "endTime": {
2944 /// "examples": [
2945 /// 1649756817004
2946 /// ],
2947 /// "type": "integer",
2948 /// "format": "int64"
2949 /// },
2950 /// "executedAmt": {
2951 /// "examples": [
2952 /// "0.000"
2953 /// ],
2954 /// "type": "string"
2955 /// },
2956 /// "executedQty": {
2957 /// "examples": [
2958 /// "0.000"
2959 /// ],
2960 /// "type": "string"
2961 /// },
2962 /// "side": {
2963 /// "examples": [
2964 /// "SELL"
2965 /// ],
2966 /// "type": "string"
2967 /// },
2968 /// "symbol": {
2969 /// "examples": [
2970 /// "ETHUSDT"
2971 /// ],
2972 /// "type": "string"
2973 /// },
2974 /// "totalQty": {
2975 /// "examples": [
2976 /// "5.000"
2977 /// ],
2978 /// "type": "string"
2979 /// },
2980 /// "urgency": {
2981 /// "examples": [
2982 /// "LOW"
2983 /// ],
2984 /// "type": "string"
2985 /// }
2986 /// }
2987 ///}
2988 /// ```
2989 /// </details>
2990 #[derive(Clone, Debug, Deserialize, Serialize)]
2991 pub struct AlgoSpotHistoricalOrdersResponseOrdersItem {
2992 #[serde(rename = "algoId")]
2993 pub algo_id: i64,
2994 #[serde(rename = "algoStatus")]
2995 pub algo_status: String,
2996 #[serde(rename = "algoType")]
2997 pub algo_type: String,
2998 #[serde(rename = "avgPrice")]
2999 pub avg_price: String,
3000 #[serde(rename = "bookTime")]
3001 pub book_time: i64,
3002 #[serde(rename = "clientAlgoId")]
3003 pub client_algo_id: String,
3004 #[serde(rename = "endTime")]
3005 pub end_time: i64,
3006 #[serde(rename = "executedAmt")]
3007 pub executed_amt: String,
3008 #[serde(rename = "executedQty")]
3009 pub executed_qty: String,
3010 pub side: String,
3011 pub symbol: String,
3012 #[serde(rename = "totalQty")]
3013 pub total_qty: String,
3014 pub urgency: String,
3015 }
3016 impl From<&AlgoSpotHistoricalOrdersResponseOrdersItem>
3017 for AlgoSpotHistoricalOrdersResponseOrdersItem {
3018 fn from(value: &AlgoSpotHistoricalOrdersResponseOrdersItem) -> Self {
3019 value.clone()
3020 }
3021 }
3022 ///AlgoSpotHistoricalOrdersSide
3023 ///
3024 /// <details><summary>JSON schema</summary>
3025 ///
3026 /// ```json
3027 ///{
3028 /// "examples": [
3029 /// "SELL"
3030 /// ],
3031 /// "type": "string",
3032 /// "enum": [
3033 /// "SELL",
3034 /// "BUY"
3035 /// ]
3036 ///}
3037 /// ```
3038 /// </details>
3039 #[derive(
3040 Clone,
3041 Copy,
3042 Debug,
3043 Deserialize,
3044 Eq,
3045 Hash,
3046 Ord,
3047 PartialEq,
3048 PartialOrd,
3049 Serialize
3050 )]
3051 pub enum AlgoSpotHistoricalOrdersSide {
3052 #[serde(rename = "SELL")]
3053 Sell,
3054 #[serde(rename = "BUY")]
3055 Buy,
3056 }
3057 impl From<&AlgoSpotHistoricalOrdersSide> for AlgoSpotHistoricalOrdersSide {
3058 fn from(value: &AlgoSpotHistoricalOrdersSide) -> Self {
3059 value.clone()
3060 }
3061 }
3062 impl ToString for AlgoSpotHistoricalOrdersSide {
3063 fn to_string(&self) -> String {
3064 match *self {
3065 Self::Sell => "SELL".to_string(),
3066 Self::Buy => "BUY".to_string(),
3067 }
3068 }
3069 }
3070 impl std::str::FromStr for AlgoSpotHistoricalOrdersSide {
3071 type Err = self::error::ConversionError;
3072 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
3073 match value {
3074 "SELL" => Ok(Self::Sell),
3075 "BUY" => Ok(Self::Buy),
3076 _ => Err("invalid value".into()),
3077 }
3078 }
3079 }
3080 impl std::convert::TryFrom<&str> for AlgoSpotHistoricalOrdersSide {
3081 type Error = self::error::ConversionError;
3082 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
3083 value.parse()
3084 }
3085 }
3086 impl std::convert::TryFrom<&String> for AlgoSpotHistoricalOrdersSide {
3087 type Error = self::error::ConversionError;
3088 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
3089 value.parse()
3090 }
3091 }
3092 impl std::convert::TryFrom<String> for AlgoSpotHistoricalOrdersSide {
3093 type Error = self::error::ConversionError;
3094 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
3095 value.parse()
3096 }
3097 }
3098 ///AlgoSpotNewOrderTwapResponse
3099 ///
3100 /// <details><summary>JSON schema</summary>
3101 ///
3102 /// ```json
3103 ///{
3104 /// "type": "object",
3105 /// "required": [
3106 /// "clientAlgoId",
3107 /// "code",
3108 /// "msg",
3109 /// "success"
3110 /// ],
3111 /// "properties": {
3112 /// "clientAlgoId": {
3113 /// "examples": [
3114 /// "65ce1630101a480b85915d7e11fd5078"
3115 /// ],
3116 /// "type": "string"
3117 /// },
3118 /// "code": {
3119 /// "examples": [
3120 /// 0
3121 /// ],
3122 /// "type": "integer"
3123 /// },
3124 /// "msg": {
3125 /// "examples": [
3126 /// "OK"
3127 /// ],
3128 /// "type": "string"
3129 /// },
3130 /// "success": {
3131 /// "examples": [
3132 /// true
3133 /// ],
3134 /// "type": "boolean"
3135 /// }
3136 /// }
3137 ///}
3138 /// ```
3139 /// </details>
3140 #[derive(Clone, Debug, Deserialize, Serialize)]
3141 pub struct AlgoSpotNewOrderTwapResponse {
3142 #[serde(rename = "clientAlgoId")]
3143 pub client_algo_id: String,
3144 pub code: i64,
3145 pub msg: String,
3146 pub success: bool,
3147 }
3148 impl From<&AlgoSpotNewOrderTwapResponse> for AlgoSpotNewOrderTwapResponse {
3149 fn from(value: &AlgoSpotNewOrderTwapResponse) -> Self {
3150 value.clone()
3151 }
3152 }
3153 ///AlgoSpotNewOrderTwapSide
3154 ///
3155 /// <details><summary>JSON schema</summary>
3156 ///
3157 /// ```json
3158 ///{
3159 /// "examples": [
3160 /// "SELL"
3161 /// ],
3162 /// "type": "string",
3163 /// "enum": [
3164 /// "SELL",
3165 /// "BUY"
3166 /// ]
3167 ///}
3168 /// ```
3169 /// </details>
3170 #[derive(
3171 Clone,
3172 Copy,
3173 Debug,
3174 Deserialize,
3175 Eq,
3176 Hash,
3177 Ord,
3178 PartialEq,
3179 PartialOrd,
3180 Serialize
3181 )]
3182 pub enum AlgoSpotNewOrderTwapSide {
3183 #[serde(rename = "SELL")]
3184 Sell,
3185 #[serde(rename = "BUY")]
3186 Buy,
3187 }
3188 impl From<&AlgoSpotNewOrderTwapSide> for AlgoSpotNewOrderTwapSide {
3189 fn from(value: &AlgoSpotNewOrderTwapSide) -> Self {
3190 value.clone()
3191 }
3192 }
3193 impl ToString for AlgoSpotNewOrderTwapSide {
3194 fn to_string(&self) -> String {
3195 match *self {
3196 Self::Sell => "SELL".to_string(),
3197 Self::Buy => "BUY".to_string(),
3198 }
3199 }
3200 }
3201 impl std::str::FromStr for AlgoSpotNewOrderTwapSide {
3202 type Err = self::error::ConversionError;
3203 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
3204 match value {
3205 "SELL" => Ok(Self::Sell),
3206 "BUY" => Ok(Self::Buy),
3207 _ => Err("invalid value".into()),
3208 }
3209 }
3210 }
3211 impl std::convert::TryFrom<&str> for AlgoSpotNewOrderTwapSide {
3212 type Error = self::error::ConversionError;
3213 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
3214 value.parse()
3215 }
3216 }
3217 impl std::convert::TryFrom<&String> for AlgoSpotNewOrderTwapSide {
3218 type Error = self::error::ConversionError;
3219 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
3220 value.parse()
3221 }
3222 }
3223 impl std::convert::TryFrom<String> for AlgoSpotNewOrderTwapSide {
3224 type Error = self::error::ConversionError;
3225 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
3226 value.parse()
3227 }
3228 }
3229 ///AlgoSpotOpenOrdersResponse
3230 ///
3231 /// <details><summary>JSON schema</summary>
3232 ///
3233 /// ```json
3234 ///{
3235 /// "type": "object",
3236 /// "required": [
3237 /// "orders",
3238 /// "total"
3239 /// ],
3240 /// "properties": {
3241 /// "orders": {
3242 /// "type": "array",
3243 /// "items": {
3244 /// "type": "object",
3245 /// "required": [
3246 /// "algoId",
3247 /// "algoStatus",
3248 /// "algoType",
3249 /// "avgPrice",
3250 /// "bookTime",
3251 /// "clientAlgoId",
3252 /// "endTime",
3253 /// "executedAmt",
3254 /// "executedQty",
3255 /// "side",
3256 /// "symbol",
3257 /// "totalQty",
3258 /// "urgency"
3259 /// ],
3260 /// "properties": {
3261 /// "algoId": {
3262 /// "examples": [
3263 /// 14517
3264 /// ],
3265 /// "type": "integer"
3266 /// },
3267 /// "algoStatus": {
3268 /// "examples": [
3269 /// "WORKING"
3270 /// ],
3271 /// "type": "string"
3272 /// },
3273 /// "algoType": {
3274 /// "examples": [
3275 /// "TWAP"
3276 /// ],
3277 /// "type": "string"
3278 /// },
3279 /// "avgPrice": {
3280 /// "examples": [
3281 /// "0.00"
3282 /// ],
3283 /// "type": "string"
3284 /// },
3285 /// "bookTime": {
3286 /// "examples": [
3287 /// 1649756817004
3288 /// ],
3289 /// "type": "integer",
3290 /// "format": "int64"
3291 /// },
3292 /// "clientAlgoId": {
3293 /// "examples": [
3294 /// "d7096549481642f8a0bb69e9e2e31f2e"
3295 /// ],
3296 /// "type": "string"
3297 /// },
3298 /// "endTime": {
3299 /// "examples": [
3300 /// 1649756817004
3301 /// ],
3302 /// "type": "integer",
3303 /// "format": "int64"
3304 /// },
3305 /// "executedAmt": {
3306 /// "examples": [
3307 /// "0.000"
3308 /// ],
3309 /// "type": "string"
3310 /// },
3311 /// "executedQty": {
3312 /// "examples": [
3313 /// "0.000"
3314 /// ],
3315 /// "type": "string"
3316 /// },
3317 /// "side": {
3318 /// "examples": [
3319 /// "SELL"
3320 /// ],
3321 /// "type": "string"
3322 /// },
3323 /// "symbol": {
3324 /// "examples": [
3325 /// "ETHUSDT"
3326 /// ],
3327 /// "type": "string"
3328 /// },
3329 /// "totalQty": {
3330 /// "examples": [
3331 /// "5.000"
3332 /// ],
3333 /// "type": "string"
3334 /// },
3335 /// "urgency": {
3336 /// "examples": [
3337 /// "LOW"
3338 /// ],
3339 /// "type": "string"
3340 /// }
3341 /// }
3342 /// }
3343 /// },
3344 /// "total": {
3345 /// "examples": [
3346 /// 1
3347 /// ],
3348 /// "type": "integer",
3349 /// "format": "int64"
3350 /// }
3351 /// }
3352 ///}
3353 /// ```
3354 /// </details>
3355 #[derive(Clone, Debug, Deserialize, Serialize)]
3356 pub struct AlgoSpotOpenOrdersResponse {
3357 pub orders: Vec<AlgoSpotOpenOrdersResponseOrdersItem>,
3358 pub total: i64,
3359 }
3360 impl From<&AlgoSpotOpenOrdersResponse> for AlgoSpotOpenOrdersResponse {
3361 fn from(value: &AlgoSpotOpenOrdersResponse) -> Self {
3362 value.clone()
3363 }
3364 }
3365 ///AlgoSpotOpenOrdersResponseOrdersItem
3366 ///
3367 /// <details><summary>JSON schema</summary>
3368 ///
3369 /// ```json
3370 ///{
3371 /// "type": "object",
3372 /// "required": [
3373 /// "algoId",
3374 /// "algoStatus",
3375 /// "algoType",
3376 /// "avgPrice",
3377 /// "bookTime",
3378 /// "clientAlgoId",
3379 /// "endTime",
3380 /// "executedAmt",
3381 /// "executedQty",
3382 /// "side",
3383 /// "symbol",
3384 /// "totalQty",
3385 /// "urgency"
3386 /// ],
3387 /// "properties": {
3388 /// "algoId": {
3389 /// "examples": [
3390 /// 14517
3391 /// ],
3392 /// "type": "integer"
3393 /// },
3394 /// "algoStatus": {
3395 /// "examples": [
3396 /// "WORKING"
3397 /// ],
3398 /// "type": "string"
3399 /// },
3400 /// "algoType": {
3401 /// "examples": [
3402 /// "TWAP"
3403 /// ],
3404 /// "type": "string"
3405 /// },
3406 /// "avgPrice": {
3407 /// "examples": [
3408 /// "0.00"
3409 /// ],
3410 /// "type": "string"
3411 /// },
3412 /// "bookTime": {
3413 /// "examples": [
3414 /// 1649756817004
3415 /// ],
3416 /// "type": "integer",
3417 /// "format": "int64"
3418 /// },
3419 /// "clientAlgoId": {
3420 /// "examples": [
3421 /// "d7096549481642f8a0bb69e9e2e31f2e"
3422 /// ],
3423 /// "type": "string"
3424 /// },
3425 /// "endTime": {
3426 /// "examples": [
3427 /// 1649756817004
3428 /// ],
3429 /// "type": "integer",
3430 /// "format": "int64"
3431 /// },
3432 /// "executedAmt": {
3433 /// "examples": [
3434 /// "0.000"
3435 /// ],
3436 /// "type": "string"
3437 /// },
3438 /// "executedQty": {
3439 /// "examples": [
3440 /// "0.000"
3441 /// ],
3442 /// "type": "string"
3443 /// },
3444 /// "side": {
3445 /// "examples": [
3446 /// "SELL"
3447 /// ],
3448 /// "type": "string"
3449 /// },
3450 /// "symbol": {
3451 /// "examples": [
3452 /// "ETHUSDT"
3453 /// ],
3454 /// "type": "string"
3455 /// },
3456 /// "totalQty": {
3457 /// "examples": [
3458 /// "5.000"
3459 /// ],
3460 /// "type": "string"
3461 /// },
3462 /// "urgency": {
3463 /// "examples": [
3464 /// "LOW"
3465 /// ],
3466 /// "type": "string"
3467 /// }
3468 /// }
3469 ///}
3470 /// ```
3471 /// </details>
3472 #[derive(Clone, Debug, Deserialize, Serialize)]
3473 pub struct AlgoSpotOpenOrdersResponseOrdersItem {
3474 #[serde(rename = "algoId")]
3475 pub algo_id: i64,
3476 #[serde(rename = "algoStatus")]
3477 pub algo_status: String,
3478 #[serde(rename = "algoType")]
3479 pub algo_type: String,
3480 #[serde(rename = "avgPrice")]
3481 pub avg_price: String,
3482 #[serde(rename = "bookTime")]
3483 pub book_time: i64,
3484 #[serde(rename = "clientAlgoId")]
3485 pub client_algo_id: String,
3486 #[serde(rename = "endTime")]
3487 pub end_time: i64,
3488 #[serde(rename = "executedAmt")]
3489 pub executed_amt: String,
3490 #[serde(rename = "executedQty")]
3491 pub executed_qty: String,
3492 pub side: String,
3493 pub symbol: String,
3494 #[serde(rename = "totalQty")]
3495 pub total_qty: String,
3496 pub urgency: String,
3497 }
3498 impl From<&AlgoSpotOpenOrdersResponseOrdersItem>
3499 for AlgoSpotOpenOrdersResponseOrdersItem {
3500 fn from(value: &AlgoSpotOpenOrdersResponseOrdersItem) -> Self {
3501 value.clone()
3502 }
3503 }
3504 ///AlgoSpotSubOrdersResponse
3505 ///
3506 /// <details><summary>JSON schema</summary>
3507 ///
3508 /// ```json
3509 ///{
3510 /// "type": "object",
3511 /// "required": [
3512 /// "executedAmt",
3513 /// "executedQty",
3514 /// "subOrders",
3515 /// "total"
3516 /// ],
3517 /// "properties": {
3518 /// "executedAmt": {
3519 /// "examples": [
3520 /// "3229.44000000"
3521 /// ],
3522 /// "type": "string"
3523 /// },
3524 /// "executedQty": {
3525 /// "examples": [
3526 /// "1.000"
3527 /// ],
3528 /// "type": "string"
3529 /// },
3530 /// "subOrders": {
3531 /// "type": "array",
3532 /// "items": {
3533 /// "type": "object",
3534 /// "required": [
3535 /// "algoId",
3536 /// "avgPrice",
3537 /// "bookTime",
3538 /// "executedAmt",
3539 /// "executedQty",
3540 /// "feeAmt",
3541 /// "feeAsset",
3542 /// "orderId",
3543 /// "orderStatus",
3544 /// "origQty",
3545 /// "side",
3546 /// "subId",
3547 /// "symbol",
3548 /// "timeInForce"
3549 /// ],
3550 /// "properties": {
3551 /// "algoId": {
3552 /// "examples": [
3553 /// 14517
3554 /// ],
3555 /// "type": "integer"
3556 /// },
3557 /// "avgPrice": {
3558 /// "examples": [
3559 /// "3229.44"
3560 /// ],
3561 /// "type": "string"
3562 /// },
3563 /// "bookTime": {
3564 /// "examples": [
3565 /// 1649319001964
3566 /// ],
3567 /// "type": "integer",
3568 /// "format": "int64"
3569 /// },
3570 /// "executedAmt": {
3571 /// "examples": [
3572 /// "0.000"
3573 /// ],
3574 /// "type": "string"
3575 /// },
3576 /// "executedQty": {
3577 /// "examples": [
3578 /// "0.000"
3579 /// ],
3580 /// "type": "string"
3581 /// },
3582 /// "feeAmt": {
3583 /// "examples": [
3584 /// "-1.61471999"
3585 /// ],
3586 /// "type": "string"
3587 /// },
3588 /// "feeAsset": {
3589 /// "examples": [
3590 /// "USDT"
3591 /// ],
3592 /// "type": "string"
3593 /// },
3594 /// "orderId": {
3595 /// "examples": [
3596 /// 8389765519993908929
3597 /// ],
3598 /// "type": "integer",
3599 /// "format": "int64"
3600 /// },
3601 /// "orderStatus": {
3602 /// "examples": [
3603 /// "FILLED"
3604 /// ],
3605 /// "type": "string"
3606 /// },
3607 /// "origQty": {
3608 /// "examples": [
3609 /// "1.000"
3610 /// ],
3611 /// "type": "string"
3612 /// },
3613 /// "side": {
3614 /// "examples": [
3615 /// "SELL"
3616 /// ],
3617 /// "type": "string"
3618 /// },
3619 /// "subId": {
3620 /// "examples": [
3621 /// 1
3622 /// ],
3623 /// "type": "integer"
3624 /// },
3625 /// "symbol": {
3626 /// "examples": [
3627 /// "ETHUSDT"
3628 /// ],
3629 /// "type": "string"
3630 /// },
3631 /// "timeInForce": {
3632 /// "examples": [
3633 /// "IMMEDIATE_OR_CANCEL"
3634 /// ],
3635 /// "type": "string"
3636 /// }
3637 /// }
3638 /// }
3639 /// },
3640 /// "total": {
3641 /// "examples": [
3642 /// 1
3643 /// ],
3644 /// "type": "integer",
3645 /// "format": "int64"
3646 /// }
3647 /// }
3648 ///}
3649 /// ```
3650 /// </details>
3651 #[derive(Clone, Debug, Deserialize, Serialize)]
3652 pub struct AlgoSpotSubOrdersResponse {
3653 #[serde(rename = "executedAmt")]
3654 pub executed_amt: String,
3655 #[serde(rename = "executedQty")]
3656 pub executed_qty: String,
3657 #[serde(rename = "subOrders")]
3658 pub sub_orders: Vec<AlgoSpotSubOrdersResponseSubOrdersItem>,
3659 pub total: i64,
3660 }
3661 impl From<&AlgoSpotSubOrdersResponse> for AlgoSpotSubOrdersResponse {
3662 fn from(value: &AlgoSpotSubOrdersResponse) -> Self {
3663 value.clone()
3664 }
3665 }
3666 ///AlgoSpotSubOrdersResponseSubOrdersItem
3667 ///
3668 /// <details><summary>JSON schema</summary>
3669 ///
3670 /// ```json
3671 ///{
3672 /// "type": "object",
3673 /// "required": [
3674 /// "algoId",
3675 /// "avgPrice",
3676 /// "bookTime",
3677 /// "executedAmt",
3678 /// "executedQty",
3679 /// "feeAmt",
3680 /// "feeAsset",
3681 /// "orderId",
3682 /// "orderStatus",
3683 /// "origQty",
3684 /// "side",
3685 /// "subId",
3686 /// "symbol",
3687 /// "timeInForce"
3688 /// ],
3689 /// "properties": {
3690 /// "algoId": {
3691 /// "examples": [
3692 /// 14517
3693 /// ],
3694 /// "type": "integer"
3695 /// },
3696 /// "avgPrice": {
3697 /// "examples": [
3698 /// "3229.44"
3699 /// ],
3700 /// "type": "string"
3701 /// },
3702 /// "bookTime": {
3703 /// "examples": [
3704 /// 1649319001964
3705 /// ],
3706 /// "type": "integer",
3707 /// "format": "int64"
3708 /// },
3709 /// "executedAmt": {
3710 /// "examples": [
3711 /// "0.000"
3712 /// ],
3713 /// "type": "string"
3714 /// },
3715 /// "executedQty": {
3716 /// "examples": [
3717 /// "0.000"
3718 /// ],
3719 /// "type": "string"
3720 /// },
3721 /// "feeAmt": {
3722 /// "examples": [
3723 /// "-1.61471999"
3724 /// ],
3725 /// "type": "string"
3726 /// },
3727 /// "feeAsset": {
3728 /// "examples": [
3729 /// "USDT"
3730 /// ],
3731 /// "type": "string"
3732 /// },
3733 /// "orderId": {
3734 /// "examples": [
3735 /// 8389765519993908929
3736 /// ],
3737 /// "type": "integer",
3738 /// "format": "int64"
3739 /// },
3740 /// "orderStatus": {
3741 /// "examples": [
3742 /// "FILLED"
3743 /// ],
3744 /// "type": "string"
3745 /// },
3746 /// "origQty": {
3747 /// "examples": [
3748 /// "1.000"
3749 /// ],
3750 /// "type": "string"
3751 /// },
3752 /// "side": {
3753 /// "examples": [
3754 /// "SELL"
3755 /// ],
3756 /// "type": "string"
3757 /// },
3758 /// "subId": {
3759 /// "examples": [
3760 /// 1
3761 /// ],
3762 /// "type": "integer"
3763 /// },
3764 /// "symbol": {
3765 /// "examples": [
3766 /// "ETHUSDT"
3767 /// ],
3768 /// "type": "string"
3769 /// },
3770 /// "timeInForce": {
3771 /// "examples": [
3772 /// "IMMEDIATE_OR_CANCEL"
3773 /// ],
3774 /// "type": "string"
3775 /// }
3776 /// }
3777 ///}
3778 /// ```
3779 /// </details>
3780 #[derive(Clone, Debug, Deserialize, Serialize)]
3781 pub struct AlgoSpotSubOrdersResponseSubOrdersItem {
3782 #[serde(rename = "algoId")]
3783 pub algo_id: i64,
3784 #[serde(rename = "avgPrice")]
3785 pub avg_price: String,
3786 #[serde(rename = "bookTime")]
3787 pub book_time: i64,
3788 #[serde(rename = "executedAmt")]
3789 pub executed_amt: String,
3790 #[serde(rename = "executedQty")]
3791 pub executed_qty: String,
3792 #[serde(rename = "feeAmt")]
3793 pub fee_amt: String,
3794 #[serde(rename = "feeAsset")]
3795 pub fee_asset: String,
3796 #[serde(rename = "orderId")]
3797 pub order_id: i64,
3798 #[serde(rename = "orderStatus")]
3799 pub order_status: String,
3800 #[serde(rename = "origQty")]
3801 pub orig_qty: String,
3802 pub side: String,
3803 #[serde(rename = "subId")]
3804 pub sub_id: i64,
3805 pub symbol: String,
3806 #[serde(rename = "timeInForce")]
3807 pub time_in_force: String,
3808 }
3809 impl From<&AlgoSpotSubOrdersResponseSubOrdersItem>
3810 for AlgoSpotSubOrdersResponseSubOrdersItem {
3811 fn from(value: &AlgoSpotSubOrdersResponseSubOrdersItem) -> Self {
3812 value.clone()
3813 }
3814 }
3815 ///AllOrderListResponseItem
3816 ///
3817 /// <details><summary>JSON schema</summary>
3818 ///
3819 /// ```json
3820 ///{
3821 /// "type": "object",
3822 /// "required": [
3823 /// "contingencyType",
3824 /// "isIsolated",
3825 /// "listClientOrderId",
3826 /// "listOrderStatus",
3827 /// "listStatusType",
3828 /// "orderListId",
3829 /// "orders",
3830 /// "symbol",
3831 /// "transactionTime"
3832 /// ],
3833 /// "properties": {
3834 /// "contingencyType": {
3835 /// "examples": [
3836 /// "OCO"
3837 /// ],
3838 /// "type": "string"
3839 /// },
3840 /// "isIsolated": {
3841 /// "type": "boolean"
3842 /// },
3843 /// "listClientOrderId": {
3844 /// "examples": [
3845 /// "amEEAXryFzFwYF1FeRpUoZ"
3846 /// ],
3847 /// "type": "string"
3848 /// },
3849 /// "listOrderStatus": {
3850 /// "examples": [
3851 /// "EXECUTING"
3852 /// ],
3853 /// "type": "string"
3854 /// },
3855 /// "listStatusType": {
3856 /// "examples": [
3857 /// "EXEC_STARTED"
3858 /// ],
3859 /// "type": "string"
3860 /// },
3861 /// "orderListId": {
3862 /// "examples": [
3863 /// 29
3864 /// ],
3865 /// "type": "integer",
3866 /// "format": "int64"
3867 /// },
3868 /// "orders": {
3869 /// "type": "array",
3870 /// "items": {
3871 /// "examples": [
3872 /// [
3873 /// {
3874 /// "clientOrderId": "oD7aesZqjEGlZrbtRpy5zB",
3875 /// "orderId": 4,
3876 /// "symbol": "LTCBTC"
3877 /// },
3878 /// {
3879 /// "clientOrderId": "Jr1h6xirOxgeJOUuYQS7V3",
3880 /// "orderId": 5,
3881 /// "symbol": "LTCBTC"
3882 /// }
3883 /// ]
3884 /// ],
3885 /// "type": "object",
3886 /// "required": [
3887 /// "clientOrderId",
3888 /// "orderId",
3889 /// "symbol"
3890 /// ],
3891 /// "properties": {
3892 /// "clientOrderId": {
3893 /// "type": "string"
3894 /// },
3895 /// "orderId": {
3896 /// "type": "integer",
3897 /// "format": "int64"
3898 /// },
3899 /// "symbol": {
3900 /// "type": "string"
3901 /// }
3902 /// }
3903 /// }
3904 /// },
3905 /// "symbol": {
3906 /// "examples": [
3907 /// "LTCBTC"
3908 /// ],
3909 /// "type": "string"
3910 /// },
3911 /// "transactionTime": {
3912 /// "examples": [
3913 /// 1565245913483
3914 /// ],
3915 /// "type": "integer",
3916 /// "format": "int64"
3917 /// }
3918 /// }
3919 ///}
3920 /// ```
3921 /// </details>
3922 #[derive(Clone, Debug, Deserialize, Serialize)]
3923 pub struct AllOrderListResponseItem {
3924 #[serde(rename = "contingencyType")]
3925 pub contingency_type: String,
3926 #[serde(rename = "isIsolated")]
3927 pub is_isolated: bool,
3928 #[serde(rename = "listClientOrderId")]
3929 pub list_client_order_id: String,
3930 #[serde(rename = "listOrderStatus")]
3931 pub list_order_status: String,
3932 #[serde(rename = "listStatusType")]
3933 pub list_status_type: String,
3934 #[serde(rename = "orderListId")]
3935 pub order_list_id: i64,
3936 pub orders: Vec<AllOrderListResponseItemOrdersItem>,
3937 pub symbol: String,
3938 #[serde(rename = "transactionTime")]
3939 pub transaction_time: i64,
3940 }
3941 impl From<&AllOrderListResponseItem> for AllOrderListResponseItem {
3942 fn from(value: &AllOrderListResponseItem) -> Self {
3943 value.clone()
3944 }
3945 }
3946 ///AllOrderListResponseItemOrdersItem
3947 ///
3948 /// <details><summary>JSON schema</summary>
3949 ///
3950 /// ```json
3951 ///{
3952 /// "examples": [
3953 /// [
3954 /// {
3955 /// "clientOrderId": "oD7aesZqjEGlZrbtRpy5zB",
3956 /// "orderId": 4,
3957 /// "symbol": "LTCBTC"
3958 /// },
3959 /// {
3960 /// "clientOrderId": "Jr1h6xirOxgeJOUuYQS7V3",
3961 /// "orderId": 5,
3962 /// "symbol": "LTCBTC"
3963 /// }
3964 /// ]
3965 /// ],
3966 /// "type": "object",
3967 /// "required": [
3968 /// "clientOrderId",
3969 /// "orderId",
3970 /// "symbol"
3971 /// ],
3972 /// "properties": {
3973 /// "clientOrderId": {
3974 /// "type": "string"
3975 /// },
3976 /// "orderId": {
3977 /// "type": "integer",
3978 /// "format": "int64"
3979 /// },
3980 /// "symbol": {
3981 /// "type": "string"
3982 /// }
3983 /// }
3984 ///}
3985 /// ```
3986 /// </details>
3987 #[derive(Clone, Debug, Deserialize, Serialize)]
3988 pub struct AllOrderListResponseItemOrdersItem {
3989 #[serde(rename = "clientOrderId")]
3990 pub client_order_id: String,
3991 #[serde(rename = "orderId")]
3992 pub order_id: i64,
3993 pub symbol: String,
3994 }
3995 impl From<&AllOrderListResponseItemOrdersItem>
3996 for AllOrderListResponseItemOrdersItem {
3997 fn from(value: &AllOrderListResponseItemOrdersItem) -> Self {
3998 value.clone()
3999 }
4000 }
4001 ///ApplyForMarginLoanIsIsolated
4002 ///
4003 /// <details><summary>JSON schema</summary>
4004 ///
4005 /// ```json
4006 ///{
4007 /// "type": "string",
4008 /// "enum": [
4009 /// "TRUE",
4010 /// "FALSE"
4011 /// ]
4012 ///}
4013 /// ```
4014 /// </details>
4015 #[derive(
4016 Clone,
4017 Copy,
4018 Debug,
4019 Deserialize,
4020 Eq,
4021 Hash,
4022 Ord,
4023 PartialEq,
4024 PartialOrd,
4025 Serialize
4026 )]
4027 pub enum ApplyForMarginLoanIsIsolated {
4028 #[serde(rename = "TRUE")]
4029 True,
4030 #[serde(rename = "FALSE")]
4031 False,
4032 }
4033 impl From<&ApplyForMarginLoanIsIsolated> for ApplyForMarginLoanIsIsolated {
4034 fn from(value: &ApplyForMarginLoanIsIsolated) -> Self {
4035 value.clone()
4036 }
4037 }
4038 impl ToString for ApplyForMarginLoanIsIsolated {
4039 fn to_string(&self) -> String {
4040 match *self {
4041 Self::True => "TRUE".to_string(),
4042 Self::False => "FALSE".to_string(),
4043 }
4044 }
4045 }
4046 impl std::str::FromStr for ApplyForMarginLoanIsIsolated {
4047 type Err = self::error::ConversionError;
4048 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
4049 match value {
4050 "TRUE" => Ok(Self::True),
4051 "FALSE" => Ok(Self::False),
4052 _ => Err("invalid value".into()),
4053 }
4054 }
4055 }
4056 impl std::convert::TryFrom<&str> for ApplyForMarginLoanIsIsolated {
4057 type Error = self::error::ConversionError;
4058 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
4059 value.parse()
4060 }
4061 }
4062 impl std::convert::TryFrom<&String> for ApplyForMarginLoanIsIsolated {
4063 type Error = self::error::ConversionError;
4064 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
4065 value.parse()
4066 }
4067 }
4068 impl std::convert::TryFrom<String> for ApplyForMarginLoanIsIsolated {
4069 type Error = self::error::ConversionError;
4070 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
4071 value.parse()
4072 }
4073 }
4074 ///AssetAssetDetailResponse
4075 ///
4076 /// <details><summary>JSON schema</summary>
4077 ///
4078 /// ```json
4079 ///{
4080 /// "type": "object",
4081 /// "required": [
4082 /// "CTR"
4083 /// ],
4084 /// "properties": {
4085 /// "CTR": {
4086 /// "type": "object",
4087 /// "required": [
4088 /// "depositStatus",
4089 /// "depositTip",
4090 /// "minWithdrawAmount",
4091 /// "withdrawFee",
4092 /// "withdrawStatus"
4093 /// ],
4094 /// "properties": {
4095 /// "depositStatus": {
4096 /// "description": "deposit status (false if ALL of networks' are false)",
4097 /// "examples": [
4098 /// false
4099 /// ],
4100 /// "type": "boolean"
4101 /// },
4102 /// "depositTip": {
4103 /// "examples": [
4104 /// "Delisted, Deposit Suspended"
4105 /// ],
4106 /// "type": "string"
4107 /// },
4108 /// "minWithdrawAmount": {
4109 /// "examples": [
4110 /// "70.00000000"
4111 /// ],
4112 /// "type": "string"
4113 /// },
4114 /// "withdrawFee": {
4115 /// "examples": [
4116 /// 35
4117 /// ],
4118 /// "type": "integer",
4119 /// "format": "int64"
4120 /// },
4121 /// "withdrawStatus": {
4122 /// "description": "withdrawStatus status (false if ALL of networks' are false)",
4123 /// "type": "boolean"
4124 /// }
4125 /// }
4126 /// }
4127 /// }
4128 ///}
4129 /// ```
4130 /// </details>
4131 #[derive(Clone, Debug, Deserialize, Serialize)]
4132 pub struct AssetAssetDetailResponse {
4133 #[serde(rename = "CTR")]
4134 pub ctr: AssetAssetDetailResponseCtr,
4135 }
4136 impl From<&AssetAssetDetailResponse> for AssetAssetDetailResponse {
4137 fn from(value: &AssetAssetDetailResponse) -> Self {
4138 value.clone()
4139 }
4140 }
4141 ///AssetAssetDetailResponseCtr
4142 ///
4143 /// <details><summary>JSON schema</summary>
4144 ///
4145 /// ```json
4146 ///{
4147 /// "type": "object",
4148 /// "required": [
4149 /// "depositStatus",
4150 /// "depositTip",
4151 /// "minWithdrawAmount",
4152 /// "withdrawFee",
4153 /// "withdrawStatus"
4154 /// ],
4155 /// "properties": {
4156 /// "depositStatus": {
4157 /// "description": "deposit status (false if ALL of networks' are false)",
4158 /// "examples": [
4159 /// false
4160 /// ],
4161 /// "type": "boolean"
4162 /// },
4163 /// "depositTip": {
4164 /// "examples": [
4165 /// "Delisted, Deposit Suspended"
4166 /// ],
4167 /// "type": "string"
4168 /// },
4169 /// "minWithdrawAmount": {
4170 /// "examples": [
4171 /// "70.00000000"
4172 /// ],
4173 /// "type": "string"
4174 /// },
4175 /// "withdrawFee": {
4176 /// "examples": [
4177 /// 35
4178 /// ],
4179 /// "type": "integer",
4180 /// "format": "int64"
4181 /// },
4182 /// "withdrawStatus": {
4183 /// "description": "withdrawStatus status (false if ALL of networks' are false)",
4184 /// "type": "boolean"
4185 /// }
4186 /// }
4187 ///}
4188 /// ```
4189 /// </details>
4190 #[derive(Clone, Debug, Deserialize, Serialize)]
4191 pub struct AssetAssetDetailResponseCtr {
4192 ///deposit status (false if ALL of networks' are false)
4193 #[serde(rename = "depositStatus")]
4194 pub deposit_status: bool,
4195 #[serde(rename = "depositTip")]
4196 pub deposit_tip: String,
4197 #[serde(rename = "minWithdrawAmount")]
4198 pub min_withdraw_amount: String,
4199 #[serde(rename = "withdrawFee")]
4200 pub withdraw_fee: i64,
4201 ///withdrawStatus status (false if ALL of networks' are false)
4202 #[serde(rename = "withdrawStatus")]
4203 pub withdraw_status: bool,
4204 }
4205 impl From<&AssetAssetDetailResponseCtr> for AssetAssetDetailResponseCtr {
4206 fn from(value: &AssetAssetDetailResponseCtr) -> Self {
4207 value.clone()
4208 }
4209 }
4210 ///AssetAssetDividendResponse
4211 ///
4212 /// <details><summary>JSON schema</summary>
4213 ///
4214 /// ```json
4215 ///{
4216 /// "type": "object",
4217 /// "required": [
4218 /// "rows",
4219 /// "total"
4220 /// ],
4221 /// "properties": {
4222 /// "rows": {
4223 /// "type": "array",
4224 /// "items": {
4225 /// "type": "object",
4226 /// "required": [
4227 /// "amount",
4228 /// "asset",
4229 /// "divTime",
4230 /// "enInfo",
4231 /// "id",
4232 /// "tranId"
4233 /// ],
4234 /// "properties": {
4235 /// "amount": {
4236 /// "examples": [
4237 /// "10.00000000"
4238 /// ],
4239 /// "type": "string"
4240 /// },
4241 /// "asset": {
4242 /// "examples": [
4243 /// "BHFT"
4244 /// ],
4245 /// "type": "string"
4246 /// },
4247 /// "divTime": {
4248 /// "examples": [
4249 /// 1563189166000
4250 /// ],
4251 /// "type": "integer",
4252 /// "format": "int64"
4253 /// },
4254 /// "enInfo": {
4255 /// "examples": [
4256 /// "BHFT distribution"
4257 /// ],
4258 /// "type": "string"
4259 /// },
4260 /// "id": {
4261 /// "examples": [
4262 /// 242006910
4263 /// ],
4264 /// "type": "integer",
4265 /// "format": "int64"
4266 /// },
4267 /// "tranId": {
4268 /// "examples": [
4269 /// 2968885920
4270 /// ],
4271 /// "type": "integer",
4272 /// "format": "int64"
4273 /// }
4274 /// }
4275 /// }
4276 /// },
4277 /// "total": {
4278 /// "examples": [
4279 /// 1
4280 /// ],
4281 /// "type": "integer",
4282 /// "format": "int32"
4283 /// }
4284 /// }
4285 ///}
4286 /// ```
4287 /// </details>
4288 #[derive(Clone, Debug, Deserialize, Serialize)]
4289 pub struct AssetAssetDividendResponse {
4290 pub rows: Vec<AssetAssetDividendResponseRowsItem>,
4291 pub total: i32,
4292 }
4293 impl From<&AssetAssetDividendResponse> for AssetAssetDividendResponse {
4294 fn from(value: &AssetAssetDividendResponse) -> Self {
4295 value.clone()
4296 }
4297 }
4298 ///AssetAssetDividendResponseRowsItem
4299 ///
4300 /// <details><summary>JSON schema</summary>
4301 ///
4302 /// ```json
4303 ///{
4304 /// "type": "object",
4305 /// "required": [
4306 /// "amount",
4307 /// "asset",
4308 /// "divTime",
4309 /// "enInfo",
4310 /// "id",
4311 /// "tranId"
4312 /// ],
4313 /// "properties": {
4314 /// "amount": {
4315 /// "examples": [
4316 /// "10.00000000"
4317 /// ],
4318 /// "type": "string"
4319 /// },
4320 /// "asset": {
4321 /// "examples": [
4322 /// "BHFT"
4323 /// ],
4324 /// "type": "string"
4325 /// },
4326 /// "divTime": {
4327 /// "examples": [
4328 /// 1563189166000
4329 /// ],
4330 /// "type": "integer",
4331 /// "format": "int64"
4332 /// },
4333 /// "enInfo": {
4334 /// "examples": [
4335 /// "BHFT distribution"
4336 /// ],
4337 /// "type": "string"
4338 /// },
4339 /// "id": {
4340 /// "examples": [
4341 /// 242006910
4342 /// ],
4343 /// "type": "integer",
4344 /// "format": "int64"
4345 /// },
4346 /// "tranId": {
4347 /// "examples": [
4348 /// 2968885920
4349 /// ],
4350 /// "type": "integer",
4351 /// "format": "int64"
4352 /// }
4353 /// }
4354 ///}
4355 /// ```
4356 /// </details>
4357 #[derive(Clone, Debug, Deserialize, Serialize)]
4358 pub struct AssetAssetDividendResponseRowsItem {
4359 pub amount: String,
4360 pub asset: String,
4361 #[serde(rename = "divTime")]
4362 pub div_time: i64,
4363 #[serde(rename = "enInfo")]
4364 pub en_info: String,
4365 pub id: i64,
4366 #[serde(rename = "tranId")]
4367 pub tran_id: i64,
4368 }
4369 impl From<&AssetAssetDividendResponseRowsItem>
4370 for AssetAssetDividendResponseRowsItem {
4371 fn from(value: &AssetAssetDividendResponseRowsItem) -> Self {
4372 value.clone()
4373 }
4374 }
4375 ///AssetConvertTransferQueryByPageAccountType
4376 ///
4377 /// <details><summary>JSON schema</summary>
4378 ///
4379 /// ```json
4380 ///{
4381 /// "type": "string",
4382 /// "enum": [
4383 /// "MAIN",
4384 /// "CARD"
4385 /// ]
4386 ///}
4387 /// ```
4388 /// </details>
4389 #[derive(
4390 Clone,
4391 Copy,
4392 Debug,
4393 Deserialize,
4394 Eq,
4395 Hash,
4396 Ord,
4397 PartialEq,
4398 PartialOrd,
4399 Serialize
4400 )]
4401 pub enum AssetConvertTransferQueryByPageAccountType {
4402 #[serde(rename = "MAIN")]
4403 Main,
4404 #[serde(rename = "CARD")]
4405 Card,
4406 }
4407 impl From<&AssetConvertTransferQueryByPageAccountType>
4408 for AssetConvertTransferQueryByPageAccountType {
4409 fn from(value: &AssetConvertTransferQueryByPageAccountType) -> Self {
4410 value.clone()
4411 }
4412 }
4413 impl ToString for AssetConvertTransferQueryByPageAccountType {
4414 fn to_string(&self) -> String {
4415 match *self {
4416 Self::Main => "MAIN".to_string(),
4417 Self::Card => "CARD".to_string(),
4418 }
4419 }
4420 }
4421 impl std::str::FromStr for AssetConvertTransferQueryByPageAccountType {
4422 type Err = self::error::ConversionError;
4423 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
4424 match value {
4425 "MAIN" => Ok(Self::Main),
4426 "CARD" => Ok(Self::Card),
4427 _ => Err("invalid value".into()),
4428 }
4429 }
4430 }
4431 impl std::convert::TryFrom<&str> for AssetConvertTransferQueryByPageAccountType {
4432 type Error = self::error::ConversionError;
4433 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
4434 value.parse()
4435 }
4436 }
4437 impl std::convert::TryFrom<&String> for AssetConvertTransferQueryByPageAccountType {
4438 type Error = self::error::ConversionError;
4439 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
4440 value.parse()
4441 }
4442 }
4443 impl std::convert::TryFrom<String> for AssetConvertTransferQueryByPageAccountType {
4444 type Error = self::error::ConversionError;
4445 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
4446 value.parse()
4447 }
4448 }
4449 ///AssetConvertTransferQueryByPageResponse
4450 ///
4451 /// <details><summary>JSON schema</summary>
4452 ///
4453 /// ```json
4454 ///{
4455 /// "type": "object",
4456 /// "required": [
4457 /// "rows",
4458 /// "total"
4459 /// ],
4460 /// "properties": {
4461 /// "rows": {
4462 /// "type": "array",
4463 /// "items": {
4464 /// "type": "object",
4465 /// "required": [
4466 /// "accountType",
4467 /// "deductedAmount",
4468 /// "deductedAsset",
4469 /// "status",
4470 /// "targetAmount",
4471 /// "targetAsset",
4472 /// "time",
4473 /// "tranId",
4474 /// "type"
4475 /// ],
4476 /// "properties": {
4477 /// "accountType": {
4478 /// "examples": [
4479 /// "MAIN"
4480 /// ],
4481 /// "type": "string"
4482 /// },
4483 /// "deductedAmount": {
4484 /// "examples": [
4485 /// "1"
4486 /// ],
4487 /// "type": "string"
4488 /// },
4489 /// "deductedAsset": {
4490 /// "examples": [
4491 /// "BUSD"
4492 /// ],
4493 /// "type": "string"
4494 /// },
4495 /// "status": {
4496 /// "examples": [
4497 /// "S"
4498 /// ],
4499 /// "type": "string"
4500 /// },
4501 /// "targetAmount": {
4502 /// "examples": [
4503 /// "1"
4504 /// ],
4505 /// "type": "string"
4506 /// },
4507 /// "targetAsset": {
4508 /// "examples": [
4509 /// "USDC"
4510 /// ],
4511 /// "type": "string"
4512 /// },
4513 /// "time": {
4514 /// "examples": [
4515 /// 1664442078000
4516 /// ],
4517 /// "type": "integer",
4518 /// "format": "int64"
4519 /// },
4520 /// "tranId": {
4521 /// "examples": [
4522 /// 118263407119
4523 /// ],
4524 /// "type": "integer",
4525 /// "format": "int64"
4526 /// },
4527 /// "type": {
4528 /// "examples": [
4529 /// 244
4530 /// ],
4531 /// "type": "integer",
4532 /// "format": "int64"
4533 /// }
4534 /// }
4535 /// }
4536 /// },
4537 /// "total": {
4538 /// "examples": [
4539 /// 1
4540 /// ],
4541 /// "type": "integer",
4542 /// "format": "int32"
4543 /// }
4544 /// }
4545 ///}
4546 /// ```
4547 /// </details>
4548 #[derive(Clone, Debug, Deserialize, Serialize)]
4549 pub struct AssetConvertTransferQueryByPageResponse {
4550 pub rows: Vec<AssetConvertTransferQueryByPageResponseRowsItem>,
4551 pub total: i32,
4552 }
4553 impl From<&AssetConvertTransferQueryByPageResponse>
4554 for AssetConvertTransferQueryByPageResponse {
4555 fn from(value: &AssetConvertTransferQueryByPageResponse) -> Self {
4556 value.clone()
4557 }
4558 }
4559 ///AssetConvertTransferQueryByPageResponseRowsItem
4560 ///
4561 /// <details><summary>JSON schema</summary>
4562 ///
4563 /// ```json
4564 ///{
4565 /// "type": "object",
4566 /// "required": [
4567 /// "accountType",
4568 /// "deductedAmount",
4569 /// "deductedAsset",
4570 /// "status",
4571 /// "targetAmount",
4572 /// "targetAsset",
4573 /// "time",
4574 /// "tranId",
4575 /// "type"
4576 /// ],
4577 /// "properties": {
4578 /// "accountType": {
4579 /// "examples": [
4580 /// "MAIN"
4581 /// ],
4582 /// "type": "string"
4583 /// },
4584 /// "deductedAmount": {
4585 /// "examples": [
4586 /// "1"
4587 /// ],
4588 /// "type": "string"
4589 /// },
4590 /// "deductedAsset": {
4591 /// "examples": [
4592 /// "BUSD"
4593 /// ],
4594 /// "type": "string"
4595 /// },
4596 /// "status": {
4597 /// "examples": [
4598 /// "S"
4599 /// ],
4600 /// "type": "string"
4601 /// },
4602 /// "targetAmount": {
4603 /// "examples": [
4604 /// "1"
4605 /// ],
4606 /// "type": "string"
4607 /// },
4608 /// "targetAsset": {
4609 /// "examples": [
4610 /// "USDC"
4611 /// ],
4612 /// "type": "string"
4613 /// },
4614 /// "time": {
4615 /// "examples": [
4616 /// 1664442078000
4617 /// ],
4618 /// "type": "integer",
4619 /// "format": "int64"
4620 /// },
4621 /// "tranId": {
4622 /// "examples": [
4623 /// 118263407119
4624 /// ],
4625 /// "type": "integer",
4626 /// "format": "int64"
4627 /// },
4628 /// "type": {
4629 /// "examples": [
4630 /// 244
4631 /// ],
4632 /// "type": "integer",
4633 /// "format": "int64"
4634 /// }
4635 /// }
4636 ///}
4637 /// ```
4638 /// </details>
4639 #[derive(Clone, Debug, Deserialize, Serialize)]
4640 pub struct AssetConvertTransferQueryByPageResponseRowsItem {
4641 #[serde(rename = "accountType")]
4642 pub account_type: String,
4643 #[serde(rename = "deductedAmount")]
4644 pub deducted_amount: String,
4645 #[serde(rename = "deductedAsset")]
4646 pub deducted_asset: String,
4647 pub status: String,
4648 #[serde(rename = "targetAmount")]
4649 pub target_amount: String,
4650 #[serde(rename = "targetAsset")]
4651 pub target_asset: String,
4652 pub time: i64,
4653 #[serde(rename = "tranId")]
4654 pub tran_id: i64,
4655 #[serde(rename = "type")]
4656 pub type_: i64,
4657 }
4658 impl From<&AssetConvertTransferQueryByPageResponseRowsItem>
4659 for AssetConvertTransferQueryByPageResponseRowsItem {
4660 fn from(value: &AssetConvertTransferQueryByPageResponseRowsItem) -> Self {
4661 value.clone()
4662 }
4663 }
4664 ///AssetConvertTransferResponse
4665 ///
4666 /// <details><summary>JSON schema</summary>
4667 ///
4668 /// ```json
4669 ///{
4670 /// "type": "object",
4671 /// "required": [
4672 /// "status",
4673 /// "tranId"
4674 /// ],
4675 /// "properties": {
4676 /// "status": {
4677 /// "examples": [
4678 /// "S"
4679 /// ],
4680 /// "type": "string"
4681 /// },
4682 /// "tranId": {
4683 /// "examples": [
4684 /// 118263407119
4685 /// ],
4686 /// "type": "integer",
4687 /// "format": "int64"
4688 /// }
4689 /// }
4690 ///}
4691 /// ```
4692 /// </details>
4693 #[derive(Clone, Debug, Deserialize, Serialize)]
4694 pub struct AssetConvertTransferResponse {
4695 pub status: String,
4696 #[serde(rename = "tranId")]
4697 pub tran_id: i64,
4698 }
4699 impl From<&AssetConvertTransferResponse> for AssetConvertTransferResponse {
4700 fn from(value: &AssetConvertTransferResponse) -> Self {
4701 value.clone()
4702 }
4703 }
4704 ///AssetCustodyTransferHistoryResponse
4705 ///
4706 /// <details><summary>JSON schema</summary>
4707 ///
4708 /// ```json
4709 ///{
4710 /// "type": "object",
4711 /// "required": [
4712 /// "rows",
4713 /// "total"
4714 /// ],
4715 /// "properties": {
4716 /// "rows": {
4717 /// "type": "array",
4718 /// "items": {
4719 /// "type": "object",
4720 /// "required": [
4721 /// "amount",
4722 /// "asset",
4723 /// "clientTranId",
4724 /// "time",
4725 /// "transferType"
4726 /// ],
4727 /// "properties": {
4728 /// "amount": {
4729 /// "examples": [
4730 /// "1"
4731 /// ],
4732 /// "type": "string"
4733 /// },
4734 /// "asset": {
4735 /// "examples": [
4736 /// "ETH"
4737 /// ],
4738 /// "type": "string"
4739 /// },
4740 /// "clientTranId": {
4741 /// "examples": [
4742 /// "293915932290879488"
4743 /// ],
4744 /// "type": "string"
4745 /// },
4746 /// "time": {
4747 /// "examples": [
4748 /// 1695205406000
4749 /// ],
4750 /// "type": "integer",
4751 /// "format": "int64"
4752 /// },
4753 /// "transferType": {
4754 /// "examples": [
4755 /// "Undelegate"
4756 /// ],
4757 /// "type": "string"
4758 /// }
4759 /// }
4760 /// }
4761 /// },
4762 /// "total": {
4763 /// "examples": [
4764 /// 3316
4765 /// ],
4766 /// "type": "integer"
4767 /// }
4768 /// }
4769 ///}
4770 /// ```
4771 /// </details>
4772 #[derive(Clone, Debug, Deserialize, Serialize)]
4773 pub struct AssetCustodyTransferHistoryResponse {
4774 pub rows: Vec<AssetCustodyTransferHistoryResponseRowsItem>,
4775 pub total: i64,
4776 }
4777 impl From<&AssetCustodyTransferHistoryResponse>
4778 for AssetCustodyTransferHistoryResponse {
4779 fn from(value: &AssetCustodyTransferHistoryResponse) -> Self {
4780 value.clone()
4781 }
4782 }
4783 ///AssetCustodyTransferHistoryResponseRowsItem
4784 ///
4785 /// <details><summary>JSON schema</summary>
4786 ///
4787 /// ```json
4788 ///{
4789 /// "type": "object",
4790 /// "required": [
4791 /// "amount",
4792 /// "asset",
4793 /// "clientTranId",
4794 /// "time",
4795 /// "transferType"
4796 /// ],
4797 /// "properties": {
4798 /// "amount": {
4799 /// "examples": [
4800 /// "1"
4801 /// ],
4802 /// "type": "string"
4803 /// },
4804 /// "asset": {
4805 /// "examples": [
4806 /// "ETH"
4807 /// ],
4808 /// "type": "string"
4809 /// },
4810 /// "clientTranId": {
4811 /// "examples": [
4812 /// "293915932290879488"
4813 /// ],
4814 /// "type": "string"
4815 /// },
4816 /// "time": {
4817 /// "examples": [
4818 /// 1695205406000
4819 /// ],
4820 /// "type": "integer",
4821 /// "format": "int64"
4822 /// },
4823 /// "transferType": {
4824 /// "examples": [
4825 /// "Undelegate"
4826 /// ],
4827 /// "type": "string"
4828 /// }
4829 /// }
4830 ///}
4831 /// ```
4832 /// </details>
4833 #[derive(Clone, Debug, Deserialize, Serialize)]
4834 pub struct AssetCustodyTransferHistoryResponseRowsItem {
4835 pub amount: String,
4836 pub asset: String,
4837 #[serde(rename = "clientTranId")]
4838 pub client_tran_id: String,
4839 pub time: i64,
4840 #[serde(rename = "transferType")]
4841 pub transfer_type: String,
4842 }
4843 impl From<&AssetCustodyTransferHistoryResponseRowsItem>
4844 for AssetCustodyTransferHistoryResponseRowsItem {
4845 fn from(value: &AssetCustodyTransferHistoryResponseRowsItem) -> Self {
4846 value.clone()
4847 }
4848 }
4849 ///AssetDribbletResponse
4850 ///
4851 /// <details><summary>JSON schema</summary>
4852 ///
4853 /// ```json
4854 ///{
4855 /// "type": "object",
4856 /// "required": [
4857 /// "total",
4858 /// "userAssetDribblets"
4859 /// ],
4860 /// "properties": {
4861 /// "total": {
4862 /// "description": "Total counts of exchange",
4863 /// "examples": [
4864 /// 8
4865 /// ],
4866 /// "type": "integer",
4867 /// "format": "int64"
4868 /// },
4869 /// "userAssetDribblets": {
4870 /// "type": "array",
4871 /// "items": {
4872 /// "type": "object",
4873 /// "required": [
4874 /// "operateTime",
4875 /// "totalServiceChargeAmount",
4876 /// "totalTransferedAmount",
4877 /// "transId",
4878 /// "userAssetDribbletDetails"
4879 /// ],
4880 /// "properties": {
4881 /// "operateTime": {
4882 /// "examples": [
4883 /// 1615985535000
4884 /// ],
4885 /// "type": "integer",
4886 /// "format": "int64"
4887 /// },
4888 /// "totalServiceChargeAmount": {
4889 /// "description": "Total service charge amount for this exchange.",
4890 /// "examples": [
4891 /// "0.00002699"
4892 /// ],
4893 /// "type": "string"
4894 /// },
4895 /// "totalTransferedAmount": {
4896 /// "description": "Total transfered BNB amount for this exchange.",
4897 /// "examples": [
4898 /// "0.00132256"
4899 /// ],
4900 /// "type": "string"
4901 /// },
4902 /// "transId": {
4903 /// "examples": [
4904 /// 45178372831
4905 /// ],
4906 /// "type": "integer",
4907 /// "format": "int64"
4908 /// },
4909 /// "userAssetDribbletDetails": {
4910 /// "type": "array",
4911 /// "items": {
4912 /// "type": "object",
4913 /// "required": [
4914 /// "amount",
4915 /// "fromAsset",
4916 /// "operateTime",
4917 /// "serviceChargeAmount",
4918 /// "transId",
4919 /// "transferedAmount"
4920 /// ],
4921 /// "properties": {
4922 /// "amount": {
4923 /// "examples": [
4924 /// "0.0009"
4925 /// ],
4926 /// "type": "string"
4927 /// },
4928 /// "fromAsset": {
4929 /// "examples": [
4930 /// "USDT"
4931 /// ],
4932 /// "type": "string"
4933 /// },
4934 /// "operateTime": {
4935 /// "examples": [
4936 /// 1615985535000
4937 /// ],
4938 /// "type": "integer",
4939 /// "format": "int64"
4940 /// },
4941 /// "serviceChargeAmount": {
4942 /// "examples": [
4943 /// "0.000009"
4944 /// ],
4945 /// "type": "string"
4946 /// },
4947 /// "transId": {
4948 /// "examples": [
4949 /// 4359321
4950 /// ],
4951 /// "type": "integer",
4952 /// "format": "int64"
4953 /// },
4954 /// "transferedAmount": {
4955 /// "examples": [
4956 /// "0.000441"
4957 /// ],
4958 /// "type": "string"
4959 /// }
4960 /// }
4961 /// }
4962 /// }
4963 /// }
4964 /// }
4965 /// }
4966 /// }
4967 ///}
4968 /// ```
4969 /// </details>
4970 #[derive(Clone, Debug, Deserialize, Serialize)]
4971 pub struct AssetDribbletResponse {
4972 ///Total counts of exchange
4973 pub total: i64,
4974 #[serde(rename = "userAssetDribblets")]
4975 pub user_asset_dribblets: Vec<AssetDribbletResponseUserAssetDribbletsItem>,
4976 }
4977 impl From<&AssetDribbletResponse> for AssetDribbletResponse {
4978 fn from(value: &AssetDribbletResponse) -> Self {
4979 value.clone()
4980 }
4981 }
4982 ///AssetDribbletResponseUserAssetDribbletsItem
4983 ///
4984 /// <details><summary>JSON schema</summary>
4985 ///
4986 /// ```json
4987 ///{
4988 /// "type": "object",
4989 /// "required": [
4990 /// "operateTime",
4991 /// "totalServiceChargeAmount",
4992 /// "totalTransferedAmount",
4993 /// "transId",
4994 /// "userAssetDribbletDetails"
4995 /// ],
4996 /// "properties": {
4997 /// "operateTime": {
4998 /// "examples": [
4999 /// 1615985535000
5000 /// ],
5001 /// "type": "integer",
5002 /// "format": "int64"
5003 /// },
5004 /// "totalServiceChargeAmount": {
5005 /// "description": "Total service charge amount for this exchange.",
5006 /// "examples": [
5007 /// "0.00002699"
5008 /// ],
5009 /// "type": "string"
5010 /// },
5011 /// "totalTransferedAmount": {
5012 /// "description": "Total transfered BNB amount for this exchange.",
5013 /// "examples": [
5014 /// "0.00132256"
5015 /// ],
5016 /// "type": "string"
5017 /// },
5018 /// "transId": {
5019 /// "examples": [
5020 /// 45178372831
5021 /// ],
5022 /// "type": "integer",
5023 /// "format": "int64"
5024 /// },
5025 /// "userAssetDribbletDetails": {
5026 /// "type": "array",
5027 /// "items": {
5028 /// "type": "object",
5029 /// "required": [
5030 /// "amount",
5031 /// "fromAsset",
5032 /// "operateTime",
5033 /// "serviceChargeAmount",
5034 /// "transId",
5035 /// "transferedAmount"
5036 /// ],
5037 /// "properties": {
5038 /// "amount": {
5039 /// "examples": [
5040 /// "0.0009"
5041 /// ],
5042 /// "type": "string"
5043 /// },
5044 /// "fromAsset": {
5045 /// "examples": [
5046 /// "USDT"
5047 /// ],
5048 /// "type": "string"
5049 /// },
5050 /// "operateTime": {
5051 /// "examples": [
5052 /// 1615985535000
5053 /// ],
5054 /// "type": "integer",
5055 /// "format": "int64"
5056 /// },
5057 /// "serviceChargeAmount": {
5058 /// "examples": [
5059 /// "0.000009"
5060 /// ],
5061 /// "type": "string"
5062 /// },
5063 /// "transId": {
5064 /// "examples": [
5065 /// 4359321
5066 /// ],
5067 /// "type": "integer",
5068 /// "format": "int64"
5069 /// },
5070 /// "transferedAmount": {
5071 /// "examples": [
5072 /// "0.000441"
5073 /// ],
5074 /// "type": "string"
5075 /// }
5076 /// }
5077 /// }
5078 /// }
5079 /// }
5080 ///}
5081 /// ```
5082 /// </details>
5083 #[derive(Clone, Debug, Deserialize, Serialize)]
5084 pub struct AssetDribbletResponseUserAssetDribbletsItem {
5085 #[serde(rename = "operateTime")]
5086 pub operate_time: i64,
5087 ///Total service charge amount for this exchange.
5088 #[serde(rename = "totalServiceChargeAmount")]
5089 pub total_service_charge_amount: String,
5090 ///Total transfered BNB amount for this exchange.
5091 #[serde(rename = "totalTransferedAmount")]
5092 pub total_transfered_amount: String,
5093 #[serde(rename = "transId")]
5094 pub trans_id: i64,
5095 #[serde(rename = "userAssetDribbletDetails")]
5096 pub user_asset_dribblet_details: Vec<
5097 AssetDribbletResponseUserAssetDribbletsItemUserAssetDribbletDetailsItem,
5098 >,
5099 }
5100 impl From<&AssetDribbletResponseUserAssetDribbletsItem>
5101 for AssetDribbletResponseUserAssetDribbletsItem {
5102 fn from(value: &AssetDribbletResponseUserAssetDribbletsItem) -> Self {
5103 value.clone()
5104 }
5105 }
5106 ///AssetDribbletResponseUserAssetDribbletsItemUserAssetDribbletDetailsItem
5107 ///
5108 /// <details><summary>JSON schema</summary>
5109 ///
5110 /// ```json
5111 ///{
5112 /// "type": "object",
5113 /// "required": [
5114 /// "amount",
5115 /// "fromAsset",
5116 /// "operateTime",
5117 /// "serviceChargeAmount",
5118 /// "transId",
5119 /// "transferedAmount"
5120 /// ],
5121 /// "properties": {
5122 /// "amount": {
5123 /// "examples": [
5124 /// "0.0009"
5125 /// ],
5126 /// "type": "string"
5127 /// },
5128 /// "fromAsset": {
5129 /// "examples": [
5130 /// "USDT"
5131 /// ],
5132 /// "type": "string"
5133 /// },
5134 /// "operateTime": {
5135 /// "examples": [
5136 /// 1615985535000
5137 /// ],
5138 /// "type": "integer",
5139 /// "format": "int64"
5140 /// },
5141 /// "serviceChargeAmount": {
5142 /// "examples": [
5143 /// "0.000009"
5144 /// ],
5145 /// "type": "string"
5146 /// },
5147 /// "transId": {
5148 /// "examples": [
5149 /// 4359321
5150 /// ],
5151 /// "type": "integer",
5152 /// "format": "int64"
5153 /// },
5154 /// "transferedAmount": {
5155 /// "examples": [
5156 /// "0.000441"
5157 /// ],
5158 /// "type": "string"
5159 /// }
5160 /// }
5161 ///}
5162 /// ```
5163 /// </details>
5164 #[derive(Clone, Debug, Deserialize, Serialize)]
5165 pub struct AssetDribbletResponseUserAssetDribbletsItemUserAssetDribbletDetailsItem {
5166 pub amount: String,
5167 #[serde(rename = "fromAsset")]
5168 pub from_asset: String,
5169 #[serde(rename = "operateTime")]
5170 pub operate_time: i64,
5171 #[serde(rename = "serviceChargeAmount")]
5172 pub service_charge_amount: String,
5173 #[serde(rename = "transId")]
5174 pub trans_id: i64,
5175 #[serde(rename = "transferedAmount")]
5176 pub transfered_amount: String,
5177 }
5178 impl From<&AssetDribbletResponseUserAssetDribbletsItemUserAssetDribbletDetailsItem>
5179 for AssetDribbletResponseUserAssetDribbletsItemUserAssetDribbletDetailsItem {
5180 fn from(
5181 value: &AssetDribbletResponseUserAssetDribbletsItemUserAssetDribbletDetailsItem,
5182 ) -> Self {
5183 value.clone()
5184 }
5185 }
5186 ///AssetDustBtcResponse
5187 ///
5188 /// <details><summary>JSON schema</summary>
5189 ///
5190 /// ```json
5191 ///{
5192 /// "type": "object",
5193 /// "required": [
5194 /// "details",
5195 /// "dribbletPercentage",
5196 /// "totalTransferBNB",
5197 /// "totalTransferBtc"
5198 /// ],
5199 /// "properties": {
5200 /// "details": {
5201 /// "type": "array",
5202 /// "items": {
5203 /// "type": "object",
5204 /// "required": [
5205 /// "amountFree",
5206 /// "asset",
5207 /// "assetFullName",
5208 /// "exchange",
5209 /// "toBNB",
5210 /// "toBNBOffExchange",
5211 /// "toBTC"
5212 /// ],
5213 /// "properties": {
5214 /// "amountFree": {
5215 /// "description": "Convertible amount",
5216 /// "examples": [
5217 /// "6.21"
5218 /// ],
5219 /// "type": "string"
5220 /// },
5221 /// "asset": {
5222 /// "examples": [
5223 /// "ADA"
5224 /// ],
5225 /// "type": "string"
5226 /// },
5227 /// "assetFullName": {
5228 /// "examples": [
5229 /// "ADA"
5230 /// ],
5231 /// "type": "string"
5232 /// },
5233 /// "exchange": {
5234 /// "description": "Commission fee",
5235 /// "examples": [
5236 /// "0.00035546"
5237 /// ],
5238 /// "type": "string"
5239 /// },
5240 /// "toBNB": {
5241 /// "description": "BNB amount(Not deducted commission fee",
5242 /// "examples": [
5243 /// "0.01777302"
5244 /// ],
5245 /// "type": "string"
5246 /// },
5247 /// "toBNBOffExchange": {
5248 /// "description": "BNB amount(Deducted commission fee",
5249 /// "examples": [
5250 /// "0.01741756"
5251 /// ],
5252 /// "type": "string"
5253 /// },
5254 /// "toBTC": {
5255 /// "description": "BTC amount",
5256 /// "examples": [
5257 /// "0.00016848"
5258 /// ],
5259 /// "type": "string"
5260 /// }
5261 /// }
5262 /// }
5263 /// },
5264 /// "dribbletPercentage": {
5265 /// "description": "Commission fee",
5266 /// "examples": [
5267 /// "0.02"
5268 /// ],
5269 /// "type": "string"
5270 /// },
5271 /// "totalTransferBNB": {
5272 /// "examples": [
5273 /// "0.01777302"
5274 /// ],
5275 /// "type": "string"
5276 /// },
5277 /// "totalTransferBtc": {
5278 /// "examples": [
5279 /// "0.00016848"
5280 /// ],
5281 /// "type": "string"
5282 /// }
5283 /// }
5284 ///}
5285 /// ```
5286 /// </details>
5287 #[derive(Clone, Debug, Deserialize, Serialize)]
5288 pub struct AssetDustBtcResponse {
5289 pub details: Vec<AssetDustBtcResponseDetailsItem>,
5290 ///Commission fee
5291 #[serde(rename = "dribbletPercentage")]
5292 pub dribblet_percentage: String,
5293 #[serde(rename = "totalTransferBNB")]
5294 pub total_transfer_bnb: String,
5295 #[serde(rename = "totalTransferBtc")]
5296 pub total_transfer_btc: String,
5297 }
5298 impl From<&AssetDustBtcResponse> for AssetDustBtcResponse {
5299 fn from(value: &AssetDustBtcResponse) -> Self {
5300 value.clone()
5301 }
5302 }
5303 ///AssetDustBtcResponseDetailsItem
5304 ///
5305 /// <details><summary>JSON schema</summary>
5306 ///
5307 /// ```json
5308 ///{
5309 /// "type": "object",
5310 /// "required": [
5311 /// "amountFree",
5312 /// "asset",
5313 /// "assetFullName",
5314 /// "exchange",
5315 /// "toBNB",
5316 /// "toBNBOffExchange",
5317 /// "toBTC"
5318 /// ],
5319 /// "properties": {
5320 /// "amountFree": {
5321 /// "description": "Convertible amount",
5322 /// "examples": [
5323 /// "6.21"
5324 /// ],
5325 /// "type": "string"
5326 /// },
5327 /// "asset": {
5328 /// "examples": [
5329 /// "ADA"
5330 /// ],
5331 /// "type": "string"
5332 /// },
5333 /// "assetFullName": {
5334 /// "examples": [
5335 /// "ADA"
5336 /// ],
5337 /// "type": "string"
5338 /// },
5339 /// "exchange": {
5340 /// "description": "Commission fee",
5341 /// "examples": [
5342 /// "0.00035546"
5343 /// ],
5344 /// "type": "string"
5345 /// },
5346 /// "toBNB": {
5347 /// "description": "BNB amount(Not deducted commission fee",
5348 /// "examples": [
5349 /// "0.01777302"
5350 /// ],
5351 /// "type": "string"
5352 /// },
5353 /// "toBNBOffExchange": {
5354 /// "description": "BNB amount(Deducted commission fee",
5355 /// "examples": [
5356 /// "0.01741756"
5357 /// ],
5358 /// "type": "string"
5359 /// },
5360 /// "toBTC": {
5361 /// "description": "BTC amount",
5362 /// "examples": [
5363 /// "0.00016848"
5364 /// ],
5365 /// "type": "string"
5366 /// }
5367 /// }
5368 ///}
5369 /// ```
5370 /// </details>
5371 #[derive(Clone, Debug, Deserialize, Serialize)]
5372 pub struct AssetDustBtcResponseDetailsItem {
5373 ///Convertible amount
5374 #[serde(rename = "amountFree")]
5375 pub amount_free: String,
5376 pub asset: String,
5377 #[serde(rename = "assetFullName")]
5378 pub asset_full_name: String,
5379 ///Commission fee
5380 pub exchange: String,
5381 ///BNB amount(Not deducted commission fee
5382 #[serde(rename = "toBNB")]
5383 pub to_bnb: String,
5384 ///BNB amount(Deducted commission fee
5385 #[serde(rename = "toBNBOffExchange")]
5386 pub to_bnb_off_exchange: String,
5387 ///BTC amount
5388 #[serde(rename = "toBTC")]
5389 pub to_btc: String,
5390 }
5391 impl From<&AssetDustBtcResponseDetailsItem> for AssetDustBtcResponseDetailsItem {
5392 fn from(value: &AssetDustBtcResponseDetailsItem) -> Self {
5393 value.clone()
5394 }
5395 }
5396 ///AssetGetFundingAssetNeedBtcValuation
5397 ///
5398 /// <details><summary>JSON schema</summary>
5399 ///
5400 /// ```json
5401 ///{
5402 /// "type": "string",
5403 /// "enum": [
5404 /// "true",
5405 /// "false"
5406 /// ]
5407 ///}
5408 /// ```
5409 /// </details>
5410 #[derive(
5411 Clone,
5412 Copy,
5413 Debug,
5414 Deserialize,
5415 Eq,
5416 Hash,
5417 Ord,
5418 PartialEq,
5419 PartialOrd,
5420 Serialize
5421 )]
5422 pub enum AssetGetFundingAssetNeedBtcValuation {
5423 #[serde(rename = "true")]
5424 True,
5425 #[serde(rename = "false")]
5426 False,
5427 }
5428 impl From<&AssetGetFundingAssetNeedBtcValuation>
5429 for AssetGetFundingAssetNeedBtcValuation {
5430 fn from(value: &AssetGetFundingAssetNeedBtcValuation) -> Self {
5431 value.clone()
5432 }
5433 }
5434 impl ToString for AssetGetFundingAssetNeedBtcValuation {
5435 fn to_string(&self) -> String {
5436 match *self {
5437 Self::True => "true".to_string(),
5438 Self::False => "false".to_string(),
5439 }
5440 }
5441 }
5442 impl std::str::FromStr for AssetGetFundingAssetNeedBtcValuation {
5443 type Err = self::error::ConversionError;
5444 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
5445 match value {
5446 "true" => Ok(Self::True),
5447 "false" => Ok(Self::False),
5448 _ => Err("invalid value".into()),
5449 }
5450 }
5451 }
5452 impl std::convert::TryFrom<&str> for AssetGetFundingAssetNeedBtcValuation {
5453 type Error = self::error::ConversionError;
5454 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
5455 value.parse()
5456 }
5457 }
5458 impl std::convert::TryFrom<&String> for AssetGetFundingAssetNeedBtcValuation {
5459 type Error = self::error::ConversionError;
5460 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
5461 value.parse()
5462 }
5463 }
5464 impl std::convert::TryFrom<String> for AssetGetFundingAssetNeedBtcValuation {
5465 type Error = self::error::ConversionError;
5466 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
5467 value.parse()
5468 }
5469 }
5470 ///AssetGetFundingAssetResponseItem
5471 ///
5472 /// <details><summary>JSON schema</summary>
5473 ///
5474 /// ```json
5475 ///{
5476 /// "type": "object",
5477 /// "required": [
5478 /// "asset",
5479 /// "btcValuation",
5480 /// "free",
5481 /// "freeze",
5482 /// "locked",
5483 /// "withdrawing"
5484 /// ],
5485 /// "properties": {
5486 /// "asset": {
5487 /// "examples": [
5488 /// "USDT"
5489 /// ],
5490 /// "type": "string"
5491 /// },
5492 /// "btcValuation": {
5493 /// "examples": [
5494 /// "0.00000091"
5495 /// ],
5496 /// "type": "string"
5497 /// },
5498 /// "free": {
5499 /// "examples": [
5500 /// "1"
5501 /// ],
5502 /// "type": "string"
5503 /// },
5504 /// "freeze": {
5505 /// "examples": [
5506 /// "0"
5507 /// ],
5508 /// "type": "string"
5509 /// },
5510 /// "locked": {
5511 /// "examples": [
5512 /// "0"
5513 /// ],
5514 /// "type": "string"
5515 /// },
5516 /// "withdrawing": {
5517 /// "examples": [
5518 /// "0"
5519 /// ],
5520 /// "type": "string"
5521 /// }
5522 /// }
5523 ///}
5524 /// ```
5525 /// </details>
5526 #[derive(Clone, Debug, Deserialize, Serialize)]
5527 pub struct AssetGetFundingAssetResponseItem {
5528 pub asset: String,
5529 #[serde(rename = "btcValuation")]
5530 pub btc_valuation: String,
5531 pub free: String,
5532 pub freeze: String,
5533 pub locked: String,
5534 pub withdrawing: String,
5535 }
5536 impl From<&AssetGetFundingAssetResponseItem> for AssetGetFundingAssetResponseItem {
5537 fn from(value: &AssetGetFundingAssetResponseItem) -> Self {
5538 value.clone()
5539 }
5540 }
5541 ///AssetGetUserAssetNeedBtcValuation
5542 ///
5543 /// <details><summary>JSON schema</summary>
5544 ///
5545 /// ```json
5546 ///{
5547 /// "type": "string",
5548 /// "enum": [
5549 /// "true",
5550 /// "false"
5551 /// ]
5552 ///}
5553 /// ```
5554 /// </details>
5555 #[derive(
5556 Clone,
5557 Copy,
5558 Debug,
5559 Deserialize,
5560 Eq,
5561 Hash,
5562 Ord,
5563 PartialEq,
5564 PartialOrd,
5565 Serialize
5566 )]
5567 pub enum AssetGetUserAssetNeedBtcValuation {
5568 #[serde(rename = "true")]
5569 True,
5570 #[serde(rename = "false")]
5571 False,
5572 }
5573 impl From<&AssetGetUserAssetNeedBtcValuation> for AssetGetUserAssetNeedBtcValuation {
5574 fn from(value: &AssetGetUserAssetNeedBtcValuation) -> Self {
5575 value.clone()
5576 }
5577 }
5578 impl ToString for AssetGetUserAssetNeedBtcValuation {
5579 fn to_string(&self) -> String {
5580 match *self {
5581 Self::True => "true".to_string(),
5582 Self::False => "false".to_string(),
5583 }
5584 }
5585 }
5586 impl std::str::FromStr for AssetGetUserAssetNeedBtcValuation {
5587 type Err = self::error::ConversionError;
5588 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
5589 match value {
5590 "true" => Ok(Self::True),
5591 "false" => Ok(Self::False),
5592 _ => Err("invalid value".into()),
5593 }
5594 }
5595 }
5596 impl std::convert::TryFrom<&str> for AssetGetUserAssetNeedBtcValuation {
5597 type Error = self::error::ConversionError;
5598 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
5599 value.parse()
5600 }
5601 }
5602 impl std::convert::TryFrom<&String> for AssetGetUserAssetNeedBtcValuation {
5603 type Error = self::error::ConversionError;
5604 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
5605 value.parse()
5606 }
5607 }
5608 impl std::convert::TryFrom<String> for AssetGetUserAssetNeedBtcValuation {
5609 type Error = self::error::ConversionError;
5610 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
5611 value.parse()
5612 }
5613 }
5614 ///AssetGetUserAssetResponseItem
5615 ///
5616 /// <details><summary>JSON schema</summary>
5617 ///
5618 /// ```json
5619 ///{
5620 /// "type": "object",
5621 /// "required": [
5622 /// "asset",
5623 /// "btcValuation",
5624 /// "free",
5625 /// "freeze",
5626 /// "ipoable",
5627 /// "locked",
5628 /// "withdrawing"
5629 /// ],
5630 /// "properties": {
5631 /// "asset": {
5632 /// "examples": [
5633 /// "AVAX"
5634 /// ],
5635 /// "type": "string"
5636 /// },
5637 /// "btcValuation": {
5638 /// "examples": [
5639 /// "0"
5640 /// ],
5641 /// "type": "string"
5642 /// },
5643 /// "free": {
5644 /// "examples": [
5645 /// "1"
5646 /// ],
5647 /// "type": "string"
5648 /// },
5649 /// "freeze": {
5650 /// "examples": [
5651 /// "0"
5652 /// ],
5653 /// "type": "string"
5654 /// },
5655 /// "ipoable": {
5656 /// "examples": [
5657 /// "0"
5658 /// ],
5659 /// "type": "string"
5660 /// },
5661 /// "locked": {
5662 /// "examples": [
5663 /// "0"
5664 /// ],
5665 /// "type": "string"
5666 /// },
5667 /// "withdrawing": {
5668 /// "examples": [
5669 /// "0"
5670 /// ],
5671 /// "type": "string"
5672 /// }
5673 /// }
5674 ///}
5675 /// ```
5676 /// </details>
5677 #[derive(Clone, Debug, Deserialize, Serialize)]
5678 pub struct AssetGetUserAssetResponseItem {
5679 pub asset: String,
5680 #[serde(rename = "btcValuation")]
5681 pub btc_valuation: String,
5682 pub free: String,
5683 pub freeze: String,
5684 pub ipoable: String,
5685 pub locked: String,
5686 pub withdrawing: String,
5687 }
5688 impl From<&AssetGetUserAssetResponseItem> for AssetGetUserAssetResponseItem {
5689 fn from(value: &AssetGetUserAssetResponseItem) -> Self {
5690 value.clone()
5691 }
5692 }
5693 ///AssetLedgerTransferCloudMiningQueryByPageResponse
5694 ///
5695 /// <details><summary>JSON schema</summary>
5696 ///
5697 /// ```json
5698 ///{
5699 /// "type": "object",
5700 /// "required": [
5701 /// "rows",
5702 /// "total"
5703 /// ],
5704 /// "properties": {
5705 /// "rows": {
5706 /// "type": "array",
5707 /// "items": {
5708 /// "type": "object",
5709 /// "required": [
5710 /// "amount",
5711 /// "asset",
5712 /// "createTime",
5713 /// "status",
5714 /// "tranId",
5715 /// "type"
5716 /// ],
5717 /// "properties": {
5718 /// "amount": {
5719 /// "examples": [
5720 /// "1"
5721 /// ],
5722 /// "type": "string"
5723 /// },
5724 /// "asset": {
5725 /// "examples": [
5726 /// "USDT"
5727 /// ],
5728 /// "type": "string"
5729 /// },
5730 /// "createTime": {
5731 /// "examples": [
5732 /// 1667880112000
5733 /// ],
5734 /// "type": "integer",
5735 /// "format": "int64"
5736 /// },
5737 /// "status": {
5738 /// "examples": [
5739 /// "S"
5740 /// ],
5741 /// "type": "string"
5742 /// },
5743 /// "tranId": {
5744 /// "examples": [
5745 /// 121230610120
5746 /// ],
5747 /// "type": "integer",
5748 /// "format": "int64"
5749 /// },
5750 /// "type": {
5751 /// "examples": [
5752 /// 248
5753 /// ],
5754 /// "type": "integer",
5755 /// "format": "int64"
5756 /// }
5757 /// }
5758 /// }
5759 /// },
5760 /// "total": {
5761 /// "examples": [
5762 /// 1
5763 /// ],
5764 /// "type": "integer",
5765 /// "format": "int32"
5766 /// }
5767 /// }
5768 ///}
5769 /// ```
5770 /// </details>
5771 #[derive(Clone, Debug, Deserialize, Serialize)]
5772 pub struct AssetLedgerTransferCloudMiningQueryByPageResponse {
5773 pub rows: Vec<AssetLedgerTransferCloudMiningQueryByPageResponseRowsItem>,
5774 pub total: i32,
5775 }
5776 impl From<&AssetLedgerTransferCloudMiningQueryByPageResponse>
5777 for AssetLedgerTransferCloudMiningQueryByPageResponse {
5778 fn from(value: &AssetLedgerTransferCloudMiningQueryByPageResponse) -> Self {
5779 value.clone()
5780 }
5781 }
5782 ///AssetLedgerTransferCloudMiningQueryByPageResponseRowsItem
5783 ///
5784 /// <details><summary>JSON schema</summary>
5785 ///
5786 /// ```json
5787 ///{
5788 /// "type": "object",
5789 /// "required": [
5790 /// "amount",
5791 /// "asset",
5792 /// "createTime",
5793 /// "status",
5794 /// "tranId",
5795 /// "type"
5796 /// ],
5797 /// "properties": {
5798 /// "amount": {
5799 /// "examples": [
5800 /// "1"
5801 /// ],
5802 /// "type": "string"
5803 /// },
5804 /// "asset": {
5805 /// "examples": [
5806 /// "USDT"
5807 /// ],
5808 /// "type": "string"
5809 /// },
5810 /// "createTime": {
5811 /// "examples": [
5812 /// 1667880112000
5813 /// ],
5814 /// "type": "integer",
5815 /// "format": "int64"
5816 /// },
5817 /// "status": {
5818 /// "examples": [
5819 /// "S"
5820 /// ],
5821 /// "type": "string"
5822 /// },
5823 /// "tranId": {
5824 /// "examples": [
5825 /// 121230610120
5826 /// ],
5827 /// "type": "integer",
5828 /// "format": "int64"
5829 /// },
5830 /// "type": {
5831 /// "examples": [
5832 /// 248
5833 /// ],
5834 /// "type": "integer",
5835 /// "format": "int64"
5836 /// }
5837 /// }
5838 ///}
5839 /// ```
5840 /// </details>
5841 #[derive(Clone, Debug, Deserialize, Serialize)]
5842 pub struct AssetLedgerTransferCloudMiningQueryByPageResponseRowsItem {
5843 pub amount: String,
5844 pub asset: String,
5845 #[serde(rename = "createTime")]
5846 pub create_time: i64,
5847 pub status: String,
5848 #[serde(rename = "tranId")]
5849 pub tran_id: i64,
5850 #[serde(rename = "type")]
5851 pub type_: i64,
5852 }
5853 impl From<&AssetLedgerTransferCloudMiningQueryByPageResponseRowsItem>
5854 for AssetLedgerTransferCloudMiningQueryByPageResponseRowsItem {
5855 fn from(
5856 value: &AssetLedgerTransferCloudMiningQueryByPageResponseRowsItem,
5857 ) -> Self {
5858 value.clone()
5859 }
5860 }
5861 ///AssetTradeFeeResponseItem
5862 ///
5863 /// <details><summary>JSON schema</summary>
5864 ///
5865 /// ```json
5866 ///{
5867 /// "type": "object",
5868 /// "required": [
5869 /// "makerCommission",
5870 /// "symbol",
5871 /// "takerCommission"
5872 /// ],
5873 /// "properties": {
5874 /// "makerCommission": {
5875 /// "examples": [
5876 /// "0.001"
5877 /// ],
5878 /// "type": "string"
5879 /// },
5880 /// "symbol": {
5881 /// "examples": [
5882 /// "ADABNB"
5883 /// ],
5884 /// "type": "string"
5885 /// },
5886 /// "takerCommission": {
5887 /// "examples": [
5888 /// "0.001"
5889 /// ],
5890 /// "type": "string"
5891 /// }
5892 /// }
5893 ///}
5894 /// ```
5895 /// </details>
5896 #[derive(Clone, Debug, Deserialize, Serialize)]
5897 pub struct AssetTradeFeeResponseItem {
5898 #[serde(rename = "makerCommission")]
5899 pub maker_commission: String,
5900 pub symbol: String,
5901 #[serde(rename = "takerCommission")]
5902 pub taker_commission: String,
5903 }
5904 impl From<&AssetTradeFeeResponseItem> for AssetTradeFeeResponseItem {
5905 fn from(value: &AssetTradeFeeResponseItem) -> Self {
5906 value.clone()
5907 }
5908 }
5909 ///AssetTransferResponse
5910 ///
5911 /// <details><summary>JSON schema</summary>
5912 ///
5913 /// ```json
5914 ///{
5915 /// "type": "object",
5916 /// "required": [
5917 /// "rows",
5918 /// "total"
5919 /// ],
5920 /// "properties": {
5921 /// "rows": {
5922 /// "type": "array",
5923 /// "items": {
5924 /// "type": "object",
5925 /// "required": [
5926 /// "amount",
5927 /// "asset",
5928 /// "status",
5929 /// "timestamp",
5930 /// "tranId",
5931 /// "type"
5932 /// ],
5933 /// "properties": {
5934 /// "amount": {
5935 /// "examples": [
5936 /// "1"
5937 /// ],
5938 /// "type": "string"
5939 /// },
5940 /// "asset": {
5941 /// "examples": [
5942 /// "USDT"
5943 /// ],
5944 /// "type": "string"
5945 /// },
5946 /// "status": {
5947 /// "examples": [
5948 /// "CONFIRMED"
5949 /// ],
5950 /// "type": "string"
5951 /// },
5952 /// "timestamp": {
5953 /// "examples": [
5954 /// 1544433328000
5955 /// ],
5956 /// "type": "integer",
5957 /// "format": "int64"
5958 /// },
5959 /// "tranId": {
5960 /// "examples": [
5961 /// 11415955596
5962 /// ],
5963 /// "type": "integer",
5964 /// "format": "int64"
5965 /// },
5966 /// "type": {
5967 /// "examples": [
5968 /// "MAIN_UMFUTUR"
5969 /// ],
5970 /// "type": "string"
5971 /// }
5972 /// }
5973 /// }
5974 /// },
5975 /// "total": {
5976 /// "examples": [
5977 /// 1
5978 /// ],
5979 /// "type": "integer",
5980 /// "format": "int32"
5981 /// }
5982 /// }
5983 ///}
5984 /// ```
5985 /// </details>
5986 #[derive(Clone, Debug, Deserialize, Serialize)]
5987 pub struct AssetTransferResponse {
5988 pub rows: Vec<AssetTransferResponseRowsItem>,
5989 pub total: i32,
5990 }
5991 impl From<&AssetTransferResponse> for AssetTransferResponse {
5992 fn from(value: &AssetTransferResponse) -> Self {
5993 value.clone()
5994 }
5995 }
5996 ///AssetTransferResponseRowsItem
5997 ///
5998 /// <details><summary>JSON schema</summary>
5999 ///
6000 /// ```json
6001 ///{
6002 /// "type": "object",
6003 /// "required": [
6004 /// "amount",
6005 /// "asset",
6006 /// "status",
6007 /// "timestamp",
6008 /// "tranId",
6009 /// "type"
6010 /// ],
6011 /// "properties": {
6012 /// "amount": {
6013 /// "examples": [
6014 /// "1"
6015 /// ],
6016 /// "type": "string"
6017 /// },
6018 /// "asset": {
6019 /// "examples": [
6020 /// "USDT"
6021 /// ],
6022 /// "type": "string"
6023 /// },
6024 /// "status": {
6025 /// "examples": [
6026 /// "CONFIRMED"
6027 /// ],
6028 /// "type": "string"
6029 /// },
6030 /// "timestamp": {
6031 /// "examples": [
6032 /// 1544433328000
6033 /// ],
6034 /// "type": "integer",
6035 /// "format": "int64"
6036 /// },
6037 /// "tranId": {
6038 /// "examples": [
6039 /// 11415955596
6040 /// ],
6041 /// "type": "integer",
6042 /// "format": "int64"
6043 /// },
6044 /// "type": {
6045 /// "examples": [
6046 /// "MAIN_UMFUTUR"
6047 /// ],
6048 /// "type": "string"
6049 /// }
6050 /// }
6051 ///}
6052 /// ```
6053 /// </details>
6054 #[derive(Clone, Debug, Deserialize, Serialize)]
6055 pub struct AssetTransferResponseRowsItem {
6056 pub amount: String,
6057 pub asset: String,
6058 pub status: String,
6059 pub timestamp: i64,
6060 #[serde(rename = "tranId")]
6061 pub tran_id: i64,
6062 #[serde(rename = "type")]
6063 pub type_: String,
6064 }
6065 impl From<&AssetTransferResponseRowsItem> for AssetTransferResponseRowsItem {
6066 fn from(value: &AssetTransferResponseRowsItem) -> Self {
6067 value.clone()
6068 }
6069 }
6070 ///AssetTransferType
6071 ///
6072 /// <details><summary>JSON schema</summary>
6073 ///
6074 /// ```json
6075 ///{
6076 /// "examples": [
6077 /// "MAIN_C2C"
6078 /// ],
6079 /// "type": "string",
6080 /// "enum": [
6081 /// "MAIN_C2C",
6082 /// "MAIN_UMFUTURE",
6083 /// "MAIN_CMFUTURE",
6084 /// "MAIN_MARGIN",
6085 /// "MAIN_MINING",
6086 /// "C2C_MAIN",
6087 /// "C2C_UMFUTURE",
6088 /// "C2C_MINING",
6089 /// "C2C_MARGIN",
6090 /// "UMFUTURE_MAIN",
6091 /// "UMFUTURE_C2C",
6092 /// "UMFUTURE_MARGIN",
6093 /// "CMFUTURE_MAIN",
6094 /// "CMFUTURE_MARGIN",
6095 /// "MARGIN_MAIN",
6096 /// "MARGIN_UMFUTURE",
6097 /// "MARGIN_CMFUTURE",
6098 /// "MARGIN_MINING",
6099 /// "MARGIN_C2C",
6100 /// "MINING_MAIN",
6101 /// "MINING_UMFUTURE",
6102 /// "MINING_C2C",
6103 /// "MINING_MARGIN",
6104 /// "MAIN_PAY",
6105 /// "PAY_MAIN",
6106 /// "ISOLATEDMARGIN_MARGIN",
6107 /// "MARGIN_ISOLATEDMARGIN",
6108 /// "ISOLATEDMARGIN_ISOLATEDMARGIN"
6109 /// ]
6110 ///}
6111 /// ```
6112 /// </details>
6113 #[derive(
6114 Clone,
6115 Copy,
6116 Debug,
6117 Deserialize,
6118 Eq,
6119 Hash,
6120 Ord,
6121 PartialEq,
6122 PartialOrd,
6123 Serialize
6124 )]
6125 pub enum AssetTransferType {
6126 #[serde(rename = "MAIN_C2C")]
6127 MainC2c,
6128 #[serde(rename = "MAIN_UMFUTURE")]
6129 MainUmfuture,
6130 #[serde(rename = "MAIN_CMFUTURE")]
6131 MainCmfuture,
6132 #[serde(rename = "MAIN_MARGIN")]
6133 MainMargin,
6134 #[serde(rename = "MAIN_MINING")]
6135 MainMining,
6136 #[serde(rename = "C2C_MAIN")]
6137 C2cMain,
6138 #[serde(rename = "C2C_UMFUTURE")]
6139 C2cUmfuture,
6140 #[serde(rename = "C2C_MINING")]
6141 C2cMining,
6142 #[serde(rename = "C2C_MARGIN")]
6143 C2cMargin,
6144 #[serde(rename = "UMFUTURE_MAIN")]
6145 UmfutureMain,
6146 #[serde(rename = "UMFUTURE_C2C")]
6147 UmfutureC2c,
6148 #[serde(rename = "UMFUTURE_MARGIN")]
6149 UmfutureMargin,
6150 #[serde(rename = "CMFUTURE_MAIN")]
6151 CmfutureMain,
6152 #[serde(rename = "CMFUTURE_MARGIN")]
6153 CmfutureMargin,
6154 #[serde(rename = "MARGIN_MAIN")]
6155 MarginMain,
6156 #[serde(rename = "MARGIN_UMFUTURE")]
6157 MarginUmfuture,
6158 #[serde(rename = "MARGIN_CMFUTURE")]
6159 MarginCmfuture,
6160 #[serde(rename = "MARGIN_MINING")]
6161 MarginMining,
6162 #[serde(rename = "MARGIN_C2C")]
6163 MarginC2c,
6164 #[serde(rename = "MINING_MAIN")]
6165 MiningMain,
6166 #[serde(rename = "MINING_UMFUTURE")]
6167 MiningUmfuture,
6168 #[serde(rename = "MINING_C2C")]
6169 MiningC2c,
6170 #[serde(rename = "MINING_MARGIN")]
6171 MiningMargin,
6172 #[serde(rename = "MAIN_PAY")]
6173 MainPay,
6174 #[serde(rename = "PAY_MAIN")]
6175 PayMain,
6176 #[serde(rename = "ISOLATEDMARGIN_MARGIN")]
6177 IsolatedmarginMargin,
6178 #[serde(rename = "MARGIN_ISOLATEDMARGIN")]
6179 MarginIsolatedmargin,
6180 #[serde(rename = "ISOLATEDMARGIN_ISOLATEDMARGIN")]
6181 IsolatedmarginIsolatedmargin,
6182 }
6183 impl From<&AssetTransferType> for AssetTransferType {
6184 fn from(value: &AssetTransferType) -> Self {
6185 value.clone()
6186 }
6187 }
6188 impl ToString for AssetTransferType {
6189 fn to_string(&self) -> String {
6190 match *self {
6191 Self::MainC2c => "MAIN_C2C".to_string(),
6192 Self::MainUmfuture => "MAIN_UMFUTURE".to_string(),
6193 Self::MainCmfuture => "MAIN_CMFUTURE".to_string(),
6194 Self::MainMargin => "MAIN_MARGIN".to_string(),
6195 Self::MainMining => "MAIN_MINING".to_string(),
6196 Self::C2cMain => "C2C_MAIN".to_string(),
6197 Self::C2cUmfuture => "C2C_UMFUTURE".to_string(),
6198 Self::C2cMining => "C2C_MINING".to_string(),
6199 Self::C2cMargin => "C2C_MARGIN".to_string(),
6200 Self::UmfutureMain => "UMFUTURE_MAIN".to_string(),
6201 Self::UmfutureC2c => "UMFUTURE_C2C".to_string(),
6202 Self::UmfutureMargin => "UMFUTURE_MARGIN".to_string(),
6203 Self::CmfutureMain => "CMFUTURE_MAIN".to_string(),
6204 Self::CmfutureMargin => "CMFUTURE_MARGIN".to_string(),
6205 Self::MarginMain => "MARGIN_MAIN".to_string(),
6206 Self::MarginUmfuture => "MARGIN_UMFUTURE".to_string(),
6207 Self::MarginCmfuture => "MARGIN_CMFUTURE".to_string(),
6208 Self::MarginMining => "MARGIN_MINING".to_string(),
6209 Self::MarginC2c => "MARGIN_C2C".to_string(),
6210 Self::MiningMain => "MINING_MAIN".to_string(),
6211 Self::MiningUmfuture => "MINING_UMFUTURE".to_string(),
6212 Self::MiningC2c => "MINING_C2C".to_string(),
6213 Self::MiningMargin => "MINING_MARGIN".to_string(),
6214 Self::MainPay => "MAIN_PAY".to_string(),
6215 Self::PayMain => "PAY_MAIN".to_string(),
6216 Self::IsolatedmarginMargin => "ISOLATEDMARGIN_MARGIN".to_string(),
6217 Self::MarginIsolatedmargin => "MARGIN_ISOLATEDMARGIN".to_string(),
6218 Self::IsolatedmarginIsolatedmargin => {
6219 "ISOLATEDMARGIN_ISOLATEDMARGIN".to_string()
6220 }
6221 }
6222 }
6223 }
6224 impl std::str::FromStr for AssetTransferType {
6225 type Err = self::error::ConversionError;
6226 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
6227 match value {
6228 "MAIN_C2C" => Ok(Self::MainC2c),
6229 "MAIN_UMFUTURE" => Ok(Self::MainUmfuture),
6230 "MAIN_CMFUTURE" => Ok(Self::MainCmfuture),
6231 "MAIN_MARGIN" => Ok(Self::MainMargin),
6232 "MAIN_MINING" => Ok(Self::MainMining),
6233 "C2C_MAIN" => Ok(Self::C2cMain),
6234 "C2C_UMFUTURE" => Ok(Self::C2cUmfuture),
6235 "C2C_MINING" => Ok(Self::C2cMining),
6236 "C2C_MARGIN" => Ok(Self::C2cMargin),
6237 "UMFUTURE_MAIN" => Ok(Self::UmfutureMain),
6238 "UMFUTURE_C2C" => Ok(Self::UmfutureC2c),
6239 "UMFUTURE_MARGIN" => Ok(Self::UmfutureMargin),
6240 "CMFUTURE_MAIN" => Ok(Self::CmfutureMain),
6241 "CMFUTURE_MARGIN" => Ok(Self::CmfutureMargin),
6242 "MARGIN_MAIN" => Ok(Self::MarginMain),
6243 "MARGIN_UMFUTURE" => Ok(Self::MarginUmfuture),
6244 "MARGIN_CMFUTURE" => Ok(Self::MarginCmfuture),
6245 "MARGIN_MINING" => Ok(Self::MarginMining),
6246 "MARGIN_C2C" => Ok(Self::MarginC2c),
6247 "MINING_MAIN" => Ok(Self::MiningMain),
6248 "MINING_UMFUTURE" => Ok(Self::MiningUmfuture),
6249 "MINING_C2C" => Ok(Self::MiningC2c),
6250 "MINING_MARGIN" => Ok(Self::MiningMargin),
6251 "MAIN_PAY" => Ok(Self::MainPay),
6252 "PAY_MAIN" => Ok(Self::PayMain),
6253 "ISOLATEDMARGIN_MARGIN" => Ok(Self::IsolatedmarginMargin),
6254 "MARGIN_ISOLATEDMARGIN" => Ok(Self::MarginIsolatedmargin),
6255 "ISOLATEDMARGIN_ISOLATEDMARGIN" => Ok(Self::IsolatedmarginIsolatedmargin),
6256 _ => Err("invalid value".into()),
6257 }
6258 }
6259 }
6260 impl std::convert::TryFrom<&str> for AssetTransferType {
6261 type Error = self::error::ConversionError;
6262 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
6263 value.parse()
6264 }
6265 }
6266 impl std::convert::TryFrom<&String> for AssetTransferType {
6267 type Error = self::error::ConversionError;
6268 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
6269 value.parse()
6270 }
6271 }
6272 impl std::convert::TryFrom<String> for AssetTransferType {
6273 type Error = self::error::ConversionError;
6274 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
6275 value.parse()
6276 }
6277 }
6278 ///AssetWalletBalanceResponseItem
6279 ///
6280 /// <details><summary>JSON schema</summary>
6281 ///
6282 /// ```json
6283 ///{
6284 /// "type": "object",
6285 /// "required": [
6286 /// "activate",
6287 /// "balance",
6288 /// "walletName"
6289 /// ],
6290 /// "properties": {
6291 /// "activate": {
6292 /// "examples": [
6293 /// true
6294 /// ],
6295 /// "type": "boolean"
6296 /// },
6297 /// "balance": {
6298 /// "examples": [
6299 /// "0"
6300 /// ],
6301 /// "type": "string"
6302 /// },
6303 /// "walletName": {
6304 /// "examples": [
6305 /// "Spot"
6306 /// ],
6307 /// "type": "string"
6308 /// }
6309 /// }
6310 ///}
6311 /// ```
6312 /// </details>
6313 #[derive(Clone, Debug, Deserialize, Serialize)]
6314 pub struct AssetWalletBalanceResponseItem {
6315 pub activate: bool,
6316 pub balance: String,
6317 #[serde(rename = "walletName")]
6318 pub wallet_name: String,
6319 }
6320 impl From<&AssetWalletBalanceResponseItem> for AssetWalletBalanceResponseItem {
6321 fn from(value: &AssetWalletBalanceResponseItem) -> Self {
6322 value.clone()
6323 }
6324 }
6325 ///AvgPriceResponse
6326 ///
6327 /// <details><summary>JSON schema</summary>
6328 ///
6329 /// ```json
6330 ///{
6331 /// "type": "object",
6332 /// "required": [
6333 /// "mins",
6334 /// "price"
6335 /// ],
6336 /// "properties": {
6337 /// "mins": {
6338 /// "examples": [
6339 /// 5
6340 /// ],
6341 /// "type": "integer",
6342 /// "format": "int64"
6343 /// },
6344 /// "price": {
6345 /// "examples": [
6346 /// "9.35751834"
6347 /// ],
6348 /// "type": "string"
6349 /// }
6350 /// }
6351 ///}
6352 /// ```
6353 /// </details>
6354 #[derive(Clone, Debug, Deserialize, Serialize)]
6355 pub struct AvgPriceResponse {
6356 pub mins: i64,
6357 pub price: String,
6358 }
6359 impl From<&AvgPriceResponse> for AvgPriceResponse {
6360 fn from(value: &AvgPriceResponse) -> Self {
6361 value.clone()
6362 }
6363 }
6364 ///BlvtRedeemRecordResponseItem
6365 ///
6366 /// <details><summary>JSON schema</summary>
6367 ///
6368 /// ```json
6369 ///{
6370 /// "type": "object",
6371 /// "required": [
6372 /// "amount",
6373 /// "fee",
6374 /// "id",
6375 /// "nav",
6376 /// "netProceed",
6377 /// "timestamp",
6378 /// "tokenName"
6379 /// ],
6380 /// "properties": {
6381 /// "amount": {
6382 /// "description": "Redemption amount",
6383 /// "examples": [
6384 /// "0.54216292"
6385 /// ],
6386 /// "type": "string"
6387 /// },
6388 /// "fee": {
6389 /// "description": "Reemption fee",
6390 /// "examples": [
6391 /// "0.00995598"
6392 /// ],
6393 /// "type": "string"
6394 /// },
6395 /// "id": {
6396 /// "examples": [
6397 /// 1
6398 /// ],
6399 /// "type": "integer",
6400 /// "format": "int64"
6401 /// },
6402 /// "nav": {
6403 /// "description": "NAV of redemption",
6404 /// "examples": [
6405 /// "18.36345064"
6406 /// ],
6407 /// "type": "string"
6408 /// },
6409 /// "netProceed": {
6410 /// "description": "Net redemption value in usdt",
6411 /// "examples": [
6412 /// "9.94602604"
6413 /// ],
6414 /// "type": "string"
6415 /// },
6416 /// "timestamp": {
6417 /// "examples": [
6418 /// 1599128003050
6419 /// ],
6420 /// "type": "integer",
6421 /// "format": "int64"
6422 /// },
6423 /// "tokenName": {
6424 /// "examples": [
6425 /// "LINKUP"
6426 /// ],
6427 /// "type": "string"
6428 /// }
6429 /// }
6430 ///}
6431 /// ```
6432 /// </details>
6433 #[derive(Clone, Debug, Deserialize, Serialize)]
6434 pub struct BlvtRedeemRecordResponseItem {
6435 ///Redemption amount
6436 pub amount: String,
6437 ///Reemption fee
6438 pub fee: String,
6439 pub id: i64,
6440 ///NAV of redemption
6441 pub nav: String,
6442 ///Net redemption value in usdt
6443 #[serde(rename = "netProceed")]
6444 pub net_proceed: String,
6445 pub timestamp: i64,
6446 #[serde(rename = "tokenName")]
6447 pub token_name: String,
6448 }
6449 impl From<&BlvtRedeemRecordResponseItem> for BlvtRedeemRecordResponseItem {
6450 fn from(value: &BlvtRedeemRecordResponseItem) -> Self {
6451 value.clone()
6452 }
6453 }
6454 ///BlvtRedeemResponse
6455 ///
6456 /// <details><summary>JSON schema</summary>
6457 ///
6458 /// ```json
6459 ///{
6460 /// "type": "object",
6461 /// "required": [
6462 /// "amount",
6463 /// "id",
6464 /// "redeemAmount",
6465 /// "status",
6466 /// "timestamp",
6467 /// "tokenName"
6468 /// ],
6469 /// "properties": {
6470 /// "amount": {
6471 /// "description": "Redemption value in usdt",
6472 /// "examples": [
6473 /// "10.05022099"
6474 /// ],
6475 /// "type": "string"
6476 /// },
6477 /// "id": {
6478 /// "examples": [
6479 /// 123
6480 /// ],
6481 /// "type": "integer",
6482 /// "format": "int64"
6483 /// },
6484 /// "redeemAmount": {
6485 /// "description": "Redemption token amount",
6486 /// "examples": [
6487 /// "0.95590905"
6488 /// ],
6489 /// "type": "string"
6490 /// },
6491 /// "status": {
6492 /// "description": "S, P, and F for \"success\", \"pending\", and \"failure\"",
6493 /// "examples": [
6494 /// "S"
6495 /// ],
6496 /// "type": "string"
6497 /// },
6498 /// "timestamp": {
6499 /// "examples": [
6500 /// 1600250279614
6501 /// ],
6502 /// "type": "integer",
6503 /// "format": "int64"
6504 /// },
6505 /// "tokenName": {
6506 /// "examples": [
6507 /// "LINKUP"
6508 /// ],
6509 /// "type": "string"
6510 /// }
6511 /// }
6512 ///}
6513 /// ```
6514 /// </details>
6515 #[derive(Clone, Debug, Deserialize, Serialize)]
6516 pub struct BlvtRedeemResponse {
6517 ///Redemption value in usdt
6518 pub amount: String,
6519 pub id: i64,
6520 ///Redemption token amount
6521 #[serde(rename = "redeemAmount")]
6522 pub redeem_amount: String,
6523 ///S, P, and F for "success", "pending", and "failure"
6524 pub status: String,
6525 pub timestamp: i64,
6526 #[serde(rename = "tokenName")]
6527 pub token_name: String,
6528 }
6529 impl From<&BlvtRedeemResponse> for BlvtRedeemResponse {
6530 fn from(value: &BlvtRedeemResponse) -> Self {
6531 value.clone()
6532 }
6533 }
6534 ///BlvtSubscribeRecordResponse
6535 ///
6536 /// <details><summary>JSON schema</summary>
6537 ///
6538 /// ```json
6539 ///{
6540 /// "type": "object",
6541 /// "required": [
6542 /// "amount",
6543 /// "fee",
6544 /// "id",
6545 /// "nav",
6546 /// "timestamp",
6547 /// "tokenName",
6548 /// "totalCharge"
6549 /// ],
6550 /// "properties": {
6551 /// "amount": {
6552 /// "description": "Subscription amount",
6553 /// "examples": [
6554 /// "0.54216292"
6555 /// ],
6556 /// "type": "string"
6557 /// },
6558 /// "fee": {
6559 /// "description": "Subscription fee in usdt",
6560 /// "examples": [
6561 /// "0.00999000"
6562 /// ],
6563 /// "type": "string"
6564 /// },
6565 /// "id": {
6566 /// "examples": [
6567 /// 1
6568 /// ],
6569 /// "type": "integer",
6570 /// "format": "int64"
6571 /// },
6572 /// "nav": {
6573 /// "description": "NAV price of subscription",
6574 /// "examples": [
6575 /// "18.42621386"
6576 /// ],
6577 /// "type": "string"
6578 /// },
6579 /// "timestamp": {
6580 /// "examples": [
6581 /// 1599127217916
6582 /// ],
6583 /// "type": "integer",
6584 /// "format": "int64"
6585 /// },
6586 /// "tokenName": {
6587 /// "examples": [
6588 /// "LINKUP"
6589 /// ],
6590 /// "type": "string"
6591 /// },
6592 /// "totalCharge": {
6593 /// "description": "Subscription cost in usdt",
6594 /// "examples": [
6595 /// "9.99999991"
6596 /// ],
6597 /// "type": "string"
6598 /// }
6599 /// }
6600 ///}
6601 /// ```
6602 /// </details>
6603 #[derive(Clone, Debug, Deserialize, Serialize)]
6604 pub struct BlvtSubscribeRecordResponse {
6605 ///Subscription amount
6606 pub amount: String,
6607 ///Subscription fee in usdt
6608 pub fee: String,
6609 pub id: i64,
6610 ///NAV price of subscription
6611 pub nav: String,
6612 pub timestamp: i64,
6613 #[serde(rename = "tokenName")]
6614 pub token_name: String,
6615 ///Subscription cost in usdt
6616 #[serde(rename = "totalCharge")]
6617 pub total_charge: String,
6618 }
6619 impl From<&BlvtSubscribeRecordResponse> for BlvtSubscribeRecordResponse {
6620 fn from(value: &BlvtSubscribeRecordResponse) -> Self {
6621 value.clone()
6622 }
6623 }
6624 ///BlvtSubscribeResponse
6625 ///
6626 /// <details><summary>JSON schema</summary>
6627 ///
6628 /// ```json
6629 ///{
6630 /// "type": "object",
6631 /// "required": [
6632 /// "amount",
6633 /// "cost",
6634 /// "id",
6635 /// "status",
6636 /// "timestamp",
6637 /// "tokenName"
6638 /// ],
6639 /// "properties": {
6640 /// "amount": {
6641 /// "description": "subscribed token amount",
6642 /// "examples": [
6643 /// "0.9559090500"
6644 /// ],
6645 /// "type": "string"
6646 /// },
6647 /// "cost": {
6648 /// "description": "subscription cost in usdt",
6649 /// "examples": [
6650 /// "9.99999995"
6651 /// ],
6652 /// "type": "string"
6653 /// },
6654 /// "id": {
6655 /// "examples": [
6656 /// 123
6657 /// ],
6658 /// "type": "integer",
6659 /// "format": "int64"
6660 /// },
6661 /// "status": {
6662 /// "description": "S, P, and F for \"success\", \"pending\", and \"failure\"",
6663 /// "examples": [
6664 /// "S"
6665 /// ],
6666 /// "type": "string"
6667 /// },
6668 /// "timestamp": {
6669 /// "examples": [
6670 /// 1600249972899
6671 /// ],
6672 /// "type": "integer",
6673 /// "format": "int64"
6674 /// },
6675 /// "tokenName": {
6676 /// "examples": [
6677 /// "LINKUP"
6678 /// ],
6679 /// "type": "string"
6680 /// }
6681 /// }
6682 ///}
6683 /// ```
6684 /// </details>
6685 #[derive(Clone, Debug, Deserialize, Serialize)]
6686 pub struct BlvtSubscribeResponse {
6687 ///subscribed token amount
6688 pub amount: String,
6689 ///subscription cost in usdt
6690 pub cost: String,
6691 pub id: i64,
6692 ///S, P, and F for "success", "pending", and "failure"
6693 pub status: String,
6694 pub timestamp: i64,
6695 #[serde(rename = "tokenName")]
6696 pub token_name: String,
6697 }
6698 impl From<&BlvtSubscribeResponse> for BlvtSubscribeResponse {
6699 fn from(value: &BlvtSubscribeResponse) -> Self {
6700 value.clone()
6701 }
6702 }
6703 ///BlvtTokenInfoResponseItem
6704 ///
6705 /// <details><summary>JSON schema</summary>
6706 ///
6707 /// ```json
6708 ///{
6709 /// "type": "object",
6710 /// "required": [
6711 /// "basket",
6712 /// "currentBaskets",
6713 /// "dailyManagementFee",
6714 /// "dailyPurchaseLimit",
6715 /// "dailyRedeemLimit",
6716 /// "description",
6717 /// "fundingRate",
6718 /// "nav",
6719 /// "purchaseFeePct",
6720 /// "realLeverage",
6721 /// "redeemFeePct",
6722 /// "timestamp",
6723 /// "tokenIssued",
6724 /// "tokenName",
6725 /// "underlying"
6726 /// ],
6727 /// "properties": {
6728 /// "basket": {
6729 /// "examples": [
6730 /// "-821.474 BTCUSDT Futures"
6731 /// ],
6732 /// "type": "string"
6733 /// },
6734 /// "currentBaskets": {
6735 /// "type": "array",
6736 /// "items": {
6737 /// "type": "object",
6738 /// "required": [
6739 /// "amount",
6740 /// "notionalValue",
6741 /// "symbol"
6742 /// ],
6743 /// "properties": {
6744 /// "amount": {
6745 /// "examples": [
6746 /// "-1183.984"
6747 /// ],
6748 /// "type": "string"
6749 /// },
6750 /// "notionalValue": {
6751 /// "examples": [
6752 /// "-22871089.96704"
6753 /// ],
6754 /// "type": "string"
6755 /// },
6756 /// "symbol": {
6757 /// "examples": [
6758 /// "BTCUSDT"
6759 /// ],
6760 /// "type": "string"
6761 /// }
6762 /// }
6763 /// }
6764 /// },
6765 /// "dailyManagementFee": {
6766 /// "examples": [
6767 /// "0.0001"
6768 /// ],
6769 /// "type": "string"
6770 /// },
6771 /// "dailyPurchaseLimit": {
6772 /// "examples": [
6773 /// "100000.00"
6774 /// ],
6775 /// "type": "string"
6776 /// },
6777 /// "dailyRedeemLimit": {
6778 /// "examples": [
6779 /// "1000000.00"
6780 /// ],
6781 /// "type": "string"
6782 /// },
6783 /// "description": {
6784 /// "examples": [
6785 /// "3X Short Bitcoin Token"
6786 /// ],
6787 /// "type": "string"
6788 /// },
6789 /// "fundingRate": {
6790 /// "examples": [
6791 /// "0.001020"
6792 /// ],
6793 /// "type": "string"
6794 /// },
6795 /// "nav": {
6796 /// "examples": [
6797 /// "4.79"
6798 /// ],
6799 /// "type": "string"
6800 /// },
6801 /// "purchaseFeePct": {
6802 /// "examples": [
6803 /// "0.0010"
6804 /// ],
6805 /// "type": "string"
6806 /// },
6807 /// "realLeverage": {
6808 /// "examples": [
6809 /// "-2.316"
6810 /// ],
6811 /// "type": "string"
6812 /// },
6813 /// "redeemFeePct": {
6814 /// "examples": [
6815 /// "0.0010"
6816 /// ],
6817 /// "type": "string"
6818 /// },
6819 /// "timestamp": {
6820 /// "examples": [
6821 /// 1583127900000
6822 /// ],
6823 /// "type": "integer",
6824 /// "format": "int64"
6825 /// },
6826 /// "tokenIssued": {
6827 /// "examples": [
6828 /// "717953.95"
6829 /// ],
6830 /// "type": "string"
6831 /// },
6832 /// "tokenName": {
6833 /// "examples": [
6834 /// "BTCDOWN"
6835 /// ],
6836 /// "type": "string"
6837 /// },
6838 /// "underlying": {
6839 /// "examples": [
6840 /// "BTC"
6841 /// ],
6842 /// "type": "string"
6843 /// }
6844 /// }
6845 ///}
6846 /// ```
6847 /// </details>
6848 #[derive(Clone, Debug, Deserialize, Serialize)]
6849 pub struct BlvtTokenInfoResponseItem {
6850 pub basket: String,
6851 #[serde(rename = "currentBaskets")]
6852 pub current_baskets: Vec<BlvtTokenInfoResponseItemCurrentBasketsItem>,
6853 #[serde(rename = "dailyManagementFee")]
6854 pub daily_management_fee: String,
6855 #[serde(rename = "dailyPurchaseLimit")]
6856 pub daily_purchase_limit: String,
6857 #[serde(rename = "dailyRedeemLimit")]
6858 pub daily_redeem_limit: String,
6859 pub description: String,
6860 #[serde(rename = "fundingRate")]
6861 pub funding_rate: String,
6862 pub nav: String,
6863 #[serde(rename = "purchaseFeePct")]
6864 pub purchase_fee_pct: String,
6865 #[serde(rename = "realLeverage")]
6866 pub real_leverage: String,
6867 #[serde(rename = "redeemFeePct")]
6868 pub redeem_fee_pct: String,
6869 pub timestamp: i64,
6870 #[serde(rename = "tokenIssued")]
6871 pub token_issued: String,
6872 #[serde(rename = "tokenName")]
6873 pub token_name: String,
6874 pub underlying: String,
6875 }
6876 impl From<&BlvtTokenInfoResponseItem> for BlvtTokenInfoResponseItem {
6877 fn from(value: &BlvtTokenInfoResponseItem) -> Self {
6878 value.clone()
6879 }
6880 }
6881 ///BlvtTokenInfoResponseItemCurrentBasketsItem
6882 ///
6883 /// <details><summary>JSON schema</summary>
6884 ///
6885 /// ```json
6886 ///{
6887 /// "type": "object",
6888 /// "required": [
6889 /// "amount",
6890 /// "notionalValue",
6891 /// "symbol"
6892 /// ],
6893 /// "properties": {
6894 /// "amount": {
6895 /// "examples": [
6896 /// "-1183.984"
6897 /// ],
6898 /// "type": "string"
6899 /// },
6900 /// "notionalValue": {
6901 /// "examples": [
6902 /// "-22871089.96704"
6903 /// ],
6904 /// "type": "string"
6905 /// },
6906 /// "symbol": {
6907 /// "examples": [
6908 /// "BTCUSDT"
6909 /// ],
6910 /// "type": "string"
6911 /// }
6912 /// }
6913 ///}
6914 /// ```
6915 /// </details>
6916 #[derive(Clone, Debug, Deserialize, Serialize)]
6917 pub struct BlvtTokenInfoResponseItemCurrentBasketsItem {
6918 pub amount: String,
6919 #[serde(rename = "notionalValue")]
6920 pub notional_value: String,
6921 pub symbol: String,
6922 }
6923 impl From<&BlvtTokenInfoResponseItemCurrentBasketsItem>
6924 for BlvtTokenInfoResponseItemCurrentBasketsItem {
6925 fn from(value: &BlvtTokenInfoResponseItemCurrentBasketsItem) -> Self {
6926 value.clone()
6927 }
6928 }
6929 ///BlvtUserLimitResponseItem
6930 ///
6931 /// <details><summary>JSON schema</summary>
6932 ///
6933 /// ```json
6934 ///{
6935 /// "type": "object",
6936 /// "required": [
6937 /// "tokenName",
6938 /// "userDailyTotalPurchaseLimit",
6939 /// "userDailyTotalRedeemLimit"
6940 /// ],
6941 /// "properties": {
6942 /// "tokenName": {
6943 /// "examples": [
6944 /// "LINKUP"
6945 /// ],
6946 /// "type": "string"
6947 /// },
6948 /// "userDailyTotalPurchaseLimit": {
6949 /// "description": "USDT",
6950 /// "examples": [
6951 /// "1000"
6952 /// ],
6953 /// "type": "string"
6954 /// },
6955 /// "userDailyTotalRedeemLimit": {
6956 /// "description": "USDT",
6957 /// "examples": [
6958 /// "1000"
6959 /// ],
6960 /// "type": "string"
6961 /// }
6962 /// }
6963 ///}
6964 /// ```
6965 /// </details>
6966 #[derive(Clone, Debug, Deserialize, Serialize)]
6967 pub struct BlvtUserLimitResponseItem {
6968 #[serde(rename = "tokenName")]
6969 pub token_name: String,
6970 ///USDT
6971 #[serde(rename = "userDailyTotalPurchaseLimit")]
6972 pub user_daily_total_purchase_limit: String,
6973 ///USDT
6974 #[serde(rename = "userDailyTotalRedeemLimit")]
6975 pub user_daily_total_redeem_limit: String,
6976 }
6977 impl From<&BlvtUserLimitResponseItem> for BlvtUserLimitResponseItem {
6978 fn from(value: &BlvtUserLimitResponseItem) -> Self {
6979 value.clone()
6980 }
6981 }
6982 ///BnbBurnStatus
6983 ///
6984 /// <details><summary>JSON schema</summary>
6985 ///
6986 /// ```json
6987 ///{
6988 /// "type": "object",
6989 /// "required": [
6990 /// "interestBNBBurn",
6991 /// "spotBNBBurn"
6992 /// ],
6993 /// "properties": {
6994 /// "interestBNBBurn": {
6995 /// "examples": [
6996 /// false
6997 /// ],
6998 /// "type": "boolean"
6999 /// },
7000 /// "spotBNBBurn": {
7001 /// "type": "boolean"
7002 /// }
7003 /// }
7004 ///}
7005 /// ```
7006 /// </details>
7007 #[derive(Clone, Debug, Deserialize, Serialize)]
7008 pub struct BnbBurnStatus {
7009 #[serde(rename = "interestBNBBurn")]
7010 pub interest_bnb_burn: bool,
7011 #[serde(rename = "spotBNBBurn")]
7012 pub spot_bnb_burn: bool,
7013 }
7014 impl From<&BnbBurnStatus> for BnbBurnStatus {
7015 fn from(value: &BnbBurnStatus) -> Self {
7016 value.clone()
7017 }
7018 }
7019 ///BookTicker
7020 ///
7021 /// <details><summary>JSON schema</summary>
7022 ///
7023 /// ```json
7024 ///{
7025 /// "type": "object",
7026 /// "required": [
7027 /// "askPrice",
7028 /// "askQty",
7029 /// "bidPrice",
7030 /// "bidQty",
7031 /// "symbol"
7032 /// ],
7033 /// "properties": {
7034 /// "askPrice": {
7035 /// "examples": [
7036 /// "16.36450000"
7037 /// ],
7038 /// "type": "string"
7039 /// },
7040 /// "askQty": {
7041 /// "examples": [
7042 /// "12.56000000"
7043 /// ],
7044 /// "type": "string"
7045 /// },
7046 /// "bidPrice": {
7047 /// "examples": [
7048 /// "16.36240000"
7049 /// ],
7050 /// "type": "string"
7051 /// },
7052 /// "bidQty": {
7053 /// "examples": [
7054 /// "256.78000000"
7055 /// ],
7056 /// "type": "string"
7057 /// },
7058 /// "symbol": {
7059 /// "examples": [
7060 /// "BNBBTC"
7061 /// ],
7062 /// "type": "string"
7063 /// }
7064 /// }
7065 ///}
7066 /// ```
7067 /// </details>
7068 #[derive(Clone, Debug, Deserialize, Serialize)]
7069 pub struct BookTicker {
7070 #[serde(rename = "askPrice")]
7071 pub ask_price: String,
7072 #[serde(rename = "askQty")]
7073 pub ask_qty: String,
7074 #[serde(rename = "bidPrice")]
7075 pub bid_price: String,
7076 #[serde(rename = "bidQty")]
7077 pub bid_qty: String,
7078 pub symbol: String,
7079 }
7080 impl From<&BookTicker> for BookTicker {
7081 fn from(value: &BookTicker) -> Self {
7082 value.clone()
7083 }
7084 }
7085 ///BookTickerList
7086 ///
7087 /// <details><summary>JSON schema</summary>
7088 ///
7089 /// ```json
7090 ///{
7091 /// "type": "array",
7092 /// "items": {
7093 /// "$ref": "#/components/schemas/bookTicker"
7094 /// }
7095 ///}
7096 /// ```
7097 /// </details>
7098 #[derive(Clone, Debug, Deserialize, Serialize)]
7099 pub struct BookTickerList(pub Vec<BookTicker>);
7100 impl std::ops::Deref for BookTickerList {
7101 type Target = Vec<BookTicker>;
7102 fn deref(&self) -> &Vec<BookTicker> {
7103 &self.0
7104 }
7105 }
7106 impl From<BookTickerList> for Vec<BookTicker> {
7107 fn from(value: BookTickerList) -> Self {
7108 value.0
7109 }
7110 }
7111 impl From<&BookTickerList> for BookTickerList {
7112 fn from(value: &BookTickerList) -> Self {
7113 value.clone()
7114 }
7115 }
7116 impl From<Vec<BookTicker>> for BookTickerList {
7117 fn from(value: Vec<BookTicker>) -> Self {
7118 Self(value)
7119 }
7120 }
7121 ///BswapAddLiquidityPreviewCombination
7122 ///
7123 /// <details><summary>JSON schema</summary>
7124 ///
7125 /// ```json
7126 ///{
7127 /// "type": "object",
7128 /// "required": [
7129 /// "baseAmt",
7130 /// "baseAsset",
7131 /// "price",
7132 /// "quoteAmt",
7133 /// "quoteAsset",
7134 /// "share"
7135 /// ],
7136 /// "properties": {
7137 /// "baseAmt": {
7138 /// "examples": [
7139 /// 299975
7140 /// ],
7141 /// "type": "integer",
7142 /// "format": "int64"
7143 /// },
7144 /// "baseAsset": {
7145 /// "examples": [
7146 /// "BUSD"
7147 /// ],
7148 /// "type": "string"
7149 /// },
7150 /// "price": {
7151 /// "examples": [
7152 /// 1.00008334
7153 /// ],
7154 /// "type": "number",
7155 /// "format": "double"
7156 /// },
7157 /// "quoteAmt": {
7158 /// "examples": [
7159 /// 300000
7160 /// ],
7161 /// "type": "integer",
7162 /// "format": "int64"
7163 /// },
7164 /// "quoteAsset": {
7165 /// "examples": [
7166 /// "USDT"
7167 /// ],
7168 /// "type": "string"
7169 /// },
7170 /// "share": {
7171 /// "examples": [
7172 /// 1.23
7173 /// ],
7174 /// "type": "number",
7175 /// "format": "double"
7176 /// }
7177 /// }
7178 ///}
7179 /// ```
7180 /// </details>
7181 #[derive(Clone, Debug, Deserialize, Serialize)]
7182 pub struct BswapAddLiquidityPreviewCombination {
7183 #[serde(rename = "baseAmt")]
7184 pub base_amt: i64,
7185 #[serde(rename = "baseAsset")]
7186 pub base_asset: String,
7187 pub price: f64,
7188 #[serde(rename = "quoteAmt")]
7189 pub quote_amt: i64,
7190 #[serde(rename = "quoteAsset")]
7191 pub quote_asset: String,
7192 pub share: f64,
7193 }
7194 impl From<&BswapAddLiquidityPreviewCombination>
7195 for BswapAddLiquidityPreviewCombination {
7196 fn from(value: &BswapAddLiquidityPreviewCombination) -> Self {
7197 value.clone()
7198 }
7199 }
7200 ///BswapAddLiquidityPreviewResponse
7201 ///
7202 /// <details><summary>JSON schema</summary>
7203 ///
7204 /// ```json
7205 ///{
7206 /// "oneOf": [
7207 /// {
7208 /// "$ref": "#/components/schemas/bswapAddLiquidityPreviewCombination"
7209 /// },
7210 /// {
7211 /// "$ref": "#/components/schemas/bswapAddLiquidityPreviewSingle"
7212 /// }
7213 /// ]
7214 ///}
7215 /// ```
7216 /// </details>
7217 #[derive(Clone, Debug, Deserialize, Serialize)]
7218 #[serde(untagged)]
7219 pub enum BswapAddLiquidityPreviewResponse {
7220 Combination(BswapAddLiquidityPreviewCombination),
7221 Single(BswapAddLiquidityPreviewSingle),
7222 }
7223 impl From<&BswapAddLiquidityPreviewResponse> for BswapAddLiquidityPreviewResponse {
7224 fn from(value: &BswapAddLiquidityPreviewResponse) -> Self {
7225 value.clone()
7226 }
7227 }
7228 impl From<BswapAddLiquidityPreviewCombination> for BswapAddLiquidityPreviewResponse {
7229 fn from(value: BswapAddLiquidityPreviewCombination) -> Self {
7230 Self::Combination(value)
7231 }
7232 }
7233 impl From<BswapAddLiquidityPreviewSingle> for BswapAddLiquidityPreviewResponse {
7234 fn from(value: BswapAddLiquidityPreviewSingle) -> Self {
7235 Self::Single(value)
7236 }
7237 }
7238 ///BswapAddLiquidityPreviewSingle
7239 ///
7240 /// <details><summary>JSON schema</summary>
7241 ///
7242 /// ```json
7243 ///{
7244 /// "type": "object",
7245 /// "required": [
7246 /// "fee",
7247 /// "price",
7248 /// "quoteAmt",
7249 /// "quoteAsset",
7250 /// "share",
7251 /// "slippage"
7252 /// ],
7253 /// "properties": {
7254 /// "fee": {
7255 /// "examples": [
7256 /// 120
7257 /// ],
7258 /// "type": "number",
7259 /// "format": "double"
7260 /// },
7261 /// "price": {
7262 /// "examples": [
7263 /// 1.00008334
7264 /// ],
7265 /// "type": "number",
7266 /// "format": "double"
7267 /// },
7268 /// "quoteAmt": {
7269 /// "examples": [
7270 /// 300000
7271 /// ],
7272 /// "type": "integer",
7273 /// "format": "int64"
7274 /// },
7275 /// "quoteAsset": {
7276 /// "examples": [
7277 /// "USDT"
7278 /// ],
7279 /// "type": "string"
7280 /// },
7281 /// "share": {
7282 /// "examples": [
7283 /// 1.23
7284 /// ],
7285 /// "type": "number",
7286 /// "format": "double"
7287 /// },
7288 /// "slippage": {
7289 /// "examples": [
7290 /// 0.00007245
7291 /// ],
7292 /// "type": "number",
7293 /// "format": "double"
7294 /// }
7295 /// }
7296 ///}
7297 /// ```
7298 /// </details>
7299 #[derive(Clone, Debug, Deserialize, Serialize)]
7300 pub struct BswapAddLiquidityPreviewSingle {
7301 pub fee: f64,
7302 pub price: f64,
7303 #[serde(rename = "quoteAmt")]
7304 pub quote_amt: i64,
7305 #[serde(rename = "quoteAsset")]
7306 pub quote_asset: String,
7307 pub share: f64,
7308 pub slippage: f64,
7309 }
7310 impl From<&BswapAddLiquidityPreviewSingle> for BswapAddLiquidityPreviewSingle {
7311 fn from(value: &BswapAddLiquidityPreviewSingle) -> Self {
7312 value.clone()
7313 }
7314 }
7315 ///BswapAddLiquidityPreviewType
7316 ///
7317 /// <details><summary>JSON schema</summary>
7318 ///
7319 /// ```json
7320 ///{
7321 /// "examples": [
7322 /// "SINGLE"
7323 /// ],
7324 /// "type": "string",
7325 /// "enum": [
7326 /// "SINGLE",
7327 /// "COMBINATION"
7328 /// ]
7329 ///}
7330 /// ```
7331 /// </details>
7332 #[derive(
7333 Clone,
7334 Copy,
7335 Debug,
7336 Deserialize,
7337 Eq,
7338 Hash,
7339 Ord,
7340 PartialEq,
7341 PartialOrd,
7342 Serialize
7343 )]
7344 pub enum BswapAddLiquidityPreviewType {
7345 #[serde(rename = "SINGLE")]
7346 Single,
7347 #[serde(rename = "COMBINATION")]
7348 Combination,
7349 }
7350 impl From<&BswapAddLiquidityPreviewType> for BswapAddLiquidityPreviewType {
7351 fn from(value: &BswapAddLiquidityPreviewType) -> Self {
7352 value.clone()
7353 }
7354 }
7355 impl ToString for BswapAddLiquidityPreviewType {
7356 fn to_string(&self) -> String {
7357 match *self {
7358 Self::Single => "SINGLE".to_string(),
7359 Self::Combination => "COMBINATION".to_string(),
7360 }
7361 }
7362 }
7363 impl std::str::FromStr for BswapAddLiquidityPreviewType {
7364 type Err = self::error::ConversionError;
7365 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
7366 match value {
7367 "SINGLE" => Ok(Self::Single),
7368 "COMBINATION" => Ok(Self::Combination),
7369 _ => Err("invalid value".into()),
7370 }
7371 }
7372 }
7373 impl std::convert::TryFrom<&str> for BswapAddLiquidityPreviewType {
7374 type Error = self::error::ConversionError;
7375 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
7376 value.parse()
7377 }
7378 }
7379 impl std::convert::TryFrom<&String> for BswapAddLiquidityPreviewType {
7380 type Error = self::error::ConversionError;
7381 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
7382 value.parse()
7383 }
7384 }
7385 impl std::convert::TryFrom<String> for BswapAddLiquidityPreviewType {
7386 type Error = self::error::ConversionError;
7387 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
7388 value.parse()
7389 }
7390 }
7391 ///BswapClaimRewardsResponse
7392 ///
7393 /// <details><summary>JSON schema</summary>
7394 ///
7395 /// ```json
7396 ///{
7397 /// "type": "object",
7398 /// "required": [
7399 /// "success"
7400 /// ],
7401 /// "properties": {
7402 /// "success": {
7403 /// "type": "boolean"
7404 /// }
7405 /// }
7406 ///}
7407 /// ```
7408 /// </details>
7409 #[derive(Clone, Debug, Deserialize, Serialize)]
7410 pub struct BswapClaimRewardsResponse {
7411 pub success: bool,
7412 }
7413 impl From<&BswapClaimRewardsResponse> for BswapClaimRewardsResponse {
7414 fn from(value: &BswapClaimRewardsResponse) -> Self {
7415 value.clone()
7416 }
7417 }
7418 ///BswapClaimedHistoryResponseItem
7419 ///
7420 /// <details><summary>JSON schema</summary>
7421 ///
7422 /// ```json
7423 ///{
7424 /// "type": "object",
7425 /// "required": [
7426 /// "assetRewards",
7427 /// "claimAmount",
7428 /// "claimTime",
7429 /// "poolId",
7430 /// "poolName",
7431 /// "status"
7432 /// ],
7433 /// "properties": {
7434 /// "assetRewards": {
7435 /// "examples": [
7436 /// "BNB"
7437 /// ],
7438 /// "type": "string"
7439 /// },
7440 /// "claimAmount": {
7441 /// "examples": [
7442 /// 2.3e-7
7443 /// ],
7444 /// "type": "number",
7445 /// "format": "float"
7446 /// },
7447 /// "claimTime": {
7448 /// "examples": [
7449 /// 1565769342148
7450 /// ],
7451 /// "type": "integer",
7452 /// "format": "int64"
7453 /// },
7454 /// "poolId": {
7455 /// "examples": [
7456 /// 52
7457 /// ],
7458 /// "type": "integer",
7459 /// "format": "int32"
7460 /// },
7461 /// "poolName": {
7462 /// "examples": [
7463 /// "BNB/USDT"
7464 /// ],
7465 /// "type": "string"
7466 /// },
7467 /// "status": {
7468 /// "description": "0: pending, 1: success",
7469 /// "examples": [
7470 /// 1
7471 /// ],
7472 /// "type": "integer",
7473 /// "format": "int32"
7474 /// }
7475 /// }
7476 ///}
7477 /// ```
7478 /// </details>
7479 #[derive(Clone, Debug, Deserialize, Serialize)]
7480 pub struct BswapClaimedHistoryResponseItem {
7481 #[serde(rename = "assetRewards")]
7482 pub asset_rewards: String,
7483 #[serde(rename = "claimAmount")]
7484 pub claim_amount: f32,
7485 #[serde(rename = "claimTime")]
7486 pub claim_time: i64,
7487 #[serde(rename = "poolId")]
7488 pub pool_id: i32,
7489 #[serde(rename = "poolName")]
7490 pub pool_name: String,
7491 ///0: pending, 1: success
7492 pub status: i32,
7493 }
7494 impl From<&BswapClaimedHistoryResponseItem> for BswapClaimedHistoryResponseItem {
7495 fn from(value: &BswapClaimedHistoryResponseItem) -> Self {
7496 value.clone()
7497 }
7498 }
7499 ///BswapLiquidityAddResponse
7500 ///
7501 /// <details><summary>JSON schema</summary>
7502 ///
7503 /// ```json
7504 ///{
7505 /// "type": "object",
7506 /// "required": [
7507 /// "operationId"
7508 /// ],
7509 /// "properties": {
7510 /// "operationId": {
7511 /// "examples": [
7512 /// 12341
7513 /// ],
7514 /// "type": "integer",
7515 /// "format": "int64"
7516 /// }
7517 /// }
7518 ///}
7519 /// ```
7520 /// </details>
7521 #[derive(Clone, Debug, Deserialize, Serialize)]
7522 pub struct BswapLiquidityAddResponse {
7523 #[serde(rename = "operationId")]
7524 pub operation_id: i64,
7525 }
7526 impl From<&BswapLiquidityAddResponse> for BswapLiquidityAddResponse {
7527 fn from(value: &BswapLiquidityAddResponse) -> Self {
7528 value.clone()
7529 }
7530 }
7531 ///BswapLiquidityAddType
7532 ///
7533 /// <details><summary>JSON schema</summary>
7534 ///
7535 /// ```json
7536 ///{
7537 /// "examples": [
7538 /// "Single"
7539 /// ],
7540 /// "type": "string",
7541 /// "enum": [
7542 /// "Single",
7543 /// "Combination"
7544 /// ]
7545 ///}
7546 /// ```
7547 /// </details>
7548 #[derive(
7549 Clone,
7550 Copy,
7551 Debug,
7552 Deserialize,
7553 Eq,
7554 Hash,
7555 Ord,
7556 PartialEq,
7557 PartialOrd,
7558 Serialize
7559 )]
7560 pub enum BswapLiquidityAddType {
7561 Single,
7562 Combination,
7563 }
7564 impl From<&BswapLiquidityAddType> for BswapLiquidityAddType {
7565 fn from(value: &BswapLiquidityAddType) -> Self {
7566 value.clone()
7567 }
7568 }
7569 impl ToString for BswapLiquidityAddType {
7570 fn to_string(&self) -> String {
7571 match *self {
7572 Self::Single => "Single".to_string(),
7573 Self::Combination => "Combination".to_string(),
7574 }
7575 }
7576 }
7577 impl std::str::FromStr for BswapLiquidityAddType {
7578 type Err = self::error::ConversionError;
7579 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
7580 match value {
7581 "Single" => Ok(Self::Single),
7582 "Combination" => Ok(Self::Combination),
7583 _ => Err("invalid value".into()),
7584 }
7585 }
7586 }
7587 impl std::convert::TryFrom<&str> for BswapLiquidityAddType {
7588 type Error = self::error::ConversionError;
7589 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
7590 value.parse()
7591 }
7592 }
7593 impl std::convert::TryFrom<&String> for BswapLiquidityAddType {
7594 type Error = self::error::ConversionError;
7595 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
7596 value.parse()
7597 }
7598 }
7599 impl std::convert::TryFrom<String> for BswapLiquidityAddType {
7600 type Error = self::error::ConversionError;
7601 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
7602 value.parse()
7603 }
7604 }
7605 ///BswapLiquidityOpsOperation
7606 ///
7607 /// <details><summary>JSON schema</summary>
7608 ///
7609 /// ```json
7610 ///{
7611 /// "type": "string",
7612 /// "enum": [
7613 /// "ADD",
7614 /// "REMOVE"
7615 /// ]
7616 ///}
7617 /// ```
7618 /// </details>
7619 #[derive(
7620 Clone,
7621 Copy,
7622 Debug,
7623 Deserialize,
7624 Eq,
7625 Hash,
7626 Ord,
7627 PartialEq,
7628 PartialOrd,
7629 Serialize
7630 )]
7631 pub enum BswapLiquidityOpsOperation {
7632 #[serde(rename = "ADD")]
7633 Add,
7634 #[serde(rename = "REMOVE")]
7635 Remove,
7636 }
7637 impl From<&BswapLiquidityOpsOperation> for BswapLiquidityOpsOperation {
7638 fn from(value: &BswapLiquidityOpsOperation) -> Self {
7639 value.clone()
7640 }
7641 }
7642 impl ToString for BswapLiquidityOpsOperation {
7643 fn to_string(&self) -> String {
7644 match *self {
7645 Self::Add => "ADD".to_string(),
7646 Self::Remove => "REMOVE".to_string(),
7647 }
7648 }
7649 }
7650 impl std::str::FromStr for BswapLiquidityOpsOperation {
7651 type Err = self::error::ConversionError;
7652 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
7653 match value {
7654 "ADD" => Ok(Self::Add),
7655 "REMOVE" => Ok(Self::Remove),
7656 _ => Err("invalid value".into()),
7657 }
7658 }
7659 }
7660 impl std::convert::TryFrom<&str> for BswapLiquidityOpsOperation {
7661 type Error = self::error::ConversionError;
7662 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
7663 value.parse()
7664 }
7665 }
7666 impl std::convert::TryFrom<&String> for BswapLiquidityOpsOperation {
7667 type Error = self::error::ConversionError;
7668 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
7669 value.parse()
7670 }
7671 }
7672 impl std::convert::TryFrom<String> for BswapLiquidityOpsOperation {
7673 type Error = self::error::ConversionError;
7674 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
7675 value.parse()
7676 }
7677 }
7678 ///BswapLiquidityOpsResponseItem
7679 ///
7680 /// <details><summary>JSON schema</summary>
7681 ///
7682 /// ```json
7683 ///{
7684 /// "type": "object",
7685 /// "required": [
7686 /// "operation",
7687 /// "operationId",
7688 /// "poolId",
7689 /// "poolName",
7690 /// "shareAmount",
7691 /// "status",
7692 /// "updateTime"
7693 /// ],
7694 /// "properties": {
7695 /// "operation": {
7696 /// "description": "\"ADD\" or \"REMOVE\"",
7697 /// "examples": [
7698 /// "ADD"
7699 /// ],
7700 /// "type": "string"
7701 /// },
7702 /// "operationId": {
7703 /// "examples": [
7704 /// 12341
7705 /// ],
7706 /// "type": "integer",
7707 /// "format": "int64"
7708 /// },
7709 /// "poolId": {
7710 /// "examples": [
7711 /// 2
7712 /// ],
7713 /// "type": "integer",
7714 /// "format": "int64"
7715 /// },
7716 /// "poolName": {
7717 /// "examples": [
7718 /// "BUSD/USDT"
7719 /// ],
7720 /// "type": "string"
7721 /// },
7722 /// "shareAmount": {
7723 /// "examples": [
7724 /// "10.1"
7725 /// ],
7726 /// "type": "string"
7727 /// },
7728 /// "status": {
7729 /// "description": "0: pending, 1: success, 2: failed",
7730 /// "examples": [
7731 /// 1
7732 /// ],
7733 /// "type": "integer",
7734 /// "format": "int32"
7735 /// },
7736 /// "updateTime": {
7737 /// "examples": [
7738 /// 1565769342148
7739 /// ],
7740 /// "type": "integer",
7741 /// "format": "int64"
7742 /// }
7743 /// }
7744 ///}
7745 /// ```
7746 /// </details>
7747 #[derive(Clone, Debug, Deserialize, Serialize)]
7748 pub struct BswapLiquidityOpsResponseItem {
7749 ///"ADD" or "REMOVE"
7750 pub operation: String,
7751 #[serde(rename = "operationId")]
7752 pub operation_id: i64,
7753 #[serde(rename = "poolId")]
7754 pub pool_id: i64,
7755 #[serde(rename = "poolName")]
7756 pub pool_name: String,
7757 #[serde(rename = "shareAmount")]
7758 pub share_amount: String,
7759 ///0: pending, 1: success, 2: failed
7760 pub status: i32,
7761 #[serde(rename = "updateTime")]
7762 pub update_time: i64,
7763 }
7764 impl From<&BswapLiquidityOpsResponseItem> for BswapLiquidityOpsResponseItem {
7765 fn from(value: &BswapLiquidityOpsResponseItem) -> Self {
7766 value.clone()
7767 }
7768 }
7769 ///BswapLiquidityRemoveResponse
7770 ///
7771 /// <details><summary>JSON schema</summary>
7772 ///
7773 /// ```json
7774 ///{
7775 /// "type": "object",
7776 /// "required": [
7777 /// "operationId"
7778 /// ],
7779 /// "properties": {
7780 /// "operationId": {
7781 /// "examples": [
7782 /// 12341
7783 /// ],
7784 /// "type": "integer",
7785 /// "format": "int64"
7786 /// }
7787 /// }
7788 ///}
7789 /// ```
7790 /// </details>
7791 #[derive(Clone, Debug, Deserialize, Serialize)]
7792 pub struct BswapLiquidityRemoveResponse {
7793 #[serde(rename = "operationId")]
7794 pub operation_id: i64,
7795 }
7796 impl From<&BswapLiquidityRemoveResponse> for BswapLiquidityRemoveResponse {
7797 fn from(value: &BswapLiquidityRemoveResponse) -> Self {
7798 value.clone()
7799 }
7800 }
7801 ///BswapLiquidityRemoveType
7802 ///
7803 /// <details><summary>JSON schema</summary>
7804 ///
7805 /// ```json
7806 ///{
7807 /// "examples": [
7808 /// "SINGLE"
7809 /// ],
7810 /// "type": "string",
7811 /// "enum": [
7812 /// "SINGLE",
7813 /// "COMBINATION"
7814 /// ]
7815 ///}
7816 /// ```
7817 /// </details>
7818 #[derive(
7819 Clone,
7820 Copy,
7821 Debug,
7822 Deserialize,
7823 Eq,
7824 Hash,
7825 Ord,
7826 PartialEq,
7827 PartialOrd,
7828 Serialize
7829 )]
7830 pub enum BswapLiquidityRemoveType {
7831 #[serde(rename = "SINGLE")]
7832 Single,
7833 #[serde(rename = "COMBINATION")]
7834 Combination,
7835 }
7836 impl From<&BswapLiquidityRemoveType> for BswapLiquidityRemoveType {
7837 fn from(value: &BswapLiquidityRemoveType) -> Self {
7838 value.clone()
7839 }
7840 }
7841 impl ToString for BswapLiquidityRemoveType {
7842 fn to_string(&self) -> String {
7843 match *self {
7844 Self::Single => "SINGLE".to_string(),
7845 Self::Combination => "COMBINATION".to_string(),
7846 }
7847 }
7848 }
7849 impl std::str::FromStr for BswapLiquidityRemoveType {
7850 type Err = self::error::ConversionError;
7851 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
7852 match value {
7853 "SINGLE" => Ok(Self::Single),
7854 "COMBINATION" => Ok(Self::Combination),
7855 _ => Err("invalid value".into()),
7856 }
7857 }
7858 }
7859 impl std::convert::TryFrom<&str> for BswapLiquidityRemoveType {
7860 type Error = self::error::ConversionError;
7861 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
7862 value.parse()
7863 }
7864 }
7865 impl std::convert::TryFrom<&String> for BswapLiquidityRemoveType {
7866 type Error = self::error::ConversionError;
7867 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
7868 value.parse()
7869 }
7870 }
7871 impl std::convert::TryFrom<String> for BswapLiquidityRemoveType {
7872 type Error = self::error::ConversionError;
7873 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
7874 value.parse()
7875 }
7876 }
7877 ///BswapLiquidityResponseItem
7878 ///
7879 /// <details><summary>JSON schema</summary>
7880 ///
7881 /// ```json
7882 ///{
7883 /// "type": "object",
7884 /// "required": [
7885 /// "liquidity",
7886 /// "poolId",
7887 /// "poolNmae",
7888 /// "share",
7889 /// "updateTime"
7890 /// ],
7891 /// "properties": {
7892 /// "liquidity": {
7893 /// "type": "object",
7894 /// "required": [
7895 /// "BUSD",
7896 /// "USDT"
7897 /// ],
7898 /// "properties": {
7899 /// "BUSD": {
7900 /// "examples": [
7901 /// 100000315.79
7902 /// ],
7903 /// "type": "number",
7904 /// "format": "double"
7905 /// },
7906 /// "USDT": {
7907 /// "examples": [
7908 /// 99999245.54
7909 /// ],
7910 /// "type": "number",
7911 /// "format": "double"
7912 /// }
7913 /// }
7914 /// },
7915 /// "poolId": {
7916 /// "examples": [
7917 /// 2
7918 /// ],
7919 /// "type": "integer",
7920 /// "format": "int64"
7921 /// },
7922 /// "poolNmae": {
7923 /// "examples": [
7924 /// "BUSD/USDT"
7925 /// ],
7926 /// "type": "string"
7927 /// },
7928 /// "share": {
7929 /// "type": "object",
7930 /// "required": [
7931 /// "asset",
7932 /// "shareAmount",
7933 /// "sharePercentage"
7934 /// ],
7935 /// "properties": {
7936 /// "asset": {
7937 /// "type": "object",
7938 /// "required": [
7939 /// "BUSD",
7940 /// "USDT"
7941 /// ],
7942 /// "properties": {
7943 /// "BUSD": {
7944 /// "examples": [
7945 /// 6207.02
7946 /// ],
7947 /// "type": "number",
7948 /// "format": "double"
7949 /// },
7950 /// "USDT": {
7951 /// "examples": [
7952 /// 6206.95
7953 /// ],
7954 /// "type": "number",
7955 /// "format": "double"
7956 /// }
7957 /// }
7958 /// },
7959 /// "shareAmount": {
7960 /// "examples": [
7961 /// 12415
7962 /// ],
7963 /// "type": "number",
7964 /// "format": "double"
7965 /// },
7966 /// "sharePercentage": {
7967 /// "examples": [
7968 /// 0.00006207
7969 /// ],
7970 /// "type": "number",
7971 /// "format": "double"
7972 /// }
7973 /// }
7974 /// },
7975 /// "updateTime": {
7976 /// "examples": [
7977 /// 1565769342148
7978 /// ],
7979 /// "type": "integer",
7980 /// "format": "int64"
7981 /// }
7982 /// }
7983 ///}
7984 /// ```
7985 /// </details>
7986 #[derive(Clone, Debug, Deserialize, Serialize)]
7987 pub struct BswapLiquidityResponseItem {
7988 pub liquidity: BswapLiquidityResponseItemLiquidity,
7989 #[serde(rename = "poolId")]
7990 pub pool_id: i64,
7991 #[serde(rename = "poolNmae")]
7992 pub pool_nmae: String,
7993 pub share: BswapLiquidityResponseItemShare,
7994 #[serde(rename = "updateTime")]
7995 pub update_time: i64,
7996 }
7997 impl From<&BswapLiquidityResponseItem> for BswapLiquidityResponseItem {
7998 fn from(value: &BswapLiquidityResponseItem) -> Self {
7999 value.clone()
8000 }
8001 }
8002 ///BswapLiquidityResponseItemLiquidity
8003 ///
8004 /// <details><summary>JSON schema</summary>
8005 ///
8006 /// ```json
8007 ///{
8008 /// "type": "object",
8009 /// "required": [
8010 /// "BUSD",
8011 /// "USDT"
8012 /// ],
8013 /// "properties": {
8014 /// "BUSD": {
8015 /// "examples": [
8016 /// 100000315.79
8017 /// ],
8018 /// "type": "number",
8019 /// "format": "double"
8020 /// },
8021 /// "USDT": {
8022 /// "examples": [
8023 /// 99999245.54
8024 /// ],
8025 /// "type": "number",
8026 /// "format": "double"
8027 /// }
8028 /// }
8029 ///}
8030 /// ```
8031 /// </details>
8032 #[derive(Clone, Debug, Deserialize, Serialize)]
8033 pub struct BswapLiquidityResponseItemLiquidity {
8034 #[serde(rename = "BUSD")]
8035 pub busd: f64,
8036 #[serde(rename = "USDT")]
8037 pub usdt: f64,
8038 }
8039 impl From<&BswapLiquidityResponseItemLiquidity>
8040 for BswapLiquidityResponseItemLiquidity {
8041 fn from(value: &BswapLiquidityResponseItemLiquidity) -> Self {
8042 value.clone()
8043 }
8044 }
8045 ///BswapLiquidityResponseItemShare
8046 ///
8047 /// <details><summary>JSON schema</summary>
8048 ///
8049 /// ```json
8050 ///{
8051 /// "type": "object",
8052 /// "required": [
8053 /// "asset",
8054 /// "shareAmount",
8055 /// "sharePercentage"
8056 /// ],
8057 /// "properties": {
8058 /// "asset": {
8059 /// "type": "object",
8060 /// "required": [
8061 /// "BUSD",
8062 /// "USDT"
8063 /// ],
8064 /// "properties": {
8065 /// "BUSD": {
8066 /// "examples": [
8067 /// 6207.02
8068 /// ],
8069 /// "type": "number",
8070 /// "format": "double"
8071 /// },
8072 /// "USDT": {
8073 /// "examples": [
8074 /// 6206.95
8075 /// ],
8076 /// "type": "number",
8077 /// "format": "double"
8078 /// }
8079 /// }
8080 /// },
8081 /// "shareAmount": {
8082 /// "examples": [
8083 /// 12415
8084 /// ],
8085 /// "type": "number",
8086 /// "format": "double"
8087 /// },
8088 /// "sharePercentage": {
8089 /// "examples": [
8090 /// 0.00006207
8091 /// ],
8092 /// "type": "number",
8093 /// "format": "double"
8094 /// }
8095 /// }
8096 ///}
8097 /// ```
8098 /// </details>
8099 #[derive(Clone, Debug, Deserialize, Serialize)]
8100 pub struct BswapLiquidityResponseItemShare {
8101 pub asset: BswapLiquidityResponseItemShareAsset,
8102 #[serde(rename = "shareAmount")]
8103 pub share_amount: f64,
8104 #[serde(rename = "sharePercentage")]
8105 pub share_percentage: f64,
8106 }
8107 impl From<&BswapLiquidityResponseItemShare> for BswapLiquidityResponseItemShare {
8108 fn from(value: &BswapLiquidityResponseItemShare) -> Self {
8109 value.clone()
8110 }
8111 }
8112 ///BswapLiquidityResponseItemShareAsset
8113 ///
8114 /// <details><summary>JSON schema</summary>
8115 ///
8116 /// ```json
8117 ///{
8118 /// "type": "object",
8119 /// "required": [
8120 /// "BUSD",
8121 /// "USDT"
8122 /// ],
8123 /// "properties": {
8124 /// "BUSD": {
8125 /// "examples": [
8126 /// 6207.02
8127 /// ],
8128 /// "type": "number",
8129 /// "format": "double"
8130 /// },
8131 /// "USDT": {
8132 /// "examples": [
8133 /// 6206.95
8134 /// ],
8135 /// "type": "number",
8136 /// "format": "double"
8137 /// }
8138 /// }
8139 ///}
8140 /// ```
8141 /// </details>
8142 #[derive(Clone, Debug, Deserialize, Serialize)]
8143 pub struct BswapLiquidityResponseItemShareAsset {
8144 #[serde(rename = "BUSD")]
8145 pub busd: f64,
8146 #[serde(rename = "USDT")]
8147 pub usdt: f64,
8148 }
8149 impl From<&BswapLiquidityResponseItemShareAsset>
8150 for BswapLiquidityResponseItemShareAsset {
8151 fn from(value: &BswapLiquidityResponseItemShareAsset) -> Self {
8152 value.clone()
8153 }
8154 }
8155 ///BswapPoolConfigureResponseItem
8156 ///
8157 /// <details><summary>JSON schema</summary>
8158 ///
8159 /// ```json
8160 ///{
8161 /// "type": "object",
8162 /// "required": [
8163 /// "assetConfigure",
8164 /// "liquidity",
8165 /// "poolId",
8166 /// "poolNmae",
8167 /// "updateTime"
8168 /// ],
8169 /// "properties": {
8170 /// "assetConfigure": {
8171 /// "type": "object",
8172 /// "required": [
8173 /// "BUSD",
8174 /// "USDT"
8175 /// ],
8176 /// "properties": {
8177 /// "BUSD": {
8178 /// "type": "object",
8179 /// "required": [
8180 /// "maxAdd",
8181 /// "maxSwap",
8182 /// "minAdd",
8183 /// "minSwap"
8184 /// ],
8185 /// "properties": {
8186 /// "maxAdd": {
8187 /// "examples": [
8188 /// 20
8189 /// ],
8190 /// "type": "integer",
8191 /// "format": "int64"
8192 /// },
8193 /// "maxSwap": {
8194 /// "examples": [
8195 /// 30
8196 /// ],
8197 /// "type": "integer",
8198 /// "format": "int64"
8199 /// },
8200 /// "minAdd": {
8201 /// "examples": [
8202 /// 10
8203 /// ],
8204 /// "type": "integer",
8205 /// "format": "int64"
8206 /// },
8207 /// "minSwap": {
8208 /// "examples": [
8209 /// 10
8210 /// ],
8211 /// "type": "integer",
8212 /// "format": "int64"
8213 /// }
8214 /// }
8215 /// },
8216 /// "USDT": {
8217 /// "type": "object",
8218 /// "required": [
8219 /// "maxAdd",
8220 /// "maxSwap",
8221 /// "minAdd",
8222 /// "minSwap"
8223 /// ],
8224 /// "properties": {
8225 /// "maxAdd": {
8226 /// "examples": [
8227 /// 20
8228 /// ],
8229 /// "type": "integer",
8230 /// "format": "int64"
8231 /// },
8232 /// "maxSwap": {
8233 /// "examples": [
8234 /// 30
8235 /// ],
8236 /// "type": "integer",
8237 /// "format": "int64"
8238 /// },
8239 /// "minAdd": {
8240 /// "examples": [
8241 /// 10
8242 /// ],
8243 /// "type": "integer",
8244 /// "format": "int64"
8245 /// },
8246 /// "minSwap": {
8247 /// "examples": [
8248 /// 10
8249 /// ],
8250 /// "type": "integer",
8251 /// "format": "int64"
8252 /// }
8253 /// }
8254 /// }
8255 /// }
8256 /// },
8257 /// "liquidity": {
8258 /// "type": "object",
8259 /// "required": [
8260 /// "constantA",
8261 /// "minRedeemShare",
8262 /// "slippageTolerance"
8263 /// ],
8264 /// "properties": {
8265 /// "constantA": {
8266 /// "description": "\"NA\" if pool is an innovation pool",
8267 /// "examples": [
8268 /// 2000
8269 /// ],
8270 /// "type": "integer",
8271 /// "format": "int64"
8272 /// },
8273 /// "minRedeemShare": {
8274 /// "examples": [
8275 /// 0.1
8276 /// ],
8277 /// "type": "number",
8278 /// "format": "double"
8279 /// },
8280 /// "slippageTolerance": {
8281 /// "description": "The swap proceeds only when the slippage is within the set range",
8282 /// "examples": [
8283 /// 0.2
8284 /// ],
8285 /// "type": "number",
8286 /// "format": "double"
8287 /// }
8288 /// }
8289 /// },
8290 /// "poolId": {
8291 /// "examples": [
8292 /// 2
8293 /// ],
8294 /// "type": "integer",
8295 /// "format": "int64"
8296 /// },
8297 /// "poolNmae": {
8298 /// "examples": [
8299 /// "BUSD/USDT"
8300 /// ],
8301 /// "type": "string"
8302 /// },
8303 /// "updateTime": {
8304 /// "examples": [
8305 /// 1565769342148
8306 /// ],
8307 /// "type": "integer",
8308 /// "format": "int64"
8309 /// }
8310 /// }
8311 ///}
8312 /// ```
8313 /// </details>
8314 #[derive(Clone, Debug, Deserialize, Serialize)]
8315 pub struct BswapPoolConfigureResponseItem {
8316 #[serde(rename = "assetConfigure")]
8317 pub asset_configure: BswapPoolConfigureResponseItemAssetConfigure,
8318 pub liquidity: BswapPoolConfigureResponseItemLiquidity,
8319 #[serde(rename = "poolId")]
8320 pub pool_id: i64,
8321 #[serde(rename = "poolNmae")]
8322 pub pool_nmae: String,
8323 #[serde(rename = "updateTime")]
8324 pub update_time: i64,
8325 }
8326 impl From<&BswapPoolConfigureResponseItem> for BswapPoolConfigureResponseItem {
8327 fn from(value: &BswapPoolConfigureResponseItem) -> Self {
8328 value.clone()
8329 }
8330 }
8331 ///BswapPoolConfigureResponseItemAssetConfigure
8332 ///
8333 /// <details><summary>JSON schema</summary>
8334 ///
8335 /// ```json
8336 ///{
8337 /// "type": "object",
8338 /// "required": [
8339 /// "BUSD",
8340 /// "USDT"
8341 /// ],
8342 /// "properties": {
8343 /// "BUSD": {
8344 /// "type": "object",
8345 /// "required": [
8346 /// "maxAdd",
8347 /// "maxSwap",
8348 /// "minAdd",
8349 /// "minSwap"
8350 /// ],
8351 /// "properties": {
8352 /// "maxAdd": {
8353 /// "examples": [
8354 /// 20
8355 /// ],
8356 /// "type": "integer",
8357 /// "format": "int64"
8358 /// },
8359 /// "maxSwap": {
8360 /// "examples": [
8361 /// 30
8362 /// ],
8363 /// "type": "integer",
8364 /// "format": "int64"
8365 /// },
8366 /// "minAdd": {
8367 /// "examples": [
8368 /// 10
8369 /// ],
8370 /// "type": "integer",
8371 /// "format": "int64"
8372 /// },
8373 /// "minSwap": {
8374 /// "examples": [
8375 /// 10
8376 /// ],
8377 /// "type": "integer",
8378 /// "format": "int64"
8379 /// }
8380 /// }
8381 /// },
8382 /// "USDT": {
8383 /// "type": "object",
8384 /// "required": [
8385 /// "maxAdd",
8386 /// "maxSwap",
8387 /// "minAdd",
8388 /// "minSwap"
8389 /// ],
8390 /// "properties": {
8391 /// "maxAdd": {
8392 /// "examples": [
8393 /// 20
8394 /// ],
8395 /// "type": "integer",
8396 /// "format": "int64"
8397 /// },
8398 /// "maxSwap": {
8399 /// "examples": [
8400 /// 30
8401 /// ],
8402 /// "type": "integer",
8403 /// "format": "int64"
8404 /// },
8405 /// "minAdd": {
8406 /// "examples": [
8407 /// 10
8408 /// ],
8409 /// "type": "integer",
8410 /// "format": "int64"
8411 /// },
8412 /// "minSwap": {
8413 /// "examples": [
8414 /// 10
8415 /// ],
8416 /// "type": "integer",
8417 /// "format": "int64"
8418 /// }
8419 /// }
8420 /// }
8421 /// }
8422 ///}
8423 /// ```
8424 /// </details>
8425 #[derive(Clone, Debug, Deserialize, Serialize)]
8426 pub struct BswapPoolConfigureResponseItemAssetConfigure {
8427 #[serde(rename = "BUSD")]
8428 pub busd: BswapPoolConfigureResponseItemAssetConfigureBusd,
8429 #[serde(rename = "USDT")]
8430 pub usdt: BswapPoolConfigureResponseItemAssetConfigureUsdt,
8431 }
8432 impl From<&BswapPoolConfigureResponseItemAssetConfigure>
8433 for BswapPoolConfigureResponseItemAssetConfigure {
8434 fn from(value: &BswapPoolConfigureResponseItemAssetConfigure) -> Self {
8435 value.clone()
8436 }
8437 }
8438 ///BswapPoolConfigureResponseItemAssetConfigureBusd
8439 ///
8440 /// <details><summary>JSON schema</summary>
8441 ///
8442 /// ```json
8443 ///{
8444 /// "type": "object",
8445 /// "required": [
8446 /// "maxAdd",
8447 /// "maxSwap",
8448 /// "minAdd",
8449 /// "minSwap"
8450 /// ],
8451 /// "properties": {
8452 /// "maxAdd": {
8453 /// "examples": [
8454 /// 20
8455 /// ],
8456 /// "type": "integer",
8457 /// "format": "int64"
8458 /// },
8459 /// "maxSwap": {
8460 /// "examples": [
8461 /// 30
8462 /// ],
8463 /// "type": "integer",
8464 /// "format": "int64"
8465 /// },
8466 /// "minAdd": {
8467 /// "examples": [
8468 /// 10
8469 /// ],
8470 /// "type": "integer",
8471 /// "format": "int64"
8472 /// },
8473 /// "minSwap": {
8474 /// "examples": [
8475 /// 10
8476 /// ],
8477 /// "type": "integer",
8478 /// "format": "int64"
8479 /// }
8480 /// }
8481 ///}
8482 /// ```
8483 /// </details>
8484 #[derive(Clone, Debug, Deserialize, Serialize)]
8485 pub struct BswapPoolConfigureResponseItemAssetConfigureBusd {
8486 #[serde(rename = "maxAdd")]
8487 pub max_add: i64,
8488 #[serde(rename = "maxSwap")]
8489 pub max_swap: i64,
8490 #[serde(rename = "minAdd")]
8491 pub min_add: i64,
8492 #[serde(rename = "minSwap")]
8493 pub min_swap: i64,
8494 }
8495 impl From<&BswapPoolConfigureResponseItemAssetConfigureBusd>
8496 for BswapPoolConfigureResponseItemAssetConfigureBusd {
8497 fn from(value: &BswapPoolConfigureResponseItemAssetConfigureBusd) -> Self {
8498 value.clone()
8499 }
8500 }
8501 ///BswapPoolConfigureResponseItemAssetConfigureUsdt
8502 ///
8503 /// <details><summary>JSON schema</summary>
8504 ///
8505 /// ```json
8506 ///{
8507 /// "type": "object",
8508 /// "required": [
8509 /// "maxAdd",
8510 /// "maxSwap",
8511 /// "minAdd",
8512 /// "minSwap"
8513 /// ],
8514 /// "properties": {
8515 /// "maxAdd": {
8516 /// "examples": [
8517 /// 20
8518 /// ],
8519 /// "type": "integer",
8520 /// "format": "int64"
8521 /// },
8522 /// "maxSwap": {
8523 /// "examples": [
8524 /// 30
8525 /// ],
8526 /// "type": "integer",
8527 /// "format": "int64"
8528 /// },
8529 /// "minAdd": {
8530 /// "examples": [
8531 /// 10
8532 /// ],
8533 /// "type": "integer",
8534 /// "format": "int64"
8535 /// },
8536 /// "minSwap": {
8537 /// "examples": [
8538 /// 10
8539 /// ],
8540 /// "type": "integer",
8541 /// "format": "int64"
8542 /// }
8543 /// }
8544 ///}
8545 /// ```
8546 /// </details>
8547 #[derive(Clone, Debug, Deserialize, Serialize)]
8548 pub struct BswapPoolConfigureResponseItemAssetConfigureUsdt {
8549 #[serde(rename = "maxAdd")]
8550 pub max_add: i64,
8551 #[serde(rename = "maxSwap")]
8552 pub max_swap: i64,
8553 #[serde(rename = "minAdd")]
8554 pub min_add: i64,
8555 #[serde(rename = "minSwap")]
8556 pub min_swap: i64,
8557 }
8558 impl From<&BswapPoolConfigureResponseItemAssetConfigureUsdt>
8559 for BswapPoolConfigureResponseItemAssetConfigureUsdt {
8560 fn from(value: &BswapPoolConfigureResponseItemAssetConfigureUsdt) -> Self {
8561 value.clone()
8562 }
8563 }
8564 ///BswapPoolConfigureResponseItemLiquidity
8565 ///
8566 /// <details><summary>JSON schema</summary>
8567 ///
8568 /// ```json
8569 ///{
8570 /// "type": "object",
8571 /// "required": [
8572 /// "constantA",
8573 /// "minRedeemShare",
8574 /// "slippageTolerance"
8575 /// ],
8576 /// "properties": {
8577 /// "constantA": {
8578 /// "description": "\"NA\" if pool is an innovation pool",
8579 /// "examples": [
8580 /// 2000
8581 /// ],
8582 /// "type": "integer",
8583 /// "format": "int64"
8584 /// },
8585 /// "minRedeemShare": {
8586 /// "examples": [
8587 /// 0.1
8588 /// ],
8589 /// "type": "number",
8590 /// "format": "double"
8591 /// },
8592 /// "slippageTolerance": {
8593 /// "description": "The swap proceeds only when the slippage is within the set range",
8594 /// "examples": [
8595 /// 0.2
8596 /// ],
8597 /// "type": "number",
8598 /// "format": "double"
8599 /// }
8600 /// }
8601 ///}
8602 /// ```
8603 /// </details>
8604 #[derive(Clone, Debug, Deserialize, Serialize)]
8605 pub struct BswapPoolConfigureResponseItemLiquidity {
8606 ///"NA" if pool is an innovation pool
8607 #[serde(rename = "constantA")]
8608 pub constant_a: i64,
8609 #[serde(rename = "minRedeemShare")]
8610 pub min_redeem_share: f64,
8611 #[serde(rename = "slippageTolerance")]
8612 pub slippage_tolerance: f64,
8613 }
8614 impl From<&BswapPoolConfigureResponseItemLiquidity>
8615 for BswapPoolConfigureResponseItemLiquidity {
8616 fn from(value: &BswapPoolConfigureResponseItemLiquidity) -> Self {
8617 value.clone()
8618 }
8619 }
8620 ///BswapPoolsResponseItem
8621 ///
8622 /// <details><summary>JSON schema</summary>
8623 ///
8624 /// ```json
8625 ///{
8626 /// "type": "object",
8627 /// "required": [
8628 /// "assets",
8629 /// "poolId",
8630 /// "poolName"
8631 /// ],
8632 /// "properties": {
8633 /// "assets": {
8634 /// "examples": [
8635 /// [
8636 /// "BUSD",
8637 /// "USDT"
8638 /// ]
8639 /// ],
8640 /// "type": "array",
8641 /// "items": {
8642 /// "type": "string",
8643 /// "maxItems": 2,
8644 /// "minItems": 2
8645 /// }
8646 /// },
8647 /// "poolId": {
8648 /// "examples": [
8649 /// 2
8650 /// ],
8651 /// "type": "integer",
8652 /// "format": "int64"
8653 /// },
8654 /// "poolName": {
8655 /// "examples": [
8656 /// "BUSD/USDT"
8657 /// ],
8658 /// "type": "string"
8659 /// }
8660 /// }
8661 ///}
8662 /// ```
8663 /// </details>
8664 #[derive(Clone, Debug, Deserialize, Serialize)]
8665 pub struct BswapPoolsResponseItem {
8666 pub assets: Vec<String>,
8667 #[serde(rename = "poolId")]
8668 pub pool_id: i64,
8669 #[serde(rename = "poolName")]
8670 pub pool_name: String,
8671 }
8672 impl From<&BswapPoolsResponseItem> for BswapPoolsResponseItem {
8673 fn from(value: &BswapPoolsResponseItem) -> Self {
8674 value.clone()
8675 }
8676 }
8677 ///BswapQuoteResponse
8678 ///
8679 /// <details><summary>JSON schema</summary>
8680 ///
8681 /// ```json
8682 ///{
8683 /// "type": "object",
8684 /// "required": [
8685 /// "baseAsset",
8686 /// "baseQty",
8687 /// "fee",
8688 /// "price",
8689 /// "quoteAsset",
8690 /// "quoteQty",
8691 /// "slippage"
8692 /// ],
8693 /// "properties": {
8694 /// "baseAsset": {
8695 /// "examples": [
8696 /// "BUSD"
8697 /// ],
8698 /// "type": "string"
8699 /// },
8700 /// "baseQty": {
8701 /// "examples": [
8702 /// 299975
8703 /// ],
8704 /// "type": "number",
8705 /// "format": "double"
8706 /// },
8707 /// "fee": {
8708 /// "examples": [
8709 /// 120
8710 /// ],
8711 /// "type": "number",
8712 /// "format": "double"
8713 /// },
8714 /// "price": {
8715 /// "examples": [
8716 /// 1.00008334
8717 /// ],
8718 /// "type": "number",
8719 /// "format": "double"
8720 /// },
8721 /// "quoteAsset": {
8722 /// "examples": [
8723 /// "USDT"
8724 /// ],
8725 /// "type": "string"
8726 /// },
8727 /// "quoteQty": {
8728 /// "examples": [
8729 /// 300000
8730 /// ],
8731 /// "type": "number",
8732 /// "format": "double"
8733 /// },
8734 /// "slippage": {
8735 /// "examples": [
8736 /// 0.00007245
8737 /// ],
8738 /// "type": "number",
8739 /// "format": "double"
8740 /// }
8741 /// }
8742 ///}
8743 /// ```
8744 /// </details>
8745 #[derive(Clone, Debug, Deserialize, Serialize)]
8746 pub struct BswapQuoteResponse {
8747 #[serde(rename = "baseAsset")]
8748 pub base_asset: String,
8749 #[serde(rename = "baseQty")]
8750 pub base_qty: f64,
8751 pub fee: f64,
8752 pub price: f64,
8753 #[serde(rename = "quoteAsset")]
8754 pub quote_asset: String,
8755 #[serde(rename = "quoteQty")]
8756 pub quote_qty: f64,
8757 pub slippage: f64,
8758 }
8759 impl From<&BswapQuoteResponse> for BswapQuoteResponse {
8760 fn from(value: &BswapQuoteResponse) -> Self {
8761 value.clone()
8762 }
8763 }
8764 ///BswapRemoveLiquidityPreviewResponse
8765 ///
8766 /// <details><summary>JSON schema</summary>
8767 ///
8768 /// ```json
8769 ///{
8770 /// "oneOf": [
8771 /// {
8772 /// "$ref": "#/components/schemas/bswapRmvLiquidityPreviewCombination"
8773 /// },
8774 /// {
8775 /// "$ref": "#/components/schemas/bswapRmvLiquidityPreviewSingle"
8776 /// }
8777 /// ]
8778 ///}
8779 /// ```
8780 /// </details>
8781 #[derive(Clone, Debug, Deserialize, Serialize)]
8782 #[serde(untagged)]
8783 pub enum BswapRemoveLiquidityPreviewResponse {
8784 Combination(BswapRmvLiquidityPreviewCombination),
8785 Single(BswapRmvLiquidityPreviewSingle),
8786 }
8787 impl From<&BswapRemoveLiquidityPreviewResponse>
8788 for BswapRemoveLiquidityPreviewResponse {
8789 fn from(value: &BswapRemoveLiquidityPreviewResponse) -> Self {
8790 value.clone()
8791 }
8792 }
8793 impl From<BswapRmvLiquidityPreviewCombination>
8794 for BswapRemoveLiquidityPreviewResponse {
8795 fn from(value: BswapRmvLiquidityPreviewCombination) -> Self {
8796 Self::Combination(value)
8797 }
8798 }
8799 impl From<BswapRmvLiquidityPreviewSingle> for BswapRemoveLiquidityPreviewResponse {
8800 fn from(value: BswapRmvLiquidityPreviewSingle) -> Self {
8801 Self::Single(value)
8802 }
8803 }
8804 ///BswapRemoveLiquidityPreviewType
8805 ///
8806 /// <details><summary>JSON schema</summary>
8807 ///
8808 /// ```json
8809 ///{
8810 /// "examples": [
8811 /// "SINGLE"
8812 /// ],
8813 /// "type": "string",
8814 /// "enum": [
8815 /// "SINGLE",
8816 /// "COMBINATION"
8817 /// ]
8818 ///}
8819 /// ```
8820 /// </details>
8821 #[derive(
8822 Clone,
8823 Copy,
8824 Debug,
8825 Deserialize,
8826 Eq,
8827 Hash,
8828 Ord,
8829 PartialEq,
8830 PartialOrd,
8831 Serialize
8832 )]
8833 pub enum BswapRemoveLiquidityPreviewType {
8834 #[serde(rename = "SINGLE")]
8835 Single,
8836 #[serde(rename = "COMBINATION")]
8837 Combination,
8838 }
8839 impl From<&BswapRemoveLiquidityPreviewType> for BswapRemoveLiquidityPreviewType {
8840 fn from(value: &BswapRemoveLiquidityPreviewType) -> Self {
8841 value.clone()
8842 }
8843 }
8844 impl ToString for BswapRemoveLiquidityPreviewType {
8845 fn to_string(&self) -> String {
8846 match *self {
8847 Self::Single => "SINGLE".to_string(),
8848 Self::Combination => "COMBINATION".to_string(),
8849 }
8850 }
8851 }
8852 impl std::str::FromStr for BswapRemoveLiquidityPreviewType {
8853 type Err = self::error::ConversionError;
8854 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
8855 match value {
8856 "SINGLE" => Ok(Self::Single),
8857 "COMBINATION" => Ok(Self::Combination),
8858 _ => Err("invalid value".into()),
8859 }
8860 }
8861 }
8862 impl std::convert::TryFrom<&str> for BswapRemoveLiquidityPreviewType {
8863 type Error = self::error::ConversionError;
8864 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
8865 value.parse()
8866 }
8867 }
8868 impl std::convert::TryFrom<&String> for BswapRemoveLiquidityPreviewType {
8869 type Error = self::error::ConversionError;
8870 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
8871 value.parse()
8872 }
8873 }
8874 impl std::convert::TryFrom<String> for BswapRemoveLiquidityPreviewType {
8875 type Error = self::error::ConversionError;
8876 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
8877 value.parse()
8878 }
8879 }
8880 ///BswapRmvLiquidityPreviewCombination
8881 ///
8882 /// <details><summary>JSON schema</summary>
8883 ///
8884 /// ```json
8885 ///{
8886 /// "type": "object",
8887 /// "required": [
8888 /// "baseAmt",
8889 /// "baseAsset",
8890 /// "price",
8891 /// "quoteAmt",
8892 /// "quoteAsset"
8893 /// ],
8894 /// "properties": {
8895 /// "baseAmt": {
8896 /// "examples": [
8897 /// 299975
8898 /// ],
8899 /// "type": "integer",
8900 /// "format": "int64"
8901 /// },
8902 /// "baseAsset": {
8903 /// "examples": [
8904 /// "BUSD"
8905 /// ],
8906 /// "type": "string"
8907 /// },
8908 /// "price": {
8909 /// "examples": [
8910 /// 1.00008334
8911 /// ],
8912 /// "type": "number",
8913 /// "format": "double"
8914 /// },
8915 /// "quoteAmt": {
8916 /// "examples": [
8917 /// 300000
8918 /// ],
8919 /// "type": "integer",
8920 /// "format": "int64"
8921 /// },
8922 /// "quoteAsset": {
8923 /// "examples": [
8924 /// "USDT"
8925 /// ],
8926 /// "type": "string"
8927 /// }
8928 /// }
8929 ///}
8930 /// ```
8931 /// </details>
8932 #[derive(Clone, Debug, Deserialize, Serialize)]
8933 pub struct BswapRmvLiquidityPreviewCombination {
8934 #[serde(rename = "baseAmt")]
8935 pub base_amt: i64,
8936 #[serde(rename = "baseAsset")]
8937 pub base_asset: String,
8938 pub price: f64,
8939 #[serde(rename = "quoteAmt")]
8940 pub quote_amt: i64,
8941 #[serde(rename = "quoteAsset")]
8942 pub quote_asset: String,
8943 }
8944 impl From<&BswapRmvLiquidityPreviewCombination>
8945 for BswapRmvLiquidityPreviewCombination {
8946 fn from(value: &BswapRmvLiquidityPreviewCombination) -> Self {
8947 value.clone()
8948 }
8949 }
8950 ///BswapRmvLiquidityPreviewSingle
8951 ///
8952 /// <details><summary>JSON schema</summary>
8953 ///
8954 /// ```json
8955 ///{
8956 /// "type": "object",
8957 /// "required": [
8958 /// "fee",
8959 /// "price",
8960 /// "quoteAmt",
8961 /// "quoteAsset",
8962 /// "slippage"
8963 /// ],
8964 /// "properties": {
8965 /// "fee": {
8966 /// "examples": [
8967 /// 120
8968 /// ],
8969 /// "type": "number",
8970 /// "format": "double"
8971 /// },
8972 /// "price": {
8973 /// "examples": [
8974 /// 1.00008334
8975 /// ],
8976 /// "type": "number",
8977 /// "format": "double"
8978 /// },
8979 /// "quoteAmt": {
8980 /// "examples": [
8981 /// 300000
8982 /// ],
8983 /// "type": "integer",
8984 /// "format": "int64"
8985 /// },
8986 /// "quoteAsset": {
8987 /// "examples": [
8988 /// "USDT"
8989 /// ],
8990 /// "type": "string"
8991 /// },
8992 /// "slippage": {
8993 /// "examples": [
8994 /// 0.00007245
8995 /// ],
8996 /// "type": "number",
8997 /// "format": "double"
8998 /// }
8999 /// }
9000 ///}
9001 /// ```
9002 /// </details>
9003 #[derive(Clone, Debug, Deserialize, Serialize)]
9004 pub struct BswapRmvLiquidityPreviewSingle {
9005 pub fee: f64,
9006 pub price: f64,
9007 #[serde(rename = "quoteAmt")]
9008 pub quote_amt: i64,
9009 #[serde(rename = "quoteAsset")]
9010 pub quote_asset: String,
9011 pub slippage: f64,
9012 }
9013 impl From<&BswapRmvLiquidityPreviewSingle> for BswapRmvLiquidityPreviewSingle {
9014 fn from(value: &BswapRmvLiquidityPreviewSingle) -> Self {
9015 value.clone()
9016 }
9017 }
9018 ///BswapSwapResponse
9019 ///
9020 /// <details><summary>JSON schema</summary>
9021 ///
9022 /// ```json
9023 ///{
9024 /// "type": "object",
9025 /// "required": [
9026 /// "swapId"
9027 /// ],
9028 /// "properties": {
9029 /// "swapId": {
9030 /// "examples": [
9031 /// 2314
9032 /// ],
9033 /// "type": "integer",
9034 /// "format": "int64"
9035 /// }
9036 /// }
9037 ///}
9038 /// ```
9039 /// </details>
9040 #[derive(Clone, Debug, Deserialize, Serialize)]
9041 pub struct BswapSwapResponse {
9042 #[serde(rename = "swapId")]
9043 pub swap_id: i64,
9044 }
9045 impl From<&BswapSwapResponse> for BswapSwapResponse {
9046 fn from(value: &BswapSwapResponse) -> Self {
9047 value.clone()
9048 }
9049 }
9050 ///BswapUnclaimedRewardsResponse
9051 ///
9052 /// <details><summary>JSON schema</summary>
9053 ///
9054 /// ```json
9055 ///{
9056 /// "type": "object",
9057 /// "required": [
9058 /// "details",
9059 /// "totalUnclaimedRewards"
9060 /// ],
9061 /// "properties": {
9062 /// "details": {
9063 /// "type": "object",
9064 /// "required": [
9065 /// "BNB/BTC",
9066 /// "BNB/USDT"
9067 /// ],
9068 /// "properties": {
9069 /// "BNB/BTC": {
9070 /// "type": "object",
9071 /// "required": [
9072 /// "BNB"
9073 /// ],
9074 /// "properties": {
9075 /// "BNB": {
9076 /// "examples": [
9077 /// 1e-8
9078 /// ],
9079 /// "type": "number",
9080 /// "format": "double"
9081 /// }
9082 /// }
9083 /// },
9084 /// "BNB/USDT": {
9085 /// "type": "object",
9086 /// "required": [
9087 /// "BUSD",
9088 /// "USDT"
9089 /// ],
9090 /// "properties": {
9091 /// "BUSD": {
9092 /// "examples": [
9093 /// 100000315.79
9094 /// ],
9095 /// "type": "number",
9096 /// "format": "float"
9097 /// },
9098 /// "USDT": {
9099 /// "examples": [
9100 /// 2e-8
9101 /// ],
9102 /// "type": "number",
9103 /// "format": "double"
9104 /// }
9105 /// }
9106 /// }
9107 /// }
9108 /// },
9109 /// "totalUnclaimedRewards": {
9110 /// "type": "object",
9111 /// "required": [
9112 /// "BNB",
9113 /// "BUSD",
9114 /// "USDT"
9115 /// ],
9116 /// "properties": {
9117 /// "BNB": {
9118 /// "examples": [
9119 /// 1e-8
9120 /// ],
9121 /// "type": "number",
9122 /// "format": "double"
9123 /// },
9124 /// "BUSD": {
9125 /// "examples": [
9126 /// 100000315.79
9127 /// ],
9128 /// "type": "number",
9129 /// "format": "float"
9130 /// },
9131 /// "USDT": {
9132 /// "examples": [
9133 /// 2e-8
9134 /// ],
9135 /// "type": "number",
9136 /// "format": "double"
9137 /// }
9138 /// }
9139 /// }
9140 /// }
9141 ///}
9142 /// ```
9143 /// </details>
9144 #[derive(Clone, Debug, Deserialize, Serialize)]
9145 pub struct BswapUnclaimedRewardsResponse {
9146 pub details: BswapUnclaimedRewardsResponseDetails,
9147 #[serde(rename = "totalUnclaimedRewards")]
9148 pub total_unclaimed_rewards: BswapUnclaimedRewardsResponseTotalUnclaimedRewards,
9149 }
9150 impl From<&BswapUnclaimedRewardsResponse> for BswapUnclaimedRewardsResponse {
9151 fn from(value: &BswapUnclaimedRewardsResponse) -> Self {
9152 value.clone()
9153 }
9154 }
9155 ///BswapUnclaimedRewardsResponseDetails
9156 ///
9157 /// <details><summary>JSON schema</summary>
9158 ///
9159 /// ```json
9160 ///{
9161 /// "type": "object",
9162 /// "required": [
9163 /// "BNB/BTC",
9164 /// "BNB/USDT"
9165 /// ],
9166 /// "properties": {
9167 /// "BNB/BTC": {
9168 /// "type": "object",
9169 /// "required": [
9170 /// "BNB"
9171 /// ],
9172 /// "properties": {
9173 /// "BNB": {
9174 /// "examples": [
9175 /// 1e-8
9176 /// ],
9177 /// "type": "number",
9178 /// "format": "double"
9179 /// }
9180 /// }
9181 /// },
9182 /// "BNB/USDT": {
9183 /// "type": "object",
9184 /// "required": [
9185 /// "BUSD",
9186 /// "USDT"
9187 /// ],
9188 /// "properties": {
9189 /// "BUSD": {
9190 /// "examples": [
9191 /// 100000315.79
9192 /// ],
9193 /// "type": "number",
9194 /// "format": "float"
9195 /// },
9196 /// "USDT": {
9197 /// "examples": [
9198 /// 2e-8
9199 /// ],
9200 /// "type": "number",
9201 /// "format": "double"
9202 /// }
9203 /// }
9204 /// }
9205 /// }
9206 ///}
9207 /// ```
9208 /// </details>
9209 #[derive(Clone, Debug, Deserialize, Serialize)]
9210 pub struct BswapUnclaimedRewardsResponseDetails {
9211 #[serde(rename = "BNB/BTC")]
9212 pub bnb_btc: BswapUnclaimedRewardsResponseDetailsBnbBtc,
9213 #[serde(rename = "BNB/USDT")]
9214 pub bnb_usdt: BswapUnclaimedRewardsResponseDetailsBnbUsdt,
9215 }
9216 impl From<&BswapUnclaimedRewardsResponseDetails>
9217 for BswapUnclaimedRewardsResponseDetails {
9218 fn from(value: &BswapUnclaimedRewardsResponseDetails) -> Self {
9219 value.clone()
9220 }
9221 }
9222 ///BswapUnclaimedRewardsResponseDetailsBnbBtc
9223 ///
9224 /// <details><summary>JSON schema</summary>
9225 ///
9226 /// ```json
9227 ///{
9228 /// "type": "object",
9229 /// "required": [
9230 /// "BNB"
9231 /// ],
9232 /// "properties": {
9233 /// "BNB": {
9234 /// "examples": [
9235 /// 1e-8
9236 /// ],
9237 /// "type": "number",
9238 /// "format": "double"
9239 /// }
9240 /// }
9241 ///}
9242 /// ```
9243 /// </details>
9244 #[derive(Clone, Debug, Deserialize, Serialize)]
9245 pub struct BswapUnclaimedRewardsResponseDetailsBnbBtc {
9246 #[serde(rename = "BNB")]
9247 pub bnb: f64,
9248 }
9249 impl From<&BswapUnclaimedRewardsResponseDetailsBnbBtc>
9250 for BswapUnclaimedRewardsResponseDetailsBnbBtc {
9251 fn from(value: &BswapUnclaimedRewardsResponseDetailsBnbBtc) -> Self {
9252 value.clone()
9253 }
9254 }
9255 ///BswapUnclaimedRewardsResponseDetailsBnbUsdt
9256 ///
9257 /// <details><summary>JSON schema</summary>
9258 ///
9259 /// ```json
9260 ///{
9261 /// "type": "object",
9262 /// "required": [
9263 /// "BUSD",
9264 /// "USDT"
9265 /// ],
9266 /// "properties": {
9267 /// "BUSD": {
9268 /// "examples": [
9269 /// 100000315.79
9270 /// ],
9271 /// "type": "number",
9272 /// "format": "float"
9273 /// },
9274 /// "USDT": {
9275 /// "examples": [
9276 /// 2e-8
9277 /// ],
9278 /// "type": "number",
9279 /// "format": "double"
9280 /// }
9281 /// }
9282 ///}
9283 /// ```
9284 /// </details>
9285 #[derive(Clone, Debug, Deserialize, Serialize)]
9286 pub struct BswapUnclaimedRewardsResponseDetailsBnbUsdt {
9287 #[serde(rename = "BUSD")]
9288 pub busd: f32,
9289 #[serde(rename = "USDT")]
9290 pub usdt: f64,
9291 }
9292 impl From<&BswapUnclaimedRewardsResponseDetailsBnbUsdt>
9293 for BswapUnclaimedRewardsResponseDetailsBnbUsdt {
9294 fn from(value: &BswapUnclaimedRewardsResponseDetailsBnbUsdt) -> Self {
9295 value.clone()
9296 }
9297 }
9298 ///BswapUnclaimedRewardsResponseTotalUnclaimedRewards
9299 ///
9300 /// <details><summary>JSON schema</summary>
9301 ///
9302 /// ```json
9303 ///{
9304 /// "type": "object",
9305 /// "required": [
9306 /// "BNB",
9307 /// "BUSD",
9308 /// "USDT"
9309 /// ],
9310 /// "properties": {
9311 /// "BNB": {
9312 /// "examples": [
9313 /// 1e-8
9314 /// ],
9315 /// "type": "number",
9316 /// "format": "double"
9317 /// },
9318 /// "BUSD": {
9319 /// "examples": [
9320 /// 100000315.79
9321 /// ],
9322 /// "type": "number",
9323 /// "format": "float"
9324 /// },
9325 /// "USDT": {
9326 /// "examples": [
9327 /// 2e-8
9328 /// ],
9329 /// "type": "number",
9330 /// "format": "double"
9331 /// }
9332 /// }
9333 ///}
9334 /// ```
9335 /// </details>
9336 #[derive(Clone, Debug, Deserialize, Serialize)]
9337 pub struct BswapUnclaimedRewardsResponseTotalUnclaimedRewards {
9338 #[serde(rename = "BNB")]
9339 pub bnb: f64,
9340 #[serde(rename = "BUSD")]
9341 pub busd: f32,
9342 #[serde(rename = "USDT")]
9343 pub usdt: f64,
9344 }
9345 impl From<&BswapUnclaimedRewardsResponseTotalUnclaimedRewards>
9346 for BswapUnclaimedRewardsResponseTotalUnclaimedRewards {
9347 fn from(value: &BswapUnclaimedRewardsResponseTotalUnclaimedRewards) -> Self {
9348 value.clone()
9349 }
9350 }
9351 ///C2cOrderMatchListUserOrderHistoryResponse
9352 ///
9353 /// <details><summary>JSON schema</summary>
9354 ///
9355 /// ```json
9356 ///{
9357 /// "type": "object",
9358 /// "required": [
9359 /// "code",
9360 /// "data",
9361 /// "message",
9362 /// "success",
9363 /// "total"
9364 /// ],
9365 /// "properties": {
9366 /// "code": {
9367 /// "examples": [
9368 /// "000000"
9369 /// ],
9370 /// "type": "string"
9371 /// },
9372 /// "data": {
9373 /// "type": "array",
9374 /// "items": {
9375 /// "type": "object",
9376 /// "required": [
9377 /// "advNo",
9378 /// "advertisementRole",
9379 /// "amount",
9380 /// "asset",
9381 /// "commission",
9382 /// "counterPartNickName",
9383 /// "createTime",
9384 /// "fiat",
9385 /// "fiatSymbol",
9386 /// "orderNumber",
9387 /// "orderStatus",
9388 /// "totalPrice",
9389 /// "tradeType",
9390 /// "unitPrice"
9391 /// ],
9392 /// "properties": {
9393 /// "advNo": {
9394 /// "examples": [
9395 /// "11218246497340923904"
9396 /// ],
9397 /// "type": "string"
9398 /// },
9399 /// "advertisementRole": {
9400 /// "examples": [
9401 /// "TAKER"
9402 /// ],
9403 /// "type": "string"
9404 /// },
9405 /// "amount": {
9406 /// "description": "Quantity (in Crypto)",
9407 /// "examples": [
9408 /// "5000.00000000"
9409 /// ],
9410 /// "type": "string"
9411 /// },
9412 /// "asset": {
9413 /// "examples": [
9414 /// "BUSD"
9415 /// ],
9416 /// "type": "string"
9417 /// },
9418 /// "commission": {
9419 /// "description": "Transaction Fee (in Crypto)",
9420 /// "examples": [
9421 /// "0"
9422 /// ],
9423 /// "type": "string"
9424 /// },
9425 /// "counterPartNickName": {
9426 /// "examples": [
9427 /// "ab***"
9428 /// ],
9429 /// "type": "string"
9430 /// },
9431 /// "createTime": {
9432 /// "examples": [
9433 /// 1619361369000
9434 /// ],
9435 /// "type": "integer",
9436 /// "format": "int64"
9437 /// },
9438 /// "fiat": {
9439 /// "examples": [
9440 /// "CNY"
9441 /// ],
9442 /// "type": "string"
9443 /// },
9444 /// "fiatSymbol": {
9445 /// "examples": [
9446 /// "¥"
9447 /// ],
9448 /// "type": "string"
9449 /// },
9450 /// "orderNumber": {
9451 /// "examples": [
9452 /// "20219644646554779648"
9453 /// ],
9454 /// "type": "string"
9455 /// },
9456 /// "orderStatus": {
9457 /// "description": "PENDING, TRADING, BUYER_PAYED, DISTRIBUTING, COMPLETED, IN_APPEAL, CANCELLED, CANCELLED_BY_SYSTEM",
9458 /// "examples": [
9459 /// "COMPLETED"
9460 /// ],
9461 /// "type": "string"
9462 /// },
9463 /// "totalPrice": {
9464 /// "examples": [
9465 /// "33400.00000000"
9466 /// ],
9467 /// "type": "string"
9468 /// },
9469 /// "tradeType": {
9470 /// "examples": [
9471 /// "SELL"
9472 /// ],
9473 /// "type": "string"
9474 /// },
9475 /// "unitPrice": {
9476 /// "description": "Unit Price (in Fiat)",
9477 /// "examples": [
9478 /// "6.68"
9479 /// ],
9480 /// "type": "string"
9481 /// }
9482 /// }
9483 /// }
9484 /// },
9485 /// "message": {
9486 /// "examples": [
9487 /// "success"
9488 /// ],
9489 /// "type": "string"
9490 /// },
9491 /// "success": {
9492 /// "type": "boolean"
9493 /// },
9494 /// "total": {
9495 /// "examples": [
9496 /// 1
9497 /// ],
9498 /// "type": "integer",
9499 /// "format": "int32"
9500 /// }
9501 /// }
9502 ///}
9503 /// ```
9504 /// </details>
9505 #[derive(Clone, Debug, Deserialize, Serialize)]
9506 pub struct C2cOrderMatchListUserOrderHistoryResponse {
9507 pub code: String,
9508 pub data: Vec<C2cOrderMatchListUserOrderHistoryResponseDataItem>,
9509 pub message: String,
9510 pub success: bool,
9511 pub total: i32,
9512 }
9513 impl From<&C2cOrderMatchListUserOrderHistoryResponse>
9514 for C2cOrderMatchListUserOrderHistoryResponse {
9515 fn from(value: &C2cOrderMatchListUserOrderHistoryResponse) -> Self {
9516 value.clone()
9517 }
9518 }
9519 ///C2cOrderMatchListUserOrderHistoryResponseDataItem
9520 ///
9521 /// <details><summary>JSON schema</summary>
9522 ///
9523 /// ```json
9524 ///{
9525 /// "type": "object",
9526 /// "required": [
9527 /// "advNo",
9528 /// "advertisementRole",
9529 /// "amount",
9530 /// "asset",
9531 /// "commission",
9532 /// "counterPartNickName",
9533 /// "createTime",
9534 /// "fiat",
9535 /// "fiatSymbol",
9536 /// "orderNumber",
9537 /// "orderStatus",
9538 /// "totalPrice",
9539 /// "tradeType",
9540 /// "unitPrice"
9541 /// ],
9542 /// "properties": {
9543 /// "advNo": {
9544 /// "examples": [
9545 /// "11218246497340923904"
9546 /// ],
9547 /// "type": "string"
9548 /// },
9549 /// "advertisementRole": {
9550 /// "examples": [
9551 /// "TAKER"
9552 /// ],
9553 /// "type": "string"
9554 /// },
9555 /// "amount": {
9556 /// "description": "Quantity (in Crypto)",
9557 /// "examples": [
9558 /// "5000.00000000"
9559 /// ],
9560 /// "type": "string"
9561 /// },
9562 /// "asset": {
9563 /// "examples": [
9564 /// "BUSD"
9565 /// ],
9566 /// "type": "string"
9567 /// },
9568 /// "commission": {
9569 /// "description": "Transaction Fee (in Crypto)",
9570 /// "examples": [
9571 /// "0"
9572 /// ],
9573 /// "type": "string"
9574 /// },
9575 /// "counterPartNickName": {
9576 /// "examples": [
9577 /// "ab***"
9578 /// ],
9579 /// "type": "string"
9580 /// },
9581 /// "createTime": {
9582 /// "examples": [
9583 /// 1619361369000
9584 /// ],
9585 /// "type": "integer",
9586 /// "format": "int64"
9587 /// },
9588 /// "fiat": {
9589 /// "examples": [
9590 /// "CNY"
9591 /// ],
9592 /// "type": "string"
9593 /// },
9594 /// "fiatSymbol": {
9595 /// "examples": [
9596 /// "¥"
9597 /// ],
9598 /// "type": "string"
9599 /// },
9600 /// "orderNumber": {
9601 /// "examples": [
9602 /// "20219644646554779648"
9603 /// ],
9604 /// "type": "string"
9605 /// },
9606 /// "orderStatus": {
9607 /// "description": "PENDING, TRADING, BUYER_PAYED, DISTRIBUTING, COMPLETED, IN_APPEAL, CANCELLED, CANCELLED_BY_SYSTEM",
9608 /// "examples": [
9609 /// "COMPLETED"
9610 /// ],
9611 /// "type": "string"
9612 /// },
9613 /// "totalPrice": {
9614 /// "examples": [
9615 /// "33400.00000000"
9616 /// ],
9617 /// "type": "string"
9618 /// },
9619 /// "tradeType": {
9620 /// "examples": [
9621 /// "SELL"
9622 /// ],
9623 /// "type": "string"
9624 /// },
9625 /// "unitPrice": {
9626 /// "description": "Unit Price (in Fiat)",
9627 /// "examples": [
9628 /// "6.68"
9629 /// ],
9630 /// "type": "string"
9631 /// }
9632 /// }
9633 ///}
9634 /// ```
9635 /// </details>
9636 #[derive(Clone, Debug, Deserialize, Serialize)]
9637 pub struct C2cOrderMatchListUserOrderHistoryResponseDataItem {
9638 #[serde(rename = "advNo")]
9639 pub adv_no: String,
9640 #[serde(rename = "advertisementRole")]
9641 pub advertisement_role: String,
9642 ///Quantity (in Crypto)
9643 pub amount: String,
9644 pub asset: String,
9645 ///Transaction Fee (in Crypto)
9646 pub commission: String,
9647 #[serde(rename = "counterPartNickName")]
9648 pub counter_part_nick_name: String,
9649 #[serde(rename = "createTime")]
9650 pub create_time: i64,
9651 pub fiat: String,
9652 #[serde(rename = "fiatSymbol")]
9653 pub fiat_symbol: String,
9654 #[serde(rename = "orderNumber")]
9655 pub order_number: String,
9656 ///PENDING, TRADING, BUYER_PAYED, DISTRIBUTING, COMPLETED, IN_APPEAL, CANCELLED, CANCELLED_BY_SYSTEM
9657 #[serde(rename = "orderStatus")]
9658 pub order_status: String,
9659 #[serde(rename = "totalPrice")]
9660 pub total_price: String,
9661 #[serde(rename = "tradeType")]
9662 pub trade_type: String,
9663 ///Unit Price (in Fiat)
9664 #[serde(rename = "unitPrice")]
9665 pub unit_price: String,
9666 }
9667 impl From<&C2cOrderMatchListUserOrderHistoryResponseDataItem>
9668 for C2cOrderMatchListUserOrderHistoryResponseDataItem {
9669 fn from(value: &C2cOrderMatchListUserOrderHistoryResponseDataItem) -> Self {
9670 value.clone()
9671 }
9672 }
9673 ///C2cOrderMatchListUserOrderHistoryTradeType
9674 ///
9675 /// <details><summary>JSON schema</summary>
9676 ///
9677 /// ```json
9678 ///{
9679 /// "type": "string",
9680 /// "enum": [
9681 /// "BUY",
9682 /// "SELL"
9683 /// ]
9684 ///}
9685 /// ```
9686 /// </details>
9687 #[derive(
9688 Clone,
9689 Copy,
9690 Debug,
9691 Deserialize,
9692 Eq,
9693 Hash,
9694 Ord,
9695 PartialEq,
9696 PartialOrd,
9697 Serialize
9698 )]
9699 pub enum C2cOrderMatchListUserOrderHistoryTradeType {
9700 #[serde(rename = "BUY")]
9701 Buy,
9702 #[serde(rename = "SELL")]
9703 Sell,
9704 }
9705 impl From<&C2cOrderMatchListUserOrderHistoryTradeType>
9706 for C2cOrderMatchListUserOrderHistoryTradeType {
9707 fn from(value: &C2cOrderMatchListUserOrderHistoryTradeType) -> Self {
9708 value.clone()
9709 }
9710 }
9711 impl ToString for C2cOrderMatchListUserOrderHistoryTradeType {
9712 fn to_string(&self) -> String {
9713 match *self {
9714 Self::Buy => "BUY".to_string(),
9715 Self::Sell => "SELL".to_string(),
9716 }
9717 }
9718 }
9719 impl std::str::FromStr for C2cOrderMatchListUserOrderHistoryTradeType {
9720 type Err = self::error::ConversionError;
9721 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
9722 match value {
9723 "BUY" => Ok(Self::Buy),
9724 "SELL" => Ok(Self::Sell),
9725 _ => Err("invalid value".into()),
9726 }
9727 }
9728 }
9729 impl std::convert::TryFrom<&str> for C2cOrderMatchListUserOrderHistoryTradeType {
9730 type Error = self::error::ConversionError;
9731 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
9732 value.parse()
9733 }
9734 }
9735 impl std::convert::TryFrom<&String> for C2cOrderMatchListUserOrderHistoryTradeType {
9736 type Error = self::error::ConversionError;
9737 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
9738 value.parse()
9739 }
9740 }
9741 impl std::convert::TryFrom<String> for C2cOrderMatchListUserOrderHistoryTradeType {
9742 type Error = self::error::ConversionError;
9743 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
9744 value.parse()
9745 }
9746 }
9747 ///CancelAlgoFuturesOrderResponse
9748 ///
9749 /// <details><summary>JSON schema</summary>
9750 ///
9751 /// ```json
9752 ///{
9753 /// "type": "object",
9754 /// "required": [
9755 /// "algoId",
9756 /// "code",
9757 /// "msg",
9758 /// "success"
9759 /// ],
9760 /// "properties": {
9761 /// "algoId": {
9762 /// "examples": [
9763 /// 14511
9764 /// ],
9765 /// "type": "integer",
9766 /// "format": "int64"
9767 /// },
9768 /// "code": {
9769 /// "examples": [
9770 /// 0
9771 /// ],
9772 /// "type": "integer",
9773 /// "format": "int64"
9774 /// },
9775 /// "msg": {
9776 /// "examples": [
9777 /// "OK"
9778 /// ],
9779 /// "type": "string"
9780 /// },
9781 /// "success": {
9782 /// "examples": [
9783 /// true
9784 /// ],
9785 /// "type": "boolean"
9786 /// }
9787 /// }
9788 ///}
9789 /// ```
9790 /// </details>
9791 #[derive(Clone, Debug, Deserialize, Serialize)]
9792 pub struct CancelAlgoFuturesOrderResponse {
9793 #[serde(rename = "algoId")]
9794 pub algo_id: i64,
9795 pub code: i64,
9796 pub msg: String,
9797 pub success: bool,
9798 }
9799 impl From<&CancelAlgoFuturesOrderResponse> for CancelAlgoFuturesOrderResponse {
9800 fn from(value: &CancelAlgoFuturesOrderResponse) -> Self {
9801 value.clone()
9802 }
9803 }
9804 ///CancelAlgoSpotOrderResponse
9805 ///
9806 /// <details><summary>JSON schema</summary>
9807 ///
9808 /// ```json
9809 ///{
9810 /// "type": "object",
9811 /// "required": [
9812 /// "algoId",
9813 /// "code",
9814 /// "msg",
9815 /// "success"
9816 /// ],
9817 /// "properties": {
9818 /// "algoId": {
9819 /// "examples": [
9820 /// 14511
9821 /// ],
9822 /// "type": "integer",
9823 /// "format": "int64"
9824 /// },
9825 /// "code": {
9826 /// "examples": [
9827 /// 0
9828 /// ],
9829 /// "type": "integer"
9830 /// },
9831 /// "msg": {
9832 /// "examples": [
9833 /// "OK"
9834 /// ],
9835 /// "type": "string"
9836 /// },
9837 /// "success": {
9838 /// "examples": [
9839 /// true
9840 /// ],
9841 /// "type": "boolean"
9842 /// }
9843 /// }
9844 ///}
9845 /// ```
9846 /// </details>
9847 #[derive(Clone, Debug, Deserialize, Serialize)]
9848 pub struct CancelAlgoSpotOrderResponse {
9849 #[serde(rename = "algoId")]
9850 pub algo_id: i64,
9851 pub code: i64,
9852 pub msg: String,
9853 pub success: bool,
9854 }
9855 impl From<&CancelAlgoSpotOrderResponse> for CancelAlgoSpotOrderResponse {
9856 fn from(value: &CancelAlgoSpotOrderResponse) -> Self {
9857 value.clone()
9858 }
9859 }
9860 ///CancelMarginOrderIsIsolated
9861 ///
9862 /// <details><summary>JSON schema</summary>
9863 ///
9864 /// ```json
9865 ///{
9866 /// "type": "string",
9867 /// "enum": [
9868 /// "TRUE",
9869 /// "FALSE"
9870 /// ]
9871 ///}
9872 /// ```
9873 /// </details>
9874 #[derive(
9875 Clone,
9876 Copy,
9877 Debug,
9878 Deserialize,
9879 Eq,
9880 Hash,
9881 Ord,
9882 PartialEq,
9883 PartialOrd,
9884 Serialize
9885 )]
9886 pub enum CancelMarginOrderIsIsolated {
9887 #[serde(rename = "TRUE")]
9888 True,
9889 #[serde(rename = "FALSE")]
9890 False,
9891 }
9892 impl From<&CancelMarginOrderIsIsolated> for CancelMarginOrderIsIsolated {
9893 fn from(value: &CancelMarginOrderIsIsolated) -> Self {
9894 value.clone()
9895 }
9896 }
9897 impl ToString for CancelMarginOrderIsIsolated {
9898 fn to_string(&self) -> String {
9899 match *self {
9900 Self::True => "TRUE".to_string(),
9901 Self::False => "FALSE".to_string(),
9902 }
9903 }
9904 }
9905 impl std::str::FromStr for CancelMarginOrderIsIsolated {
9906 type Err = self::error::ConversionError;
9907 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
9908 match value {
9909 "TRUE" => Ok(Self::True),
9910 "FALSE" => Ok(Self::False),
9911 _ => Err("invalid value".into()),
9912 }
9913 }
9914 }
9915 impl std::convert::TryFrom<&str> for CancelMarginOrderIsIsolated {
9916 type Error = self::error::ConversionError;
9917 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
9918 value.parse()
9919 }
9920 }
9921 impl std::convert::TryFrom<&String> for CancelMarginOrderIsIsolated {
9922 type Error = self::error::ConversionError;
9923 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
9924 value.parse()
9925 }
9926 }
9927 impl std::convert::TryFrom<String> for CancelMarginOrderIsIsolated {
9928 type Error = self::error::ConversionError;
9929 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
9930 value.parse()
9931 }
9932 }
9933 ///CancelMarginOrderOcoIsIsolated
9934 ///
9935 /// <details><summary>JSON schema</summary>
9936 ///
9937 /// ```json
9938 ///{
9939 /// "type": "string",
9940 /// "enum": [
9941 /// "TRUE",
9942 /// "FALSE"
9943 /// ]
9944 ///}
9945 /// ```
9946 /// </details>
9947 #[derive(
9948 Clone,
9949 Copy,
9950 Debug,
9951 Deserialize,
9952 Eq,
9953 Hash,
9954 Ord,
9955 PartialEq,
9956 PartialOrd,
9957 Serialize
9958 )]
9959 pub enum CancelMarginOrderOcoIsIsolated {
9960 #[serde(rename = "TRUE")]
9961 True,
9962 #[serde(rename = "FALSE")]
9963 False,
9964 }
9965 impl From<&CancelMarginOrderOcoIsIsolated> for CancelMarginOrderOcoIsIsolated {
9966 fn from(value: &CancelMarginOrderOcoIsIsolated) -> Self {
9967 value.clone()
9968 }
9969 }
9970 impl ToString for CancelMarginOrderOcoIsIsolated {
9971 fn to_string(&self) -> String {
9972 match *self {
9973 Self::True => "TRUE".to_string(),
9974 Self::False => "FALSE".to_string(),
9975 }
9976 }
9977 }
9978 impl std::str::FromStr for CancelMarginOrderOcoIsIsolated {
9979 type Err = self::error::ConversionError;
9980 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
9981 match value {
9982 "TRUE" => Ok(Self::True),
9983 "FALSE" => Ok(Self::False),
9984 _ => Err("invalid value".into()),
9985 }
9986 }
9987 }
9988 impl std::convert::TryFrom<&str> for CancelMarginOrderOcoIsIsolated {
9989 type Error = self::error::ConversionError;
9990 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
9991 value.parse()
9992 }
9993 }
9994 impl std::convert::TryFrom<&String> for CancelMarginOrderOcoIsIsolated {
9995 type Error = self::error::ConversionError;
9996 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
9997 value.parse()
9998 }
9999 }
10000 impl std::convert::TryFrom<String> for CancelMarginOrderOcoIsIsolated {
10001 type Error = self::error::ConversionError;
10002 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
10003 value.parse()
10004 }
10005 }
10006 ///CancelOpenOrdersResponseItem
10007 ///
10008 /// <details><summary>JSON schema</summary>
10009 ///
10010 /// ```json
10011 ///{
10012 /// "anyOf": [
10013 /// {
10014 /// "$ref": "#/components/schemas/order"
10015 /// },
10016 /// {
10017 /// "$ref": "#/components/schemas/ocoOrder"
10018 /// }
10019 /// ]
10020 ///}
10021 /// ```
10022 /// </details>
10023 #[derive(Clone, Debug, Deserialize, Serialize)]
10024 #[serde(untagged)]
10025 pub enum CancelOpenOrdersResponseItem {
10026 Order(Order),
10027 OcoOrder(OcoOrder),
10028 }
10029 impl From<&CancelOpenOrdersResponseItem> for CancelOpenOrdersResponseItem {
10030 fn from(value: &CancelOpenOrdersResponseItem) -> Self {
10031 value.clone()
10032 }
10033 }
10034 impl From<Order> for CancelOpenOrdersResponseItem {
10035 fn from(value: Order) -> Self {
10036 Self::Order(value)
10037 }
10038 }
10039 impl From<OcoOrder> for CancelOpenOrdersResponseItem {
10040 fn from(value: OcoOrder) -> Self {
10041 Self::OcoOrder(value)
10042 }
10043 }
10044 ///CancelOrderCancelRestrictions
10045 ///
10046 /// <details><summary>JSON schema</summary>
10047 ///
10048 /// ```json
10049 ///{
10050 /// "examples": [
10051 /// "ONLY_NEW"
10052 /// ],
10053 /// "type": "string",
10054 /// "enum": [
10055 /// "ONLY_NEW",
10056 /// "ONLY_PARTIALLY_FILLED"
10057 /// ]
10058 ///}
10059 /// ```
10060 /// </details>
10061 #[derive(
10062 Clone,
10063 Copy,
10064 Debug,
10065 Deserialize,
10066 Eq,
10067 Hash,
10068 Ord,
10069 PartialEq,
10070 PartialOrd,
10071 Serialize
10072 )]
10073 pub enum CancelOrderCancelRestrictions {
10074 #[serde(rename = "ONLY_NEW")]
10075 OnlyNew,
10076 #[serde(rename = "ONLY_PARTIALLY_FILLED")]
10077 OnlyPartiallyFilled,
10078 }
10079 impl From<&CancelOrderCancelRestrictions> for CancelOrderCancelRestrictions {
10080 fn from(value: &CancelOrderCancelRestrictions) -> Self {
10081 value.clone()
10082 }
10083 }
10084 impl ToString for CancelOrderCancelRestrictions {
10085 fn to_string(&self) -> String {
10086 match *self {
10087 Self::OnlyNew => "ONLY_NEW".to_string(),
10088 Self::OnlyPartiallyFilled => "ONLY_PARTIALLY_FILLED".to_string(),
10089 }
10090 }
10091 }
10092 impl std::str::FromStr for CancelOrderCancelRestrictions {
10093 type Err = self::error::ConversionError;
10094 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
10095 match value {
10096 "ONLY_NEW" => Ok(Self::OnlyNew),
10097 "ONLY_PARTIALLY_FILLED" => Ok(Self::OnlyPartiallyFilled),
10098 _ => Err("invalid value".into()),
10099 }
10100 }
10101 }
10102 impl std::convert::TryFrom<&str> for CancelOrderCancelRestrictions {
10103 type Error = self::error::ConversionError;
10104 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
10105 value.parse()
10106 }
10107 }
10108 impl std::convert::TryFrom<&String> for CancelOrderCancelRestrictions {
10109 type Error = self::error::ConversionError;
10110 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
10111 value.parse()
10112 }
10113 }
10114 impl std::convert::TryFrom<String> for CancelOrderCancelRestrictions {
10115 type Error = self::error::ConversionError;
10116 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
10117 value.parse()
10118 }
10119 }
10120 ///CanceledMarginOrderDetail
10121 ///
10122 /// <details><summary>JSON schema</summary>
10123 ///
10124 /// ```json
10125 ///{
10126 /// "type": "object",
10127 /// "required": [
10128 /// "clientOrderId",
10129 /// "cummulativeQuoteQty",
10130 /// "executedQty",
10131 /// "isIsolated",
10132 /// "orderId",
10133 /// "orderListId",
10134 /// "origClientOrderId",
10135 /// "origQty",
10136 /// "price",
10137 /// "side",
10138 /// "status",
10139 /// "symbol",
10140 /// "timeInForce",
10141 /// "type"
10142 /// ],
10143 /// "properties": {
10144 /// "clientOrderId": {
10145 /// "examples": [
10146 /// "pXLV6Hz6mprAcVYpVMTGgx"
10147 /// ],
10148 /// "type": "string"
10149 /// },
10150 /// "cummulativeQuoteQty": {
10151 /// "examples": [
10152 /// "0.000000"
10153 /// ],
10154 /// "type": "string"
10155 /// },
10156 /// "executedQty": {
10157 /// "examples": [
10158 /// "0.000000"
10159 /// ],
10160 /// "type": "string"
10161 /// },
10162 /// "isIsolated": {
10163 /// "type": "boolean"
10164 /// },
10165 /// "orderId": {
10166 /// "examples": [
10167 /// 11
10168 /// ],
10169 /// "type": "integer",
10170 /// "format": "int64"
10171 /// },
10172 /// "orderListId": {
10173 /// "examples": [
10174 /// -1
10175 /// ],
10176 /// "type": "integer",
10177 /// "format": "int64"
10178 /// },
10179 /// "origClientOrderId": {
10180 /// "examples": [
10181 /// "E6APeyTJvkMvLMYMqu1KQ4"
10182 /// ],
10183 /// "type": "string"
10184 /// },
10185 /// "origQty": {
10186 /// "examples": [
10187 /// "0.178622"
10188 /// ],
10189 /// "type": "string"
10190 /// },
10191 /// "price": {
10192 /// "examples": [
10193 /// "0.089853"
10194 /// ],
10195 /// "type": "string"
10196 /// },
10197 /// "side": {
10198 /// "examples": [
10199 /// "BUY"
10200 /// ],
10201 /// "type": "string"
10202 /// },
10203 /// "status": {
10204 /// "examples": [
10205 /// "CANCELED"
10206 /// ],
10207 /// "type": "string"
10208 /// },
10209 /// "symbol": {
10210 /// "examples": [
10211 /// "BNBUSDT"
10212 /// ],
10213 /// "type": "string"
10214 /// },
10215 /// "timeInForce": {
10216 /// "examples": [
10217 /// "GTC"
10218 /// ],
10219 /// "type": "string"
10220 /// },
10221 /// "type": {
10222 /// "examples": [
10223 /// "LIMIT"
10224 /// ],
10225 /// "type": "string"
10226 /// }
10227 /// }
10228 ///}
10229 /// ```
10230 /// </details>
10231 #[derive(Clone, Debug, Deserialize, Serialize)]
10232 pub struct CanceledMarginOrderDetail {
10233 #[serde(rename = "clientOrderId")]
10234 pub client_order_id: String,
10235 #[serde(rename = "cummulativeQuoteQty")]
10236 pub cummulative_quote_qty: String,
10237 #[serde(rename = "executedQty")]
10238 pub executed_qty: String,
10239 #[serde(rename = "isIsolated")]
10240 pub is_isolated: bool,
10241 #[serde(rename = "orderId")]
10242 pub order_id: i64,
10243 #[serde(rename = "orderListId")]
10244 pub order_list_id: i64,
10245 #[serde(rename = "origClientOrderId")]
10246 pub orig_client_order_id: String,
10247 #[serde(rename = "origQty")]
10248 pub orig_qty: String,
10249 pub price: String,
10250 pub side: String,
10251 pub status: String,
10252 pub symbol: String,
10253 #[serde(rename = "timeInForce")]
10254 pub time_in_force: String,
10255 #[serde(rename = "type")]
10256 pub type_: String,
10257 }
10258 impl From<&CanceledMarginOrderDetail> for CanceledMarginOrderDetail {
10259 fn from(value: &CanceledMarginOrderDetail) -> Self {
10260 value.clone()
10261 }
10262 }
10263 ///CapitalConfigGetallResponseItem
10264 ///
10265 /// <details><summary>JSON schema</summary>
10266 ///
10267 /// ```json
10268 ///{
10269 /// "type": "object",
10270 /// "required": [
10271 /// "coin",
10272 /// "depositAllEnable",
10273 /// "free",
10274 /// "freeze",
10275 /// "ipoable",
10276 /// "ipoing",
10277 /// "isLegalMoney",
10278 /// "locked",
10279 /// "name",
10280 /// "networkList",
10281 /// "storage",
10282 /// "trading",
10283 /// "withdrawAllEnable",
10284 /// "withdrawing"
10285 /// ],
10286 /// "properties": {
10287 /// "coin": {
10288 /// "examples": [
10289 /// "BTC"
10290 /// ],
10291 /// "type": "string"
10292 /// },
10293 /// "depositAllEnable": {
10294 /// "type": "boolean"
10295 /// },
10296 /// "free": {
10297 /// "examples": [
10298 /// "0.00000000"
10299 /// ],
10300 /// "type": "string"
10301 /// },
10302 /// "freeze": {
10303 /// "examples": [
10304 /// "0.00000000"
10305 /// ],
10306 /// "type": "string"
10307 /// },
10308 /// "ipoable": {
10309 /// "examples": [
10310 /// "0.00000000"
10311 /// ],
10312 /// "type": "string"
10313 /// },
10314 /// "ipoing": {
10315 /// "examples": [
10316 /// "0.00000000"
10317 /// ],
10318 /// "type": "string"
10319 /// },
10320 /// "isLegalMoney": {
10321 /// "examples": [
10322 /// false
10323 /// ],
10324 /// "type": "boolean"
10325 /// },
10326 /// "locked": {
10327 /// "examples": [
10328 /// "0.00000000"
10329 /// ],
10330 /// "type": "string"
10331 /// },
10332 /// "name": {
10333 /// "examples": [
10334 /// "Bitcoin"
10335 /// ],
10336 /// "type": "string"
10337 /// },
10338 /// "networkList": {
10339 /// "type": "array",
10340 /// "items": {
10341 /// "type": "object",
10342 /// "required": [
10343 /// "addressRegex",
10344 /// "coin",
10345 /// "depositDesc",
10346 /// "depositEnable",
10347 /// "isDefault",
10348 /// "memoRegex",
10349 /// "minConfirm",
10350 /// "name",
10351 /// "network",
10352 /// "resetAddressStatus",
10353 /// "sameAddress",
10354 /// "specialTips",
10355 /// "unLockConfirm",
10356 /// "withdrawDesc",
10357 /// "withdrawEnable",
10358 /// "withdrawFee",
10359 /// "withdrawIntegerMultiple",
10360 /// "withdrawMax",
10361 /// "withdrawMin"
10362 /// ],
10363 /// "properties": {
10364 /// "addressRegex": {
10365 /// "examples": [
10366 /// "^(bnb1)[0-9a-z]{38}$"
10367 /// ],
10368 /// "type": "string"
10369 /// },
10370 /// "coin": {
10371 /// "examples": [
10372 /// "BTC"
10373 /// ],
10374 /// "type": "string"
10375 /// },
10376 /// "depositDesc": {
10377 /// "description": "shown only when \"depositEnable\" is false.",
10378 /// "examples": [
10379 /// "Wallet Maintenance, Deposit Suspended"
10380 /// ],
10381 /// "type": "string"
10382 /// },
10383 /// "depositEnable": {
10384 /// "examples": [
10385 /// false
10386 /// ],
10387 /// "type": "boolean"
10388 /// },
10389 /// "isDefault": {
10390 /// "examples": [
10391 /// false
10392 /// ],
10393 /// "type": "boolean"
10394 /// },
10395 /// "memoRegex": {
10396 /// "examples": [
10397 /// "^[0-9A-Za-z\\-_]{1,120}$"
10398 /// ],
10399 /// "type": "string"
10400 /// },
10401 /// "minConfirm": {
10402 /// "description": "min number for balance confirmation.",
10403 /// "examples": [
10404 /// 1
10405 /// ],
10406 /// "type": "integer",
10407 /// "format": "int64"
10408 /// },
10409 /// "name": {
10410 /// "examples": [
10411 /// "BEP2"
10412 /// ],
10413 /// "type": "string"
10414 /// },
10415 /// "network": {
10416 /// "examples": [
10417 /// "ETH"
10418 /// ],
10419 /// "type": "string"
10420 /// },
10421 /// "resetAddressStatus": {
10422 /// "examples": [
10423 /// false
10424 /// ],
10425 /// "type": "boolean"
10426 /// },
10427 /// "sameAddress": {
10428 /// "type": "boolean"
10429 /// },
10430 /// "specialTips": {
10431 /// "examples": [
10432 /// "Both a MEMO and an Address are required to successfully deposit your BEP2-BTCB tokens to Binance."
10433 /// ],
10434 /// "type": "string"
10435 /// },
10436 /// "unLockConfirm": {
10437 /// "description": "confirmation number for balance unlock.",
10438 /// "examples": [
10439 /// 0
10440 /// ],
10441 /// "type": "integer",
10442 /// "format": "int64"
10443 /// },
10444 /// "withdrawDesc": {
10445 /// "description": "shown only when \"withdrawEnable\" is false",
10446 /// "examples": [
10447 /// "Wallet Maintenance, Withdrawal Suspended"
10448 /// ],
10449 /// "type": "string"
10450 /// },
10451 /// "withdrawEnable": {
10452 /// "examples": [
10453 /// false
10454 /// ],
10455 /// "type": "boolean"
10456 /// },
10457 /// "withdrawFee": {
10458 /// "examples": [
10459 /// "0.00000220"
10460 /// ],
10461 /// "type": "string"
10462 /// },
10463 /// "withdrawIntegerMultiple": {
10464 /// "examples": [
10465 /// "0.00000001"
10466 /// ],
10467 /// "type": "string"
10468 /// },
10469 /// "withdrawMax": {
10470 /// "examples": [
10471 /// "9999999999.99999999"
10472 /// ],
10473 /// "type": "string"
10474 /// },
10475 /// "withdrawMin": {
10476 /// "examples": [
10477 /// "0.00000440"
10478 /// ],
10479 /// "type": "string"
10480 /// }
10481 /// }
10482 /// }
10483 /// },
10484 /// "storage": {
10485 /// "examples": [
10486 /// "0.00000000"
10487 /// ],
10488 /// "type": "string"
10489 /// },
10490 /// "trading": {
10491 /// "type": "boolean"
10492 /// },
10493 /// "withdrawAllEnable": {
10494 /// "type": "boolean"
10495 /// },
10496 /// "withdrawing": {
10497 /// "examples": [
10498 /// "0.00000000"
10499 /// ],
10500 /// "type": "string"
10501 /// }
10502 /// }
10503 ///}
10504 /// ```
10505 /// </details>
10506 #[derive(Clone, Debug, Deserialize, Serialize)]
10507 pub struct CapitalConfigGetallResponseItem {
10508 pub coin: String,
10509 #[serde(rename = "depositAllEnable")]
10510 pub deposit_all_enable: bool,
10511 pub free: String,
10512 pub freeze: String,
10513 pub ipoable: String,
10514 pub ipoing: String,
10515 #[serde(rename = "isLegalMoney")]
10516 pub is_legal_money: bool,
10517 pub locked: String,
10518 pub name: String,
10519 #[serde(rename = "networkList")]
10520 pub network_list: Vec<CapitalConfigGetallResponseItemNetworkListItem>,
10521 pub storage: String,
10522 pub trading: bool,
10523 #[serde(rename = "withdrawAllEnable")]
10524 pub withdraw_all_enable: bool,
10525 pub withdrawing: String,
10526 }
10527 impl From<&CapitalConfigGetallResponseItem> for CapitalConfigGetallResponseItem {
10528 fn from(value: &CapitalConfigGetallResponseItem) -> Self {
10529 value.clone()
10530 }
10531 }
10532 ///CapitalConfigGetallResponseItemNetworkListItem
10533 ///
10534 /// <details><summary>JSON schema</summary>
10535 ///
10536 /// ```json
10537 ///{
10538 /// "type": "object",
10539 /// "required": [
10540 /// "addressRegex",
10541 /// "coin",
10542 /// "depositDesc",
10543 /// "depositEnable",
10544 /// "isDefault",
10545 /// "memoRegex",
10546 /// "minConfirm",
10547 /// "name",
10548 /// "network",
10549 /// "resetAddressStatus",
10550 /// "sameAddress",
10551 /// "specialTips",
10552 /// "unLockConfirm",
10553 /// "withdrawDesc",
10554 /// "withdrawEnable",
10555 /// "withdrawFee",
10556 /// "withdrawIntegerMultiple",
10557 /// "withdrawMax",
10558 /// "withdrawMin"
10559 /// ],
10560 /// "properties": {
10561 /// "addressRegex": {
10562 /// "examples": [
10563 /// "^(bnb1)[0-9a-z]{38}$"
10564 /// ],
10565 /// "type": "string"
10566 /// },
10567 /// "coin": {
10568 /// "examples": [
10569 /// "BTC"
10570 /// ],
10571 /// "type": "string"
10572 /// },
10573 /// "depositDesc": {
10574 /// "description": "shown only when \"depositEnable\" is false.",
10575 /// "examples": [
10576 /// "Wallet Maintenance, Deposit Suspended"
10577 /// ],
10578 /// "type": "string"
10579 /// },
10580 /// "depositEnable": {
10581 /// "examples": [
10582 /// false
10583 /// ],
10584 /// "type": "boolean"
10585 /// },
10586 /// "isDefault": {
10587 /// "examples": [
10588 /// false
10589 /// ],
10590 /// "type": "boolean"
10591 /// },
10592 /// "memoRegex": {
10593 /// "examples": [
10594 /// "^[0-9A-Za-z\\-_]{1,120}$"
10595 /// ],
10596 /// "type": "string"
10597 /// },
10598 /// "minConfirm": {
10599 /// "description": "min number for balance confirmation.",
10600 /// "examples": [
10601 /// 1
10602 /// ],
10603 /// "type": "integer",
10604 /// "format": "int64"
10605 /// },
10606 /// "name": {
10607 /// "examples": [
10608 /// "BEP2"
10609 /// ],
10610 /// "type": "string"
10611 /// },
10612 /// "network": {
10613 /// "examples": [
10614 /// "ETH"
10615 /// ],
10616 /// "type": "string"
10617 /// },
10618 /// "resetAddressStatus": {
10619 /// "examples": [
10620 /// false
10621 /// ],
10622 /// "type": "boolean"
10623 /// },
10624 /// "sameAddress": {
10625 /// "type": "boolean"
10626 /// },
10627 /// "specialTips": {
10628 /// "examples": [
10629 /// "Both a MEMO and an Address are required to successfully deposit your BEP2-BTCB tokens to Binance."
10630 /// ],
10631 /// "type": "string"
10632 /// },
10633 /// "unLockConfirm": {
10634 /// "description": "confirmation number for balance unlock.",
10635 /// "examples": [
10636 /// 0
10637 /// ],
10638 /// "type": "integer",
10639 /// "format": "int64"
10640 /// },
10641 /// "withdrawDesc": {
10642 /// "description": "shown only when \"withdrawEnable\" is false",
10643 /// "examples": [
10644 /// "Wallet Maintenance, Withdrawal Suspended"
10645 /// ],
10646 /// "type": "string"
10647 /// },
10648 /// "withdrawEnable": {
10649 /// "examples": [
10650 /// false
10651 /// ],
10652 /// "type": "boolean"
10653 /// },
10654 /// "withdrawFee": {
10655 /// "examples": [
10656 /// "0.00000220"
10657 /// ],
10658 /// "type": "string"
10659 /// },
10660 /// "withdrawIntegerMultiple": {
10661 /// "examples": [
10662 /// "0.00000001"
10663 /// ],
10664 /// "type": "string"
10665 /// },
10666 /// "withdrawMax": {
10667 /// "examples": [
10668 /// "9999999999.99999999"
10669 /// ],
10670 /// "type": "string"
10671 /// },
10672 /// "withdrawMin": {
10673 /// "examples": [
10674 /// "0.00000440"
10675 /// ],
10676 /// "type": "string"
10677 /// }
10678 /// }
10679 ///}
10680 /// ```
10681 /// </details>
10682 #[derive(Clone, Debug, Deserialize, Serialize)]
10683 pub struct CapitalConfigGetallResponseItemNetworkListItem {
10684 #[serde(rename = "addressRegex")]
10685 pub address_regex: String,
10686 pub coin: String,
10687 ///shown only when "depositEnable" is false.
10688 #[serde(rename = "depositDesc")]
10689 pub deposit_desc: String,
10690 #[serde(rename = "depositEnable")]
10691 pub deposit_enable: bool,
10692 #[serde(rename = "isDefault")]
10693 pub is_default: bool,
10694 #[serde(rename = "memoRegex")]
10695 pub memo_regex: String,
10696 ///min number for balance confirmation.
10697 #[serde(rename = "minConfirm")]
10698 pub min_confirm: i64,
10699 pub name: String,
10700 pub network: String,
10701 #[serde(rename = "resetAddressStatus")]
10702 pub reset_address_status: bool,
10703 #[serde(rename = "sameAddress")]
10704 pub same_address: bool,
10705 #[serde(rename = "specialTips")]
10706 pub special_tips: String,
10707 ///confirmation number for balance unlock.
10708 #[serde(rename = "unLockConfirm")]
10709 pub un_lock_confirm: i64,
10710 ///shown only when "withdrawEnable" is false
10711 #[serde(rename = "withdrawDesc")]
10712 pub withdraw_desc: String,
10713 #[serde(rename = "withdrawEnable")]
10714 pub withdraw_enable: bool,
10715 #[serde(rename = "withdrawFee")]
10716 pub withdraw_fee: String,
10717 #[serde(rename = "withdrawIntegerMultiple")]
10718 pub withdraw_integer_multiple: String,
10719 #[serde(rename = "withdrawMax")]
10720 pub withdraw_max: String,
10721 #[serde(rename = "withdrawMin")]
10722 pub withdraw_min: String,
10723 }
10724 impl From<&CapitalConfigGetallResponseItemNetworkListItem>
10725 for CapitalConfigGetallResponseItemNetworkListItem {
10726 fn from(value: &CapitalConfigGetallResponseItemNetworkListItem) -> Self {
10727 value.clone()
10728 }
10729 }
10730 ///CapitalContractConvertibleCoinsResponse
10731 ///
10732 /// <details><summary>JSON schema</summary>
10733 ///
10734 /// ```json
10735 ///{
10736 /// "type": "object",
10737 /// "required": [
10738 /// "coins",
10739 /// "convertEnabled",
10740 /// "exchangeRates"
10741 /// ],
10742 /// "properties": {
10743 /// "coins": {
10744 /// "type": "array",
10745 /// "items": {
10746 /// "examples": [
10747 /// "USDC"
10748 /// ],
10749 /// "type": "string"
10750 /// }
10751 /// },
10752 /// "convertEnabled": {
10753 /// "type": "boolean"
10754 /// },
10755 /// "exchangeRates": {
10756 /// "type": "object",
10757 /// "required": [
10758 /// "TUSD",
10759 /// "USDC",
10760 /// "USDP"
10761 /// ],
10762 /// "properties": {
10763 /// "TUSD": {
10764 /// "examples": [
10765 /// "1"
10766 /// ],
10767 /// "type": "string"
10768 /// },
10769 /// "USDC": {
10770 /// "examples": [
10771 /// "1"
10772 /// ],
10773 /// "type": "string"
10774 /// },
10775 /// "USDP": {
10776 /// "examples": [
10777 /// "1"
10778 /// ],
10779 /// "type": "string"
10780 /// }
10781 /// }
10782 /// }
10783 /// }
10784 ///}
10785 /// ```
10786 /// </details>
10787 #[derive(Clone, Debug, Deserialize, Serialize)]
10788 pub struct CapitalContractConvertibleCoinsResponse {
10789 pub coins: Vec<String>,
10790 #[serde(rename = "convertEnabled")]
10791 pub convert_enabled: bool,
10792 #[serde(rename = "exchangeRates")]
10793 pub exchange_rates: CapitalContractConvertibleCoinsResponseExchangeRates,
10794 }
10795 impl From<&CapitalContractConvertibleCoinsResponse>
10796 for CapitalContractConvertibleCoinsResponse {
10797 fn from(value: &CapitalContractConvertibleCoinsResponse) -> Self {
10798 value.clone()
10799 }
10800 }
10801 ///CapitalContractConvertibleCoinsResponseExchangeRates
10802 ///
10803 /// <details><summary>JSON schema</summary>
10804 ///
10805 /// ```json
10806 ///{
10807 /// "type": "object",
10808 /// "required": [
10809 /// "TUSD",
10810 /// "USDC",
10811 /// "USDP"
10812 /// ],
10813 /// "properties": {
10814 /// "TUSD": {
10815 /// "examples": [
10816 /// "1"
10817 /// ],
10818 /// "type": "string"
10819 /// },
10820 /// "USDC": {
10821 /// "examples": [
10822 /// "1"
10823 /// ],
10824 /// "type": "string"
10825 /// },
10826 /// "USDP": {
10827 /// "examples": [
10828 /// "1"
10829 /// ],
10830 /// "type": "string"
10831 /// }
10832 /// }
10833 ///}
10834 /// ```
10835 /// </details>
10836 #[derive(Clone, Debug, Deserialize, Serialize)]
10837 pub struct CapitalContractConvertibleCoinsResponseExchangeRates {
10838 #[serde(rename = "TUSD")]
10839 pub tusd: String,
10840 #[serde(rename = "USDC")]
10841 pub usdc: String,
10842 #[serde(rename = "USDP")]
10843 pub usdp: String,
10844 }
10845 impl From<&CapitalContractConvertibleCoinsResponseExchangeRates>
10846 for CapitalContractConvertibleCoinsResponseExchangeRates {
10847 fn from(value: &CapitalContractConvertibleCoinsResponseExchangeRates) -> Self {
10848 value.clone()
10849 }
10850 }
10851 ///CapitalDepositAddressListResponseItem
10852 ///
10853 /// <details><summary>JSON schema</summary>
10854 ///
10855 /// ```json
10856 ///{
10857 /// "type": "object",
10858 /// "required": [
10859 /// "address",
10860 /// "coin",
10861 /// "isDefault"
10862 /// ],
10863 /// "properties": {
10864 /// "address": {
10865 /// "examples": [
10866 /// "0xD316E95Fd9E8E237Cb11f8200Babbc5D8D177BA4"
10867 /// ],
10868 /// "type": "string"
10869 /// },
10870 /// "coin": {
10871 /// "examples": [
10872 /// "ETH"
10873 /// ],
10874 /// "type": "string"
10875 /// },
10876 /// "isDefault": {
10877 /// "examples": [
10878 /// 1
10879 /// ],
10880 /// "type": "integer",
10881 /// "format": "int32"
10882 /// }
10883 /// }
10884 ///}
10885 /// ```
10886 /// </details>
10887 #[derive(Clone, Debug, Deserialize, Serialize)]
10888 pub struct CapitalDepositAddressListResponseItem {
10889 pub address: String,
10890 pub coin: String,
10891 #[serde(rename = "isDefault")]
10892 pub is_default: i32,
10893 }
10894 impl From<&CapitalDepositAddressListResponseItem>
10895 for CapitalDepositAddressListResponseItem {
10896 fn from(value: &CapitalDepositAddressListResponseItem) -> Self {
10897 value.clone()
10898 }
10899 }
10900 ///CapitalDepositAddressResponse
10901 ///
10902 /// <details><summary>JSON schema</summary>
10903 ///
10904 /// ```json
10905 ///{
10906 /// "type": "object",
10907 /// "required": [
10908 /// "address",
10909 /// "coin",
10910 /// "tag",
10911 /// "url"
10912 /// ],
10913 /// "properties": {
10914 /// "address": {
10915 /// "examples": [
10916 /// "1HPn8Rx2y6nNSfagQBKy27GB99Vbzg89wv"
10917 /// ],
10918 /// "type": "string"
10919 /// },
10920 /// "coin": {
10921 /// "examples": [
10922 /// "BTC"
10923 /// ],
10924 /// "type": "string"
10925 /// },
10926 /// "tag": {
10927 /// "examples": [
10928 /// ""
10929 /// ],
10930 /// "type": "string"
10931 /// },
10932 /// "url": {
10933 /// "examples": [
10934 /// "https://btc.com/1HPn8Rx2y6nNSfagQBKy27GB99Vbzg89wv"
10935 /// ],
10936 /// "type": "string"
10937 /// }
10938 /// }
10939 ///}
10940 /// ```
10941 /// </details>
10942 #[derive(Clone, Debug, Deserialize, Serialize)]
10943 pub struct CapitalDepositAddressResponse {
10944 pub address: String,
10945 pub coin: String,
10946 pub tag: String,
10947 pub url: String,
10948 }
10949 impl From<&CapitalDepositAddressResponse> for CapitalDepositAddressResponse {
10950 fn from(value: &CapitalDepositAddressResponse) -> Self {
10951 value.clone()
10952 }
10953 }
10954 ///CapitalDepositCreditApplyResponse
10955 ///
10956 /// <details><summary>JSON schema</summary>
10957 ///
10958 /// ```json
10959 ///{
10960 /// "type": "object",
10961 /// "required": [
10962 /// "code",
10963 /// "data",
10964 /// "message",
10965 /// "success"
10966 /// ],
10967 /// "properties": {
10968 /// "code": {
10969 /// "examples": [
10970 /// "000000"
10971 /// ],
10972 /// "type": "string"
10973 /// },
10974 /// "data": {
10975 /// "examples": [
10976 /// true
10977 /// ],
10978 /// "type": "boolean"
10979 /// },
10980 /// "message": {
10981 /// "examples": [
10982 /// "success"
10983 /// ],
10984 /// "type": "string"
10985 /// },
10986 /// "success": {
10987 /// "examples": [
10988 /// true
10989 /// ],
10990 /// "type": "boolean"
10991 /// }
10992 /// }
10993 ///}
10994 /// ```
10995 /// </details>
10996 #[derive(Clone, Debug, Deserialize, Serialize)]
10997 pub struct CapitalDepositCreditApplyResponse {
10998 pub code: String,
10999 pub data: bool,
11000 pub message: String,
11001 pub success: bool,
11002 }
11003 impl From<&CapitalDepositCreditApplyResponse> for CapitalDepositCreditApplyResponse {
11004 fn from(value: &CapitalDepositCreditApplyResponse) -> Self {
11005 value.clone()
11006 }
11007 }
11008 ///CapitalDepositHisrecResponseItem
11009 ///
11010 /// <details><summary>JSON schema</summary>
11011 ///
11012 /// ```json
11013 ///{
11014 /// "type": "object",
11015 /// "required": [
11016 /// "address",
11017 /// "addressTag",
11018 /// "amount",
11019 /// "coin",
11020 /// "confirmTimes",
11021 /// "insertTime",
11022 /// "network",
11023 /// "status",
11024 /// "transferType",
11025 /// "txId",
11026 /// "unlockConfirm"
11027 /// ],
11028 /// "properties": {
11029 /// "address": {
11030 /// "examples": [
11031 /// "0x788cabe9236ce061e5a892e1a59395a81fc8d62c"
11032 /// ],
11033 /// "type": "string"
11034 /// },
11035 /// "addressTag": {
11036 /// "examples": [
11037 /// ""
11038 /// ],
11039 /// "type": "string"
11040 /// },
11041 /// "amount": {
11042 /// "examples": [
11043 /// "0.00999800"
11044 /// ],
11045 /// "type": "string"
11046 /// },
11047 /// "coin": {
11048 /// "examples": [
11049 /// "PAXG"
11050 /// ],
11051 /// "type": "string"
11052 /// },
11053 /// "confirmTimes": {
11054 /// "examples": [
11055 /// "12/12"
11056 /// ],
11057 /// "type": "string"
11058 /// },
11059 /// "insertTime": {
11060 /// "examples": [
11061 /// 1599621997000
11062 /// ],
11063 /// "type": "integer",
11064 /// "format": "int64"
11065 /// },
11066 /// "network": {
11067 /// "examples": [
11068 /// "ETH"
11069 /// ],
11070 /// "type": "string"
11071 /// },
11072 /// "status": {
11073 /// "examples": [
11074 /// 1
11075 /// ],
11076 /// "type": "integer",
11077 /// "format": "int32"
11078 /// },
11079 /// "transferType": {
11080 /// "examples": [
11081 /// 0
11082 /// ],
11083 /// "type": "integer",
11084 /// "format": "int32"
11085 /// },
11086 /// "txId": {
11087 /// "examples": [
11088 /// "0xaad4654a3234aa6118af9b4b335f5ae81c360b2394721c019b5d1e75328b09f3"
11089 /// ],
11090 /// "type": "string"
11091 /// },
11092 /// "unlockConfirm": {
11093 /// "description": "confirm times for unlocking",
11094 /// "examples": [
11095 /// "12/12"
11096 /// ],
11097 /// "type": "string"
11098 /// }
11099 /// }
11100 ///}
11101 /// ```
11102 /// </details>
11103 #[derive(Clone, Debug, Deserialize, Serialize)]
11104 pub struct CapitalDepositHisrecResponseItem {
11105 pub address: String,
11106 #[serde(rename = "addressTag")]
11107 pub address_tag: String,
11108 pub amount: String,
11109 pub coin: String,
11110 #[serde(rename = "confirmTimes")]
11111 pub confirm_times: String,
11112 #[serde(rename = "insertTime")]
11113 pub insert_time: i64,
11114 pub network: String,
11115 pub status: i32,
11116 #[serde(rename = "transferType")]
11117 pub transfer_type: i32,
11118 #[serde(rename = "txId")]
11119 pub tx_id: String,
11120 ///confirm times for unlocking
11121 #[serde(rename = "unlockConfirm")]
11122 pub unlock_confirm: String,
11123 }
11124 impl From<&CapitalDepositHisrecResponseItem> for CapitalDepositHisrecResponseItem {
11125 fn from(value: &CapitalDepositHisrecResponseItem) -> Self {
11126 value.clone()
11127 }
11128 }
11129 ///CapitalDepositSubAddressResponse
11130 ///
11131 /// <details><summary>JSON schema</summary>
11132 ///
11133 /// ```json
11134 ///{
11135 /// "type": "object",
11136 /// "required": [
11137 /// "address",
11138 /// "coin",
11139 /// "tag",
11140 /// "url"
11141 /// ],
11142 /// "properties": {
11143 /// "address": {
11144 /// "examples": [
11145 /// "TDunhSa7jkTNuKrusUTU1MUHtqXoBPKETV"
11146 /// ],
11147 /// "type": "string"
11148 /// },
11149 /// "coin": {
11150 /// "examples": [
11151 /// "USDT"
11152 /// ],
11153 /// "type": "string"
11154 /// },
11155 /// "tag": {
11156 /// "examples": [
11157 /// ""
11158 /// ],
11159 /// "type": "string"
11160 /// },
11161 /// "url": {
11162 /// "examples": [
11163 /// "https://tronscan.org/#/address/TDunhSa7jkTNuKrusUTU1MUHtqXoBPKETV"
11164 /// ],
11165 /// "type": "string"
11166 /// }
11167 /// }
11168 ///}
11169 /// ```
11170 /// </details>
11171 #[derive(Clone, Debug, Deserialize, Serialize)]
11172 pub struct CapitalDepositSubAddressResponse {
11173 pub address: String,
11174 pub coin: String,
11175 pub tag: String,
11176 pub url: String,
11177 }
11178 impl From<&CapitalDepositSubAddressResponse> for CapitalDepositSubAddressResponse {
11179 fn from(value: &CapitalDepositSubAddressResponse) -> Self {
11180 value.clone()
11181 }
11182 }
11183 ///CapitalDepositSubHisrecResponseItem
11184 ///
11185 /// <details><summary>JSON schema</summary>
11186 ///
11187 /// ```json
11188 ///{
11189 /// "type": "object",
11190 /// "required": [
11191 /// "address",
11192 /// "addressTag",
11193 /// "amount",
11194 /// "coin",
11195 /// "confirmTimes",
11196 /// "insertTime",
11197 /// "network",
11198 /// "status",
11199 /// "transferType",
11200 /// "txId"
11201 /// ],
11202 /// "properties": {
11203 /// "address": {
11204 /// "examples": [
11205 /// "0x788cabe9236ce061e5a892e1a59395a81fc8d62c"
11206 /// ],
11207 /// "type": "string"
11208 /// },
11209 /// "addressTag": {
11210 /// "examples": [
11211 /// ""
11212 /// ],
11213 /// "type": "string"
11214 /// },
11215 /// "amount": {
11216 /// "examples": [
11217 /// "0.00999800"
11218 /// ],
11219 /// "type": "string"
11220 /// },
11221 /// "coin": {
11222 /// "examples": [
11223 /// "PAXG"
11224 /// ],
11225 /// "type": "string"
11226 /// },
11227 /// "confirmTimes": {
11228 /// "examples": [
11229 /// "12/12"
11230 /// ],
11231 /// "type": "string"
11232 /// },
11233 /// "insertTime": {
11234 /// "examples": [
11235 /// 1599621997000
11236 /// ],
11237 /// "type": "integer",
11238 /// "format": "int64"
11239 /// },
11240 /// "network": {
11241 /// "examples": [
11242 /// "ETH"
11243 /// ],
11244 /// "type": "string"
11245 /// },
11246 /// "status": {
11247 /// "examples": [
11248 /// 1
11249 /// ],
11250 /// "type": "integer",
11251 /// "format": "int32"
11252 /// },
11253 /// "transferType": {
11254 /// "examples": [
11255 /// 0
11256 /// ],
11257 /// "type": "integer",
11258 /// "format": "int32"
11259 /// },
11260 /// "txId": {
11261 /// "examples": [
11262 /// "0xaad4654a3234aa6118af9b4b335f5ae81c360b2394721c019b5d1e75328b09f3"
11263 /// ],
11264 /// "type": "string"
11265 /// }
11266 /// }
11267 ///}
11268 /// ```
11269 /// </details>
11270 #[derive(Clone, Debug, Deserialize, Serialize)]
11271 pub struct CapitalDepositSubHisrecResponseItem {
11272 pub address: String,
11273 #[serde(rename = "addressTag")]
11274 pub address_tag: String,
11275 pub amount: String,
11276 pub coin: String,
11277 #[serde(rename = "confirmTimes")]
11278 pub confirm_times: String,
11279 #[serde(rename = "insertTime")]
11280 pub insert_time: i64,
11281 pub network: String,
11282 pub status: i32,
11283 #[serde(rename = "transferType")]
11284 pub transfer_type: i32,
11285 #[serde(rename = "txId")]
11286 pub tx_id: String,
11287 }
11288 impl From<&CapitalDepositSubHisrecResponseItem>
11289 for CapitalDepositSubHisrecResponseItem {
11290 fn from(value: &CapitalDepositSubHisrecResponseItem) -> Self {
11291 value.clone()
11292 }
11293 }
11294 ///CapitalWithdrawApplyResponse
11295 ///
11296 /// <details><summary>JSON schema</summary>
11297 ///
11298 /// ```json
11299 ///{
11300 /// "type": "object",
11301 /// "required": [
11302 /// "id"
11303 /// ],
11304 /// "properties": {
11305 /// "id": {
11306 /// "examples": [
11307 /// "7213fea8e94b4a5593d507237e5a555b"
11308 /// ],
11309 /// "type": "string"
11310 /// }
11311 /// }
11312 ///}
11313 /// ```
11314 /// </details>
11315 #[derive(Clone, Debug, Deserialize, Serialize)]
11316 pub struct CapitalWithdrawApplyResponse {
11317 pub id: String,
11318 }
11319 impl From<&CapitalWithdrawApplyResponse> for CapitalWithdrawApplyResponse {
11320 fn from(value: &CapitalWithdrawApplyResponse) -> Self {
11321 value.clone()
11322 }
11323 }
11324 ///CapitalWithdrawHistoryResponseItem
11325 ///
11326 /// <details><summary>JSON schema</summary>
11327 ///
11328 /// ```json
11329 ///{
11330 /// "type": "object",
11331 /// "required": [
11332 /// "address",
11333 /// "amount",
11334 /// "applyTime",
11335 /// "coin",
11336 /// "id",
11337 /// "network",
11338 /// "status",
11339 /// "transactionFee",
11340 /// "transferType",
11341 /// "txId",
11342 /// "withdrawOrderId"
11343 /// ],
11344 /// "properties": {
11345 /// "address": {
11346 /// "examples": [
11347 /// "0x94df8b352de7f46f64b01d3666bf6e936e44ce60"
11348 /// ],
11349 /// "type": "string"
11350 /// },
11351 /// "amount": {
11352 /// "examples": [
11353 /// "8.91000000"
11354 /// ],
11355 /// "type": "string"
11356 /// },
11357 /// "applyTime": {
11358 /// "examples": [
11359 /// "2019-10-12 11:12:02"
11360 /// ],
11361 /// "type": "string"
11362 /// },
11363 /// "coin": {
11364 /// "examples": [
11365 /// "USDT"
11366 /// ],
11367 /// "type": "string"
11368 /// },
11369 /// "confirmNo": {
11370 /// "examples": [
11371 /// 3
11372 /// ],
11373 /// "type": "integer",
11374 /// "format": "int32"
11375 /// },
11376 /// "id": {
11377 /// "examples": [
11378 /// "b6ae22b3aa844210a7041aee7589627c"
11379 /// ],
11380 /// "type": "string"
11381 /// },
11382 /// "info": {
11383 /// "description": "Reason for withdrawal failure",
11384 /// "examples": [
11385 /// "The address is not valid. Please confirm with the recipient"
11386 /// ],
11387 /// "type": "string"
11388 /// },
11389 /// "network": {
11390 /// "examples": [
11391 /// "ETH"
11392 /// ],
11393 /// "type": "string"
11394 /// },
11395 /// "status": {
11396 /// "examples": [
11397 /// 6
11398 /// ],
11399 /// "type": "integer",
11400 /// "format": "int32"
11401 /// },
11402 /// "transactionFee": {
11403 /// "examples": [
11404 /// "0.004"
11405 /// ],
11406 /// "type": "string"
11407 /// },
11408 /// "transferType": {
11409 /// "description": "1 for internal transfer, 0 for external transfer",
11410 /// "examples": [
11411 /// 0
11412 /// ],
11413 /// "type": "integer",
11414 /// "format": "int32"
11415 /// },
11416 /// "txId": {
11417 /// "examples": [
11418 /// "0xb5ef8c13b968a406cc62a93a8bd80f9e9a906ef1b3fcf20a2e48573c17659268"
11419 /// ],
11420 /// "type": "string"
11421 /// },
11422 /// "withdrawOrderId": {
11423 /// "description": "will not be returned if there's no withdrawOrderId for this withdraw.",
11424 /// "examples": [
11425 /// "WITHDRAWtest123"
11426 /// ],
11427 /// "type": "string"
11428 /// }
11429 /// }
11430 ///}
11431 /// ```
11432 /// </details>
11433 #[derive(Clone, Debug, Deserialize, Serialize)]
11434 pub struct CapitalWithdrawHistoryResponseItem {
11435 pub address: String,
11436 pub amount: String,
11437 #[serde(rename = "applyTime")]
11438 pub apply_time: String,
11439 pub coin: String,
11440 #[serde(rename = "confirmNo", default, skip_serializing_if = "Option::is_none")]
11441 pub confirm_no: Option<i32>,
11442 pub id: String,
11443 ///Reason for withdrawal failure
11444 #[serde(default, skip_serializing_if = "Option::is_none")]
11445 pub info: Option<String>,
11446 pub network: String,
11447 pub status: i32,
11448 #[serde(rename = "transactionFee")]
11449 pub transaction_fee: String,
11450 ///1 for internal transfer, 0 for external transfer
11451 #[serde(rename = "transferType")]
11452 pub transfer_type: i32,
11453 #[serde(rename = "txId")]
11454 pub tx_id: String,
11455 ///will not be returned if there's no withdrawOrderId for this withdraw.
11456 #[serde(rename = "withdrawOrderId")]
11457 pub withdraw_order_id: String,
11458 }
11459 impl From<&CapitalWithdrawHistoryResponseItem>
11460 for CapitalWithdrawHistoryResponseItem {
11461 fn from(value: &CapitalWithdrawHistoryResponseItem) -> Self {
11462 value.clone()
11463 }
11464 }
11465 ///ConvertAcceptQuoteResponse
11466 ///
11467 /// <details><summary>JSON schema</summary>
11468 ///
11469 /// ```json
11470 ///{
11471 /// "type": "object",
11472 /// "required": [
11473 /// "createTime",
11474 /// "orderId",
11475 /// "orderStatus"
11476 /// ],
11477 /// "properties": {
11478 /// "createTime": {
11479 /// "examples": [
11480 /// 1623381330472
11481 /// ],
11482 /// "type": "integer",
11483 /// "format": "int64"
11484 /// },
11485 /// "orderId": {
11486 /// "examples": [
11487 /// "933256278426274426"
11488 /// ],
11489 /// "type": "string"
11490 /// },
11491 /// "orderStatus": {
11492 /// "examples": [
11493 /// "PROCESS"
11494 /// ],
11495 /// "type": "string"
11496 /// }
11497 /// }
11498 ///}
11499 /// ```
11500 /// </details>
11501 #[derive(Clone, Debug, Deserialize, Serialize)]
11502 pub struct ConvertAcceptQuoteResponse {
11503 #[serde(rename = "createTime")]
11504 pub create_time: i64,
11505 #[serde(rename = "orderId")]
11506 pub order_id: String,
11507 #[serde(rename = "orderStatus")]
11508 pub order_status: String,
11509 }
11510 impl From<&ConvertAcceptQuoteResponse> for ConvertAcceptQuoteResponse {
11511 fn from(value: &ConvertAcceptQuoteResponse) -> Self {
11512 value.clone()
11513 }
11514 }
11515 ///ConvertAssetInfoResponseItem
11516 ///
11517 /// <details><summary>JSON schema</summary>
11518 ///
11519 /// ```json
11520 ///{
11521 /// "type": "object",
11522 /// "required": [
11523 /// "asset",
11524 /// "fraction"
11525 /// ],
11526 /// "properties": {
11527 /// "asset": {
11528 /// "examples": [
11529 /// "BTC"
11530 /// ],
11531 /// "type": "string"
11532 /// },
11533 /// "fraction": {
11534 /// "examples": [
11535 /// 8
11536 /// ],
11537 /// "type": "integer",
11538 /// "format": "int32"
11539 /// }
11540 /// }
11541 ///}
11542 /// ```
11543 /// </details>
11544 #[derive(Clone, Debug, Deserialize, Serialize)]
11545 pub struct ConvertAssetInfoResponseItem {
11546 pub asset: String,
11547 pub fraction: i32,
11548 }
11549 impl From<&ConvertAssetInfoResponseItem> for ConvertAssetInfoResponseItem {
11550 fn from(value: &ConvertAssetInfoResponseItem) -> Self {
11551 value.clone()
11552 }
11553 }
11554 ///ConvertDustAssetsToBnbResponse
11555 ///
11556 /// <details><summary>JSON schema</summary>
11557 ///
11558 /// ```json
11559 ///{
11560 /// "type": "object",
11561 /// "required": [
11562 /// "totalServiceCharge",
11563 /// "totalTransfered",
11564 /// "transferResult"
11565 /// ],
11566 /// "properties": {
11567 /// "totalServiceCharge": {
11568 /// "examples": [
11569 /// "0.02102542"
11570 /// ],
11571 /// "type": "string"
11572 /// },
11573 /// "totalTransfered": {
11574 /// "examples": [
11575 /// "1.05127099"
11576 /// ],
11577 /// "type": "string"
11578 /// },
11579 /// "transferResult": {
11580 /// "type": "array",
11581 /// "items": {
11582 /// "type": "object",
11583 /// "required": [
11584 /// "amount",
11585 /// "fromAsset",
11586 /// "operateTime",
11587 /// "serviceChargeAmount",
11588 /// "tranId",
11589 /// "transferedAmount"
11590 /// ],
11591 /// "properties": {
11592 /// "amount": {
11593 /// "examples": [
11594 /// "0.03000000"
11595 /// ],
11596 /// "type": "string"
11597 /// },
11598 /// "fromAsset": {
11599 /// "examples": [
11600 /// "ETH"
11601 /// ],
11602 /// "type": "string"
11603 /// },
11604 /// "operateTime": {
11605 /// "examples": [
11606 /// 1563368549307
11607 /// ],
11608 /// "type": "integer",
11609 /// "format": "int64"
11610 /// },
11611 /// "serviceChargeAmount": {
11612 /// "examples": [
11613 /// "0.00500000"
11614 /// ],
11615 /// "type": "string"
11616 /// },
11617 /// "tranId": {
11618 /// "examples": [
11619 /// 1563368549307
11620 /// ],
11621 /// "type": "integer",
11622 /// "format": "int64"
11623 /// },
11624 /// "transferedAmount": {
11625 /// "examples": [
11626 /// "0.25000000"
11627 /// ],
11628 /// "type": "string"
11629 /// }
11630 /// }
11631 /// }
11632 /// }
11633 /// }
11634 ///}
11635 /// ```
11636 /// </details>
11637 #[derive(Clone, Debug, Deserialize, Serialize)]
11638 pub struct ConvertDustAssetsToBnbResponse {
11639 #[serde(rename = "totalServiceCharge")]
11640 pub total_service_charge: String,
11641 #[serde(rename = "totalTransfered")]
11642 pub total_transfered: String,
11643 #[serde(rename = "transferResult")]
11644 pub transfer_result: Vec<ConvertDustAssetsToBnbResponseTransferResultItem>,
11645 }
11646 impl From<&ConvertDustAssetsToBnbResponse> for ConvertDustAssetsToBnbResponse {
11647 fn from(value: &ConvertDustAssetsToBnbResponse) -> Self {
11648 value.clone()
11649 }
11650 }
11651 ///ConvertDustAssetsToBnbResponseTransferResultItem
11652 ///
11653 /// <details><summary>JSON schema</summary>
11654 ///
11655 /// ```json
11656 ///{
11657 /// "type": "object",
11658 /// "required": [
11659 /// "amount",
11660 /// "fromAsset",
11661 /// "operateTime",
11662 /// "serviceChargeAmount",
11663 /// "tranId",
11664 /// "transferedAmount"
11665 /// ],
11666 /// "properties": {
11667 /// "amount": {
11668 /// "examples": [
11669 /// "0.03000000"
11670 /// ],
11671 /// "type": "string"
11672 /// },
11673 /// "fromAsset": {
11674 /// "examples": [
11675 /// "ETH"
11676 /// ],
11677 /// "type": "string"
11678 /// },
11679 /// "operateTime": {
11680 /// "examples": [
11681 /// 1563368549307
11682 /// ],
11683 /// "type": "integer",
11684 /// "format": "int64"
11685 /// },
11686 /// "serviceChargeAmount": {
11687 /// "examples": [
11688 /// "0.00500000"
11689 /// ],
11690 /// "type": "string"
11691 /// },
11692 /// "tranId": {
11693 /// "examples": [
11694 /// 1563368549307
11695 /// ],
11696 /// "type": "integer",
11697 /// "format": "int64"
11698 /// },
11699 /// "transferedAmount": {
11700 /// "examples": [
11701 /// "0.25000000"
11702 /// ],
11703 /// "type": "string"
11704 /// }
11705 /// }
11706 ///}
11707 /// ```
11708 /// </details>
11709 #[derive(Clone, Debug, Deserialize, Serialize)]
11710 pub struct ConvertDustAssetsToBnbResponseTransferResultItem {
11711 pub amount: String,
11712 #[serde(rename = "fromAsset")]
11713 pub from_asset: String,
11714 #[serde(rename = "operateTime")]
11715 pub operate_time: i64,
11716 #[serde(rename = "serviceChargeAmount")]
11717 pub service_charge_amount: String,
11718 #[serde(rename = "tranId")]
11719 pub tran_id: i64,
11720 #[serde(rename = "transferedAmount")]
11721 pub transfered_amount: String,
11722 }
11723 impl From<&ConvertDustAssetsToBnbResponseTransferResultItem>
11724 for ConvertDustAssetsToBnbResponseTransferResultItem {
11725 fn from(value: &ConvertDustAssetsToBnbResponseTransferResultItem) -> Self {
11726 value.clone()
11727 }
11728 }
11729 ///ConvertExchangeInfoResponseItem
11730 ///
11731 /// <details><summary>JSON schema</summary>
11732 ///
11733 /// ```json
11734 ///{
11735 /// "type": "object",
11736 /// "required": [
11737 /// "fromAsset",
11738 /// "fromAssetMaxAmount",
11739 /// "fromAssetMinAmount",
11740 /// "toAsset",
11741 /// "toAssetMaxAmount",
11742 /// "toAssetMinAmount"
11743 /// ],
11744 /// "properties": {
11745 /// "fromAsset": {
11746 /// "examples": [
11747 /// "BTC"
11748 /// ],
11749 /// "type": "string"
11750 /// },
11751 /// "fromAssetMaxAmount": {
11752 /// "examples": [
11753 /// "50"
11754 /// ],
11755 /// "type": "string"
11756 /// },
11757 /// "fromAssetMinAmount": {
11758 /// "examples": [
11759 /// "0.0004"
11760 /// ],
11761 /// "type": "string"
11762 /// },
11763 /// "toAsset": {
11764 /// "examples": [
11765 /// "USDT"
11766 /// ],
11767 /// "type": "string"
11768 /// },
11769 /// "toAssetMaxAmount": {
11770 /// "examples": [
11771 /// "2500000"
11772 /// ],
11773 /// "type": "string"
11774 /// },
11775 /// "toAssetMinAmount": {
11776 /// "examples": [
11777 /// "20"
11778 /// ],
11779 /// "type": "string"
11780 /// }
11781 /// }
11782 ///}
11783 /// ```
11784 /// </details>
11785 #[derive(Clone, Debug, Deserialize, Serialize)]
11786 pub struct ConvertExchangeInfoResponseItem {
11787 #[serde(rename = "fromAsset")]
11788 pub from_asset: String,
11789 #[serde(rename = "fromAssetMaxAmount")]
11790 pub from_asset_max_amount: String,
11791 #[serde(rename = "fromAssetMinAmount")]
11792 pub from_asset_min_amount: String,
11793 #[serde(rename = "toAsset")]
11794 pub to_asset: String,
11795 #[serde(rename = "toAssetMaxAmount")]
11796 pub to_asset_max_amount: String,
11797 #[serde(rename = "toAssetMinAmount")]
11798 pub to_asset_min_amount: String,
11799 }
11800 impl From<&ConvertExchangeInfoResponseItem> for ConvertExchangeInfoResponseItem {
11801 fn from(value: &ConvertExchangeInfoResponseItem) -> Self {
11802 value.clone()
11803 }
11804 }
11805 ///ConvertGetQuoteResponse
11806 ///
11807 /// <details><summary>JSON schema</summary>
11808 ///
11809 /// ```json
11810 ///{
11811 /// "type": "object",
11812 /// "required": [
11813 /// "fromAmount",
11814 /// "inverseRatio",
11815 /// "quoteId",
11816 /// "ratio",
11817 /// "toAmount",
11818 /// "validTimestamp"
11819 /// ],
11820 /// "properties": {
11821 /// "fromAmount": {
11822 /// "examples": [
11823 /// "0.1"
11824 /// ],
11825 /// "type": "string"
11826 /// },
11827 /// "inverseRatio": {
11828 /// "examples": [
11829 /// "0.0000262"
11830 /// ],
11831 /// "type": "string"
11832 /// },
11833 /// "quoteId": {
11834 /// "examples": [
11835 /// "12415572564"
11836 /// ],
11837 /// "type": "string"
11838 /// },
11839 /// "ratio": {
11840 /// "examples": [
11841 /// "38163.7"
11842 /// ],
11843 /// "type": "string"
11844 /// },
11845 /// "toAmount": {
11846 /// "examples": [
11847 /// "3816.37"
11848 /// ],
11849 /// "type": "string"
11850 /// },
11851 /// "validTimestamp": {
11852 /// "examples": [
11853 /// 1623319461670
11854 /// ],
11855 /// "type": "integer",
11856 /// "format": "int64"
11857 /// }
11858 /// }
11859 ///}
11860 /// ```
11861 /// </details>
11862 #[derive(Clone, Debug, Deserialize, Serialize)]
11863 pub struct ConvertGetQuoteResponse {
11864 #[serde(rename = "fromAmount")]
11865 pub from_amount: String,
11866 #[serde(rename = "inverseRatio")]
11867 pub inverse_ratio: String,
11868 #[serde(rename = "quoteId")]
11869 pub quote_id: String,
11870 pub ratio: String,
11871 #[serde(rename = "toAmount")]
11872 pub to_amount: String,
11873 #[serde(rename = "validTimestamp")]
11874 pub valid_timestamp: i64,
11875 }
11876 impl From<&ConvertGetQuoteResponse> for ConvertGetQuoteResponse {
11877 fn from(value: &ConvertGetQuoteResponse) -> Self {
11878 value.clone()
11879 }
11880 }
11881 ///ConvertOrderStatusResponse
11882 ///
11883 /// <details><summary>JSON schema</summary>
11884 ///
11885 /// ```json
11886 ///{
11887 /// "type": "object",
11888 /// "required": [
11889 /// "createTime",
11890 /// "fromAmount",
11891 /// "fromAsset",
11892 /// "inverseRatio",
11893 /// "orderId",
11894 /// "orderStatus",
11895 /// "ratio",
11896 /// "toAmount",
11897 /// "toAsset"
11898 /// ],
11899 /// "properties": {
11900 /// "createTime": {
11901 /// "examples": [
11902 /// 1623381330472
11903 /// ],
11904 /// "type": "integer",
11905 /// "format": "int64"
11906 /// },
11907 /// "fromAmount": {
11908 /// "examples": [
11909 /// "0.00054414"
11910 /// ],
11911 /// "type": "string"
11912 /// },
11913 /// "fromAsset": {
11914 /// "examples": [
11915 /// "BTC"
11916 /// ],
11917 /// "type": "string"
11918 /// },
11919 /// "inverseRatio": {
11920 /// "examples": [
11921 /// "0.00002721"
11922 /// ],
11923 /// "type": "string"
11924 /// },
11925 /// "orderId": {
11926 /// "examples": [
11927 /// 933256278426274426
11928 /// ],
11929 /// "type": "integer",
11930 /// "format": "int64"
11931 /// },
11932 /// "orderStatus": {
11933 /// "examples": [
11934 /// "SUCCESS"
11935 /// ],
11936 /// "type": "string"
11937 /// },
11938 /// "ratio": {
11939 /// "examples": [
11940 /// "36755"
11941 /// ],
11942 /// "type": "string"
11943 /// },
11944 /// "toAmount": {
11945 /// "examples": [
11946 /// "20"
11947 /// ],
11948 /// "type": "string"
11949 /// },
11950 /// "toAsset": {
11951 /// "examples": [
11952 /// "USDT"
11953 /// ],
11954 /// "type": "string"
11955 /// }
11956 /// }
11957 ///}
11958 /// ```
11959 /// </details>
11960 #[derive(Clone, Debug, Deserialize, Serialize)]
11961 pub struct ConvertOrderStatusResponse {
11962 #[serde(rename = "createTime")]
11963 pub create_time: i64,
11964 #[serde(rename = "fromAmount")]
11965 pub from_amount: String,
11966 #[serde(rename = "fromAsset")]
11967 pub from_asset: String,
11968 #[serde(rename = "inverseRatio")]
11969 pub inverse_ratio: String,
11970 #[serde(rename = "orderId")]
11971 pub order_id: i64,
11972 #[serde(rename = "orderStatus")]
11973 pub order_status: String,
11974 pub ratio: String,
11975 #[serde(rename = "toAmount")]
11976 pub to_amount: String,
11977 #[serde(rename = "toAsset")]
11978 pub to_asset: String,
11979 }
11980 impl From<&ConvertOrderStatusResponse> for ConvertOrderStatusResponse {
11981 fn from(value: &ConvertOrderStatusResponse) -> Self {
11982 value.clone()
11983 }
11984 }
11985 ///ConvertTradeFlowResponse
11986 ///
11987 /// <details><summary>JSON schema</summary>
11988 ///
11989 /// ```json
11990 ///{
11991 /// "type": "object",
11992 /// "required": [
11993 /// "endTime",
11994 /// "limit",
11995 /// "list",
11996 /// "moreData",
11997 /// "startTime"
11998 /// ],
11999 /// "properties": {
12000 /// "endTime": {
12001 /// "examples": [
12002 /// 1626416139000
12003 /// ],
12004 /// "type": "integer",
12005 /// "format": "int64"
12006 /// },
12007 /// "limit": {
12008 /// "examples": [
12009 /// 100
12010 /// ],
12011 /// "type": "integer",
12012 /// "format": "int32"
12013 /// },
12014 /// "list": {
12015 /// "type": "array",
12016 /// "items": {
12017 /// "type": "object",
12018 /// "required": [
12019 /// "createTime",
12020 /// "fromAmount",
12021 /// "fromAsset",
12022 /// "inverseRatio",
12023 /// "orderId",
12024 /// "orderStatus",
12025 /// "quoteId",
12026 /// "ratio",
12027 /// "toAmount",
12028 /// "toAsset"
12029 /// ],
12030 /// "properties": {
12031 /// "createTime": {
12032 /// "examples": [
12033 /// 1624248872184
12034 /// ],
12035 /// "type": "integer",
12036 /// "format": "int64"
12037 /// },
12038 /// "fromAmount": {
12039 /// "examples": [
12040 /// "20"
12041 /// ],
12042 /// "type": "string"
12043 /// },
12044 /// "fromAsset": {
12045 /// "examples": [
12046 /// "USDT"
12047 /// ],
12048 /// "type": "string"
12049 /// },
12050 /// "inverseRatio": {
12051 /// "description": "inverse price",
12052 /// "examples": [
12053 /// "324.99"
12054 /// ],
12055 /// "type": "string"
12056 /// },
12057 /// "orderId": {
12058 /// "examples": [
12059 /// 940708407462087200
12060 /// ],
12061 /// "type": "integer",
12062 /// "format": "int64"
12063 /// },
12064 /// "orderStatus": {
12065 /// "examples": [
12066 /// "SUCCESS"
12067 /// ],
12068 /// "type": "string"
12069 /// },
12070 /// "quoteId": {
12071 /// "examples": [
12072 /// "f3b91c525b2644c7bc1e1cd31b6e1aa6"
12073 /// ],
12074 /// "type": "string"
12075 /// },
12076 /// "ratio": {
12077 /// "description": "price ratio",
12078 /// "examples": [
12079 /// "0.00307702"
12080 /// ],
12081 /// "type": "string"
12082 /// },
12083 /// "toAmount": {
12084 /// "examples": [
12085 /// "0.06154036"
12086 /// ],
12087 /// "type": "string"
12088 /// },
12089 /// "toAsset": {
12090 /// "examples": [
12091 /// "BNB"
12092 /// ],
12093 /// "type": "string"
12094 /// }
12095 /// }
12096 /// }
12097 /// },
12098 /// "moreData": {
12099 /// "examples": [
12100 /// false
12101 /// ],
12102 /// "type": "boolean"
12103 /// },
12104 /// "startTime": {
12105 /// "examples": [
12106 /// 1623824139000
12107 /// ],
12108 /// "type": "integer",
12109 /// "format": "int64"
12110 /// }
12111 /// }
12112 ///}
12113 /// ```
12114 /// </details>
12115 #[derive(Clone, Debug, Deserialize, Serialize)]
12116 pub struct ConvertTradeFlowResponse {
12117 #[serde(rename = "endTime")]
12118 pub end_time: i64,
12119 pub limit: i32,
12120 pub list: Vec<ConvertTradeFlowResponseListItem>,
12121 #[serde(rename = "moreData")]
12122 pub more_data: bool,
12123 #[serde(rename = "startTime")]
12124 pub start_time: i64,
12125 }
12126 impl From<&ConvertTradeFlowResponse> for ConvertTradeFlowResponse {
12127 fn from(value: &ConvertTradeFlowResponse) -> Self {
12128 value.clone()
12129 }
12130 }
12131 ///ConvertTradeFlowResponseListItem
12132 ///
12133 /// <details><summary>JSON schema</summary>
12134 ///
12135 /// ```json
12136 ///{
12137 /// "type": "object",
12138 /// "required": [
12139 /// "createTime",
12140 /// "fromAmount",
12141 /// "fromAsset",
12142 /// "inverseRatio",
12143 /// "orderId",
12144 /// "orderStatus",
12145 /// "quoteId",
12146 /// "ratio",
12147 /// "toAmount",
12148 /// "toAsset"
12149 /// ],
12150 /// "properties": {
12151 /// "createTime": {
12152 /// "examples": [
12153 /// 1624248872184
12154 /// ],
12155 /// "type": "integer",
12156 /// "format": "int64"
12157 /// },
12158 /// "fromAmount": {
12159 /// "examples": [
12160 /// "20"
12161 /// ],
12162 /// "type": "string"
12163 /// },
12164 /// "fromAsset": {
12165 /// "examples": [
12166 /// "USDT"
12167 /// ],
12168 /// "type": "string"
12169 /// },
12170 /// "inverseRatio": {
12171 /// "description": "inverse price",
12172 /// "examples": [
12173 /// "324.99"
12174 /// ],
12175 /// "type": "string"
12176 /// },
12177 /// "orderId": {
12178 /// "examples": [
12179 /// 940708407462087200
12180 /// ],
12181 /// "type": "integer",
12182 /// "format": "int64"
12183 /// },
12184 /// "orderStatus": {
12185 /// "examples": [
12186 /// "SUCCESS"
12187 /// ],
12188 /// "type": "string"
12189 /// },
12190 /// "quoteId": {
12191 /// "examples": [
12192 /// "f3b91c525b2644c7bc1e1cd31b6e1aa6"
12193 /// ],
12194 /// "type": "string"
12195 /// },
12196 /// "ratio": {
12197 /// "description": "price ratio",
12198 /// "examples": [
12199 /// "0.00307702"
12200 /// ],
12201 /// "type": "string"
12202 /// },
12203 /// "toAmount": {
12204 /// "examples": [
12205 /// "0.06154036"
12206 /// ],
12207 /// "type": "string"
12208 /// },
12209 /// "toAsset": {
12210 /// "examples": [
12211 /// "BNB"
12212 /// ],
12213 /// "type": "string"
12214 /// }
12215 /// }
12216 ///}
12217 /// ```
12218 /// </details>
12219 #[derive(Clone, Debug, Deserialize, Serialize)]
12220 pub struct ConvertTradeFlowResponseListItem {
12221 #[serde(rename = "createTime")]
12222 pub create_time: i64,
12223 #[serde(rename = "fromAmount")]
12224 pub from_amount: String,
12225 #[serde(rename = "fromAsset")]
12226 pub from_asset: String,
12227 ///inverse price
12228 #[serde(rename = "inverseRatio")]
12229 pub inverse_ratio: String,
12230 #[serde(rename = "orderId")]
12231 pub order_id: i64,
12232 #[serde(rename = "orderStatus")]
12233 pub order_status: String,
12234 #[serde(rename = "quoteId")]
12235 pub quote_id: String,
12236 ///price ratio
12237 pub ratio: String,
12238 #[serde(rename = "toAmount")]
12239 pub to_amount: String,
12240 #[serde(rename = "toAsset")]
12241 pub to_asset: String,
12242 }
12243 impl From<&ConvertTradeFlowResponseListItem> for ConvertTradeFlowResponseListItem {
12244 fn from(value: &ConvertTradeFlowResponseListItem) -> Self {
12245 value.clone()
12246 }
12247 }
12248 ///CreateListenKeyUserDataStreamResponse
12249 ///
12250 /// <details><summary>JSON schema</summary>
12251 ///
12252 /// ```json
12253 ///{
12254 /// "type": "object",
12255 /// "required": [
12256 /// "listenKey"
12257 /// ],
12258 /// "properties": {
12259 /// "listenKey": {
12260 /// "examples": [
12261 /// "pqia91ma19a5s61cv6a81va65sdf19v8a65a1a5s61cv6a81va65sdf19v8a65a1"
12262 /// ],
12263 /// "type": "string"
12264 /// }
12265 /// }
12266 ///}
12267 /// ```
12268 /// </details>
12269 #[derive(Clone, Debug, Deserialize, Serialize)]
12270 pub struct CreateListenKeyUserDataStreamResponse {
12271 #[serde(rename = "listenKey")]
12272 pub listen_key: String,
12273 }
12274 impl From<&CreateListenKeyUserDataStreamResponse>
12275 for CreateListenKeyUserDataStreamResponse {
12276 fn from(value: &CreateListenKeyUserDataStreamResponse) -> Self {
12277 value.clone()
12278 }
12279 }
12280 ///CreateUserDataStreamResponse
12281 ///
12282 /// <details><summary>JSON schema</summary>
12283 ///
12284 /// ```json
12285 ///{
12286 /// "type": "object",
12287 /// "required": [
12288 /// "listenKey"
12289 /// ],
12290 /// "properties": {
12291 /// "listenKey": {
12292 /// "examples": [
12293 /// "pqia91ma19a5s61cv6a81va65sdf19v8a65a1a5s61cv6a81va65sdf19v8a65a1"
12294 /// ],
12295 /// "type": "string"
12296 /// }
12297 /// }
12298 ///}
12299 /// ```
12300 /// </details>
12301 #[derive(Clone, Debug, Deserialize, Serialize)]
12302 pub struct CreateUserDataStreamResponse {
12303 #[serde(rename = "listenKey")]
12304 pub listen_key: String,
12305 }
12306 impl From<&CreateUserDataStreamResponse> for CreateUserDataStreamResponse {
12307 fn from(value: &CreateUserDataStreamResponse) -> Self {
12308 value.clone()
12309 }
12310 }
12311 ///DepthResponse
12312 ///
12313 /// <details><summary>JSON schema</summary>
12314 ///
12315 /// ```json
12316 ///{
12317 /// "type": "object",
12318 /// "required": [
12319 /// "asks",
12320 /// "bids",
12321 /// "lastUpdateId"
12322 /// ],
12323 /// "properties": {
12324 /// "asks": {
12325 /// "type": "array",
12326 /// "items": {
12327 /// "type": "array",
12328 /// "items": {
12329 /// "type": "string",
12330 /// "maxItems": 2,
12331 /// "minItems": 2
12332 /// }
12333 /// }
12334 /// },
12335 /// "bids": {
12336 /// "type": "array",
12337 /// "items": {
12338 /// "type": "array",
12339 /// "items": {
12340 /// "type": "string",
12341 /// "maxItems": 2,
12342 /// "minItems": 2
12343 /// }
12344 /// }
12345 /// },
12346 /// "lastUpdateId": {
12347 /// "type": "integer",
12348 /// "format": "int64"
12349 /// }
12350 /// }
12351 ///}
12352 /// ```
12353 /// </details>
12354 #[derive(Clone, Debug, Deserialize, Serialize)]
12355 pub struct DepthResponse {
12356 pub asks: Vec<Vec<String>>,
12357 pub bids: Vec<Vec<String>>,
12358 #[serde(rename = "lastUpdateId")]
12359 pub last_update_id: i64,
12360 }
12361 impl From<&DepthResponse> for DepthResponse {
12362 fn from(value: &DepthResponse) -> Self {
12363 value.clone()
12364 }
12365 }
12366 ///DisableIsolatedMarginAccountResponse
12367 ///
12368 /// <details><summary>JSON schema</summary>
12369 ///
12370 /// ```json
12371 ///{
12372 /// "type": "object",
12373 /// "required": [
12374 /// "success",
12375 /// "symbol"
12376 /// ],
12377 /// "properties": {
12378 /// "success": {
12379 /// "type": "boolean"
12380 /// },
12381 /// "symbol": {
12382 /// "examples": [
12383 /// "BTCUSDT"
12384 /// ],
12385 /// "type": "string"
12386 /// }
12387 /// }
12388 ///}
12389 /// ```
12390 /// </details>
12391 #[derive(Clone, Debug, Deserialize, Serialize)]
12392 pub struct DisableIsolatedMarginAccountResponse {
12393 pub success: bool,
12394 pub symbol: String,
12395 }
12396 impl From<&DisableIsolatedMarginAccountResponse>
12397 for DisableIsolatedMarginAccountResponse {
12398 fn from(value: &DisableIsolatedMarginAccountResponse) -> Self {
12399 value.clone()
12400 }
12401 }
12402 ///Error
12403 ///
12404 /// <details><summary>JSON schema</summary>
12405 ///
12406 /// ```json
12407 ///{
12408 /// "type": "object",
12409 /// "required": [
12410 /// "code",
12411 /// "msg"
12412 /// ],
12413 /// "properties": {
12414 /// "code": {
12415 /// "description": "Error code",
12416 /// "type": "integer",
12417 /// "format": "int64"
12418 /// },
12419 /// "msg": {
12420 /// "description": "Error message",
12421 /// "examples": [
12422 /// "error message"
12423 /// ],
12424 /// "type": "string"
12425 /// }
12426 /// }
12427 ///}
12428 /// ```
12429 /// </details>
12430 #[derive(Clone, Debug, Deserialize, Serialize)]
12431 pub struct Error {
12432 ///Error code
12433 pub code: i64,
12434 ///Error message
12435 pub msg: String,
12436 }
12437 impl From<&Error> for Error {
12438 fn from(value: &Error) -> Self {
12439 value.clone()
12440 }
12441 }
12442 ///ExchangeInfoResponse
12443 ///
12444 /// <details><summary>JSON schema</summary>
12445 ///
12446 /// ```json
12447 ///{
12448 /// "type": "object",
12449 /// "required": [
12450 /// "exchangeFilters",
12451 /// "rateLimits",
12452 /// "serverTime",
12453 /// "symbols",
12454 /// "timezone"
12455 /// ],
12456 /// "properties": {
12457 /// "exchangeFilters": {
12458 /// "type": "array",
12459 /// "items": {
12460 /// "type": "object"
12461 /// }
12462 /// },
12463 /// "rateLimits": {
12464 /// "type": "array",
12465 /// "items": {
12466 /// "type": "object",
12467 /// "required": [
12468 /// "interval",
12469 /// "intervalNum",
12470 /// "limit",
12471 /// "rateLimitType"
12472 /// ],
12473 /// "properties": {
12474 /// "interval": {
12475 /// "examples": [
12476 /// "MINUTE"
12477 /// ],
12478 /// "type": "string"
12479 /// },
12480 /// "intervalNum": {
12481 /// "examples": [
12482 /// 1
12483 /// ],
12484 /// "type": "integer",
12485 /// "format": "int32"
12486 /// },
12487 /// "limit": {
12488 /// "examples": [
12489 /// 1200
12490 /// ],
12491 /// "type": "integer",
12492 /// "format": "int32"
12493 /// },
12494 /// "rateLimitType": {
12495 /// "examples": [
12496 /// "REQUEST_WEIGHT"
12497 /// ],
12498 /// "type": "string"
12499 /// }
12500 /// }
12501 /// }
12502 /// },
12503 /// "serverTime": {
12504 /// "examples": [
12505 /// 1592882214236
12506 /// ],
12507 /// "type": "integer",
12508 /// "format": "int64"
12509 /// },
12510 /// "symbols": {
12511 /// "type": "array",
12512 /// "items": {
12513 /// "type": "object",
12514 /// "required": [
12515 /// "allowTrailingStop",
12516 /// "allowedSelfTradePreventionModes",
12517 /// "baseAsset",
12518 /// "baseAssetPrecision",
12519 /// "baseCommissionPrecision",
12520 /// "defaultSelfTradePreventionMode",
12521 /// "filters",
12522 /// "icebergAllowed",
12523 /// "isMarginTradingAllowed",
12524 /// "isSpotTradingAllowed",
12525 /// "ocoAllowed",
12526 /// "orderTypes",
12527 /// "permissions",
12528 /// "quoteAsset",
12529 /// "quoteAssetPrecision",
12530 /// "quoteCommissionPrecision",
12531 /// "quoteOrderQtyMarketAllowed",
12532 /// "status",
12533 /// "symbol"
12534 /// ],
12535 /// "properties": {
12536 /// "allowTrailingStop": {
12537 /// "examples": [
12538 /// false
12539 /// ],
12540 /// "type": "boolean"
12541 /// },
12542 /// "allowedSelfTradePreventionModes": {
12543 /// "type": "array",
12544 /// "items": {
12545 /// "examples": [
12546 /// "NONE"
12547 /// ],
12548 /// "type": "string"
12549 /// }
12550 /// },
12551 /// "baseAsset": {
12552 /// "examples": [
12553 /// "ETH"
12554 /// ],
12555 /// "type": "string"
12556 /// },
12557 /// "baseAssetPrecision": {
12558 /// "examples": [
12559 /// 8
12560 /// ],
12561 /// "type": "integer",
12562 /// "format": "int32"
12563 /// },
12564 /// "baseCommissionPrecision": {
12565 /// "examples": [
12566 /// 8
12567 /// ],
12568 /// "type": "integer",
12569 /// "format": "int32"
12570 /// },
12571 /// "defaultSelfTradePreventionMode": {
12572 /// "examples": [
12573 /// "NONE"
12574 /// ],
12575 /// "type": "string"
12576 /// },
12577 /// "filters": {
12578 /// "type": "array",
12579 /// "items": {
12580 /// "type": "object",
12581 /// "required": [
12582 /// "filterType",
12583 /// "maxPrice",
12584 /// "minPrice",
12585 /// "tickSize"
12586 /// ],
12587 /// "properties": {
12588 /// "filterType": {
12589 /// "examples": [
12590 /// "PRICE_FILTER"
12591 /// ],
12592 /// "type": "string"
12593 /// },
12594 /// "maxPrice": {
12595 /// "examples": [
12596 /// "100000.00000000"
12597 /// ],
12598 /// "type": "string"
12599 /// },
12600 /// "minPrice": {
12601 /// "examples": [
12602 /// "0.00000100"
12603 /// ],
12604 /// "type": "string"
12605 /// },
12606 /// "tickSize": {
12607 /// "examples": [
12608 /// "0.00000100"
12609 /// ],
12610 /// "type": "string"
12611 /// }
12612 /// }
12613 /// }
12614 /// },
12615 /// "icebergAllowed": {
12616 /// "type": "boolean"
12617 /// },
12618 /// "isMarginTradingAllowed": {
12619 /// "type": "boolean"
12620 /// },
12621 /// "isSpotTradingAllowed": {
12622 /// "type": "boolean"
12623 /// },
12624 /// "ocoAllowed": {
12625 /// "type": "boolean"
12626 /// },
12627 /// "orderTypes": {
12628 /// "type": "array",
12629 /// "items": {
12630 /// "examples": [
12631 /// "LIMIT"
12632 /// ],
12633 /// "type": "string"
12634 /// }
12635 /// },
12636 /// "permissions": {
12637 /// "type": "array",
12638 /// "items": {
12639 /// "examples": [
12640 /// "SPOT"
12641 /// ],
12642 /// "type": "string"
12643 /// }
12644 /// },
12645 /// "quoteAsset": {
12646 /// "examples": [
12647 /// "BTC"
12648 /// ],
12649 /// "type": "string"
12650 /// },
12651 /// "quoteAssetPrecision": {
12652 /// "examples": [
12653 /// 8
12654 /// ],
12655 /// "type": "integer",
12656 /// "format": "int32"
12657 /// },
12658 /// "quoteCommissionPrecision": {
12659 /// "examples": [
12660 /// 8
12661 /// ],
12662 /// "type": "integer",
12663 /// "format": "int32"
12664 /// },
12665 /// "quoteOrderQtyMarketAllowed": {
12666 /// "type": "boolean"
12667 /// },
12668 /// "status": {
12669 /// "examples": [
12670 /// "TRADING"
12671 /// ],
12672 /// "type": "string"
12673 /// },
12674 /// "symbol": {
12675 /// "examples": [
12676 /// "ETHBTC"
12677 /// ],
12678 /// "type": "string"
12679 /// }
12680 /// }
12681 /// }
12682 /// },
12683 /// "timezone": {
12684 /// "examples": [
12685 /// "UTC"
12686 /// ],
12687 /// "type": "string"
12688 /// }
12689 /// }
12690 ///}
12691 /// ```
12692 /// </details>
12693 #[derive(Clone, Debug, Deserialize, Serialize)]
12694 pub struct ExchangeInfoResponse {
12695 #[serde(rename = "exchangeFilters")]
12696 pub exchange_filters: Vec<serde_json::Map<String, serde_json::Value>>,
12697 #[serde(rename = "rateLimits")]
12698 pub rate_limits: Vec<ExchangeInfoResponseRateLimitsItem>,
12699 #[serde(rename = "serverTime")]
12700 pub server_time: i64,
12701 pub symbols: Vec<ExchangeInfoResponseSymbolsItem>,
12702 pub timezone: String,
12703 }
12704 impl From<&ExchangeInfoResponse> for ExchangeInfoResponse {
12705 fn from(value: &ExchangeInfoResponse) -> Self {
12706 value.clone()
12707 }
12708 }
12709 ///ExchangeInfoResponseRateLimitsItem
12710 ///
12711 /// <details><summary>JSON schema</summary>
12712 ///
12713 /// ```json
12714 ///{
12715 /// "type": "object",
12716 /// "required": [
12717 /// "interval",
12718 /// "intervalNum",
12719 /// "limit",
12720 /// "rateLimitType"
12721 /// ],
12722 /// "properties": {
12723 /// "interval": {
12724 /// "examples": [
12725 /// "MINUTE"
12726 /// ],
12727 /// "type": "string"
12728 /// },
12729 /// "intervalNum": {
12730 /// "examples": [
12731 /// 1
12732 /// ],
12733 /// "type": "integer",
12734 /// "format": "int32"
12735 /// },
12736 /// "limit": {
12737 /// "examples": [
12738 /// 1200
12739 /// ],
12740 /// "type": "integer",
12741 /// "format": "int32"
12742 /// },
12743 /// "rateLimitType": {
12744 /// "examples": [
12745 /// "REQUEST_WEIGHT"
12746 /// ],
12747 /// "type": "string"
12748 /// }
12749 /// }
12750 ///}
12751 /// ```
12752 /// </details>
12753 #[derive(Clone, Debug, Deserialize, Serialize)]
12754 pub struct ExchangeInfoResponseRateLimitsItem {
12755 pub interval: String,
12756 #[serde(rename = "intervalNum")]
12757 pub interval_num: i32,
12758 pub limit: i32,
12759 #[serde(rename = "rateLimitType")]
12760 pub rate_limit_type: String,
12761 }
12762 impl From<&ExchangeInfoResponseRateLimitsItem>
12763 for ExchangeInfoResponseRateLimitsItem {
12764 fn from(value: &ExchangeInfoResponseRateLimitsItem) -> Self {
12765 value.clone()
12766 }
12767 }
12768 ///ExchangeInfoResponseSymbolsItem
12769 ///
12770 /// <details><summary>JSON schema</summary>
12771 ///
12772 /// ```json
12773 ///{
12774 /// "type": "object",
12775 /// "required": [
12776 /// "allowTrailingStop",
12777 /// "allowedSelfTradePreventionModes",
12778 /// "baseAsset",
12779 /// "baseAssetPrecision",
12780 /// "baseCommissionPrecision",
12781 /// "defaultSelfTradePreventionMode",
12782 /// "filters",
12783 /// "icebergAllowed",
12784 /// "isMarginTradingAllowed",
12785 /// "isSpotTradingAllowed",
12786 /// "ocoAllowed",
12787 /// "orderTypes",
12788 /// "permissions",
12789 /// "quoteAsset",
12790 /// "quoteAssetPrecision",
12791 /// "quoteCommissionPrecision",
12792 /// "quoteOrderQtyMarketAllowed",
12793 /// "status",
12794 /// "symbol"
12795 /// ],
12796 /// "properties": {
12797 /// "allowTrailingStop": {
12798 /// "examples": [
12799 /// false
12800 /// ],
12801 /// "type": "boolean"
12802 /// },
12803 /// "allowedSelfTradePreventionModes": {
12804 /// "type": "array",
12805 /// "items": {
12806 /// "examples": [
12807 /// "NONE"
12808 /// ],
12809 /// "type": "string"
12810 /// }
12811 /// },
12812 /// "baseAsset": {
12813 /// "examples": [
12814 /// "ETH"
12815 /// ],
12816 /// "type": "string"
12817 /// },
12818 /// "baseAssetPrecision": {
12819 /// "examples": [
12820 /// 8
12821 /// ],
12822 /// "type": "integer",
12823 /// "format": "int32"
12824 /// },
12825 /// "baseCommissionPrecision": {
12826 /// "examples": [
12827 /// 8
12828 /// ],
12829 /// "type": "integer",
12830 /// "format": "int32"
12831 /// },
12832 /// "defaultSelfTradePreventionMode": {
12833 /// "examples": [
12834 /// "NONE"
12835 /// ],
12836 /// "type": "string"
12837 /// },
12838 /// "filters": {
12839 /// "type": "array",
12840 /// "items": {
12841 /// "type": "object",
12842 /// "required": [
12843 /// "filterType",
12844 /// "maxPrice",
12845 /// "minPrice",
12846 /// "tickSize"
12847 /// ],
12848 /// "properties": {
12849 /// "filterType": {
12850 /// "examples": [
12851 /// "PRICE_FILTER"
12852 /// ],
12853 /// "type": "string"
12854 /// },
12855 /// "maxPrice": {
12856 /// "examples": [
12857 /// "100000.00000000"
12858 /// ],
12859 /// "type": "string"
12860 /// },
12861 /// "minPrice": {
12862 /// "examples": [
12863 /// "0.00000100"
12864 /// ],
12865 /// "type": "string"
12866 /// },
12867 /// "tickSize": {
12868 /// "examples": [
12869 /// "0.00000100"
12870 /// ],
12871 /// "type": "string"
12872 /// }
12873 /// }
12874 /// }
12875 /// },
12876 /// "icebergAllowed": {
12877 /// "type": "boolean"
12878 /// },
12879 /// "isMarginTradingAllowed": {
12880 /// "type": "boolean"
12881 /// },
12882 /// "isSpotTradingAllowed": {
12883 /// "type": "boolean"
12884 /// },
12885 /// "ocoAllowed": {
12886 /// "type": "boolean"
12887 /// },
12888 /// "orderTypes": {
12889 /// "type": "array",
12890 /// "items": {
12891 /// "examples": [
12892 /// "LIMIT"
12893 /// ],
12894 /// "type": "string"
12895 /// }
12896 /// },
12897 /// "permissions": {
12898 /// "type": "array",
12899 /// "items": {
12900 /// "examples": [
12901 /// "SPOT"
12902 /// ],
12903 /// "type": "string"
12904 /// }
12905 /// },
12906 /// "quoteAsset": {
12907 /// "examples": [
12908 /// "BTC"
12909 /// ],
12910 /// "type": "string"
12911 /// },
12912 /// "quoteAssetPrecision": {
12913 /// "examples": [
12914 /// 8
12915 /// ],
12916 /// "type": "integer",
12917 /// "format": "int32"
12918 /// },
12919 /// "quoteCommissionPrecision": {
12920 /// "examples": [
12921 /// 8
12922 /// ],
12923 /// "type": "integer",
12924 /// "format": "int32"
12925 /// },
12926 /// "quoteOrderQtyMarketAllowed": {
12927 /// "type": "boolean"
12928 /// },
12929 /// "status": {
12930 /// "examples": [
12931 /// "TRADING"
12932 /// ],
12933 /// "type": "string"
12934 /// },
12935 /// "symbol": {
12936 /// "examples": [
12937 /// "ETHBTC"
12938 /// ],
12939 /// "type": "string"
12940 /// }
12941 /// }
12942 ///}
12943 /// ```
12944 /// </details>
12945 #[derive(Clone, Debug, Deserialize, Serialize)]
12946 pub struct ExchangeInfoResponseSymbolsItem {
12947 #[serde(rename = "allowTrailingStop")]
12948 pub allow_trailing_stop: bool,
12949 #[serde(rename = "allowedSelfTradePreventionModes")]
12950 pub allowed_self_trade_prevention_modes: Vec<String>,
12951 #[serde(rename = "baseAsset")]
12952 pub base_asset: String,
12953 #[serde(rename = "baseAssetPrecision")]
12954 pub base_asset_precision: i32,
12955 #[serde(rename = "baseCommissionPrecision")]
12956 pub base_commission_precision: i32,
12957 #[serde(rename = "defaultSelfTradePreventionMode")]
12958 pub default_self_trade_prevention_mode: String,
12959 pub filters: Vec<ExchangeInfoResponseSymbolsItemFiltersItem>,
12960 #[serde(rename = "icebergAllowed")]
12961 pub iceberg_allowed: bool,
12962 #[serde(rename = "isMarginTradingAllowed")]
12963 pub is_margin_trading_allowed: bool,
12964 #[serde(rename = "isSpotTradingAllowed")]
12965 pub is_spot_trading_allowed: bool,
12966 #[serde(rename = "ocoAllowed")]
12967 pub oco_allowed: bool,
12968 #[serde(rename = "orderTypes")]
12969 pub order_types: Vec<String>,
12970 pub permissions: Vec<String>,
12971 #[serde(rename = "quoteAsset")]
12972 pub quote_asset: String,
12973 #[serde(rename = "quoteAssetPrecision")]
12974 pub quote_asset_precision: i32,
12975 #[serde(rename = "quoteCommissionPrecision")]
12976 pub quote_commission_precision: i32,
12977 #[serde(rename = "quoteOrderQtyMarketAllowed")]
12978 pub quote_order_qty_market_allowed: bool,
12979 pub status: String,
12980 pub symbol: String,
12981 }
12982 impl From<&ExchangeInfoResponseSymbolsItem> for ExchangeInfoResponseSymbolsItem {
12983 fn from(value: &ExchangeInfoResponseSymbolsItem) -> Self {
12984 value.clone()
12985 }
12986 }
12987 ///ExchangeInfoResponseSymbolsItemFiltersItem
12988 ///
12989 /// <details><summary>JSON schema</summary>
12990 ///
12991 /// ```json
12992 ///{
12993 /// "type": "object",
12994 /// "required": [
12995 /// "filterType",
12996 /// "maxPrice",
12997 /// "minPrice",
12998 /// "tickSize"
12999 /// ],
13000 /// "properties": {
13001 /// "filterType": {
13002 /// "examples": [
13003 /// "PRICE_FILTER"
13004 /// ],
13005 /// "type": "string"
13006 /// },
13007 /// "maxPrice": {
13008 /// "examples": [
13009 /// "100000.00000000"
13010 /// ],
13011 /// "type": "string"
13012 /// },
13013 /// "minPrice": {
13014 /// "examples": [
13015 /// "0.00000100"
13016 /// ],
13017 /// "type": "string"
13018 /// },
13019 /// "tickSize": {
13020 /// "examples": [
13021 /// "0.00000100"
13022 /// ],
13023 /// "type": "string"
13024 /// }
13025 /// }
13026 ///}
13027 /// ```
13028 /// </details>
13029 #[derive(Clone, Debug, Deserialize, Serialize)]
13030 pub struct ExchangeInfoResponseSymbolsItemFiltersItem {
13031 #[serde(rename = "filterType")]
13032 pub filter_type: String,
13033 #[serde(rename = "maxPrice")]
13034 pub max_price: String,
13035 #[serde(rename = "minPrice")]
13036 pub min_price: String,
13037 #[serde(rename = "tickSize")]
13038 pub tick_size: String,
13039 }
13040 impl From<&ExchangeInfoResponseSymbolsItemFiltersItem>
13041 for ExchangeInfoResponseSymbolsItemFiltersItem {
13042 fn from(value: &ExchangeInfoResponseSymbolsItemFiltersItem) -> Self {
13043 value.clone()
13044 }
13045 }
13046 ///FiatOrdersResponse
13047 ///
13048 /// <details><summary>JSON schema</summary>
13049 ///
13050 /// ```json
13051 ///{
13052 /// "type": "object",
13053 /// "required": [
13054 /// "code",
13055 /// "data",
13056 /// "message",
13057 /// "success",
13058 /// "total"
13059 /// ],
13060 /// "properties": {
13061 /// "code": {
13062 /// "examples": [
13063 /// "000000"
13064 /// ],
13065 /// "type": "string"
13066 /// },
13067 /// "data": {
13068 /// "type": "array",
13069 /// "items": {
13070 /// "type": "object",
13071 /// "required": [
13072 /// "amount",
13073 /// "createTime",
13074 /// "fiatCurrency",
13075 /// "indicatedAmount",
13076 /// "method",
13077 /// "orderNo",
13078 /// "status",
13079 /// "totalFee",
13080 /// "updateTime"
13081 /// ],
13082 /// "properties": {
13083 /// "amount": {
13084 /// "examples": [
13085 /// "10.00"
13086 /// ],
13087 /// "type": "string"
13088 /// },
13089 /// "createTime": {
13090 /// "examples": [
13091 /// 1626144956000
13092 /// ],
13093 /// "type": "integer",
13094 /// "format": "int64"
13095 /// },
13096 /// "fiatCurrency": {
13097 /// "examples": [
13098 /// "BRL"
13099 /// ],
13100 /// "type": "string"
13101 /// },
13102 /// "indicatedAmount": {
13103 /// "examples": [
13104 /// "10.00"
13105 /// ],
13106 /// "type": "string"
13107 /// },
13108 /// "method": {
13109 /// "examples": [
13110 /// "BankAccount"
13111 /// ],
13112 /// "type": "string"
13113 /// },
13114 /// "orderNo": {
13115 /// "examples": [
13116 /// "7d76d611-0568-4f43-afb6-24cac7767365"
13117 /// ],
13118 /// "type": "string"
13119 /// },
13120 /// "status": {
13121 /// "description": "Processing, Failed, Successful, Finished, Refunding, Refunded, Refund Failed, Order Partial credit Stopped",
13122 /// "examples": [
13123 /// "Expired"
13124 /// ],
13125 /// "type": "string"
13126 /// },
13127 /// "totalFee": {
13128 /// "examples": [
13129 /// "0.00"
13130 /// ],
13131 /// "type": "string"
13132 /// },
13133 /// "updateTime": {
13134 /// "examples": [
13135 /// 1626400907000
13136 /// ],
13137 /// "type": "integer",
13138 /// "format": "int64"
13139 /// }
13140 /// }
13141 /// }
13142 /// },
13143 /// "message": {
13144 /// "examples": [
13145 /// "success"
13146 /// ],
13147 /// "type": "string"
13148 /// },
13149 /// "success": {
13150 /// "type": "boolean"
13151 /// },
13152 /// "total": {
13153 /// "examples": [
13154 /// 1
13155 /// ],
13156 /// "type": "integer",
13157 /// "format": "int32"
13158 /// }
13159 /// }
13160 ///}
13161 /// ```
13162 /// </details>
13163 #[derive(Clone, Debug, Deserialize, Serialize)]
13164 pub struct FiatOrdersResponse {
13165 pub code: String,
13166 pub data: Vec<FiatOrdersResponseDataItem>,
13167 pub message: String,
13168 pub success: bool,
13169 pub total: i32,
13170 }
13171 impl From<&FiatOrdersResponse> for FiatOrdersResponse {
13172 fn from(value: &FiatOrdersResponse) -> Self {
13173 value.clone()
13174 }
13175 }
13176 ///FiatOrdersResponseDataItem
13177 ///
13178 /// <details><summary>JSON schema</summary>
13179 ///
13180 /// ```json
13181 ///{
13182 /// "type": "object",
13183 /// "required": [
13184 /// "amount",
13185 /// "createTime",
13186 /// "fiatCurrency",
13187 /// "indicatedAmount",
13188 /// "method",
13189 /// "orderNo",
13190 /// "status",
13191 /// "totalFee",
13192 /// "updateTime"
13193 /// ],
13194 /// "properties": {
13195 /// "amount": {
13196 /// "examples": [
13197 /// "10.00"
13198 /// ],
13199 /// "type": "string"
13200 /// },
13201 /// "createTime": {
13202 /// "examples": [
13203 /// 1626144956000
13204 /// ],
13205 /// "type": "integer",
13206 /// "format": "int64"
13207 /// },
13208 /// "fiatCurrency": {
13209 /// "examples": [
13210 /// "BRL"
13211 /// ],
13212 /// "type": "string"
13213 /// },
13214 /// "indicatedAmount": {
13215 /// "examples": [
13216 /// "10.00"
13217 /// ],
13218 /// "type": "string"
13219 /// },
13220 /// "method": {
13221 /// "examples": [
13222 /// "BankAccount"
13223 /// ],
13224 /// "type": "string"
13225 /// },
13226 /// "orderNo": {
13227 /// "examples": [
13228 /// "7d76d611-0568-4f43-afb6-24cac7767365"
13229 /// ],
13230 /// "type": "string"
13231 /// },
13232 /// "status": {
13233 /// "description": "Processing, Failed, Successful, Finished, Refunding, Refunded, Refund Failed, Order Partial credit Stopped",
13234 /// "examples": [
13235 /// "Expired"
13236 /// ],
13237 /// "type": "string"
13238 /// },
13239 /// "totalFee": {
13240 /// "examples": [
13241 /// "0.00"
13242 /// ],
13243 /// "type": "string"
13244 /// },
13245 /// "updateTime": {
13246 /// "examples": [
13247 /// 1626400907000
13248 /// ],
13249 /// "type": "integer",
13250 /// "format": "int64"
13251 /// }
13252 /// }
13253 ///}
13254 /// ```
13255 /// </details>
13256 #[derive(Clone, Debug, Deserialize, Serialize)]
13257 pub struct FiatOrdersResponseDataItem {
13258 pub amount: String,
13259 #[serde(rename = "createTime")]
13260 pub create_time: i64,
13261 #[serde(rename = "fiatCurrency")]
13262 pub fiat_currency: String,
13263 #[serde(rename = "indicatedAmount")]
13264 pub indicated_amount: String,
13265 pub method: String,
13266 #[serde(rename = "orderNo")]
13267 pub order_no: String,
13268 ///Processing, Failed, Successful, Finished, Refunding, Refunded, Refund Failed, Order Partial credit Stopped
13269 pub status: String,
13270 #[serde(rename = "totalFee")]
13271 pub total_fee: String,
13272 #[serde(rename = "updateTime")]
13273 pub update_time: i64,
13274 }
13275 impl From<&FiatOrdersResponseDataItem> for FiatOrdersResponseDataItem {
13276 fn from(value: &FiatOrdersResponseDataItem) -> Self {
13277 value.clone()
13278 }
13279 }
13280 ///FiatPaymentsResponse
13281 ///
13282 /// <details><summary>JSON schema</summary>
13283 ///
13284 /// ```json
13285 ///{
13286 /// "type": "object",
13287 /// "required": [
13288 /// "code",
13289 /// "data",
13290 /// "message",
13291 /// "success",
13292 /// "total"
13293 /// ],
13294 /// "properties": {
13295 /// "code": {
13296 /// "examples": [
13297 /// "000000"
13298 /// ],
13299 /// "type": "string"
13300 /// },
13301 /// "data": {
13302 /// "type": "array",
13303 /// "items": {
13304 /// "type": "object",
13305 /// "required": [
13306 /// "createTime",
13307 /// "cryptoCurrency",
13308 /// "fiatCurrency",
13309 /// "obtainAmount",
13310 /// "orderNo",
13311 /// "price",
13312 /// "sourceAmount",
13313 /// "status",
13314 /// "totalFee",
13315 /// "updateTime"
13316 /// ],
13317 /// "properties": {
13318 /// "createTime": {
13319 /// "examples": [
13320 /// 1624529919000
13321 /// ],
13322 /// "type": "integer",
13323 /// "format": "int64"
13324 /// },
13325 /// "cryptoCurrency": {
13326 /// "description": "Crypto token",
13327 /// "examples": [
13328 /// "LUNA"
13329 /// ],
13330 /// "type": "string"
13331 /// },
13332 /// "fiatCurrency": {
13333 /// "description": "Fiat token",
13334 /// "examples": [
13335 /// "EUR"
13336 /// ],
13337 /// "type": "string"
13338 /// },
13339 /// "obtainAmount": {
13340 /// "description": "Crypto trade amount",
13341 /// "examples": [
13342 /// "4.462"
13343 /// ],
13344 /// "type": "string"
13345 /// },
13346 /// "orderNo": {
13347 /// "examples": [
13348 /// "353fca443f06466db0c4dc89f94f027a"
13349 /// ],
13350 /// "type": "string"
13351 /// },
13352 /// "price": {
13353 /// "examples": [
13354 /// "4.437472"
13355 /// ],
13356 /// "type": "string"
13357 /// },
13358 /// "sourceAmount": {
13359 /// "description": "Fiat trade amount",
13360 /// "examples": [
13361 /// "20.00"
13362 /// ],
13363 /// "type": "string"
13364 /// },
13365 /// "status": {
13366 /// "description": "Processing, Completed, Failed, Refunded",
13367 /// "examples": [
13368 /// "Failed"
13369 /// ],
13370 /// "type": "string"
13371 /// },
13372 /// "totalFee": {
13373 /// "description": "Trade fee",
13374 /// "examples": [
13375 /// "0.2"
13376 /// ],
13377 /// "type": "string"
13378 /// },
13379 /// "updateTime": {
13380 /// "examples": [
13381 /// 1624529919000
13382 /// ],
13383 /// "type": "integer",
13384 /// "format": "int64"
13385 /// }
13386 /// }
13387 /// }
13388 /// },
13389 /// "message": {
13390 /// "examples": [
13391 /// "success"
13392 /// ],
13393 /// "type": "string"
13394 /// },
13395 /// "success": {
13396 /// "type": "boolean"
13397 /// },
13398 /// "total": {
13399 /// "examples": [
13400 /// 1
13401 /// ],
13402 /// "type": "integer",
13403 /// "format": "int32"
13404 /// }
13405 /// }
13406 ///}
13407 /// ```
13408 /// </details>
13409 #[derive(Clone, Debug, Deserialize, Serialize)]
13410 pub struct FiatPaymentsResponse {
13411 pub code: String,
13412 pub data: Vec<FiatPaymentsResponseDataItem>,
13413 pub message: String,
13414 pub success: bool,
13415 pub total: i32,
13416 }
13417 impl From<&FiatPaymentsResponse> for FiatPaymentsResponse {
13418 fn from(value: &FiatPaymentsResponse) -> Self {
13419 value.clone()
13420 }
13421 }
13422 ///FiatPaymentsResponseDataItem
13423 ///
13424 /// <details><summary>JSON schema</summary>
13425 ///
13426 /// ```json
13427 ///{
13428 /// "type": "object",
13429 /// "required": [
13430 /// "createTime",
13431 /// "cryptoCurrency",
13432 /// "fiatCurrency",
13433 /// "obtainAmount",
13434 /// "orderNo",
13435 /// "price",
13436 /// "sourceAmount",
13437 /// "status",
13438 /// "totalFee",
13439 /// "updateTime"
13440 /// ],
13441 /// "properties": {
13442 /// "createTime": {
13443 /// "examples": [
13444 /// 1624529919000
13445 /// ],
13446 /// "type": "integer",
13447 /// "format": "int64"
13448 /// },
13449 /// "cryptoCurrency": {
13450 /// "description": "Crypto token",
13451 /// "examples": [
13452 /// "LUNA"
13453 /// ],
13454 /// "type": "string"
13455 /// },
13456 /// "fiatCurrency": {
13457 /// "description": "Fiat token",
13458 /// "examples": [
13459 /// "EUR"
13460 /// ],
13461 /// "type": "string"
13462 /// },
13463 /// "obtainAmount": {
13464 /// "description": "Crypto trade amount",
13465 /// "examples": [
13466 /// "4.462"
13467 /// ],
13468 /// "type": "string"
13469 /// },
13470 /// "orderNo": {
13471 /// "examples": [
13472 /// "353fca443f06466db0c4dc89f94f027a"
13473 /// ],
13474 /// "type": "string"
13475 /// },
13476 /// "price": {
13477 /// "examples": [
13478 /// "4.437472"
13479 /// ],
13480 /// "type": "string"
13481 /// },
13482 /// "sourceAmount": {
13483 /// "description": "Fiat trade amount",
13484 /// "examples": [
13485 /// "20.00"
13486 /// ],
13487 /// "type": "string"
13488 /// },
13489 /// "status": {
13490 /// "description": "Processing, Completed, Failed, Refunded",
13491 /// "examples": [
13492 /// "Failed"
13493 /// ],
13494 /// "type": "string"
13495 /// },
13496 /// "totalFee": {
13497 /// "description": "Trade fee",
13498 /// "examples": [
13499 /// "0.2"
13500 /// ],
13501 /// "type": "string"
13502 /// },
13503 /// "updateTime": {
13504 /// "examples": [
13505 /// 1624529919000
13506 /// ],
13507 /// "type": "integer",
13508 /// "format": "int64"
13509 /// }
13510 /// }
13511 ///}
13512 /// ```
13513 /// </details>
13514 #[derive(Clone, Debug, Deserialize, Serialize)]
13515 pub struct FiatPaymentsResponseDataItem {
13516 #[serde(rename = "createTime")]
13517 pub create_time: i64,
13518 ///Crypto token
13519 #[serde(rename = "cryptoCurrency")]
13520 pub crypto_currency: String,
13521 ///Fiat token
13522 #[serde(rename = "fiatCurrency")]
13523 pub fiat_currency: String,
13524 ///Crypto trade amount
13525 #[serde(rename = "obtainAmount")]
13526 pub obtain_amount: String,
13527 #[serde(rename = "orderNo")]
13528 pub order_no: String,
13529 pub price: String,
13530 ///Fiat trade amount
13531 #[serde(rename = "sourceAmount")]
13532 pub source_amount: String,
13533 ///Processing, Completed, Failed, Refunded
13534 pub status: String,
13535 ///Trade fee
13536 #[serde(rename = "totalFee")]
13537 pub total_fee: String,
13538 #[serde(rename = "updateTime")]
13539 pub update_time: i64,
13540 }
13541 impl From<&FiatPaymentsResponseDataItem> for FiatPaymentsResponseDataItem {
13542 fn from(value: &FiatPaymentsResponseDataItem) -> Self {
13543 value.clone()
13544 }
13545 }
13546 ///FuturesHistDataLinkDataType
13547 ///
13548 /// <details><summary>JSON schema</summary>
13549 ///
13550 /// ```json
13551 ///{
13552 /// "examples": [
13553 /// "T_DEPTH"
13554 /// ],
13555 /// "type": "string",
13556 /// "enum": [
13557 /// "T_DEPTH",
13558 /// "S_DEPTH"
13559 /// ]
13560 ///}
13561 /// ```
13562 /// </details>
13563 #[derive(
13564 Clone,
13565 Copy,
13566 Debug,
13567 Deserialize,
13568 Eq,
13569 Hash,
13570 Ord,
13571 PartialEq,
13572 PartialOrd,
13573 Serialize
13574 )]
13575 pub enum FuturesHistDataLinkDataType {
13576 #[serde(rename = "T_DEPTH")]
13577 TDepth,
13578 #[serde(rename = "S_DEPTH")]
13579 SDepth,
13580 }
13581 impl From<&FuturesHistDataLinkDataType> for FuturesHistDataLinkDataType {
13582 fn from(value: &FuturesHistDataLinkDataType) -> Self {
13583 value.clone()
13584 }
13585 }
13586 impl ToString for FuturesHistDataLinkDataType {
13587 fn to_string(&self) -> String {
13588 match *self {
13589 Self::TDepth => "T_DEPTH".to_string(),
13590 Self::SDepth => "S_DEPTH".to_string(),
13591 }
13592 }
13593 }
13594 impl std::str::FromStr for FuturesHistDataLinkDataType {
13595 type Err = self::error::ConversionError;
13596 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
13597 match value {
13598 "T_DEPTH" => Ok(Self::TDepth),
13599 "S_DEPTH" => Ok(Self::SDepth),
13600 _ => Err("invalid value".into()),
13601 }
13602 }
13603 }
13604 impl std::convert::TryFrom<&str> for FuturesHistDataLinkDataType {
13605 type Error = self::error::ConversionError;
13606 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
13607 value.parse()
13608 }
13609 }
13610 impl std::convert::TryFrom<&String> for FuturesHistDataLinkDataType {
13611 type Error = self::error::ConversionError;
13612 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
13613 value.parse()
13614 }
13615 }
13616 impl std::convert::TryFrom<String> for FuturesHistDataLinkDataType {
13617 type Error = self::error::ConversionError;
13618 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
13619 value.parse()
13620 }
13621 }
13622 ///FuturesHistDataLinkResponse
13623 ///
13624 /// <details><summary>JSON schema</summary>
13625 ///
13626 /// ```json
13627 ///{
13628 /// "type": "object",
13629 /// "required": [
13630 /// "data"
13631 /// ],
13632 /// "properties": {
13633 /// "data": {
13634 /// "type": "array",
13635 /// "items": {
13636 /// "type": "object",
13637 /// "required": [
13638 /// "day",
13639 /// "url"
13640 /// ],
13641 /// "properties": {
13642 /// "day": {
13643 /// "examples": [
13644 /// "2023-06-30"
13645 /// ],
13646 /// "type": "string"
13647 /// },
13648 /// "url": {
13649 /// "examples": [
13650 /// "https://bin-prod-user-rebate-bucket.s3.ap-northeast-1.amazonaws.com/xxx"
13651 /// ],
13652 /// "type": "string"
13653 /// }
13654 /// }
13655 /// }
13656 /// }
13657 /// }
13658 ///}
13659 /// ```
13660 /// </details>
13661 #[derive(Clone, Debug, Deserialize, Serialize)]
13662 pub struct FuturesHistDataLinkResponse {
13663 pub data: Vec<FuturesHistDataLinkResponseDataItem>,
13664 }
13665 impl From<&FuturesHistDataLinkResponse> for FuturesHistDataLinkResponse {
13666 fn from(value: &FuturesHistDataLinkResponse) -> Self {
13667 value.clone()
13668 }
13669 }
13670 ///FuturesHistDataLinkResponseDataItem
13671 ///
13672 /// <details><summary>JSON schema</summary>
13673 ///
13674 /// ```json
13675 ///{
13676 /// "type": "object",
13677 /// "required": [
13678 /// "day",
13679 /// "url"
13680 /// ],
13681 /// "properties": {
13682 /// "day": {
13683 /// "examples": [
13684 /// "2023-06-30"
13685 /// ],
13686 /// "type": "string"
13687 /// },
13688 /// "url": {
13689 /// "examples": [
13690 /// "https://bin-prod-user-rebate-bucket.s3.ap-northeast-1.amazonaws.com/xxx"
13691 /// ],
13692 /// "type": "string"
13693 /// }
13694 /// }
13695 ///}
13696 /// ```
13697 /// </details>
13698 #[derive(Clone, Debug, Deserialize, Serialize)]
13699 pub struct FuturesHistDataLinkResponseDataItem {
13700 pub day: String,
13701 pub url: String,
13702 }
13703 impl From<&FuturesHistDataLinkResponseDataItem>
13704 for FuturesHistDataLinkResponseDataItem {
13705 fn from(value: &FuturesHistDataLinkResponseDataItem) -> Self {
13706 value.clone()
13707 }
13708 }
13709 ///FuturesTransferResponse
13710 ///
13711 /// <details><summary>JSON schema</summary>
13712 ///
13713 /// ```json
13714 ///{
13715 /// "type": "object",
13716 /// "required": [
13717 /// "tranId"
13718 /// ],
13719 /// "properties": {
13720 /// "tranId": {
13721 /// "examples": [
13722 /// 100000001
13723 /// ],
13724 /// "type": "integer",
13725 /// "format": "int64"
13726 /// }
13727 /// }
13728 ///}
13729 /// ```
13730 /// </details>
13731 #[derive(Clone, Debug, Deserialize, Serialize)]
13732 pub struct FuturesTransferResponse {
13733 #[serde(rename = "tranId")]
13734 pub tran_id: i64,
13735 }
13736 impl From<&FuturesTransferResponse> for FuturesTransferResponse {
13737 fn from(value: &FuturesTransferResponse) -> Self {
13738 value.clone()
13739 }
13740 }
13741 ///GetAutoRepayFuturesStatusResponse
13742 ///
13743 /// <details><summary>JSON schema</summary>
13744 ///
13745 /// ```json
13746 ///{
13747 /// "type": "object",
13748 /// "required": [
13749 /// "autoRepay"
13750 /// ],
13751 /// "properties": {
13752 /// "autoRepay": {
13753 /// "examples": [
13754 /// true
13755 /// ],
13756 /// "type": "boolean"
13757 /// }
13758 /// }
13759 ///}
13760 /// ```
13761 /// </details>
13762 #[derive(Clone, Debug, Deserialize, Serialize)]
13763 pub struct GetAutoRepayFuturesStatusResponse {
13764 #[serde(rename = "autoRepay")]
13765 pub auto_repay: bool,
13766 }
13767 impl From<&GetAutoRepayFuturesStatusResponse> for GetAutoRepayFuturesStatusResponse {
13768 fn from(value: &GetAutoRepayFuturesStatusResponse) -> Self {
13769 value.clone()
13770 }
13771 }
13772 ///GetFutureAccountTransactionHistoryResponse
13773 ///
13774 /// <details><summary>JSON schema</summary>
13775 ///
13776 /// ```json
13777 ///{
13778 /// "type": "object",
13779 /// "required": [
13780 /// "rows",
13781 /// "total"
13782 /// ],
13783 /// "properties": {
13784 /// "rows": {
13785 /// "type": "array",
13786 /// "items": {
13787 /// "type": "object",
13788 /// "required": [
13789 /// "amount",
13790 /// "asset",
13791 /// "status",
13792 /// "timestamp",
13793 /// "tranId",
13794 /// "type"
13795 /// ],
13796 /// "properties": {
13797 /// "amount": {
13798 /// "examples": [
13799 /// "40.84624400"
13800 /// ],
13801 /// "type": "string"
13802 /// },
13803 /// "asset": {
13804 /// "examples": [
13805 /// "USDT"
13806 /// ],
13807 /// "type": "string"
13808 /// },
13809 /// "status": {
13810 /// "description": "one of PENDING (pending to execution), CONFIRMED (successfully transfered), FAILED (execution failed, nothing happened to your account);",
13811 /// "examples": [
13812 /// "CONFIRMED"
13813 /// ],
13814 /// "type": "string"
13815 /// },
13816 /// "timestamp": {
13817 /// "examples": [
13818 /// 1555056425000
13819 /// ],
13820 /// "type": "integer",
13821 /// "format": "int64"
13822 /// },
13823 /// "tranId": {
13824 /// "examples": [
13825 /// 100000001
13826 /// ],
13827 /// "type": "integer",
13828 /// "format": "int64"
13829 /// },
13830 /// "type": {
13831 /// "examples": [
13832 /// "1"
13833 /// ],
13834 /// "type": "string"
13835 /// }
13836 /// }
13837 /// }
13838 /// },
13839 /// "total": {
13840 /// "examples": [
13841 /// 1
13842 /// ],
13843 /// "type": "integer",
13844 /// "format": "int32"
13845 /// }
13846 /// }
13847 ///}
13848 /// ```
13849 /// </details>
13850 #[derive(Clone, Debug, Deserialize, Serialize)]
13851 pub struct GetFutureAccountTransactionHistoryResponse {
13852 pub rows: Vec<GetFutureAccountTransactionHistoryResponseRowsItem>,
13853 pub total: i32,
13854 }
13855 impl From<&GetFutureAccountTransactionHistoryResponse>
13856 for GetFutureAccountTransactionHistoryResponse {
13857 fn from(value: &GetFutureAccountTransactionHistoryResponse) -> Self {
13858 value.clone()
13859 }
13860 }
13861 ///GetFutureAccountTransactionHistoryResponseRowsItem
13862 ///
13863 /// <details><summary>JSON schema</summary>
13864 ///
13865 /// ```json
13866 ///{
13867 /// "type": "object",
13868 /// "required": [
13869 /// "amount",
13870 /// "asset",
13871 /// "status",
13872 /// "timestamp",
13873 /// "tranId",
13874 /// "type"
13875 /// ],
13876 /// "properties": {
13877 /// "amount": {
13878 /// "examples": [
13879 /// "40.84624400"
13880 /// ],
13881 /// "type": "string"
13882 /// },
13883 /// "asset": {
13884 /// "examples": [
13885 /// "USDT"
13886 /// ],
13887 /// "type": "string"
13888 /// },
13889 /// "status": {
13890 /// "description": "one of PENDING (pending to execution), CONFIRMED (successfully transfered), FAILED (execution failed, nothing happened to your account);",
13891 /// "examples": [
13892 /// "CONFIRMED"
13893 /// ],
13894 /// "type": "string"
13895 /// },
13896 /// "timestamp": {
13897 /// "examples": [
13898 /// 1555056425000
13899 /// ],
13900 /// "type": "integer",
13901 /// "format": "int64"
13902 /// },
13903 /// "tranId": {
13904 /// "examples": [
13905 /// 100000001
13906 /// ],
13907 /// "type": "integer",
13908 /// "format": "int64"
13909 /// },
13910 /// "type": {
13911 /// "examples": [
13912 /// "1"
13913 /// ],
13914 /// "type": "string"
13915 /// }
13916 /// }
13917 ///}
13918 /// ```
13919 /// </details>
13920 #[derive(Clone, Debug, Deserialize, Serialize)]
13921 pub struct GetFutureAccountTransactionHistoryResponseRowsItem {
13922 pub amount: String,
13923 pub asset: String,
13924 ///one of PENDING (pending to execution), CONFIRMED (successfully transfered), FAILED (execution failed, nothing happened to your account);
13925 pub status: String,
13926 pub timestamp: i64,
13927 #[serde(rename = "tranId")]
13928 pub tran_id: i64,
13929 #[serde(rename = "type")]
13930 pub type_: String,
13931 }
13932 impl From<&GetFutureAccountTransactionHistoryResponseRowsItem>
13933 for GetFutureAccountTransactionHistoryResponseRowsItem {
13934 fn from(value: &GetFutureAccountTransactionHistoryResponseRowsItem) -> Self {
13935 value.clone()
13936 }
13937 }
13938 ///GetMarginTransferResponse
13939 ///
13940 /// <details><summary>JSON schema</summary>
13941 ///
13942 /// ```json
13943 ///{
13944 /// "examples": [
13945 /// {
13946 /// "rows": [
13947 /// {
13948 /// "amount": "0.10000000",
13949 /// "asset": "BNB",
13950 /// "status": "CONFIRMED",
13951 /// "timestamp": 1566898617,
13952 /// "txId": 5240372201,
13953 /// "type": "ROLL_IN"
13954 /// }
13955 /// ],
13956 /// "total": 1
13957 /// }
13958 /// ],
13959 /// "type": "object",
13960 /// "required": [
13961 /// "rows",
13962 /// "total"
13963 /// ],
13964 /// "properties": {
13965 /// "rows": {
13966 /// "type": "array",
13967 /// "items": {
13968 /// "type": "object",
13969 /// "required": [
13970 /// "amount",
13971 /// "asset",
13972 /// "status",
13973 /// "timestamp",
13974 /// "txId",
13975 /// "type"
13976 /// ],
13977 /// "properties": {
13978 /// "amount": {
13979 /// "type": "string"
13980 /// },
13981 /// "asset": {
13982 /// "type": "string"
13983 /// },
13984 /// "status": {
13985 /// "type": "string"
13986 /// },
13987 /// "timestamp": {
13988 /// "type": "integer",
13989 /// "format": "int64"
13990 /// },
13991 /// "txId": {
13992 /// "type": "integer",
13993 /// "format": "int64"
13994 /// },
13995 /// "type": {
13996 /// "type": "string"
13997 /// }
13998 /// }
13999 /// }
14000 /// },
14001 /// "total": {
14002 /// "examples": [
14003 /// 3
14004 /// ],
14005 /// "type": "integer",
14006 /// "format": "int32"
14007 /// }
14008 /// }
14009 ///}
14010 /// ```
14011 /// </details>
14012 #[derive(Clone, Debug, Deserialize, Serialize)]
14013 pub struct GetMarginTransferResponse {
14014 pub rows: Vec<GetMarginTransferResponseRowsItem>,
14015 pub total: i32,
14016 }
14017 impl From<&GetMarginTransferResponse> for GetMarginTransferResponse {
14018 fn from(value: &GetMarginTransferResponse) -> Self {
14019 value.clone()
14020 }
14021 }
14022 ///GetMarginTransferResponseRowsItem
14023 ///
14024 /// <details><summary>JSON schema</summary>
14025 ///
14026 /// ```json
14027 ///{
14028 /// "type": "object",
14029 /// "required": [
14030 /// "amount",
14031 /// "asset",
14032 /// "status",
14033 /// "timestamp",
14034 /// "txId",
14035 /// "type"
14036 /// ],
14037 /// "properties": {
14038 /// "amount": {
14039 /// "type": "string"
14040 /// },
14041 /// "asset": {
14042 /// "type": "string"
14043 /// },
14044 /// "status": {
14045 /// "type": "string"
14046 /// },
14047 /// "timestamp": {
14048 /// "type": "integer",
14049 /// "format": "int64"
14050 /// },
14051 /// "txId": {
14052 /// "type": "integer",
14053 /// "format": "int64"
14054 /// },
14055 /// "type": {
14056 /// "type": "string"
14057 /// }
14058 /// }
14059 ///}
14060 /// ```
14061 /// </details>
14062 #[derive(Clone, Debug, Deserialize, Serialize)]
14063 pub struct GetMarginTransferResponseRowsItem {
14064 pub amount: String,
14065 pub asset: String,
14066 pub status: String,
14067 pub timestamp: i64,
14068 #[serde(rename = "txId")]
14069 pub tx_id: i64,
14070 #[serde(rename = "type")]
14071 pub type_: String,
14072 }
14073 impl From<&GetMarginTransferResponseRowsItem> for GetMarginTransferResponseRowsItem {
14074 fn from(value: &GetMarginTransferResponseRowsItem) -> Self {
14075 value.clone()
14076 }
14077 }
14078 ///GetMarginTransferType
14079 ///
14080 /// <details><summary>JSON schema</summary>
14081 ///
14082 /// ```json
14083 ///{
14084 /// "type": "string",
14085 /// "enum": [
14086 /// "ROLL_IN",
14087 /// "ROLL_OUT"
14088 /// ]
14089 ///}
14090 /// ```
14091 /// </details>
14092 #[derive(
14093 Clone,
14094 Copy,
14095 Debug,
14096 Deserialize,
14097 Eq,
14098 Hash,
14099 Ord,
14100 PartialEq,
14101 PartialOrd,
14102 Serialize
14103 )]
14104 pub enum GetMarginTransferType {
14105 #[serde(rename = "ROLL_IN")]
14106 RollIn,
14107 #[serde(rename = "ROLL_OUT")]
14108 RollOut,
14109 }
14110 impl From<&GetMarginTransferType> for GetMarginTransferType {
14111 fn from(value: &GetMarginTransferType) -> Self {
14112 value.clone()
14113 }
14114 }
14115 impl ToString for GetMarginTransferType {
14116 fn to_string(&self) -> String {
14117 match *self {
14118 Self::RollIn => "ROLL_IN".to_string(),
14119 Self::RollOut => "ROLL_OUT".to_string(),
14120 }
14121 }
14122 }
14123 impl std::str::FromStr for GetMarginTransferType {
14124 type Err = self::error::ConversionError;
14125 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
14126 match value {
14127 "ROLL_IN" => Ok(Self::RollIn),
14128 "ROLL_OUT" => Ok(Self::RollOut),
14129 _ => Err("invalid value".into()),
14130 }
14131 }
14132 }
14133 impl std::convert::TryFrom<&str> for GetMarginTransferType {
14134 type Error = self::error::ConversionError;
14135 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
14136 value.parse()
14137 }
14138 }
14139 impl std::convert::TryFrom<&String> for GetMarginTransferType {
14140 type Error = self::error::ConversionError;
14141 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
14142 value.parse()
14143 }
14144 }
14145 impl std::convert::TryFrom<String> for GetMarginTransferType {
14146 type Error = self::error::ConversionError;
14147 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
14148 value.parse()
14149 }
14150 }
14151 ///GiftcardBuyCodeResponse
14152 ///
14153 /// <details><summary>JSON schema</summary>
14154 ///
14155 /// ```json
14156 ///{
14157 /// "type": "object",
14158 /// "required": [
14159 /// "code",
14160 /// "data",
14161 /// "message",
14162 /// "success"
14163 /// ],
14164 /// "properties": {
14165 /// "code": {
14166 /// "examples": [
14167 /// "000000"
14168 /// ],
14169 /// "type": "string"
14170 /// },
14171 /// "data": {
14172 /// "type": "object",
14173 /// "required": [
14174 /// "code",
14175 /// "referenceNo"
14176 /// ],
14177 /// "properties": {
14178 /// "code": {
14179 /// "examples": [
14180 /// "AOGANK3NB4GIT3C6"
14181 /// ],
14182 /// "type": "string"
14183 /// },
14184 /// "referenceNo": {
14185 /// "examples": [
14186 /// "0033002327977405"
14187 /// ],
14188 /// "type": "string"
14189 /// }
14190 /// }
14191 /// },
14192 /// "message": {
14193 /// "examples": [
14194 /// "success"
14195 /// ],
14196 /// "type": "string"
14197 /// },
14198 /// "success": {
14199 /// "type": "boolean"
14200 /// }
14201 /// }
14202 ///}
14203 /// ```
14204 /// </details>
14205 #[derive(Clone, Debug, Deserialize, Serialize)]
14206 pub struct GiftcardBuyCodeResponse {
14207 pub code: String,
14208 pub data: GiftcardBuyCodeResponseData,
14209 pub message: String,
14210 pub success: bool,
14211 }
14212 impl From<&GiftcardBuyCodeResponse> for GiftcardBuyCodeResponse {
14213 fn from(value: &GiftcardBuyCodeResponse) -> Self {
14214 value.clone()
14215 }
14216 }
14217 ///GiftcardBuyCodeResponseData
14218 ///
14219 /// <details><summary>JSON schema</summary>
14220 ///
14221 /// ```json
14222 ///{
14223 /// "type": "object",
14224 /// "required": [
14225 /// "code",
14226 /// "referenceNo"
14227 /// ],
14228 /// "properties": {
14229 /// "code": {
14230 /// "examples": [
14231 /// "AOGANK3NB4GIT3C6"
14232 /// ],
14233 /// "type": "string"
14234 /// },
14235 /// "referenceNo": {
14236 /// "examples": [
14237 /// "0033002327977405"
14238 /// ],
14239 /// "type": "string"
14240 /// }
14241 /// }
14242 ///}
14243 /// ```
14244 /// </details>
14245 #[derive(Clone, Debug, Deserialize, Serialize)]
14246 pub struct GiftcardBuyCodeResponseData {
14247 pub code: String,
14248 #[serde(rename = "referenceNo")]
14249 pub reference_no: String,
14250 }
14251 impl From<&GiftcardBuyCodeResponseData> for GiftcardBuyCodeResponseData {
14252 fn from(value: &GiftcardBuyCodeResponseData) -> Self {
14253 value.clone()
14254 }
14255 }
14256 ///GiftcardBuyCodeTokenLimitResponse
14257 ///
14258 /// <details><summary>JSON schema</summary>
14259 ///
14260 /// ```json
14261 ///{
14262 /// "type": "object",
14263 /// "required": [
14264 /// "code",
14265 /// "data",
14266 /// "message",
14267 /// "success"
14268 /// ],
14269 /// "properties": {
14270 /// "code": {
14271 /// "examples": [
14272 /// "000000"
14273 /// ],
14274 /// "type": "string"
14275 /// },
14276 /// "data": {
14277 /// "type": "object",
14278 /// "required": [
14279 /// "code",
14280 /// "referenceNo"
14281 /// ],
14282 /// "properties": {
14283 /// "coin": {
14284 /// "examples": [
14285 /// "BNB"
14286 /// ],
14287 /// "type": "string"
14288 /// },
14289 /// "fromMax": {
14290 /// "examples": [
14291 /// "1"
14292 /// ],
14293 /// "type": "string"
14294 /// },
14295 /// "fromMin": {
14296 /// "examples": [
14297 /// "0.01"
14298 /// ],
14299 /// "type": "string"
14300 /// }
14301 /// }
14302 /// },
14303 /// "message": {
14304 /// "examples": [
14305 /// "success"
14306 /// ],
14307 /// "type": "string"
14308 /// },
14309 /// "success": {
14310 /// "type": "boolean"
14311 /// }
14312 /// }
14313 ///}
14314 /// ```
14315 /// </details>
14316 #[derive(Clone, Debug, Deserialize, Serialize)]
14317 pub struct GiftcardBuyCodeTokenLimitResponse {
14318 pub code: String,
14319 pub data: GiftcardBuyCodeTokenLimitResponseData,
14320 pub message: String,
14321 pub success: bool,
14322 }
14323 impl From<&GiftcardBuyCodeTokenLimitResponse> for GiftcardBuyCodeTokenLimitResponse {
14324 fn from(value: &GiftcardBuyCodeTokenLimitResponse) -> Self {
14325 value.clone()
14326 }
14327 }
14328 ///GiftcardBuyCodeTokenLimitResponseData
14329 ///
14330 /// <details><summary>JSON schema</summary>
14331 ///
14332 /// ```json
14333 ///{
14334 /// "type": "object",
14335 /// "required": [
14336 /// "code",
14337 /// "referenceNo"
14338 /// ],
14339 /// "properties": {
14340 /// "coin": {
14341 /// "examples": [
14342 /// "BNB"
14343 /// ],
14344 /// "type": "string"
14345 /// },
14346 /// "fromMax": {
14347 /// "examples": [
14348 /// "1"
14349 /// ],
14350 /// "type": "string"
14351 /// },
14352 /// "fromMin": {
14353 /// "examples": [
14354 /// "0.01"
14355 /// ],
14356 /// "type": "string"
14357 /// }
14358 /// }
14359 ///}
14360 /// ```
14361 /// </details>
14362 #[derive(Clone, Debug, Deserialize, Serialize)]
14363 pub struct GiftcardBuyCodeTokenLimitResponseData {
14364 pub code: serde_json::Value,
14365 #[serde(default, skip_serializing_if = "Option::is_none")]
14366 pub coin: Option<String>,
14367 #[serde(rename = "fromMax", default, skip_serializing_if = "Option::is_none")]
14368 pub from_max: Option<String>,
14369 #[serde(rename = "fromMin", default, skip_serializing_if = "Option::is_none")]
14370 pub from_min: Option<String>,
14371 #[serde(rename = "referenceNo")]
14372 pub reference_no: serde_json::Value,
14373 }
14374 impl From<&GiftcardBuyCodeTokenLimitResponseData>
14375 for GiftcardBuyCodeTokenLimitResponseData {
14376 fn from(value: &GiftcardBuyCodeTokenLimitResponseData) -> Self {
14377 value.clone()
14378 }
14379 }
14380 ///GiftcardCreateCodeResponse
14381 ///
14382 /// <details><summary>JSON schema</summary>
14383 ///
14384 /// ```json
14385 ///{
14386 /// "type": "object",
14387 /// "required": [
14388 /// "code",
14389 /// "data",
14390 /// "message",
14391 /// "success"
14392 /// ],
14393 /// "properties": {
14394 /// "code": {
14395 /// "examples": [
14396 /// "000000"
14397 /// ],
14398 /// "type": "string"
14399 /// },
14400 /// "data": {
14401 /// "type": "object",
14402 /// "required": [
14403 /// "code",
14404 /// "referenceNo"
14405 /// ],
14406 /// "properties": {
14407 /// "code": {
14408 /// "examples": [
14409 /// "AOGANK3NB4GIT3C6"
14410 /// ],
14411 /// "type": "string"
14412 /// },
14413 /// "referenceNo": {
14414 /// "examples": [
14415 /// "0033002327977405"
14416 /// ],
14417 /// "type": "string"
14418 /// }
14419 /// }
14420 /// },
14421 /// "message": {
14422 /// "examples": [
14423 /// "success"
14424 /// ],
14425 /// "type": "string"
14426 /// },
14427 /// "success": {
14428 /// "type": "boolean"
14429 /// }
14430 /// }
14431 ///}
14432 /// ```
14433 /// </details>
14434 #[derive(Clone, Debug, Deserialize, Serialize)]
14435 pub struct GiftcardCreateCodeResponse {
14436 pub code: String,
14437 pub data: GiftcardCreateCodeResponseData,
14438 pub message: String,
14439 pub success: bool,
14440 }
14441 impl From<&GiftcardCreateCodeResponse> for GiftcardCreateCodeResponse {
14442 fn from(value: &GiftcardCreateCodeResponse) -> Self {
14443 value.clone()
14444 }
14445 }
14446 ///GiftcardCreateCodeResponseData
14447 ///
14448 /// <details><summary>JSON schema</summary>
14449 ///
14450 /// ```json
14451 ///{
14452 /// "type": "object",
14453 /// "required": [
14454 /// "code",
14455 /// "referenceNo"
14456 /// ],
14457 /// "properties": {
14458 /// "code": {
14459 /// "examples": [
14460 /// "AOGANK3NB4GIT3C6"
14461 /// ],
14462 /// "type": "string"
14463 /// },
14464 /// "referenceNo": {
14465 /// "examples": [
14466 /// "0033002327977405"
14467 /// ],
14468 /// "type": "string"
14469 /// }
14470 /// }
14471 ///}
14472 /// ```
14473 /// </details>
14474 #[derive(Clone, Debug, Deserialize, Serialize)]
14475 pub struct GiftcardCreateCodeResponseData {
14476 pub code: String,
14477 #[serde(rename = "referenceNo")]
14478 pub reference_no: String,
14479 }
14480 impl From<&GiftcardCreateCodeResponseData> for GiftcardCreateCodeResponseData {
14481 fn from(value: &GiftcardCreateCodeResponseData) -> Self {
14482 value.clone()
14483 }
14484 }
14485 ///GiftcardCryptographyRsaPublicKeyResponse
14486 ///
14487 /// <details><summary>JSON schema</summary>
14488 ///
14489 /// ```json
14490 ///{
14491 /// "type": "object",
14492 /// "required": [
14493 /// "code",
14494 /// "data",
14495 /// "message",
14496 /// "success"
14497 /// ],
14498 /// "properties": {
14499 /// "code": {
14500 /// "examples": [
14501 /// "000000"
14502 /// ],
14503 /// "type": "string"
14504 /// },
14505 /// "data": {
14506 /// "examples": [
14507 /// "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCXBBVKLAc1GQ5FsIFFqOHrPTox5noBONIKr+IAedTR9FkVxq6e65updEbfdhRNkMOeYIO2i0UylrjGC0X8YSoIszmrVHeV0l06Zh1oJuZos1+7N+WLuz9JvlPaawof3GUakTxYWWCa9+8KIbLKsoKMdfS96VT+8iOXO3quMGKUmQIDAQAB"
14508 /// ],
14509 /// "type": "string"
14510 /// },
14511 /// "message": {
14512 /// "examples": [
14513 /// "success"
14514 /// ],
14515 /// "type": "string"
14516 /// },
14517 /// "success": {
14518 /// "examples": [
14519 /// true
14520 /// ],
14521 /// "type": "boolean"
14522 /// }
14523 /// }
14524 ///}
14525 /// ```
14526 /// </details>
14527 #[derive(Clone, Debug, Deserialize, Serialize)]
14528 pub struct GiftcardCryptographyRsaPublicKeyResponse {
14529 pub code: String,
14530 pub data: String,
14531 pub message: String,
14532 pub success: bool,
14533 }
14534 impl From<&GiftcardCryptographyRsaPublicKeyResponse>
14535 for GiftcardCryptographyRsaPublicKeyResponse {
14536 fn from(value: &GiftcardCryptographyRsaPublicKeyResponse) -> Self {
14537 value.clone()
14538 }
14539 }
14540 ///GiftcardRedeemCodeResponse
14541 ///
14542 /// <details><summary>JSON schema</summary>
14543 ///
14544 /// ```json
14545 ///{
14546 /// "type": "object",
14547 /// "required": [
14548 /// "code",
14549 /// "data",
14550 /// "message",
14551 /// "success"
14552 /// ],
14553 /// "properties": {
14554 /// "code": {
14555 /// "examples": [
14556 /// "000000"
14557 /// ],
14558 /// "type": "string"
14559 /// },
14560 /// "data": {
14561 /// "type": "object",
14562 /// "required": [
14563 /// "amount",
14564 /// "identityNo",
14565 /// "referenceNo",
14566 /// "token"
14567 /// ],
14568 /// "properties": {
14569 /// "amount": {
14570 /// "examples": [
14571 /// "10"
14572 /// ],
14573 /// "type": "string"
14574 /// },
14575 /// "identityNo": {
14576 /// "examples": [
14577 /// "10316281761814589440"
14578 /// ],
14579 /// "type": "string"
14580 /// },
14581 /// "referenceNo": {
14582 /// "examples": [
14583 /// "0033002327977405"
14584 /// ],
14585 /// "type": "string"
14586 /// },
14587 /// "token": {
14588 /// "examples": [
14589 /// "BNB"
14590 /// ],
14591 /// "type": "string"
14592 /// }
14593 /// }
14594 /// },
14595 /// "message": {
14596 /// "examples": [
14597 /// "success"
14598 /// ],
14599 /// "type": "string"
14600 /// },
14601 /// "success": {
14602 /// "type": "boolean"
14603 /// }
14604 /// }
14605 ///}
14606 /// ```
14607 /// </details>
14608 #[derive(Clone, Debug, Deserialize, Serialize)]
14609 pub struct GiftcardRedeemCodeResponse {
14610 pub code: String,
14611 pub data: GiftcardRedeemCodeResponseData,
14612 pub message: String,
14613 pub success: bool,
14614 }
14615 impl From<&GiftcardRedeemCodeResponse> for GiftcardRedeemCodeResponse {
14616 fn from(value: &GiftcardRedeemCodeResponse) -> Self {
14617 value.clone()
14618 }
14619 }
14620 ///GiftcardRedeemCodeResponseData
14621 ///
14622 /// <details><summary>JSON schema</summary>
14623 ///
14624 /// ```json
14625 ///{
14626 /// "type": "object",
14627 /// "required": [
14628 /// "amount",
14629 /// "identityNo",
14630 /// "referenceNo",
14631 /// "token"
14632 /// ],
14633 /// "properties": {
14634 /// "amount": {
14635 /// "examples": [
14636 /// "10"
14637 /// ],
14638 /// "type": "string"
14639 /// },
14640 /// "identityNo": {
14641 /// "examples": [
14642 /// "10316281761814589440"
14643 /// ],
14644 /// "type": "string"
14645 /// },
14646 /// "referenceNo": {
14647 /// "examples": [
14648 /// "0033002327977405"
14649 /// ],
14650 /// "type": "string"
14651 /// },
14652 /// "token": {
14653 /// "examples": [
14654 /// "BNB"
14655 /// ],
14656 /// "type": "string"
14657 /// }
14658 /// }
14659 ///}
14660 /// ```
14661 /// </details>
14662 #[derive(Clone, Debug, Deserialize, Serialize)]
14663 pub struct GiftcardRedeemCodeResponseData {
14664 pub amount: String,
14665 #[serde(rename = "identityNo")]
14666 pub identity_no: String,
14667 #[serde(rename = "referenceNo")]
14668 pub reference_no: String,
14669 pub token: String,
14670 }
14671 impl From<&GiftcardRedeemCodeResponseData> for GiftcardRedeemCodeResponseData {
14672 fn from(value: &GiftcardRedeemCodeResponseData) -> Self {
14673 value.clone()
14674 }
14675 }
14676 ///GiftcardVerifyResponse
14677 ///
14678 /// <details><summary>JSON schema</summary>
14679 ///
14680 /// ```json
14681 ///{
14682 /// "type": "object",
14683 /// "required": [
14684 /// "code",
14685 /// "data",
14686 /// "message",
14687 /// "success"
14688 /// ],
14689 /// "properties": {
14690 /// "code": {
14691 /// "examples": [
14692 /// "000000"
14693 /// ],
14694 /// "type": "string"
14695 /// },
14696 /// "data": {
14697 /// "type": "object",
14698 /// "required": [
14699 /// "amount",
14700 /// "token",
14701 /// "valid"
14702 /// ],
14703 /// "properties": {
14704 /// "amount": {
14705 /// "examples": [
14706 /// "0.00000001"
14707 /// ],
14708 /// "type": "string"
14709 /// },
14710 /// "token": {
14711 /// "examples": [
14712 /// "BNB"
14713 /// ],
14714 /// "type": "string"
14715 /// },
14716 /// "valid": {
14717 /// "type": "boolean"
14718 /// }
14719 /// }
14720 /// },
14721 /// "message": {
14722 /// "examples": [
14723 /// "success"
14724 /// ],
14725 /// "type": "string"
14726 /// },
14727 /// "success": {
14728 /// "type": "boolean"
14729 /// }
14730 /// }
14731 ///}
14732 /// ```
14733 /// </details>
14734 #[derive(Clone, Debug, Deserialize, Serialize)]
14735 pub struct GiftcardVerifyResponse {
14736 pub code: String,
14737 pub data: GiftcardVerifyResponseData,
14738 pub message: String,
14739 pub success: bool,
14740 }
14741 impl From<&GiftcardVerifyResponse> for GiftcardVerifyResponse {
14742 fn from(value: &GiftcardVerifyResponse) -> Self {
14743 value.clone()
14744 }
14745 }
14746 ///GiftcardVerifyResponseData
14747 ///
14748 /// <details><summary>JSON schema</summary>
14749 ///
14750 /// ```json
14751 ///{
14752 /// "type": "object",
14753 /// "required": [
14754 /// "amount",
14755 /// "token",
14756 /// "valid"
14757 /// ],
14758 /// "properties": {
14759 /// "amount": {
14760 /// "examples": [
14761 /// "0.00000001"
14762 /// ],
14763 /// "type": "string"
14764 /// },
14765 /// "token": {
14766 /// "examples": [
14767 /// "BNB"
14768 /// ],
14769 /// "type": "string"
14770 /// },
14771 /// "valid": {
14772 /// "type": "boolean"
14773 /// }
14774 /// }
14775 ///}
14776 /// ```
14777 /// </details>
14778 #[derive(Clone, Debug, Deserialize, Serialize)]
14779 pub struct GiftcardVerifyResponseData {
14780 pub amount: String,
14781 pub token: String,
14782 pub valid: bool,
14783 }
14784 impl From<&GiftcardVerifyResponseData> for GiftcardVerifyResponseData {
14785 fn from(value: &GiftcardVerifyResponseData) -> Self {
14786 value.clone()
14787 }
14788 }
14789 ///IsolatedMarginAccountInfo
14790 ///
14791 /// <details><summary>JSON schema</summary>
14792 ///
14793 /// ```json
14794 ///{
14795 /// "type": "object",
14796 /// "required": [
14797 /// "assets",
14798 /// "totalAssetOfBtc",
14799 /// "totalLiabilityOfBtc",
14800 /// "totalNetAssetOfBtc"
14801 /// ],
14802 /// "properties": {
14803 /// "assets": {
14804 /// "type": "array",
14805 /// "items": {
14806 /// "type": "object",
14807 /// "required": [
14808 /// "baseAsset",
14809 /// "enabled",
14810 /// "indexPrice",
14811 /// "isolatedCreated",
14812 /// "liquidatePrice",
14813 /// "liquidateRate",
14814 /// "marginLevel",
14815 /// "marginLevelStatus",
14816 /// "marginRatio",
14817 /// "quoteAsset",
14818 /// "symbol",
14819 /// "tradeEnabled"
14820 /// ],
14821 /// "properties": {
14822 /// "baseAsset": {
14823 /// "type": "object",
14824 /// "required": [
14825 /// "asset",
14826 /// "borrowEnabled",
14827 /// "borrowed",
14828 /// "free",
14829 /// "interest",
14830 /// "locked",
14831 /// "netAsset",
14832 /// "netAssetOfBtc",
14833 /// "repayEnabled",
14834 /// "totalAsset"
14835 /// ],
14836 /// "properties": {
14837 /// "asset": {
14838 /// "examples": [
14839 /// "BTC"
14840 /// ],
14841 /// "type": "string"
14842 /// },
14843 /// "borrowEnabled": {
14844 /// "type": "boolean"
14845 /// },
14846 /// "borrowed": {
14847 /// "examples": [
14848 /// "0.00000000"
14849 /// ],
14850 /// "type": "string"
14851 /// },
14852 /// "free": {
14853 /// "examples": [
14854 /// "0.00000000"
14855 /// ],
14856 /// "type": "string"
14857 /// },
14858 /// "interest": {
14859 /// "examples": [
14860 /// "0.00000000"
14861 /// ],
14862 /// "type": "string"
14863 /// },
14864 /// "locked": {
14865 /// "examples": [
14866 /// "0.00000000"
14867 /// ],
14868 /// "type": "string"
14869 /// },
14870 /// "netAsset": {
14871 /// "examples": [
14872 /// "0.00000000"
14873 /// ],
14874 /// "type": "string"
14875 /// },
14876 /// "netAssetOfBtc": {
14877 /// "examples": [
14878 /// "0.00000000"
14879 /// ],
14880 /// "type": "string"
14881 /// },
14882 /// "repayEnabled": {
14883 /// "type": "boolean"
14884 /// },
14885 /// "totalAsset": {
14886 /// "examples": [
14887 /// "0.00000000"
14888 /// ],
14889 /// "type": "string"
14890 /// }
14891 /// }
14892 /// },
14893 /// "enabled": {
14894 /// "description": "true-enabled, false-disabled",
14895 /// "type": "boolean"
14896 /// },
14897 /// "indexPrice": {
14898 /// "examples": [
14899 /// "10000.00000000"
14900 /// ],
14901 /// "type": "string"
14902 /// },
14903 /// "isolatedCreated": {
14904 /// "type": "boolean"
14905 /// },
14906 /// "liquidatePrice": {
14907 /// "examples": [
14908 /// "1000.00000000"
14909 /// ],
14910 /// "type": "string"
14911 /// },
14912 /// "liquidateRate": {
14913 /// "examples": [
14914 /// "1.00000000"
14915 /// ],
14916 /// "type": "string"
14917 /// },
14918 /// "marginLevel": {
14919 /// "examples": [
14920 /// "0.00000000"
14921 /// ],
14922 /// "type": "string"
14923 /// },
14924 /// "marginLevelStatus": {
14925 /// "description": "\"EXCESSIVE\", \"NORMAL\", \"MARGIN_CALL\", \"PRE_LIQUIDATION\", \"FORCE_LIQUIDATION\"",
14926 /// "examples": [
14927 /// "EXCESSIVE"
14928 /// ],
14929 /// "type": "string"
14930 /// },
14931 /// "marginRatio": {
14932 /// "examples": [
14933 /// "0.00000000"
14934 /// ],
14935 /// "type": "string"
14936 /// },
14937 /// "quoteAsset": {
14938 /// "type": "object",
14939 /// "required": [
14940 /// "asset",
14941 /// "borrowEnabled",
14942 /// "borrowed",
14943 /// "free",
14944 /// "interest",
14945 /// "locked",
14946 /// "netAsset",
14947 /// "netAssetOfBtc",
14948 /// "repayEnabled",
14949 /// "totalAsset"
14950 /// ],
14951 /// "properties": {
14952 /// "asset": {
14953 /// "examples": [
14954 /// "USDT"
14955 /// ],
14956 /// "type": "string"
14957 /// },
14958 /// "borrowEnabled": {
14959 /// "type": "boolean"
14960 /// },
14961 /// "borrowed": {
14962 /// "examples": [
14963 /// "0.00000000"
14964 /// ],
14965 /// "type": "string"
14966 /// },
14967 /// "free": {
14968 /// "examples": [
14969 /// "0.00000000"
14970 /// ],
14971 /// "type": "string"
14972 /// },
14973 /// "interest": {
14974 /// "examples": [
14975 /// "0.00000000"
14976 /// ],
14977 /// "type": "string"
14978 /// },
14979 /// "locked": {
14980 /// "examples": [
14981 /// "0.00000000"
14982 /// ],
14983 /// "type": "string"
14984 /// },
14985 /// "netAsset": {
14986 /// "examples": [
14987 /// "0.00000000"
14988 /// ],
14989 /// "type": "string"
14990 /// },
14991 /// "netAssetOfBtc": {
14992 /// "examples": [
14993 /// "0.00000000"
14994 /// ],
14995 /// "type": "string"
14996 /// },
14997 /// "repayEnabled": {
14998 /// "type": "boolean"
14999 /// },
15000 /// "totalAsset": {
15001 /// "examples": [
15002 /// "0.00000000"
15003 /// ],
15004 /// "type": "string"
15005 /// }
15006 /// }
15007 /// },
15008 /// "symbol": {
15009 /// "examples": [
15010 /// "BTCUSDT"
15011 /// ],
15012 /// "type": "string"
15013 /// },
15014 /// "tradeEnabled": {
15015 /// "type": "boolean"
15016 /// }
15017 /// }
15018 /// }
15019 /// },
15020 /// "totalAssetOfBtc": {
15021 /// "examples": [
15022 /// "0.00000000"
15023 /// ],
15024 /// "type": "string"
15025 /// },
15026 /// "totalLiabilityOfBtc": {
15027 /// "examples": [
15028 /// "0.00000000"
15029 /// ],
15030 /// "type": "string"
15031 /// },
15032 /// "totalNetAssetOfBtc": {
15033 /// "examples": [
15034 /// "0.00000000"
15035 /// ],
15036 /// "type": "string"
15037 /// }
15038 /// }
15039 ///}
15040 /// ```
15041 /// </details>
15042 #[derive(Clone, Debug, Deserialize, Serialize)]
15043 pub struct IsolatedMarginAccountInfo {
15044 pub assets: Vec<IsolatedMarginAccountInfoAssetsItem>,
15045 #[serde(rename = "totalAssetOfBtc")]
15046 pub total_asset_of_btc: String,
15047 #[serde(rename = "totalLiabilityOfBtc")]
15048 pub total_liability_of_btc: String,
15049 #[serde(rename = "totalNetAssetOfBtc")]
15050 pub total_net_asset_of_btc: String,
15051 }
15052 impl From<&IsolatedMarginAccountInfo> for IsolatedMarginAccountInfo {
15053 fn from(value: &IsolatedMarginAccountInfo) -> Self {
15054 value.clone()
15055 }
15056 }
15057 ///IsolatedMarginAccountInfoAssetsItem
15058 ///
15059 /// <details><summary>JSON schema</summary>
15060 ///
15061 /// ```json
15062 ///{
15063 /// "type": "object",
15064 /// "required": [
15065 /// "baseAsset",
15066 /// "enabled",
15067 /// "indexPrice",
15068 /// "isolatedCreated",
15069 /// "liquidatePrice",
15070 /// "liquidateRate",
15071 /// "marginLevel",
15072 /// "marginLevelStatus",
15073 /// "marginRatio",
15074 /// "quoteAsset",
15075 /// "symbol",
15076 /// "tradeEnabled"
15077 /// ],
15078 /// "properties": {
15079 /// "baseAsset": {
15080 /// "type": "object",
15081 /// "required": [
15082 /// "asset",
15083 /// "borrowEnabled",
15084 /// "borrowed",
15085 /// "free",
15086 /// "interest",
15087 /// "locked",
15088 /// "netAsset",
15089 /// "netAssetOfBtc",
15090 /// "repayEnabled",
15091 /// "totalAsset"
15092 /// ],
15093 /// "properties": {
15094 /// "asset": {
15095 /// "examples": [
15096 /// "BTC"
15097 /// ],
15098 /// "type": "string"
15099 /// },
15100 /// "borrowEnabled": {
15101 /// "type": "boolean"
15102 /// },
15103 /// "borrowed": {
15104 /// "examples": [
15105 /// "0.00000000"
15106 /// ],
15107 /// "type": "string"
15108 /// },
15109 /// "free": {
15110 /// "examples": [
15111 /// "0.00000000"
15112 /// ],
15113 /// "type": "string"
15114 /// },
15115 /// "interest": {
15116 /// "examples": [
15117 /// "0.00000000"
15118 /// ],
15119 /// "type": "string"
15120 /// },
15121 /// "locked": {
15122 /// "examples": [
15123 /// "0.00000000"
15124 /// ],
15125 /// "type": "string"
15126 /// },
15127 /// "netAsset": {
15128 /// "examples": [
15129 /// "0.00000000"
15130 /// ],
15131 /// "type": "string"
15132 /// },
15133 /// "netAssetOfBtc": {
15134 /// "examples": [
15135 /// "0.00000000"
15136 /// ],
15137 /// "type": "string"
15138 /// },
15139 /// "repayEnabled": {
15140 /// "type": "boolean"
15141 /// },
15142 /// "totalAsset": {
15143 /// "examples": [
15144 /// "0.00000000"
15145 /// ],
15146 /// "type": "string"
15147 /// }
15148 /// }
15149 /// },
15150 /// "enabled": {
15151 /// "description": "true-enabled, false-disabled",
15152 /// "type": "boolean"
15153 /// },
15154 /// "indexPrice": {
15155 /// "examples": [
15156 /// "10000.00000000"
15157 /// ],
15158 /// "type": "string"
15159 /// },
15160 /// "isolatedCreated": {
15161 /// "type": "boolean"
15162 /// },
15163 /// "liquidatePrice": {
15164 /// "examples": [
15165 /// "1000.00000000"
15166 /// ],
15167 /// "type": "string"
15168 /// },
15169 /// "liquidateRate": {
15170 /// "examples": [
15171 /// "1.00000000"
15172 /// ],
15173 /// "type": "string"
15174 /// },
15175 /// "marginLevel": {
15176 /// "examples": [
15177 /// "0.00000000"
15178 /// ],
15179 /// "type": "string"
15180 /// },
15181 /// "marginLevelStatus": {
15182 /// "description": "\"EXCESSIVE\", \"NORMAL\", \"MARGIN_CALL\", \"PRE_LIQUIDATION\", \"FORCE_LIQUIDATION\"",
15183 /// "examples": [
15184 /// "EXCESSIVE"
15185 /// ],
15186 /// "type": "string"
15187 /// },
15188 /// "marginRatio": {
15189 /// "examples": [
15190 /// "0.00000000"
15191 /// ],
15192 /// "type": "string"
15193 /// },
15194 /// "quoteAsset": {
15195 /// "type": "object",
15196 /// "required": [
15197 /// "asset",
15198 /// "borrowEnabled",
15199 /// "borrowed",
15200 /// "free",
15201 /// "interest",
15202 /// "locked",
15203 /// "netAsset",
15204 /// "netAssetOfBtc",
15205 /// "repayEnabled",
15206 /// "totalAsset"
15207 /// ],
15208 /// "properties": {
15209 /// "asset": {
15210 /// "examples": [
15211 /// "USDT"
15212 /// ],
15213 /// "type": "string"
15214 /// },
15215 /// "borrowEnabled": {
15216 /// "type": "boolean"
15217 /// },
15218 /// "borrowed": {
15219 /// "examples": [
15220 /// "0.00000000"
15221 /// ],
15222 /// "type": "string"
15223 /// },
15224 /// "free": {
15225 /// "examples": [
15226 /// "0.00000000"
15227 /// ],
15228 /// "type": "string"
15229 /// },
15230 /// "interest": {
15231 /// "examples": [
15232 /// "0.00000000"
15233 /// ],
15234 /// "type": "string"
15235 /// },
15236 /// "locked": {
15237 /// "examples": [
15238 /// "0.00000000"
15239 /// ],
15240 /// "type": "string"
15241 /// },
15242 /// "netAsset": {
15243 /// "examples": [
15244 /// "0.00000000"
15245 /// ],
15246 /// "type": "string"
15247 /// },
15248 /// "netAssetOfBtc": {
15249 /// "examples": [
15250 /// "0.00000000"
15251 /// ],
15252 /// "type": "string"
15253 /// },
15254 /// "repayEnabled": {
15255 /// "type": "boolean"
15256 /// },
15257 /// "totalAsset": {
15258 /// "examples": [
15259 /// "0.00000000"
15260 /// ],
15261 /// "type": "string"
15262 /// }
15263 /// }
15264 /// },
15265 /// "symbol": {
15266 /// "examples": [
15267 /// "BTCUSDT"
15268 /// ],
15269 /// "type": "string"
15270 /// },
15271 /// "tradeEnabled": {
15272 /// "type": "boolean"
15273 /// }
15274 /// }
15275 ///}
15276 /// ```
15277 /// </details>
15278 #[derive(Clone, Debug, Deserialize, Serialize)]
15279 pub struct IsolatedMarginAccountInfoAssetsItem {
15280 #[serde(rename = "baseAsset")]
15281 pub base_asset: IsolatedMarginAccountInfoAssetsItemBaseAsset,
15282 ///true-enabled, false-disabled
15283 pub enabled: bool,
15284 #[serde(rename = "indexPrice")]
15285 pub index_price: String,
15286 #[serde(rename = "isolatedCreated")]
15287 pub isolated_created: bool,
15288 #[serde(rename = "liquidatePrice")]
15289 pub liquidate_price: String,
15290 #[serde(rename = "liquidateRate")]
15291 pub liquidate_rate: String,
15292 #[serde(rename = "marginLevel")]
15293 pub margin_level: String,
15294 ///"EXCESSIVE", "NORMAL", "MARGIN_CALL", "PRE_LIQUIDATION", "FORCE_LIQUIDATION"
15295 #[serde(rename = "marginLevelStatus")]
15296 pub margin_level_status: String,
15297 #[serde(rename = "marginRatio")]
15298 pub margin_ratio: String,
15299 #[serde(rename = "quoteAsset")]
15300 pub quote_asset: IsolatedMarginAccountInfoAssetsItemQuoteAsset,
15301 pub symbol: String,
15302 #[serde(rename = "tradeEnabled")]
15303 pub trade_enabled: bool,
15304 }
15305 impl From<&IsolatedMarginAccountInfoAssetsItem>
15306 for IsolatedMarginAccountInfoAssetsItem {
15307 fn from(value: &IsolatedMarginAccountInfoAssetsItem) -> Self {
15308 value.clone()
15309 }
15310 }
15311 ///IsolatedMarginAccountInfoAssetsItemBaseAsset
15312 ///
15313 /// <details><summary>JSON schema</summary>
15314 ///
15315 /// ```json
15316 ///{
15317 /// "type": "object",
15318 /// "required": [
15319 /// "asset",
15320 /// "borrowEnabled",
15321 /// "borrowed",
15322 /// "free",
15323 /// "interest",
15324 /// "locked",
15325 /// "netAsset",
15326 /// "netAssetOfBtc",
15327 /// "repayEnabled",
15328 /// "totalAsset"
15329 /// ],
15330 /// "properties": {
15331 /// "asset": {
15332 /// "examples": [
15333 /// "BTC"
15334 /// ],
15335 /// "type": "string"
15336 /// },
15337 /// "borrowEnabled": {
15338 /// "type": "boolean"
15339 /// },
15340 /// "borrowed": {
15341 /// "examples": [
15342 /// "0.00000000"
15343 /// ],
15344 /// "type": "string"
15345 /// },
15346 /// "free": {
15347 /// "examples": [
15348 /// "0.00000000"
15349 /// ],
15350 /// "type": "string"
15351 /// },
15352 /// "interest": {
15353 /// "examples": [
15354 /// "0.00000000"
15355 /// ],
15356 /// "type": "string"
15357 /// },
15358 /// "locked": {
15359 /// "examples": [
15360 /// "0.00000000"
15361 /// ],
15362 /// "type": "string"
15363 /// },
15364 /// "netAsset": {
15365 /// "examples": [
15366 /// "0.00000000"
15367 /// ],
15368 /// "type": "string"
15369 /// },
15370 /// "netAssetOfBtc": {
15371 /// "examples": [
15372 /// "0.00000000"
15373 /// ],
15374 /// "type": "string"
15375 /// },
15376 /// "repayEnabled": {
15377 /// "type": "boolean"
15378 /// },
15379 /// "totalAsset": {
15380 /// "examples": [
15381 /// "0.00000000"
15382 /// ],
15383 /// "type": "string"
15384 /// }
15385 /// }
15386 ///}
15387 /// ```
15388 /// </details>
15389 #[derive(Clone, Debug, Deserialize, Serialize)]
15390 pub struct IsolatedMarginAccountInfoAssetsItemBaseAsset {
15391 pub asset: String,
15392 #[serde(rename = "borrowEnabled")]
15393 pub borrow_enabled: bool,
15394 pub borrowed: String,
15395 pub free: String,
15396 pub interest: String,
15397 pub locked: String,
15398 #[serde(rename = "netAsset")]
15399 pub net_asset: String,
15400 #[serde(rename = "netAssetOfBtc")]
15401 pub net_asset_of_btc: String,
15402 #[serde(rename = "repayEnabled")]
15403 pub repay_enabled: bool,
15404 #[serde(rename = "totalAsset")]
15405 pub total_asset: String,
15406 }
15407 impl From<&IsolatedMarginAccountInfoAssetsItemBaseAsset>
15408 for IsolatedMarginAccountInfoAssetsItemBaseAsset {
15409 fn from(value: &IsolatedMarginAccountInfoAssetsItemBaseAsset) -> Self {
15410 value.clone()
15411 }
15412 }
15413 ///IsolatedMarginAccountInfoAssetsItemQuoteAsset
15414 ///
15415 /// <details><summary>JSON schema</summary>
15416 ///
15417 /// ```json
15418 ///{
15419 /// "type": "object",
15420 /// "required": [
15421 /// "asset",
15422 /// "borrowEnabled",
15423 /// "borrowed",
15424 /// "free",
15425 /// "interest",
15426 /// "locked",
15427 /// "netAsset",
15428 /// "netAssetOfBtc",
15429 /// "repayEnabled",
15430 /// "totalAsset"
15431 /// ],
15432 /// "properties": {
15433 /// "asset": {
15434 /// "examples": [
15435 /// "USDT"
15436 /// ],
15437 /// "type": "string"
15438 /// },
15439 /// "borrowEnabled": {
15440 /// "type": "boolean"
15441 /// },
15442 /// "borrowed": {
15443 /// "examples": [
15444 /// "0.00000000"
15445 /// ],
15446 /// "type": "string"
15447 /// },
15448 /// "free": {
15449 /// "examples": [
15450 /// "0.00000000"
15451 /// ],
15452 /// "type": "string"
15453 /// },
15454 /// "interest": {
15455 /// "examples": [
15456 /// "0.00000000"
15457 /// ],
15458 /// "type": "string"
15459 /// },
15460 /// "locked": {
15461 /// "examples": [
15462 /// "0.00000000"
15463 /// ],
15464 /// "type": "string"
15465 /// },
15466 /// "netAsset": {
15467 /// "examples": [
15468 /// "0.00000000"
15469 /// ],
15470 /// "type": "string"
15471 /// },
15472 /// "netAssetOfBtc": {
15473 /// "examples": [
15474 /// "0.00000000"
15475 /// ],
15476 /// "type": "string"
15477 /// },
15478 /// "repayEnabled": {
15479 /// "type": "boolean"
15480 /// },
15481 /// "totalAsset": {
15482 /// "examples": [
15483 /// "0.00000000"
15484 /// ],
15485 /// "type": "string"
15486 /// }
15487 /// }
15488 ///}
15489 /// ```
15490 /// </details>
15491 #[derive(Clone, Debug, Deserialize, Serialize)]
15492 pub struct IsolatedMarginAccountInfoAssetsItemQuoteAsset {
15493 pub asset: String,
15494 #[serde(rename = "borrowEnabled")]
15495 pub borrow_enabled: bool,
15496 pub borrowed: String,
15497 pub free: String,
15498 pub interest: String,
15499 pub locked: String,
15500 #[serde(rename = "netAsset")]
15501 pub net_asset: String,
15502 #[serde(rename = "netAssetOfBtc")]
15503 pub net_asset_of_btc: String,
15504 #[serde(rename = "repayEnabled")]
15505 pub repay_enabled: bool,
15506 #[serde(rename = "totalAsset")]
15507 pub total_asset: String,
15508 }
15509 impl From<&IsolatedMarginAccountInfoAssetsItemQuoteAsset>
15510 for IsolatedMarginAccountInfoAssetsItemQuoteAsset {
15511 fn from(value: &IsolatedMarginAccountInfoAssetsItemQuoteAsset) -> Self {
15512 value.clone()
15513 }
15514 }
15515 ///KlineCandlestickDataInterval
15516 ///
15517 /// <details><summary>JSON schema</summary>
15518 ///
15519 /// ```json
15520 ///{
15521 /// "examples": [
15522 /// "\"1m\""
15523 /// ],
15524 /// "type": "string",
15525 /// "enum": [
15526 /// "1s",
15527 /// "1m",
15528 /// "3m",
15529 /// "5m",
15530 /// "15m",
15531 /// "30m",
15532 /// "1h",
15533 /// "2h",
15534 /// "4h",
15535 /// "6h",
15536 /// "8h",
15537 /// "12h",
15538 /// "1d",
15539 /// "3d",
15540 /// "1w"
15541 /// ]
15542 ///}
15543 /// ```
15544 /// </details>
15545 #[derive(
15546 Clone,
15547 Copy,
15548 Debug,
15549 Deserialize,
15550 Eq,
15551 Hash,
15552 Ord,
15553 PartialEq,
15554 PartialOrd,
15555 Serialize
15556 )]
15557 pub enum KlineCandlestickDataInterval {
15558 #[serde(rename = "1s")]
15559 _1s,
15560 #[serde(rename = "1m")]
15561 _1m,
15562 #[serde(rename = "3m")]
15563 _3m,
15564 #[serde(rename = "5m")]
15565 _5m,
15566 #[serde(rename = "15m")]
15567 _15m,
15568 #[serde(rename = "30m")]
15569 _30m,
15570 #[serde(rename = "1h")]
15571 _1h,
15572 #[serde(rename = "2h")]
15573 _2h,
15574 #[serde(rename = "4h")]
15575 _4h,
15576 #[serde(rename = "6h")]
15577 _6h,
15578 #[serde(rename = "8h")]
15579 _8h,
15580 #[serde(rename = "12h")]
15581 _12h,
15582 #[serde(rename = "1d")]
15583 _1d,
15584 #[serde(rename = "3d")]
15585 _3d,
15586 #[serde(rename = "1w")]
15587 _1w,
15588 }
15589 impl From<&KlineCandlestickDataInterval> for KlineCandlestickDataInterval {
15590 fn from(value: &KlineCandlestickDataInterval) -> Self {
15591 value.clone()
15592 }
15593 }
15594 impl ToString for KlineCandlestickDataInterval {
15595 fn to_string(&self) -> String {
15596 match *self {
15597 Self::_1s => "1s".to_string(),
15598 Self::_1m => "1m".to_string(),
15599 Self::_3m => "3m".to_string(),
15600 Self::_5m => "5m".to_string(),
15601 Self::_15m => "15m".to_string(),
15602 Self::_30m => "30m".to_string(),
15603 Self::_1h => "1h".to_string(),
15604 Self::_2h => "2h".to_string(),
15605 Self::_4h => "4h".to_string(),
15606 Self::_6h => "6h".to_string(),
15607 Self::_8h => "8h".to_string(),
15608 Self::_12h => "12h".to_string(),
15609 Self::_1d => "1d".to_string(),
15610 Self::_3d => "3d".to_string(),
15611 Self::_1w => "1w".to_string(),
15612 }
15613 }
15614 }
15615 impl std::str::FromStr for KlineCandlestickDataInterval {
15616 type Err = self::error::ConversionError;
15617 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
15618 match value {
15619 "1s" => Ok(Self::_1s),
15620 "1m" => Ok(Self::_1m),
15621 "3m" => Ok(Self::_3m),
15622 "5m" => Ok(Self::_5m),
15623 "15m" => Ok(Self::_15m),
15624 "30m" => Ok(Self::_30m),
15625 "1h" => Ok(Self::_1h),
15626 "2h" => Ok(Self::_2h),
15627 "4h" => Ok(Self::_4h),
15628 "6h" => Ok(Self::_6h),
15629 "8h" => Ok(Self::_8h),
15630 "12h" => Ok(Self::_12h),
15631 "1d" => Ok(Self::_1d),
15632 "3d" => Ok(Self::_3d),
15633 "1w" => Ok(Self::_1w),
15634 _ => Err("invalid value".into()),
15635 }
15636 }
15637 }
15638 impl std::convert::TryFrom<&str> for KlineCandlestickDataInterval {
15639 type Error = self::error::ConversionError;
15640 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
15641 value.parse()
15642 }
15643 }
15644 impl std::convert::TryFrom<&String> for KlineCandlestickDataInterval {
15645 type Error = self::error::ConversionError;
15646 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
15647 value.parse()
15648 }
15649 }
15650 impl std::convert::TryFrom<String> for KlineCandlestickDataInterval {
15651 type Error = self::error::ConversionError;
15652 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
15653 value.parse()
15654 }
15655 }
15656 ///KlineCandlestickDataResponseItemItem
15657 ///
15658 /// <details><summary>JSON schema</summary>
15659 ///
15660 /// ```json
15661 ///{
15662 /// "oneOf": [
15663 /// {
15664 /// "type": "integer",
15665 /// "format": "int64"
15666 /// },
15667 /// {
15668 /// "type": "string"
15669 /// }
15670 /// ],
15671 /// "maxItems": 12,
15672 /// "minItems": 12
15673 ///}
15674 /// ```
15675 /// </details>
15676 #[derive(Clone, Debug, Deserialize, Serialize)]
15677 #[serde(untagged)]
15678 pub enum KlineCandlestickDataResponseItemItem {
15679 Variant0(i64),
15680 Variant1(String),
15681 }
15682 impl From<&KlineCandlestickDataResponseItemItem>
15683 for KlineCandlestickDataResponseItemItem {
15684 fn from(value: &KlineCandlestickDataResponseItemItem) -> Self {
15685 value.clone()
15686 }
15687 }
15688 impl std::str::FromStr for KlineCandlestickDataResponseItemItem {
15689 type Err = self::error::ConversionError;
15690 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
15691 if let Ok(v) = value.parse() {
15692 Ok(Self::Variant0(v))
15693 } else if let Ok(v) = value.parse() {
15694 Ok(Self::Variant1(v))
15695 } else {
15696 Err("string conversion failed for all variants".into())
15697 }
15698 }
15699 }
15700 impl std::convert::TryFrom<&str> for KlineCandlestickDataResponseItemItem {
15701 type Error = self::error::ConversionError;
15702 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
15703 value.parse()
15704 }
15705 }
15706 impl std::convert::TryFrom<&String> for KlineCandlestickDataResponseItemItem {
15707 type Error = self::error::ConversionError;
15708 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
15709 value.parse()
15710 }
15711 }
15712 impl std::convert::TryFrom<String> for KlineCandlestickDataResponseItemItem {
15713 type Error = self::error::ConversionError;
15714 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
15715 value.parse()
15716 }
15717 }
15718 impl ToString for KlineCandlestickDataResponseItemItem {
15719 fn to_string(&self) -> String {
15720 match self {
15721 Self::Variant0(x) => x.to_string(),
15722 Self::Variant1(x) => x.to_string(),
15723 }
15724 }
15725 }
15726 impl From<i64> for KlineCandlestickDataResponseItemItem {
15727 fn from(value: i64) -> Self {
15728 Self::Variant0(value)
15729 }
15730 }
15731 ///LendingAutoInvestAllAssetResponse
15732 ///
15733 /// <details><summary>JSON schema</summary>
15734 ///
15735 /// ```json
15736 ///{
15737 /// "type": "object",
15738 /// "required": [
15739 /// "sourceAssets",
15740 /// "targetAssets"
15741 /// ],
15742 /// "properties": {
15743 /// "sourceAssets": {
15744 /// "type": "array",
15745 /// "items": {
15746 /// "examples": [
15747 /// [
15748 /// "BTC",
15749 /// "BNB"
15750 /// ]
15751 /// ],
15752 /// "type": "string"
15753 /// }
15754 /// },
15755 /// "targetAssets": {
15756 /// "type": "array",
15757 /// "items": {
15758 /// "examples": [
15759 /// [
15760 /// "BTC",
15761 /// "BNB"
15762 /// ]
15763 /// ],
15764 /// "type": "string"
15765 /// }
15766 /// }
15767 /// }
15768 ///}
15769 /// ```
15770 /// </details>
15771 #[derive(Clone, Debug, Deserialize, Serialize)]
15772 pub struct LendingAutoInvestAllAssetResponse {
15773 #[serde(rename = "sourceAssets")]
15774 pub source_assets: Vec<String>,
15775 #[serde(rename = "targetAssets")]
15776 pub target_assets: Vec<String>,
15777 }
15778 impl From<&LendingAutoInvestAllAssetResponse> for LendingAutoInvestAllAssetResponse {
15779 fn from(value: &LendingAutoInvestAllAssetResponse) -> Self {
15780 value.clone()
15781 }
15782 }
15783 ///LendingAutoInvestSourceAssetListResponse
15784 ///
15785 /// <details><summary>JSON schema</summary>
15786 ///
15787 /// ```json
15788 ///{
15789 /// "type": "object",
15790 /// "required": [
15791 /// "feeRate",
15792 /// "sourceAssets"
15793 /// ],
15794 /// "properties": {
15795 /// "feeRate": {
15796 /// "examples": [
15797 /// "0.002"
15798 /// ],
15799 /// "type": "string"
15800 /// },
15801 /// "sourceAssets": {
15802 /// "type": "array",
15803 /// "items": {
15804 /// "type": "object",
15805 /// "required": [
15806 /// "assetMaxAmount",
15807 /// "assetMinAmount",
15808 /// "flexibleAmount",
15809 /// "scale",
15810 /// "sourceAsset"
15811 /// ],
15812 /// "properties": {
15813 /// "assetMaxAmount": {
15814 /// "examples": [
15815 /// "1000000"
15816 /// ],
15817 /// "type": "string"
15818 /// },
15819 /// "assetMinAmount": {
15820 /// "examples": [
15821 /// "0.1"
15822 /// ],
15823 /// "type": "string"
15824 /// },
15825 /// "flexibleAmount": {
15826 /// "examples": [
15827 /// "1111"
15828 /// ],
15829 /// "type": "string"
15830 /// },
15831 /// "scale": {
15832 /// "examples": [
15833 /// "2"
15834 /// ],
15835 /// "type": "string"
15836 /// },
15837 /// "sourceAsset": {
15838 /// "examples": [
15839 /// "USDT"
15840 /// ],
15841 /// "type": "string"
15842 /// }
15843 /// }
15844 /// }
15845 /// }
15846 /// }
15847 ///}
15848 /// ```
15849 /// </details>
15850 #[derive(Clone, Debug, Deserialize, Serialize)]
15851 pub struct LendingAutoInvestSourceAssetListResponse {
15852 #[serde(rename = "feeRate")]
15853 pub fee_rate: String,
15854 #[serde(rename = "sourceAssets")]
15855 pub source_assets: Vec<LendingAutoInvestSourceAssetListResponseSourceAssetsItem>,
15856 }
15857 impl From<&LendingAutoInvestSourceAssetListResponse>
15858 for LendingAutoInvestSourceAssetListResponse {
15859 fn from(value: &LendingAutoInvestSourceAssetListResponse) -> Self {
15860 value.clone()
15861 }
15862 }
15863 ///LendingAutoInvestSourceAssetListResponseSourceAssetsItem
15864 ///
15865 /// <details><summary>JSON schema</summary>
15866 ///
15867 /// ```json
15868 ///{
15869 /// "type": "object",
15870 /// "required": [
15871 /// "assetMaxAmount",
15872 /// "assetMinAmount",
15873 /// "flexibleAmount",
15874 /// "scale",
15875 /// "sourceAsset"
15876 /// ],
15877 /// "properties": {
15878 /// "assetMaxAmount": {
15879 /// "examples": [
15880 /// "1000000"
15881 /// ],
15882 /// "type": "string"
15883 /// },
15884 /// "assetMinAmount": {
15885 /// "examples": [
15886 /// "0.1"
15887 /// ],
15888 /// "type": "string"
15889 /// },
15890 /// "flexibleAmount": {
15891 /// "examples": [
15892 /// "1111"
15893 /// ],
15894 /// "type": "string"
15895 /// },
15896 /// "scale": {
15897 /// "examples": [
15898 /// "2"
15899 /// ],
15900 /// "type": "string"
15901 /// },
15902 /// "sourceAsset": {
15903 /// "examples": [
15904 /// "USDT"
15905 /// ],
15906 /// "type": "string"
15907 /// }
15908 /// }
15909 ///}
15910 /// ```
15911 /// </details>
15912 #[derive(Clone, Debug, Deserialize, Serialize)]
15913 pub struct LendingAutoInvestSourceAssetListResponseSourceAssetsItem {
15914 #[serde(rename = "assetMaxAmount")]
15915 pub asset_max_amount: String,
15916 #[serde(rename = "assetMinAmount")]
15917 pub asset_min_amount: String,
15918 #[serde(rename = "flexibleAmount")]
15919 pub flexible_amount: String,
15920 pub scale: String,
15921 #[serde(rename = "sourceAsset")]
15922 pub source_asset: String,
15923 }
15924 impl From<&LendingAutoInvestSourceAssetListResponseSourceAssetsItem>
15925 for LendingAutoInvestSourceAssetListResponseSourceAssetsItem {
15926 fn from(
15927 value: &LendingAutoInvestSourceAssetListResponseSourceAssetsItem,
15928 ) -> Self {
15929 value.clone()
15930 }
15931 }
15932 ///LendingAutoInvestTargetAssetListResponse
15933 ///
15934 /// <details><summary>JSON schema</summary>
15935 ///
15936 /// ```json
15937 ///{
15938 /// "type": "object",
15939 /// "properties": {
15940 /// "autoInvestAssetList": {
15941 /// "type": "array",
15942 /// "items": {
15943 /// "type": "object",
15944 /// "required": [
15945 /// "roiAndDimensionTypeList",
15946 /// "targetAsset"
15947 /// ],
15948 /// "properties": {
15949 /// "roiAndDimensionTypeList": {
15950 /// "type": "array",
15951 /// "items": {
15952 /// "type": "object",
15953 /// "required": [
15954 /// "dimensionUnit",
15955 /// "dimensionValue",
15956 /// "simulateRoi"
15957 /// ],
15958 /// "properties": {
15959 /// "dimensionUnit": {
15960 /// "examples": [
15961 /// "year"
15962 /// ],
15963 /// "type": "string"
15964 /// },
15965 /// "dimensionValue": {
15966 /// "examples": [
15967 /// "3"
15968 /// ],
15969 /// "type": "string"
15970 /// },
15971 /// "simulateRoi": {
15972 /// "examples": [
15973 /// "5.004"
15974 /// ],
15975 /// "type": "string"
15976 /// }
15977 /// }
15978 /// }
15979 /// },
15980 /// "targetAsset": {
15981 /// "examples": [
15982 /// "BTC"
15983 /// ],
15984 /// "type": "string"
15985 /// }
15986 /// }
15987 /// }
15988 /// },
15989 /// "targetAssets": {
15990 /// "examples": [
15991 /// "BTC"
15992 /// ],
15993 /// "type": "string"
15994 /// }
15995 /// }
15996 ///}
15997 /// ```
15998 /// </details>
15999 #[derive(Clone, Debug, Deserialize, Serialize)]
16000 pub struct LendingAutoInvestTargetAssetListResponse {
16001 #[serde(
16002 rename = "autoInvestAssetList",
16003 default,
16004 skip_serializing_if = "Vec::is_empty"
16005 )]
16006 pub auto_invest_asset_list: Vec<
16007 LendingAutoInvestTargetAssetListResponseAutoInvestAssetListItem,
16008 >,
16009 #[serde(
16010 rename = "targetAssets",
16011 default,
16012 skip_serializing_if = "Option::is_none"
16013 )]
16014 pub target_assets: Option<String>,
16015 }
16016 impl From<&LendingAutoInvestTargetAssetListResponse>
16017 for LendingAutoInvestTargetAssetListResponse {
16018 fn from(value: &LendingAutoInvestTargetAssetListResponse) -> Self {
16019 value.clone()
16020 }
16021 }
16022 ///LendingAutoInvestTargetAssetListResponseAutoInvestAssetListItem
16023 ///
16024 /// <details><summary>JSON schema</summary>
16025 ///
16026 /// ```json
16027 ///{
16028 /// "type": "object",
16029 /// "required": [
16030 /// "roiAndDimensionTypeList",
16031 /// "targetAsset"
16032 /// ],
16033 /// "properties": {
16034 /// "roiAndDimensionTypeList": {
16035 /// "type": "array",
16036 /// "items": {
16037 /// "type": "object",
16038 /// "required": [
16039 /// "dimensionUnit",
16040 /// "dimensionValue",
16041 /// "simulateRoi"
16042 /// ],
16043 /// "properties": {
16044 /// "dimensionUnit": {
16045 /// "examples": [
16046 /// "year"
16047 /// ],
16048 /// "type": "string"
16049 /// },
16050 /// "dimensionValue": {
16051 /// "examples": [
16052 /// "3"
16053 /// ],
16054 /// "type": "string"
16055 /// },
16056 /// "simulateRoi": {
16057 /// "examples": [
16058 /// "5.004"
16059 /// ],
16060 /// "type": "string"
16061 /// }
16062 /// }
16063 /// }
16064 /// },
16065 /// "targetAsset": {
16066 /// "examples": [
16067 /// "BTC"
16068 /// ],
16069 /// "type": "string"
16070 /// }
16071 /// }
16072 ///}
16073 /// ```
16074 /// </details>
16075 #[derive(Clone, Debug, Deserialize, Serialize)]
16076 pub struct LendingAutoInvestTargetAssetListResponseAutoInvestAssetListItem {
16077 #[serde(rename = "roiAndDimensionTypeList")]
16078 pub roi_and_dimension_type_list: Vec<
16079 LendingAutoInvestTargetAssetListResponseAutoInvestAssetListItemRoiAndDimensionTypeListItem,
16080 >,
16081 #[serde(rename = "targetAsset")]
16082 pub target_asset: String,
16083 }
16084 impl From<&LendingAutoInvestTargetAssetListResponseAutoInvestAssetListItem>
16085 for LendingAutoInvestTargetAssetListResponseAutoInvestAssetListItem {
16086 fn from(
16087 value: &LendingAutoInvestTargetAssetListResponseAutoInvestAssetListItem,
16088 ) -> Self {
16089 value.clone()
16090 }
16091 }
16092 ///LendingAutoInvestTargetAssetListResponseAutoInvestAssetListItemRoiAndDimensionTypeListItem
16093 ///
16094 /// <details><summary>JSON schema</summary>
16095 ///
16096 /// ```json
16097 ///{
16098 /// "type": "object",
16099 /// "required": [
16100 /// "dimensionUnit",
16101 /// "dimensionValue",
16102 /// "simulateRoi"
16103 /// ],
16104 /// "properties": {
16105 /// "dimensionUnit": {
16106 /// "examples": [
16107 /// "year"
16108 /// ],
16109 /// "type": "string"
16110 /// },
16111 /// "dimensionValue": {
16112 /// "examples": [
16113 /// "3"
16114 /// ],
16115 /// "type": "string"
16116 /// },
16117 /// "simulateRoi": {
16118 /// "examples": [
16119 /// "5.004"
16120 /// ],
16121 /// "type": "string"
16122 /// }
16123 /// }
16124 ///}
16125 /// ```
16126 /// </details>
16127 #[derive(Clone, Debug, Deserialize, Serialize)]
16128 pub struct LendingAutoInvestTargetAssetListResponseAutoInvestAssetListItemRoiAndDimensionTypeListItem {
16129 #[serde(rename = "dimensionUnit")]
16130 pub dimension_unit: String,
16131 #[serde(rename = "dimensionValue")]
16132 pub dimension_value: String,
16133 #[serde(rename = "simulateRoi")]
16134 pub simulate_roi: String,
16135 }
16136 impl From<
16137 &LendingAutoInvestTargetAssetListResponseAutoInvestAssetListItemRoiAndDimensionTypeListItem,
16138 >
16139 for LendingAutoInvestTargetAssetListResponseAutoInvestAssetListItemRoiAndDimensionTypeListItem {
16140 fn from(
16141 value: &LendingAutoInvestTargetAssetListResponseAutoInvestAssetListItemRoiAndDimensionTypeListItem,
16142 ) -> Self {
16143 value.clone()
16144 }
16145 }
16146 ///LendingAutoInvestTargetAssetRoiListResponseItem
16147 ///
16148 /// <details><summary>JSON schema</summary>
16149 ///
16150 /// ```json
16151 ///{
16152 /// "type": "object",
16153 /// "required": [
16154 /// "date",
16155 /// "simulateRoi"
16156 /// ],
16157 /// "properties": {
16158 /// "date": {
16159 /// "examples": [
16160 /// "1648378800000"
16161 /// ],
16162 /// "type": "string"
16163 /// },
16164 /// "simulateRoi": {
16165 /// "examples": [
16166 /// "1.75"
16167 /// ],
16168 /// "type": "string"
16169 /// }
16170 /// }
16171 ///}
16172 /// ```
16173 /// </details>
16174 #[derive(Clone, Debug, Deserialize, Serialize)]
16175 pub struct LendingAutoInvestTargetAssetRoiListResponseItem {
16176 pub date: String,
16177 #[serde(rename = "simulateRoi")]
16178 pub simulate_roi: String,
16179 }
16180 impl From<&LendingAutoInvestTargetAssetRoiListResponseItem>
16181 for LendingAutoInvestTargetAssetRoiListResponseItem {
16182 fn from(value: &LendingAutoInvestTargetAssetRoiListResponseItem) -> Self {
16183 value.clone()
16184 }
16185 }
16186 ///LendingCustomizedFixedPurchaseResponse
16187 ///
16188 /// <details><summary>JSON schema</summary>
16189 ///
16190 /// ```json
16191 ///{
16192 /// "type": "object",
16193 /// "required": [
16194 /// "purchaseId"
16195 /// ],
16196 /// "properties": {
16197 /// "purchaseId": {
16198 /// "examples": [
16199 /// "18356"
16200 /// ],
16201 /// "type": "string"
16202 /// }
16203 /// }
16204 ///}
16205 /// ```
16206 /// </details>
16207 #[derive(Clone, Debug, Deserialize, Serialize)]
16208 pub struct LendingCustomizedFixedPurchaseResponse {
16209 #[serde(rename = "purchaseId")]
16210 pub purchase_id: String,
16211 }
16212 impl From<&LendingCustomizedFixedPurchaseResponse>
16213 for LendingCustomizedFixedPurchaseResponse {
16214 fn from(value: &LendingCustomizedFixedPurchaseResponse) -> Self {
16215 value.clone()
16216 }
16217 }
16218 ///LendingPositionChangedResponse
16219 ///
16220 /// <details><summary>JSON schema</summary>
16221 ///
16222 /// ```json
16223 ///{
16224 /// "type": "object",
16225 /// "required": [
16226 /// "dailyPurchaseId",
16227 /// "success",
16228 /// "time"
16229 /// ],
16230 /// "properties": {
16231 /// "dailyPurchaseId": {
16232 /// "examples": [
16233 /// 862290
16234 /// ],
16235 /// "type": "integer",
16236 /// "format": "int64"
16237 /// },
16238 /// "success": {
16239 /// "type": "boolean"
16240 /// },
16241 /// "time": {
16242 /// "examples": [
16243 /// 1577233578000
16244 /// ],
16245 /// "type": "integer",
16246 /// "format": "int64"
16247 /// }
16248 /// }
16249 ///}
16250 /// ```
16251 /// </details>
16252 #[derive(Clone, Debug, Deserialize, Serialize)]
16253 pub struct LendingPositionChangedResponse {
16254 #[serde(rename = "dailyPurchaseId")]
16255 pub daily_purchase_id: i64,
16256 pub success: bool,
16257 pub time: i64,
16258 }
16259 impl From<&LendingPositionChangedResponse> for LendingPositionChangedResponse {
16260 fn from(value: &LendingPositionChangedResponse) -> Self {
16261 value.clone()
16262 }
16263 }
16264 ///LendingProjectListResponseItem
16265 ///
16266 /// <details><summary>JSON schema</summary>
16267 ///
16268 /// ```json
16269 ///{
16270 /// "type": "object",
16271 /// "required": [
16272 /// "asset",
16273 /// "displayPriority",
16274 /// "duration",
16275 /// "interestPerLot",
16276 /// "interestRate",
16277 /// "lotSize",
16278 /// "lotsLowLimit",
16279 /// "lotsPurchased",
16280 /// "lotsUpLimit",
16281 /// "maxLotsPerUser",
16282 /// "needKyc",
16283 /// "projectId",
16284 /// "projectName",
16285 /// "status",
16286 /// "type",
16287 /// "withAreaLimitation"
16288 /// ],
16289 /// "properties": {
16290 /// "asset": {
16291 /// "examples": [
16292 /// "USDT"
16293 /// ],
16294 /// "type": "string"
16295 /// },
16296 /// "displayPriority": {
16297 /// "examples": [
16298 /// 1
16299 /// ],
16300 /// "type": "integer",
16301 /// "format": "int64"
16302 /// },
16303 /// "duration": {
16304 /// "examples": [
16305 /// 90
16306 /// ],
16307 /// "type": "integer",
16308 /// "format": "int64"
16309 /// },
16310 /// "interestPerLot": {
16311 /// "examples": [
16312 /// "1.35810000"
16313 /// ],
16314 /// "type": "string"
16315 /// },
16316 /// "interestRate": {
16317 /// "examples": [
16318 /// "0.05510000"
16319 /// ],
16320 /// "type": "string"
16321 /// },
16322 /// "lotSize": {
16323 /// "examples": [
16324 /// "100.00000000"
16325 /// ],
16326 /// "type": "string"
16327 /// },
16328 /// "lotsLowLimit": {
16329 /// "examples": [
16330 /// 1
16331 /// ],
16332 /// "type": "integer",
16333 /// "format": "int64"
16334 /// },
16335 /// "lotsPurchased": {
16336 /// "examples": [
16337 /// 74155
16338 /// ],
16339 /// "type": "integer",
16340 /// "format": "int64"
16341 /// },
16342 /// "lotsUpLimit": {
16343 /// "examples": [
16344 /// 80000
16345 /// ],
16346 /// "type": "integer",
16347 /// "format": "int64"
16348 /// },
16349 /// "maxLotsPerUser": {
16350 /// "examples": [
16351 /// 2000
16352 /// ],
16353 /// "type": "integer",
16354 /// "format": "int64"
16355 /// },
16356 /// "needKyc": {
16357 /// "type": "boolean"
16358 /// },
16359 /// "projectId": {
16360 /// "examples": [
16361 /// "CUSDT90DAYSS001"
16362 /// ],
16363 /// "type": "string"
16364 /// },
16365 /// "projectName": {
16366 /// "examples": [
16367 /// "USDT"
16368 /// ],
16369 /// "type": "string"
16370 /// },
16371 /// "status": {
16372 /// "examples": [
16373 /// "PURCHASING"
16374 /// ],
16375 /// "type": "string"
16376 /// },
16377 /// "type": {
16378 /// "examples": [
16379 /// "CUSTOMIZED_FIXED"
16380 /// ],
16381 /// "type": "string"
16382 /// },
16383 /// "withAreaLimitation": {
16384 /// "type": "boolean"
16385 /// }
16386 /// }
16387 ///}
16388 /// ```
16389 /// </details>
16390 #[derive(Clone, Debug, Deserialize, Serialize)]
16391 pub struct LendingProjectListResponseItem {
16392 pub asset: String,
16393 #[serde(rename = "displayPriority")]
16394 pub display_priority: i64,
16395 pub duration: i64,
16396 #[serde(rename = "interestPerLot")]
16397 pub interest_per_lot: String,
16398 #[serde(rename = "interestRate")]
16399 pub interest_rate: String,
16400 #[serde(rename = "lotSize")]
16401 pub lot_size: String,
16402 #[serde(rename = "lotsLowLimit")]
16403 pub lots_low_limit: i64,
16404 #[serde(rename = "lotsPurchased")]
16405 pub lots_purchased: i64,
16406 #[serde(rename = "lotsUpLimit")]
16407 pub lots_up_limit: i64,
16408 #[serde(rename = "maxLotsPerUser")]
16409 pub max_lots_per_user: i64,
16410 #[serde(rename = "needKyc")]
16411 pub need_kyc: bool,
16412 #[serde(rename = "projectId")]
16413 pub project_id: String,
16414 #[serde(rename = "projectName")]
16415 pub project_name: String,
16416 pub status: String,
16417 #[serde(rename = "type")]
16418 pub type_: String,
16419 #[serde(rename = "withAreaLimitation")]
16420 pub with_area_limitation: bool,
16421 }
16422 impl From<&LendingProjectListResponseItem> for LendingProjectListResponseItem {
16423 fn from(value: &LendingProjectListResponseItem) -> Self {
16424 value.clone()
16425 }
16426 }
16427 ///LendingProjectListSortBy
16428 ///
16429 /// <details><summary>JSON schema</summary>
16430 ///
16431 /// ```json
16432 ///{
16433 /// "type": "string",
16434 /// "enum": [
16435 /// "START_TIME",
16436 /// "LOT_SIZE",
16437 /// "INTEREST_RATE",
16438 /// "DURATION"
16439 /// ]
16440 ///}
16441 /// ```
16442 /// </details>
16443 #[derive(
16444 Clone,
16445 Copy,
16446 Debug,
16447 Deserialize,
16448 Eq,
16449 Hash,
16450 Ord,
16451 PartialEq,
16452 PartialOrd,
16453 Serialize
16454 )]
16455 pub enum LendingProjectListSortBy {
16456 #[serde(rename = "START_TIME")]
16457 StartTime,
16458 #[serde(rename = "LOT_SIZE")]
16459 LotSize,
16460 #[serde(rename = "INTEREST_RATE")]
16461 InterestRate,
16462 #[serde(rename = "DURATION")]
16463 Duration,
16464 }
16465 impl From<&LendingProjectListSortBy> for LendingProjectListSortBy {
16466 fn from(value: &LendingProjectListSortBy) -> Self {
16467 value.clone()
16468 }
16469 }
16470 impl ToString for LendingProjectListSortBy {
16471 fn to_string(&self) -> String {
16472 match *self {
16473 Self::StartTime => "START_TIME".to_string(),
16474 Self::LotSize => "LOT_SIZE".to_string(),
16475 Self::InterestRate => "INTEREST_RATE".to_string(),
16476 Self::Duration => "DURATION".to_string(),
16477 }
16478 }
16479 }
16480 impl std::str::FromStr for LendingProjectListSortBy {
16481 type Err = self::error::ConversionError;
16482 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
16483 match value {
16484 "START_TIME" => Ok(Self::StartTime),
16485 "LOT_SIZE" => Ok(Self::LotSize),
16486 "INTEREST_RATE" => Ok(Self::InterestRate),
16487 "DURATION" => Ok(Self::Duration),
16488 _ => Err("invalid value".into()),
16489 }
16490 }
16491 }
16492 impl std::convert::TryFrom<&str> for LendingProjectListSortBy {
16493 type Error = self::error::ConversionError;
16494 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
16495 value.parse()
16496 }
16497 }
16498 impl std::convert::TryFrom<&String> for LendingProjectListSortBy {
16499 type Error = self::error::ConversionError;
16500 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
16501 value.parse()
16502 }
16503 }
16504 impl std::convert::TryFrom<String> for LendingProjectListSortBy {
16505 type Error = self::error::ConversionError;
16506 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
16507 value.parse()
16508 }
16509 }
16510 ///LendingProjectListStatus
16511 ///
16512 /// <details><summary>JSON schema</summary>
16513 ///
16514 /// ```json
16515 ///{
16516 /// "type": "string",
16517 /// "enum": [
16518 /// "ALL",
16519 /// "SUBSCRIBABLE",
16520 /// "UNSUBSCRIBABLE"
16521 /// ]
16522 ///}
16523 /// ```
16524 /// </details>
16525 #[derive(
16526 Clone,
16527 Copy,
16528 Debug,
16529 Deserialize,
16530 Eq,
16531 Hash,
16532 Ord,
16533 PartialEq,
16534 PartialOrd,
16535 Serialize
16536 )]
16537 pub enum LendingProjectListStatus {
16538 #[serde(rename = "ALL")]
16539 All,
16540 #[serde(rename = "SUBSCRIBABLE")]
16541 Subscribable,
16542 #[serde(rename = "UNSUBSCRIBABLE")]
16543 Unsubscribable,
16544 }
16545 impl From<&LendingProjectListStatus> for LendingProjectListStatus {
16546 fn from(value: &LendingProjectListStatus) -> Self {
16547 value.clone()
16548 }
16549 }
16550 impl ToString for LendingProjectListStatus {
16551 fn to_string(&self) -> String {
16552 match *self {
16553 Self::All => "ALL".to_string(),
16554 Self::Subscribable => "SUBSCRIBABLE".to_string(),
16555 Self::Unsubscribable => "UNSUBSCRIBABLE".to_string(),
16556 }
16557 }
16558 }
16559 impl std::str::FromStr for LendingProjectListStatus {
16560 type Err = self::error::ConversionError;
16561 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
16562 match value {
16563 "ALL" => Ok(Self::All),
16564 "SUBSCRIBABLE" => Ok(Self::Subscribable),
16565 "UNSUBSCRIBABLE" => Ok(Self::Unsubscribable),
16566 _ => Err("invalid value".into()),
16567 }
16568 }
16569 }
16570 impl std::convert::TryFrom<&str> for LendingProjectListStatus {
16571 type Error = self::error::ConversionError;
16572 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
16573 value.parse()
16574 }
16575 }
16576 impl std::convert::TryFrom<&String> for LendingProjectListStatus {
16577 type Error = self::error::ConversionError;
16578 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
16579 value.parse()
16580 }
16581 }
16582 impl std::convert::TryFrom<String> for LendingProjectListStatus {
16583 type Error = self::error::ConversionError;
16584 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
16585 value.parse()
16586 }
16587 }
16588 ///LendingProjectListType
16589 ///
16590 /// <details><summary>JSON schema</summary>
16591 ///
16592 /// ```json
16593 ///{
16594 /// "type": "string",
16595 /// "enum": [
16596 /// "ACTIVITY",
16597 /// "CUSTOMIZED_FIXED"
16598 /// ]
16599 ///}
16600 /// ```
16601 /// </details>
16602 #[derive(
16603 Clone,
16604 Copy,
16605 Debug,
16606 Deserialize,
16607 Eq,
16608 Hash,
16609 Ord,
16610 PartialEq,
16611 PartialOrd,
16612 Serialize
16613 )]
16614 pub enum LendingProjectListType {
16615 #[serde(rename = "ACTIVITY")]
16616 Activity,
16617 #[serde(rename = "CUSTOMIZED_FIXED")]
16618 CustomizedFixed,
16619 }
16620 impl From<&LendingProjectListType> for LendingProjectListType {
16621 fn from(value: &LendingProjectListType) -> Self {
16622 value.clone()
16623 }
16624 }
16625 impl ToString for LendingProjectListType {
16626 fn to_string(&self) -> String {
16627 match *self {
16628 Self::Activity => "ACTIVITY".to_string(),
16629 Self::CustomizedFixed => "CUSTOMIZED_FIXED".to_string(),
16630 }
16631 }
16632 }
16633 impl std::str::FromStr for LendingProjectListType {
16634 type Err = self::error::ConversionError;
16635 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
16636 match value {
16637 "ACTIVITY" => Ok(Self::Activity),
16638 "CUSTOMIZED_FIXED" => Ok(Self::CustomizedFixed),
16639 _ => Err("invalid value".into()),
16640 }
16641 }
16642 }
16643 impl std::convert::TryFrom<&str> for LendingProjectListType {
16644 type Error = self::error::ConversionError;
16645 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
16646 value.parse()
16647 }
16648 }
16649 impl std::convert::TryFrom<&String> for LendingProjectListType {
16650 type Error = self::error::ConversionError;
16651 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
16652 value.parse()
16653 }
16654 }
16655 impl std::convert::TryFrom<String> for LendingProjectListType {
16656 type Error = self::error::ConversionError;
16657 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
16658 value.parse()
16659 }
16660 }
16661 ///LendingProjectPositionListResponseItem
16662 ///
16663 /// <details><summary>JSON schema</summary>
16664 ///
16665 /// ```json
16666 ///{
16667 /// "type": "object",
16668 /// "required": [
16669 /// "asset",
16670 /// "canTransfer",
16671 /// "createTimestamp",
16672 /// "duration",
16673 /// "endTime",
16674 /// "interest",
16675 /// "interestRate",
16676 /// "lot",
16677 /// "positionId",
16678 /// "principal",
16679 /// "projectId",
16680 /// "projectName",
16681 /// "purchaseTime",
16682 /// "redeemDate",
16683 /// "startTime",
16684 /// "status",
16685 /// "type"
16686 /// ],
16687 /// "properties": {
16688 /// "asset": {
16689 /// "examples": [
16690 /// "USDT"
16691 /// ],
16692 /// "type": "string"
16693 /// },
16694 /// "canTransfer": {
16695 /// "type": "boolean"
16696 /// },
16697 /// "createTimestamp": {
16698 /// "examples": [
16699 /// 1587010770000
16700 /// ],
16701 /// "type": "integer",
16702 /// "format": "int64"
16703 /// },
16704 /// "duration": {
16705 /// "examples": [
16706 /// 14
16707 /// ],
16708 /// "type": "integer",
16709 /// "format": "int64"
16710 /// },
16711 /// "endTime": {
16712 /// "examples": [
16713 /// 1588291200000
16714 /// ],
16715 /// "type": "integer",
16716 /// "format": "int64"
16717 /// },
16718 /// "interest": {
16719 /// "examples": [
16720 /// "0.19950000"
16721 /// ],
16722 /// "type": "string"
16723 /// },
16724 /// "interestRate": {
16725 /// "examples": [
16726 /// "0.05201250"
16727 /// ],
16728 /// "type": "string"
16729 /// },
16730 /// "lot": {
16731 /// "examples": [
16732 /// 1
16733 /// ],
16734 /// "type": "integer",
16735 /// "format": "int64"
16736 /// },
16737 /// "positionId": {
16738 /// "examples": [
16739 /// 51724
16740 /// ],
16741 /// "type": "integer",
16742 /// "format": "int64"
16743 /// },
16744 /// "principal": {
16745 /// "examples": [
16746 /// "100.00000000"
16747 /// ],
16748 /// "type": "string"
16749 /// },
16750 /// "projectId": {
16751 /// "examples": [
16752 /// "CUSDT14DAYSS001"
16753 /// ],
16754 /// "type": "string"
16755 /// },
16756 /// "projectName": {
16757 /// "examples": [
16758 /// "USDT"
16759 /// ],
16760 /// "type": "string"
16761 /// },
16762 /// "purchaseTime": {
16763 /// "examples": [
16764 /// 1587010771000
16765 /// ],
16766 /// "type": "integer",
16767 /// "format": "int64"
16768 /// },
16769 /// "redeemDate": {
16770 /// "examples": [
16771 /// "2020-05-01"
16772 /// ],
16773 /// "type": "string",
16774 /// "format": "date"
16775 /// },
16776 /// "startTime": {
16777 /// "examples": [
16778 /// 1587081600000
16779 /// ],
16780 /// "type": "integer",
16781 /// "format": "int64"
16782 /// },
16783 /// "status": {
16784 /// "examples": [
16785 /// "HOLDING"
16786 /// ],
16787 /// "type": "string"
16788 /// },
16789 /// "type": {
16790 /// "examples": [
16791 /// "CUSTOMIZED_FIXED"
16792 /// ],
16793 /// "type": "string"
16794 /// }
16795 /// }
16796 ///}
16797 /// ```
16798 /// </details>
16799 #[derive(Clone, Debug, Deserialize, Serialize)]
16800 pub struct LendingProjectPositionListResponseItem {
16801 pub asset: String,
16802 #[serde(rename = "canTransfer")]
16803 pub can_transfer: bool,
16804 #[serde(rename = "createTimestamp")]
16805 pub create_timestamp: i64,
16806 pub duration: i64,
16807 #[serde(rename = "endTime")]
16808 pub end_time: i64,
16809 pub interest: String,
16810 #[serde(rename = "interestRate")]
16811 pub interest_rate: String,
16812 pub lot: i64,
16813 #[serde(rename = "positionId")]
16814 pub position_id: i64,
16815 pub principal: String,
16816 #[serde(rename = "projectId")]
16817 pub project_id: String,
16818 #[serde(rename = "projectName")]
16819 pub project_name: String,
16820 #[serde(rename = "purchaseTime")]
16821 pub purchase_time: i64,
16822 #[serde(rename = "redeemDate")]
16823 pub redeem_date: crate::DateRfc3339,
16824 #[serde(rename = "startTime")]
16825 pub start_time: i64,
16826 pub status: String,
16827 #[serde(rename = "type")]
16828 pub type_: String,
16829 }
16830 impl From<&LendingProjectPositionListResponseItem>
16831 for LendingProjectPositionListResponseItem {
16832 fn from(value: &LendingProjectPositionListResponseItem) -> Self {
16833 value.clone()
16834 }
16835 }
16836 ///LendingProjectPositionListStatus
16837 ///
16838 /// <details><summary>JSON schema</summary>
16839 ///
16840 /// ```json
16841 ///{
16842 /// "type": "string",
16843 /// "enum": [
16844 /// "ALL",
16845 /// "SUBSCRIBABLE",
16846 /// "UNSUBSCRIBABLE"
16847 /// ]
16848 ///}
16849 /// ```
16850 /// </details>
16851 #[derive(
16852 Clone,
16853 Copy,
16854 Debug,
16855 Deserialize,
16856 Eq,
16857 Hash,
16858 Ord,
16859 PartialEq,
16860 PartialOrd,
16861 Serialize
16862 )]
16863 pub enum LendingProjectPositionListStatus {
16864 #[serde(rename = "ALL")]
16865 All,
16866 #[serde(rename = "SUBSCRIBABLE")]
16867 Subscribable,
16868 #[serde(rename = "UNSUBSCRIBABLE")]
16869 Unsubscribable,
16870 }
16871 impl From<&LendingProjectPositionListStatus> for LendingProjectPositionListStatus {
16872 fn from(value: &LendingProjectPositionListStatus) -> Self {
16873 value.clone()
16874 }
16875 }
16876 impl ToString for LendingProjectPositionListStatus {
16877 fn to_string(&self) -> String {
16878 match *self {
16879 Self::All => "ALL".to_string(),
16880 Self::Subscribable => "SUBSCRIBABLE".to_string(),
16881 Self::Unsubscribable => "UNSUBSCRIBABLE".to_string(),
16882 }
16883 }
16884 }
16885 impl std::str::FromStr for LendingProjectPositionListStatus {
16886 type Err = self::error::ConversionError;
16887 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
16888 match value {
16889 "ALL" => Ok(Self::All),
16890 "SUBSCRIBABLE" => Ok(Self::Subscribable),
16891 "UNSUBSCRIBABLE" => Ok(Self::Unsubscribable),
16892 _ => Err("invalid value".into()),
16893 }
16894 }
16895 }
16896 impl std::convert::TryFrom<&str> for LendingProjectPositionListStatus {
16897 type Error = self::error::ConversionError;
16898 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
16899 value.parse()
16900 }
16901 }
16902 impl std::convert::TryFrom<&String> for LendingProjectPositionListStatus {
16903 type Error = self::error::ConversionError;
16904 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
16905 value.parse()
16906 }
16907 }
16908 impl std::convert::TryFrom<String> for LendingProjectPositionListStatus {
16909 type Error = self::error::ConversionError;
16910 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
16911 value.parse()
16912 }
16913 }
16914 ///LoanAdjustLtvDirection
16915 ///
16916 /// <details><summary>JSON schema</summary>
16917 ///
16918 /// ```json
16919 ///{
16920 /// "examples": [
16921 /// "ADDITIONAL"
16922 /// ],
16923 /// "type": "string",
16924 /// "enum": [
16925 /// "ADDITIONAL",
16926 /// "REDUCED"
16927 /// ]
16928 ///}
16929 /// ```
16930 /// </details>
16931 #[derive(
16932 Clone,
16933 Copy,
16934 Debug,
16935 Deserialize,
16936 Eq,
16937 Hash,
16938 Ord,
16939 PartialEq,
16940 PartialOrd,
16941 Serialize
16942 )]
16943 pub enum LoanAdjustLtvDirection {
16944 #[serde(rename = "ADDITIONAL")]
16945 Additional,
16946 #[serde(rename = "REDUCED")]
16947 Reduced,
16948 }
16949 impl From<&LoanAdjustLtvDirection> for LoanAdjustLtvDirection {
16950 fn from(value: &LoanAdjustLtvDirection) -> Self {
16951 value.clone()
16952 }
16953 }
16954 impl ToString for LoanAdjustLtvDirection {
16955 fn to_string(&self) -> String {
16956 match *self {
16957 Self::Additional => "ADDITIONAL".to_string(),
16958 Self::Reduced => "REDUCED".to_string(),
16959 }
16960 }
16961 }
16962 impl std::str::FromStr for LoanAdjustLtvDirection {
16963 type Err = self::error::ConversionError;
16964 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
16965 match value {
16966 "ADDITIONAL" => Ok(Self::Additional),
16967 "REDUCED" => Ok(Self::Reduced),
16968 _ => Err("invalid value".into()),
16969 }
16970 }
16971 }
16972 impl std::convert::TryFrom<&str> for LoanAdjustLtvDirection {
16973 type Error = self::error::ConversionError;
16974 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
16975 value.parse()
16976 }
16977 }
16978 impl std::convert::TryFrom<&String> for LoanAdjustLtvDirection {
16979 type Error = self::error::ConversionError;
16980 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
16981 value.parse()
16982 }
16983 }
16984 impl std::convert::TryFrom<String> for LoanAdjustLtvDirection {
16985 type Error = self::error::ConversionError;
16986 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
16987 value.parse()
16988 }
16989 }
16990 ///LoanAdjustLtvResponse
16991 ///
16992 /// <details><summary>JSON schema</summary>
16993 ///
16994 /// ```json
16995 ///{
16996 /// "type": "object",
16997 /// "required": [
16998 /// "amount",
16999 /// "collateralCoin",
17000 /// "currentLTV",
17001 /// "direction",
17002 /// "loanCoin"
17003 /// ],
17004 /// "properties": {
17005 /// "amount": {
17006 /// "examples": [
17007 /// "5.235"
17008 /// ],
17009 /// "type": "string"
17010 /// },
17011 /// "collateralCoin": {
17012 /// "examples": [
17013 /// "BNB"
17014 /// ],
17015 /// "type": "string"
17016 /// },
17017 /// "currentLTV": {
17018 /// "examples": [
17019 /// "0.52"
17020 /// ],
17021 /// "type": "string"
17022 /// },
17023 /// "direction": {
17024 /// "examples": [
17025 /// "ADDITIONAL"
17026 /// ],
17027 /// "type": "string"
17028 /// },
17029 /// "loanCoin": {
17030 /// "examples": [
17031 /// "BUSD"
17032 /// ],
17033 /// "type": "string"
17034 /// }
17035 /// }
17036 ///}
17037 /// ```
17038 /// </details>
17039 #[derive(Clone, Debug, Deserialize, Serialize)]
17040 pub struct LoanAdjustLtvResponse {
17041 pub amount: String,
17042 #[serde(rename = "collateralCoin")]
17043 pub collateral_coin: String,
17044 #[serde(rename = "currentLTV")]
17045 pub current_ltv: String,
17046 pub direction: String,
17047 #[serde(rename = "loanCoin")]
17048 pub loan_coin: String,
17049 }
17050 impl From<&LoanAdjustLtvResponse> for LoanAdjustLtvResponse {
17051 fn from(value: &LoanAdjustLtvResponse) -> Self {
17052 value.clone()
17053 }
17054 }
17055 ///LoanBorrowHistoryResponse
17056 ///
17057 /// <details><summary>JSON schema</summary>
17058 ///
17059 /// ```json
17060 ///{
17061 /// "type": "object",
17062 /// "required": [
17063 /// "rows",
17064 /// "total"
17065 /// ],
17066 /// "properties": {
17067 /// "rows": {
17068 /// "type": "array",
17069 /// "items": {
17070 /// "type": "object",
17071 /// "required": [
17072 /// "borrowTime",
17073 /// "collateralCoin",
17074 /// "hourlyInterestRate",
17075 /// "initialCollateralAmount",
17076 /// "initialLoanAmount",
17077 /// "loanCoin",
17078 /// "loanTerm",
17079 /// "orderId",
17080 /// "status"
17081 /// ],
17082 /// "properties": {
17083 /// "borrowTime": {
17084 /// "examples": [
17085 /// 1575018510000
17086 /// ],
17087 /// "type": "integer",
17088 /// "format": "int64"
17089 /// },
17090 /// "collateralCoin": {
17091 /// "examples": [
17092 /// "BNB"
17093 /// ],
17094 /// "type": "string"
17095 /// },
17096 /// "hourlyInterestRate": {
17097 /// "examples": [
17098 /// "0.000057"
17099 /// ],
17100 /// "type": "string"
17101 /// },
17102 /// "initialCollateralAmount": {
17103 /// "examples": [
17104 /// "49.27565492"
17105 /// ],
17106 /// "type": "string"
17107 /// },
17108 /// "initialLoanAmount": {
17109 /// "examples": [
17110 /// "10000"
17111 /// ],
17112 /// "type": "string"
17113 /// },
17114 /// "loanCoin": {
17115 /// "examples": [
17116 /// "BUSD"
17117 /// ],
17118 /// "type": "string"
17119 /// },
17120 /// "loanTerm": {
17121 /// "examples": [
17122 /// "7"
17123 /// ],
17124 /// "type": "string"
17125 /// },
17126 /// "orderId": {
17127 /// "examples": [
17128 /// 100000001
17129 /// ],
17130 /// "type": "integer",
17131 /// "format": "int64"
17132 /// },
17133 /// "status": {
17134 /// "examples": [
17135 /// "Accruing_Interest, Overdue, Liquidating, Repaying, Repaid, Liquidated, Pending, Failed"
17136 /// ],
17137 /// "type": "string"
17138 /// }
17139 /// }
17140 /// }
17141 /// },
17142 /// "total": {
17143 /// "examples": [
17144 /// 1
17145 /// ],
17146 /// "type": "integer",
17147 /// "format": "int32"
17148 /// }
17149 /// }
17150 ///}
17151 /// ```
17152 /// </details>
17153 #[derive(Clone, Debug, Deserialize, Serialize)]
17154 pub struct LoanBorrowHistoryResponse {
17155 pub rows: Vec<LoanBorrowHistoryResponseRowsItem>,
17156 pub total: i32,
17157 }
17158 impl From<&LoanBorrowHistoryResponse> for LoanBorrowHistoryResponse {
17159 fn from(value: &LoanBorrowHistoryResponse) -> Self {
17160 value.clone()
17161 }
17162 }
17163 ///LoanBorrowHistoryResponseRowsItem
17164 ///
17165 /// <details><summary>JSON schema</summary>
17166 ///
17167 /// ```json
17168 ///{
17169 /// "type": "object",
17170 /// "required": [
17171 /// "borrowTime",
17172 /// "collateralCoin",
17173 /// "hourlyInterestRate",
17174 /// "initialCollateralAmount",
17175 /// "initialLoanAmount",
17176 /// "loanCoin",
17177 /// "loanTerm",
17178 /// "orderId",
17179 /// "status"
17180 /// ],
17181 /// "properties": {
17182 /// "borrowTime": {
17183 /// "examples": [
17184 /// 1575018510000
17185 /// ],
17186 /// "type": "integer",
17187 /// "format": "int64"
17188 /// },
17189 /// "collateralCoin": {
17190 /// "examples": [
17191 /// "BNB"
17192 /// ],
17193 /// "type": "string"
17194 /// },
17195 /// "hourlyInterestRate": {
17196 /// "examples": [
17197 /// "0.000057"
17198 /// ],
17199 /// "type": "string"
17200 /// },
17201 /// "initialCollateralAmount": {
17202 /// "examples": [
17203 /// "49.27565492"
17204 /// ],
17205 /// "type": "string"
17206 /// },
17207 /// "initialLoanAmount": {
17208 /// "examples": [
17209 /// "10000"
17210 /// ],
17211 /// "type": "string"
17212 /// },
17213 /// "loanCoin": {
17214 /// "examples": [
17215 /// "BUSD"
17216 /// ],
17217 /// "type": "string"
17218 /// },
17219 /// "loanTerm": {
17220 /// "examples": [
17221 /// "7"
17222 /// ],
17223 /// "type": "string"
17224 /// },
17225 /// "orderId": {
17226 /// "examples": [
17227 /// 100000001
17228 /// ],
17229 /// "type": "integer",
17230 /// "format": "int64"
17231 /// },
17232 /// "status": {
17233 /// "examples": [
17234 /// "Accruing_Interest, Overdue, Liquidating, Repaying, Repaid, Liquidated, Pending, Failed"
17235 /// ],
17236 /// "type": "string"
17237 /// }
17238 /// }
17239 ///}
17240 /// ```
17241 /// </details>
17242 #[derive(Clone, Debug, Deserialize, Serialize)]
17243 pub struct LoanBorrowHistoryResponseRowsItem {
17244 #[serde(rename = "borrowTime")]
17245 pub borrow_time: i64,
17246 #[serde(rename = "collateralCoin")]
17247 pub collateral_coin: String,
17248 #[serde(rename = "hourlyInterestRate")]
17249 pub hourly_interest_rate: String,
17250 #[serde(rename = "initialCollateralAmount")]
17251 pub initial_collateral_amount: String,
17252 #[serde(rename = "initialLoanAmount")]
17253 pub initial_loan_amount: String,
17254 #[serde(rename = "loanCoin")]
17255 pub loan_coin: String,
17256 #[serde(rename = "loanTerm")]
17257 pub loan_term: String,
17258 #[serde(rename = "orderId")]
17259 pub order_id: i64,
17260 pub status: String,
17261 }
17262 impl From<&LoanBorrowHistoryResponseRowsItem> for LoanBorrowHistoryResponseRowsItem {
17263 fn from(value: &LoanBorrowHistoryResponseRowsItem) -> Self {
17264 value.clone()
17265 }
17266 }
17267 ///LoanBorrowResponse
17268 ///
17269 /// <details><summary>JSON schema</summary>
17270 ///
17271 /// ```json
17272 ///{
17273 /// "type": "object",
17274 /// "required": [
17275 /// "collateralAmount",
17276 /// "collateralCoin",
17277 /// "hourlyInterestRate",
17278 /// "loanAmount",
17279 /// "loanCoin",
17280 /// "orderId"
17281 /// ],
17282 /// "properties": {
17283 /// "collateralAmount": {
17284 /// "examples": [
17285 /// "50.5"
17286 /// ],
17287 /// "type": "string"
17288 /// },
17289 /// "collateralCoin": {
17290 /// "examples": [
17291 /// "BNB"
17292 /// ],
17293 /// "type": "string"
17294 /// },
17295 /// "hourlyInterestRate": {
17296 /// "examples": [
17297 /// "0.001234"
17298 /// ],
17299 /// "type": "string"
17300 /// },
17301 /// "loanAmount": {
17302 /// "examples": [
17303 /// "100.5"
17304 /// ],
17305 /// "type": "string"
17306 /// },
17307 /// "loanCoin": {
17308 /// "examples": [
17309 /// "BUSD"
17310 /// ],
17311 /// "type": "string"
17312 /// },
17313 /// "orderId": {
17314 /// "examples": [
17315 /// "100000001"
17316 /// ],
17317 /// "type": "string"
17318 /// }
17319 /// }
17320 ///}
17321 /// ```
17322 /// </details>
17323 #[derive(Clone, Debug, Deserialize, Serialize)]
17324 pub struct LoanBorrowResponse {
17325 #[serde(rename = "collateralAmount")]
17326 pub collateral_amount: String,
17327 #[serde(rename = "collateralCoin")]
17328 pub collateral_coin: String,
17329 #[serde(rename = "hourlyInterestRate")]
17330 pub hourly_interest_rate: String,
17331 #[serde(rename = "loanAmount")]
17332 pub loan_amount: String,
17333 #[serde(rename = "loanCoin")]
17334 pub loan_coin: String,
17335 #[serde(rename = "orderId")]
17336 pub order_id: String,
17337 }
17338 impl From<&LoanBorrowResponse> for LoanBorrowResponse {
17339 fn from(value: &LoanBorrowResponse) -> Self {
17340 value.clone()
17341 }
17342 }
17343 ///LoanCollateralDataResponse
17344 ///
17345 /// <details><summary>JSON schema</summary>
17346 ///
17347 /// ```json
17348 ///{
17349 /// "type": "object",
17350 /// "required": [
17351 /// "rows",
17352 /// "total"
17353 /// ],
17354 /// "properties": {
17355 /// "rows": {
17356 /// "type": "array",
17357 /// "items": {
17358 /// "type": "object",
17359 /// "required": [
17360 /// "collateralCoin",
17361 /// "initialLTV",
17362 /// "liquidationLTV",
17363 /// "marginCallLTV",
17364 /// "maxLimit",
17365 /// "vipLevel"
17366 /// ],
17367 /// "properties": {
17368 /// "collateralCoin": {
17369 /// "examples": [
17370 /// "BNB"
17371 /// ],
17372 /// "type": "string"
17373 /// },
17374 /// "initialLTV": {
17375 /// "examples": [
17376 /// "0.65"
17377 /// ],
17378 /// "type": "string"
17379 /// },
17380 /// "liquidationLTV": {
17381 /// "examples": [
17382 /// "0.83"
17383 /// ],
17384 /// "type": "string"
17385 /// },
17386 /// "marginCallLTV": {
17387 /// "examples": [
17388 /// "0.75"
17389 /// ],
17390 /// "type": "string"
17391 /// },
17392 /// "maxLimit": {
17393 /// "examples": [
17394 /// "1000000"
17395 /// ],
17396 /// "type": "string"
17397 /// },
17398 /// "vipLevel": {
17399 /// "examples": [
17400 /// 1
17401 /// ],
17402 /// "type": "integer",
17403 /// "format": "int32"
17404 /// }
17405 /// }
17406 /// }
17407 /// },
17408 /// "total": {
17409 /// "examples": [
17410 /// 1
17411 /// ],
17412 /// "type": "integer",
17413 /// "format": "int32"
17414 /// }
17415 /// }
17416 ///}
17417 /// ```
17418 /// </details>
17419 #[derive(Clone, Debug, Deserialize, Serialize)]
17420 pub struct LoanCollateralDataResponse {
17421 pub rows: Vec<LoanCollateralDataResponseRowsItem>,
17422 pub total: i32,
17423 }
17424 impl From<&LoanCollateralDataResponse> for LoanCollateralDataResponse {
17425 fn from(value: &LoanCollateralDataResponse) -> Self {
17426 value.clone()
17427 }
17428 }
17429 ///LoanCollateralDataResponseRowsItem
17430 ///
17431 /// <details><summary>JSON schema</summary>
17432 ///
17433 /// ```json
17434 ///{
17435 /// "type": "object",
17436 /// "required": [
17437 /// "collateralCoin",
17438 /// "initialLTV",
17439 /// "liquidationLTV",
17440 /// "marginCallLTV",
17441 /// "maxLimit",
17442 /// "vipLevel"
17443 /// ],
17444 /// "properties": {
17445 /// "collateralCoin": {
17446 /// "examples": [
17447 /// "BNB"
17448 /// ],
17449 /// "type": "string"
17450 /// },
17451 /// "initialLTV": {
17452 /// "examples": [
17453 /// "0.65"
17454 /// ],
17455 /// "type": "string"
17456 /// },
17457 /// "liquidationLTV": {
17458 /// "examples": [
17459 /// "0.83"
17460 /// ],
17461 /// "type": "string"
17462 /// },
17463 /// "marginCallLTV": {
17464 /// "examples": [
17465 /// "0.75"
17466 /// ],
17467 /// "type": "string"
17468 /// },
17469 /// "maxLimit": {
17470 /// "examples": [
17471 /// "1000000"
17472 /// ],
17473 /// "type": "string"
17474 /// },
17475 /// "vipLevel": {
17476 /// "examples": [
17477 /// 1
17478 /// ],
17479 /// "type": "integer",
17480 /// "format": "int32"
17481 /// }
17482 /// }
17483 ///}
17484 /// ```
17485 /// </details>
17486 #[derive(Clone, Debug, Deserialize, Serialize)]
17487 pub struct LoanCollateralDataResponseRowsItem {
17488 #[serde(rename = "collateralCoin")]
17489 pub collateral_coin: String,
17490 #[serde(rename = "initialLTV")]
17491 pub initial_ltv: String,
17492 #[serde(rename = "liquidationLTV")]
17493 pub liquidation_ltv: String,
17494 #[serde(rename = "marginCallLTV")]
17495 pub margin_call_ltv: String,
17496 #[serde(rename = "maxLimit")]
17497 pub max_limit: String,
17498 #[serde(rename = "vipLevel")]
17499 pub vip_level: i32,
17500 }
17501 impl From<&LoanCollateralDataResponseRowsItem>
17502 for LoanCollateralDataResponseRowsItem {
17503 fn from(value: &LoanCollateralDataResponseRowsItem) -> Self {
17504 value.clone()
17505 }
17506 }
17507 ///LoanCustomizeMarginCallResponse
17508 ///
17509 /// <details><summary>JSON schema</summary>
17510 ///
17511 /// ```json
17512 ///{
17513 /// "type": "object",
17514 /// "required": [
17515 /// "rows",
17516 /// "total"
17517 /// ],
17518 /// "properties": {
17519 /// "rows": {
17520 /// "type": "array",
17521 /// "items": {
17522 /// "type": "object",
17523 /// "required": [
17524 /// "afterMarginCall",
17525 /// "collateralCoin",
17526 /// "customizeTime",
17527 /// "orderId",
17528 /// "preMarginCall"
17529 /// ],
17530 /// "properties": {
17531 /// "afterMarginCall": {
17532 /// "examples": [
17533 /// "0.7"
17534 /// ],
17535 /// "type": "string"
17536 /// },
17537 /// "collateralCoin": {
17538 /// "examples": [
17539 /// "BNB"
17540 /// ],
17541 /// "type": "string"
17542 /// },
17543 /// "customizeTime": {
17544 /// "examples": [
17545 /// 1575018510000
17546 /// ],
17547 /// "type": "integer",
17548 /// "format": "int64"
17549 /// },
17550 /// "orderId": {
17551 /// "examples": [
17552 /// "100000001"
17553 /// ],
17554 /// "type": "string"
17555 /// },
17556 /// "preMarginCall": {
17557 /// "examples": [
17558 /// "0.8"
17559 /// ],
17560 /// "type": "string"
17561 /// }
17562 /// }
17563 /// }
17564 /// },
17565 /// "total": {
17566 /// "examples": [
17567 /// 1
17568 /// ],
17569 /// "type": "integer",
17570 /// "format": "int32"
17571 /// }
17572 /// }
17573 ///}
17574 /// ```
17575 /// </details>
17576 #[derive(Clone, Debug, Deserialize, Serialize)]
17577 pub struct LoanCustomizeMarginCallResponse {
17578 pub rows: Vec<LoanCustomizeMarginCallResponseRowsItem>,
17579 pub total: i32,
17580 }
17581 impl From<&LoanCustomizeMarginCallResponse> for LoanCustomizeMarginCallResponse {
17582 fn from(value: &LoanCustomizeMarginCallResponse) -> Self {
17583 value.clone()
17584 }
17585 }
17586 ///LoanCustomizeMarginCallResponseRowsItem
17587 ///
17588 /// <details><summary>JSON schema</summary>
17589 ///
17590 /// ```json
17591 ///{
17592 /// "type": "object",
17593 /// "required": [
17594 /// "afterMarginCall",
17595 /// "collateralCoin",
17596 /// "customizeTime",
17597 /// "orderId",
17598 /// "preMarginCall"
17599 /// ],
17600 /// "properties": {
17601 /// "afterMarginCall": {
17602 /// "examples": [
17603 /// "0.7"
17604 /// ],
17605 /// "type": "string"
17606 /// },
17607 /// "collateralCoin": {
17608 /// "examples": [
17609 /// "BNB"
17610 /// ],
17611 /// "type": "string"
17612 /// },
17613 /// "customizeTime": {
17614 /// "examples": [
17615 /// 1575018510000
17616 /// ],
17617 /// "type": "integer",
17618 /// "format": "int64"
17619 /// },
17620 /// "orderId": {
17621 /// "examples": [
17622 /// "100000001"
17623 /// ],
17624 /// "type": "string"
17625 /// },
17626 /// "preMarginCall": {
17627 /// "examples": [
17628 /// "0.8"
17629 /// ],
17630 /// "type": "string"
17631 /// }
17632 /// }
17633 ///}
17634 /// ```
17635 /// </details>
17636 #[derive(Clone, Debug, Deserialize, Serialize)]
17637 pub struct LoanCustomizeMarginCallResponseRowsItem {
17638 #[serde(rename = "afterMarginCall")]
17639 pub after_margin_call: String,
17640 #[serde(rename = "collateralCoin")]
17641 pub collateral_coin: String,
17642 #[serde(rename = "customizeTime")]
17643 pub customize_time: i64,
17644 #[serde(rename = "orderId")]
17645 pub order_id: String,
17646 #[serde(rename = "preMarginCall")]
17647 pub pre_margin_call: String,
17648 }
17649 impl From<&LoanCustomizeMarginCallResponseRowsItem>
17650 for LoanCustomizeMarginCallResponseRowsItem {
17651 fn from(value: &LoanCustomizeMarginCallResponseRowsItem) -> Self {
17652 value.clone()
17653 }
17654 }
17655 ///LoanFlexibleAdjustLtvDirection
17656 ///
17657 /// <details><summary>JSON schema</summary>
17658 ///
17659 /// ```json
17660 ///{
17661 /// "type": "string",
17662 /// "enum": [
17663 /// "ADDITIONAL",
17664 /// "REDUCED"
17665 /// ]
17666 ///}
17667 /// ```
17668 /// </details>
17669 #[derive(
17670 Clone,
17671 Copy,
17672 Debug,
17673 Deserialize,
17674 Eq,
17675 Hash,
17676 Ord,
17677 PartialEq,
17678 PartialOrd,
17679 Serialize
17680 )]
17681 pub enum LoanFlexibleAdjustLtvDirection {
17682 #[serde(rename = "ADDITIONAL")]
17683 Additional,
17684 #[serde(rename = "REDUCED")]
17685 Reduced,
17686 }
17687 impl From<&LoanFlexibleAdjustLtvDirection> for LoanFlexibleAdjustLtvDirection {
17688 fn from(value: &LoanFlexibleAdjustLtvDirection) -> Self {
17689 value.clone()
17690 }
17691 }
17692 impl ToString for LoanFlexibleAdjustLtvDirection {
17693 fn to_string(&self) -> String {
17694 match *self {
17695 Self::Additional => "ADDITIONAL".to_string(),
17696 Self::Reduced => "REDUCED".to_string(),
17697 }
17698 }
17699 }
17700 impl std::str::FromStr for LoanFlexibleAdjustLtvDirection {
17701 type Err = self::error::ConversionError;
17702 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
17703 match value {
17704 "ADDITIONAL" => Ok(Self::Additional),
17705 "REDUCED" => Ok(Self::Reduced),
17706 _ => Err("invalid value".into()),
17707 }
17708 }
17709 }
17710 impl std::convert::TryFrom<&str> for LoanFlexibleAdjustLtvDirection {
17711 type Error = self::error::ConversionError;
17712 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
17713 value.parse()
17714 }
17715 }
17716 impl std::convert::TryFrom<&String> for LoanFlexibleAdjustLtvDirection {
17717 type Error = self::error::ConversionError;
17718 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
17719 value.parse()
17720 }
17721 }
17722 impl std::convert::TryFrom<String> for LoanFlexibleAdjustLtvDirection {
17723 type Error = self::error::ConversionError;
17724 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
17725 value.parse()
17726 }
17727 }
17728 ///LoanFlexibleAdjustLtvResponse
17729 ///
17730 /// <details><summary>JSON schema</summary>
17731 ///
17732 /// ```json
17733 ///{
17734 /// "type": "object",
17735 /// "required": [
17736 /// "adjustmentAmount",
17737 /// "collateralCoin",
17738 /// "currentLTV",
17739 /// "direction",
17740 /// "loanCoin",
17741 /// "status"
17742 /// ],
17743 /// "properties": {
17744 /// "adjustmentAmount": {
17745 /// "examples": [
17746 /// "5.235"
17747 /// ],
17748 /// "type": "string"
17749 /// },
17750 /// "collateralCoin": {
17751 /// "examples": [
17752 /// "BNB"
17753 /// ],
17754 /// "type": "string"
17755 /// },
17756 /// "currentLTV": {
17757 /// "examples": [
17758 /// "0.235"
17759 /// ],
17760 /// "type": "string"
17761 /// },
17762 /// "direction": {
17763 /// "examples": [
17764 /// "ADDITIONAL"
17765 /// ],
17766 /// "type": "string"
17767 /// },
17768 /// "loanCoin": {
17769 /// "examples": [
17770 /// "BUSD"
17771 /// ],
17772 /// "type": "string"
17773 /// },
17774 /// "status": {
17775 /// "examples": [
17776 /// "Succeeds"
17777 /// ],
17778 /// "type": "string"
17779 /// }
17780 /// }
17781 ///}
17782 /// ```
17783 /// </details>
17784 #[derive(Clone, Debug, Deserialize, Serialize)]
17785 pub struct LoanFlexibleAdjustLtvResponse {
17786 #[serde(rename = "adjustmentAmount")]
17787 pub adjustment_amount: String,
17788 #[serde(rename = "collateralCoin")]
17789 pub collateral_coin: String,
17790 #[serde(rename = "currentLTV")]
17791 pub current_ltv: String,
17792 pub direction: String,
17793 #[serde(rename = "loanCoin")]
17794 pub loan_coin: String,
17795 pub status: String,
17796 }
17797 impl From<&LoanFlexibleAdjustLtvResponse> for LoanFlexibleAdjustLtvResponse {
17798 fn from(value: &LoanFlexibleAdjustLtvResponse) -> Self {
17799 value.clone()
17800 }
17801 }
17802 ///LoanFlexibleBorrowHistoryResponse
17803 ///
17804 /// <details><summary>JSON schema</summary>
17805 ///
17806 /// ```json
17807 ///{
17808 /// "type": "object",
17809 /// "required": [
17810 /// "rows",
17811 /// "total"
17812 /// ],
17813 /// "properties": {
17814 /// "rows": {
17815 /// "type": "array",
17816 /// "items": {
17817 /// "type": "object",
17818 /// "required": [
17819 /// "borrowTime",
17820 /// "collateralCoin",
17821 /// "initialCollateralAmount",
17822 /// "initialLoanAmount",
17823 /// "loanCoin",
17824 /// "status"
17825 /// ],
17826 /// "properties": {
17827 /// "borrowTime": {
17828 /// "examples": [
17829 /// 1575018510000
17830 /// ],
17831 /// "type": "integer",
17832 /// "format": "int64"
17833 /// },
17834 /// "collateralCoin": {
17835 /// "examples": [
17836 /// "BNB"
17837 /// ],
17838 /// "type": "string"
17839 /// },
17840 /// "initialCollateralAmount": {
17841 /// "examples": [
17842 /// "49.27565492"
17843 /// ],
17844 /// "type": "string"
17845 /// },
17846 /// "initialLoanAmount": {
17847 /// "examples": [
17848 /// "10000"
17849 /// ],
17850 /// "type": "string"
17851 /// },
17852 /// "loanCoin": {
17853 /// "examples": [
17854 /// "BUSD"
17855 /// ],
17856 /// "type": "string"
17857 /// },
17858 /// "status": {
17859 /// "examples": [
17860 /// "Succeeds"
17861 /// ],
17862 /// "type": "string"
17863 /// }
17864 /// }
17865 /// }
17866 /// },
17867 /// "total": {
17868 /// "examples": [
17869 /// 1
17870 /// ],
17871 /// "type": "integer"
17872 /// }
17873 /// }
17874 ///}
17875 /// ```
17876 /// </details>
17877 #[derive(Clone, Debug, Deserialize, Serialize)]
17878 pub struct LoanFlexibleBorrowHistoryResponse {
17879 pub rows: Vec<LoanFlexibleBorrowHistoryResponseRowsItem>,
17880 pub total: i64,
17881 }
17882 impl From<&LoanFlexibleBorrowHistoryResponse> for LoanFlexibleBorrowHistoryResponse {
17883 fn from(value: &LoanFlexibleBorrowHistoryResponse) -> Self {
17884 value.clone()
17885 }
17886 }
17887 ///LoanFlexibleBorrowHistoryResponseRowsItem
17888 ///
17889 /// <details><summary>JSON schema</summary>
17890 ///
17891 /// ```json
17892 ///{
17893 /// "type": "object",
17894 /// "required": [
17895 /// "borrowTime",
17896 /// "collateralCoin",
17897 /// "initialCollateralAmount",
17898 /// "initialLoanAmount",
17899 /// "loanCoin",
17900 /// "status"
17901 /// ],
17902 /// "properties": {
17903 /// "borrowTime": {
17904 /// "examples": [
17905 /// 1575018510000
17906 /// ],
17907 /// "type": "integer",
17908 /// "format": "int64"
17909 /// },
17910 /// "collateralCoin": {
17911 /// "examples": [
17912 /// "BNB"
17913 /// ],
17914 /// "type": "string"
17915 /// },
17916 /// "initialCollateralAmount": {
17917 /// "examples": [
17918 /// "49.27565492"
17919 /// ],
17920 /// "type": "string"
17921 /// },
17922 /// "initialLoanAmount": {
17923 /// "examples": [
17924 /// "10000"
17925 /// ],
17926 /// "type": "string"
17927 /// },
17928 /// "loanCoin": {
17929 /// "examples": [
17930 /// "BUSD"
17931 /// ],
17932 /// "type": "string"
17933 /// },
17934 /// "status": {
17935 /// "examples": [
17936 /// "Succeeds"
17937 /// ],
17938 /// "type": "string"
17939 /// }
17940 /// }
17941 ///}
17942 /// ```
17943 /// </details>
17944 #[derive(Clone, Debug, Deserialize, Serialize)]
17945 pub struct LoanFlexibleBorrowHistoryResponseRowsItem {
17946 #[serde(rename = "borrowTime")]
17947 pub borrow_time: i64,
17948 #[serde(rename = "collateralCoin")]
17949 pub collateral_coin: String,
17950 #[serde(rename = "initialCollateralAmount")]
17951 pub initial_collateral_amount: String,
17952 #[serde(rename = "initialLoanAmount")]
17953 pub initial_loan_amount: String,
17954 #[serde(rename = "loanCoin")]
17955 pub loan_coin: String,
17956 pub status: String,
17957 }
17958 impl From<&LoanFlexibleBorrowHistoryResponseRowsItem>
17959 for LoanFlexibleBorrowHistoryResponseRowsItem {
17960 fn from(value: &LoanFlexibleBorrowHistoryResponseRowsItem) -> Self {
17961 value.clone()
17962 }
17963 }
17964 ///LoanFlexibleBorrowResponse
17965 ///
17966 /// <details><summary>JSON schema</summary>
17967 ///
17968 /// ```json
17969 ///{
17970 /// "type": "object",
17971 /// "required": [
17972 /// "collateralAmount",
17973 /// "loanAmount",
17974 /// "loanCoin",
17975 /// "status"
17976 /// ],
17977 /// "properties": {
17978 /// "collateralAmount": {
17979 /// "examples": [
17980 /// "50.5"
17981 /// ],
17982 /// "type": "string"
17983 /// },
17984 /// "collateralCoin": {
17985 /// "examples": [
17986 /// "BNB"
17987 /// ],
17988 /// "type": "string"
17989 /// },
17990 /// "loanAmount": {
17991 /// "examples": [
17992 /// "100.5"
17993 /// ],
17994 /// "type": "string"
17995 /// },
17996 /// "loanCoin": {
17997 /// "examples": [
17998 /// "BUSD"
17999 /// ],
18000 /// "type": "string"
18001 /// },
18002 /// "status": {
18003 /// "examples": [
18004 /// "Succeeds"
18005 /// ],
18006 /// "type": "string"
18007 /// }
18008 /// }
18009 ///}
18010 /// ```
18011 /// </details>
18012 #[derive(Clone, Debug, Deserialize, Serialize)]
18013 pub struct LoanFlexibleBorrowResponse {
18014 #[serde(rename = "collateralAmount")]
18015 pub collateral_amount: String,
18016 #[serde(
18017 rename = "collateralCoin",
18018 default,
18019 skip_serializing_if = "Option::is_none"
18020 )]
18021 pub collateral_coin: Option<String>,
18022 #[serde(rename = "loanAmount")]
18023 pub loan_amount: String,
18024 #[serde(rename = "loanCoin")]
18025 pub loan_coin: String,
18026 pub status: String,
18027 }
18028 impl From<&LoanFlexibleBorrowResponse> for LoanFlexibleBorrowResponse {
18029 fn from(value: &LoanFlexibleBorrowResponse) -> Self {
18030 value.clone()
18031 }
18032 }
18033 ///LoanFlexibleCollateralDataResponse
18034 ///
18035 /// <details><summary>JSON schema</summary>
18036 ///
18037 /// ```json
18038 ///{
18039 /// "type": "object",
18040 /// "required": [
18041 /// "rows",
18042 /// "total"
18043 /// ],
18044 /// "properties": {
18045 /// "rows": {
18046 /// "type": "array",
18047 /// "items": {
18048 /// "type": "object",
18049 /// "required": [
18050 /// "collateralCoin",
18051 /// "initialLTV",
18052 /// "liquidationLTV",
18053 /// "marginCallLTV",
18054 /// "maxLimit"
18055 /// ],
18056 /// "properties": {
18057 /// "collateralCoin": {
18058 /// "examples": [
18059 /// "BNB"
18060 /// ],
18061 /// "type": "string"
18062 /// },
18063 /// "initialLTV": {
18064 /// "examples": [
18065 /// "0.01"
18066 /// ],
18067 /// "type": "string"
18068 /// },
18069 /// "liquidationLTV": {
18070 /// "examples": [
18071 /// "0.8"
18072 /// ],
18073 /// "type": "string"
18074 /// },
18075 /// "marginCallLTV": {
18076 /// "examples": [
18077 /// "0.7"
18078 /// ],
18079 /// "type": "string"
18080 /// },
18081 /// "maxLimit": {
18082 /// "examples": [
18083 /// "1000000"
18084 /// ],
18085 /// "type": "string"
18086 /// }
18087 /// }
18088 /// }
18089 /// },
18090 /// "total": {
18091 /// "examples": [
18092 /// 1
18093 /// ],
18094 /// "type": "integer",
18095 /// "format": "int32"
18096 /// }
18097 /// }
18098 ///}
18099 /// ```
18100 /// </details>
18101 #[derive(Clone, Debug, Deserialize, Serialize)]
18102 pub struct LoanFlexibleCollateralDataResponse {
18103 pub rows: Vec<LoanFlexibleCollateralDataResponseRowsItem>,
18104 pub total: i32,
18105 }
18106 impl From<&LoanFlexibleCollateralDataResponse>
18107 for LoanFlexibleCollateralDataResponse {
18108 fn from(value: &LoanFlexibleCollateralDataResponse) -> Self {
18109 value.clone()
18110 }
18111 }
18112 ///LoanFlexibleCollateralDataResponseRowsItem
18113 ///
18114 /// <details><summary>JSON schema</summary>
18115 ///
18116 /// ```json
18117 ///{
18118 /// "type": "object",
18119 /// "required": [
18120 /// "collateralCoin",
18121 /// "initialLTV",
18122 /// "liquidationLTV",
18123 /// "marginCallLTV",
18124 /// "maxLimit"
18125 /// ],
18126 /// "properties": {
18127 /// "collateralCoin": {
18128 /// "examples": [
18129 /// "BNB"
18130 /// ],
18131 /// "type": "string"
18132 /// },
18133 /// "initialLTV": {
18134 /// "examples": [
18135 /// "0.01"
18136 /// ],
18137 /// "type": "string"
18138 /// },
18139 /// "liquidationLTV": {
18140 /// "examples": [
18141 /// "0.8"
18142 /// ],
18143 /// "type": "string"
18144 /// },
18145 /// "marginCallLTV": {
18146 /// "examples": [
18147 /// "0.7"
18148 /// ],
18149 /// "type": "string"
18150 /// },
18151 /// "maxLimit": {
18152 /// "examples": [
18153 /// "1000000"
18154 /// ],
18155 /// "type": "string"
18156 /// }
18157 /// }
18158 ///}
18159 /// ```
18160 /// </details>
18161 #[derive(Clone, Debug, Deserialize, Serialize)]
18162 pub struct LoanFlexibleCollateralDataResponseRowsItem {
18163 #[serde(rename = "collateralCoin")]
18164 pub collateral_coin: String,
18165 #[serde(rename = "initialLTV")]
18166 pub initial_ltv: String,
18167 #[serde(rename = "liquidationLTV")]
18168 pub liquidation_ltv: String,
18169 #[serde(rename = "marginCallLTV")]
18170 pub margin_call_ltv: String,
18171 #[serde(rename = "maxLimit")]
18172 pub max_limit: String,
18173 }
18174 impl From<&LoanFlexibleCollateralDataResponseRowsItem>
18175 for LoanFlexibleCollateralDataResponseRowsItem {
18176 fn from(value: &LoanFlexibleCollateralDataResponseRowsItem) -> Self {
18177 value.clone()
18178 }
18179 }
18180 ///LoanFlexibleLoanableDataResponse
18181 ///
18182 /// <details><summary>JSON schema</summary>
18183 ///
18184 /// ```json
18185 ///{
18186 /// "type": "object",
18187 /// "required": [
18188 /// "rows",
18189 /// "total"
18190 /// ],
18191 /// "properties": {
18192 /// "rows": {
18193 /// "type": "array",
18194 /// "items": {
18195 /// "type": "object",
18196 /// "required": [
18197 /// "flexibleInterestRate",
18198 /// "flexibleMaxLimit",
18199 /// "flexibleMinLimit",
18200 /// "loanCoin"
18201 /// ],
18202 /// "properties": {
18203 /// "flexibleInterestRate": {
18204 /// "examples": [
18205 /// "0.01"
18206 /// ],
18207 /// "type": "string"
18208 /// },
18209 /// "flexibleMaxLimit": {
18210 /// "examples": [
18211 /// "1000000"
18212 /// ],
18213 /// "type": "string"
18214 /// },
18215 /// "flexibleMinLimit": {
18216 /// "examples": [
18217 /// "100"
18218 /// ],
18219 /// "type": "string"
18220 /// },
18221 /// "loanCoin": {
18222 /// "examples": [
18223 /// "BNB"
18224 /// ],
18225 /// "type": "string"
18226 /// }
18227 /// }
18228 /// }
18229 /// },
18230 /// "total": {
18231 /// "examples": [
18232 /// 1
18233 /// ],
18234 /// "type": "integer",
18235 /// "format": "int32"
18236 /// }
18237 /// }
18238 ///}
18239 /// ```
18240 /// </details>
18241 #[derive(Clone, Debug, Deserialize, Serialize)]
18242 pub struct LoanFlexibleLoanableDataResponse {
18243 pub rows: Vec<LoanFlexibleLoanableDataResponseRowsItem>,
18244 pub total: i32,
18245 }
18246 impl From<&LoanFlexibleLoanableDataResponse> for LoanFlexibleLoanableDataResponse {
18247 fn from(value: &LoanFlexibleLoanableDataResponse) -> Self {
18248 value.clone()
18249 }
18250 }
18251 ///LoanFlexibleLoanableDataResponseRowsItem
18252 ///
18253 /// <details><summary>JSON schema</summary>
18254 ///
18255 /// ```json
18256 ///{
18257 /// "type": "object",
18258 /// "required": [
18259 /// "flexibleInterestRate",
18260 /// "flexibleMaxLimit",
18261 /// "flexibleMinLimit",
18262 /// "loanCoin"
18263 /// ],
18264 /// "properties": {
18265 /// "flexibleInterestRate": {
18266 /// "examples": [
18267 /// "0.01"
18268 /// ],
18269 /// "type": "string"
18270 /// },
18271 /// "flexibleMaxLimit": {
18272 /// "examples": [
18273 /// "1000000"
18274 /// ],
18275 /// "type": "string"
18276 /// },
18277 /// "flexibleMinLimit": {
18278 /// "examples": [
18279 /// "100"
18280 /// ],
18281 /// "type": "string"
18282 /// },
18283 /// "loanCoin": {
18284 /// "examples": [
18285 /// "BNB"
18286 /// ],
18287 /// "type": "string"
18288 /// }
18289 /// }
18290 ///}
18291 /// ```
18292 /// </details>
18293 #[derive(Clone, Debug, Deserialize, Serialize)]
18294 pub struct LoanFlexibleLoanableDataResponseRowsItem {
18295 #[serde(rename = "flexibleInterestRate")]
18296 pub flexible_interest_rate: String,
18297 #[serde(rename = "flexibleMaxLimit")]
18298 pub flexible_max_limit: String,
18299 #[serde(rename = "flexibleMinLimit")]
18300 pub flexible_min_limit: String,
18301 #[serde(rename = "loanCoin")]
18302 pub loan_coin: String,
18303 }
18304 impl From<&LoanFlexibleLoanableDataResponseRowsItem>
18305 for LoanFlexibleLoanableDataResponseRowsItem {
18306 fn from(value: &LoanFlexibleLoanableDataResponseRowsItem) -> Self {
18307 value.clone()
18308 }
18309 }
18310 ///LoanFlexibleLtvAdjustmentHistoryResponse
18311 ///
18312 /// <details><summary>JSON schema</summary>
18313 ///
18314 /// ```json
18315 ///{
18316 /// "type": "object",
18317 /// "required": [
18318 /// "rows",
18319 /// "total"
18320 /// ],
18321 /// "properties": {
18322 /// "rows": {
18323 /// "type": "array",
18324 /// "items": {
18325 /// "type": "object",
18326 /// "required": [
18327 /// "adjustTime",
18328 /// "afterLTV",
18329 /// "collateralAmount",
18330 /// "collateralCoin",
18331 /// "direction",
18332 /// "loanCoin",
18333 /// "preLTV"
18334 /// ],
18335 /// "properties": {
18336 /// "adjustTime": {
18337 /// "examples": [
18338 /// 1575018510000
18339 /// ],
18340 /// "type": "integer",
18341 /// "format": "int64"
18342 /// },
18343 /// "afterLTV": {
18344 /// "examples": [
18345 /// "0.5"
18346 /// ],
18347 /// "type": "string"
18348 /// },
18349 /// "collateralAmount": {
18350 /// "examples": [
18351 /// "5.75"
18352 /// ],
18353 /// "type": "string"
18354 /// },
18355 /// "collateralCoin": {
18356 /// "examples": [
18357 /// "BNB"
18358 /// ],
18359 /// "type": "string"
18360 /// },
18361 /// "direction": {
18362 /// "examples": [
18363 /// "ADDITIONAL"
18364 /// ],
18365 /// "type": "string"
18366 /// },
18367 /// "loanCoin": {
18368 /// "examples": [
18369 /// "BNB"
18370 /// ],
18371 /// "type": "string"
18372 /// },
18373 /// "preLTV": {
18374 /// "examples": [
18375 /// "0.83"
18376 /// ],
18377 /// "type": "string"
18378 /// }
18379 /// }
18380 /// }
18381 /// },
18382 /// "total": {
18383 /// "examples": [
18384 /// 1
18385 /// ],
18386 /// "type": "integer",
18387 /// "format": "int32"
18388 /// }
18389 /// }
18390 ///}
18391 /// ```
18392 /// </details>
18393 #[derive(Clone, Debug, Deserialize, Serialize)]
18394 pub struct LoanFlexibleLtvAdjustmentHistoryResponse {
18395 pub rows: Vec<LoanFlexibleLtvAdjustmentHistoryResponseRowsItem>,
18396 pub total: i32,
18397 }
18398 impl From<&LoanFlexibleLtvAdjustmentHistoryResponse>
18399 for LoanFlexibleLtvAdjustmentHistoryResponse {
18400 fn from(value: &LoanFlexibleLtvAdjustmentHistoryResponse) -> Self {
18401 value.clone()
18402 }
18403 }
18404 ///LoanFlexibleLtvAdjustmentHistoryResponseRowsItem
18405 ///
18406 /// <details><summary>JSON schema</summary>
18407 ///
18408 /// ```json
18409 ///{
18410 /// "type": "object",
18411 /// "required": [
18412 /// "adjustTime",
18413 /// "afterLTV",
18414 /// "collateralAmount",
18415 /// "collateralCoin",
18416 /// "direction",
18417 /// "loanCoin",
18418 /// "preLTV"
18419 /// ],
18420 /// "properties": {
18421 /// "adjustTime": {
18422 /// "examples": [
18423 /// 1575018510000
18424 /// ],
18425 /// "type": "integer",
18426 /// "format": "int64"
18427 /// },
18428 /// "afterLTV": {
18429 /// "examples": [
18430 /// "0.5"
18431 /// ],
18432 /// "type": "string"
18433 /// },
18434 /// "collateralAmount": {
18435 /// "examples": [
18436 /// "5.75"
18437 /// ],
18438 /// "type": "string"
18439 /// },
18440 /// "collateralCoin": {
18441 /// "examples": [
18442 /// "BNB"
18443 /// ],
18444 /// "type": "string"
18445 /// },
18446 /// "direction": {
18447 /// "examples": [
18448 /// "ADDITIONAL"
18449 /// ],
18450 /// "type": "string"
18451 /// },
18452 /// "loanCoin": {
18453 /// "examples": [
18454 /// "BNB"
18455 /// ],
18456 /// "type": "string"
18457 /// },
18458 /// "preLTV": {
18459 /// "examples": [
18460 /// "0.83"
18461 /// ],
18462 /// "type": "string"
18463 /// }
18464 /// }
18465 ///}
18466 /// ```
18467 /// </details>
18468 #[derive(Clone, Debug, Deserialize, Serialize)]
18469 pub struct LoanFlexibleLtvAdjustmentHistoryResponseRowsItem {
18470 #[serde(rename = "adjustTime")]
18471 pub adjust_time: i64,
18472 #[serde(rename = "afterLTV")]
18473 pub after_ltv: String,
18474 #[serde(rename = "collateralAmount")]
18475 pub collateral_amount: String,
18476 #[serde(rename = "collateralCoin")]
18477 pub collateral_coin: String,
18478 pub direction: String,
18479 #[serde(rename = "loanCoin")]
18480 pub loan_coin: String,
18481 #[serde(rename = "preLTV")]
18482 pub pre_ltv: String,
18483 }
18484 impl From<&LoanFlexibleLtvAdjustmentHistoryResponseRowsItem>
18485 for LoanFlexibleLtvAdjustmentHistoryResponseRowsItem {
18486 fn from(value: &LoanFlexibleLtvAdjustmentHistoryResponseRowsItem) -> Self {
18487 value.clone()
18488 }
18489 }
18490 ///LoanFlexibleOngoingOrdersResponse
18491 ///
18492 /// <details><summary>JSON schema</summary>
18493 ///
18494 /// ```json
18495 ///{
18496 /// "type": "object",
18497 /// "required": [
18498 /// "rows",
18499 /// "total"
18500 /// ],
18501 /// "properties": {
18502 /// "rows": {
18503 /// "type": "array",
18504 /// "items": {
18505 /// "type": "object",
18506 /// "required": [
18507 /// "collateralAmount",
18508 /// "collateralCoin",
18509 /// "currentLTV",
18510 /// "loanCoin",
18511 /// "totalDebt"
18512 /// ],
18513 /// "properties": {
18514 /// "collateralAmount": {
18515 /// "examples": [
18516 /// "49.27565492"
18517 /// ],
18518 /// "type": "string"
18519 /// },
18520 /// "collateralCoin": {
18521 /// "examples": [
18522 /// "BNB"
18523 /// ],
18524 /// "type": "string"
18525 /// },
18526 /// "currentLTV": {
18527 /// "examples": [
18528 /// "0.57"
18529 /// ],
18530 /// "type": "string"
18531 /// },
18532 /// "loanCoin": {
18533 /// "examples": [
18534 /// "BUSD"
18535 /// ],
18536 /// "type": "string"
18537 /// },
18538 /// "totalDebt": {
18539 /// "examples": [
18540 /// "10000"
18541 /// ],
18542 /// "type": "string"
18543 /// }
18544 /// }
18545 /// }
18546 /// },
18547 /// "total": {
18548 /// "examples": [
18549 /// 1
18550 /// ],
18551 /// "type": "integer",
18552 /// "format": "int32"
18553 /// }
18554 /// }
18555 ///}
18556 /// ```
18557 /// </details>
18558 #[derive(Clone, Debug, Deserialize, Serialize)]
18559 pub struct LoanFlexibleOngoingOrdersResponse {
18560 pub rows: Vec<LoanFlexibleOngoingOrdersResponseRowsItem>,
18561 pub total: i32,
18562 }
18563 impl From<&LoanFlexibleOngoingOrdersResponse> for LoanFlexibleOngoingOrdersResponse {
18564 fn from(value: &LoanFlexibleOngoingOrdersResponse) -> Self {
18565 value.clone()
18566 }
18567 }
18568 ///LoanFlexibleOngoingOrdersResponseRowsItem
18569 ///
18570 /// <details><summary>JSON schema</summary>
18571 ///
18572 /// ```json
18573 ///{
18574 /// "type": "object",
18575 /// "required": [
18576 /// "collateralAmount",
18577 /// "collateralCoin",
18578 /// "currentLTV",
18579 /// "loanCoin",
18580 /// "totalDebt"
18581 /// ],
18582 /// "properties": {
18583 /// "collateralAmount": {
18584 /// "examples": [
18585 /// "49.27565492"
18586 /// ],
18587 /// "type": "string"
18588 /// },
18589 /// "collateralCoin": {
18590 /// "examples": [
18591 /// "BNB"
18592 /// ],
18593 /// "type": "string"
18594 /// },
18595 /// "currentLTV": {
18596 /// "examples": [
18597 /// "0.57"
18598 /// ],
18599 /// "type": "string"
18600 /// },
18601 /// "loanCoin": {
18602 /// "examples": [
18603 /// "BUSD"
18604 /// ],
18605 /// "type": "string"
18606 /// },
18607 /// "totalDebt": {
18608 /// "examples": [
18609 /// "10000"
18610 /// ],
18611 /// "type": "string"
18612 /// }
18613 /// }
18614 ///}
18615 /// ```
18616 /// </details>
18617 #[derive(Clone, Debug, Deserialize, Serialize)]
18618 pub struct LoanFlexibleOngoingOrdersResponseRowsItem {
18619 #[serde(rename = "collateralAmount")]
18620 pub collateral_amount: String,
18621 #[serde(rename = "collateralCoin")]
18622 pub collateral_coin: String,
18623 #[serde(rename = "currentLTV")]
18624 pub current_ltv: String,
18625 #[serde(rename = "loanCoin")]
18626 pub loan_coin: String,
18627 #[serde(rename = "totalDebt")]
18628 pub total_debt: String,
18629 }
18630 impl From<&LoanFlexibleOngoingOrdersResponseRowsItem>
18631 for LoanFlexibleOngoingOrdersResponseRowsItem {
18632 fn from(value: &LoanFlexibleOngoingOrdersResponseRowsItem) -> Self {
18633 value.clone()
18634 }
18635 }
18636 ///LoanFlexibleRepayHistoryResponse
18637 ///
18638 /// <details><summary>JSON schema</summary>
18639 ///
18640 /// ```json
18641 ///{
18642 /// "type": "object",
18643 /// "required": [
18644 /// "rows",
18645 /// "total"
18646 /// ],
18647 /// "properties": {
18648 /// "rows": {
18649 /// "type": "array",
18650 /// "items": {
18651 /// "type": "object",
18652 /// "required": [
18653 /// "collateralCoin",
18654 /// "collateralReturn",
18655 /// "loanCoin",
18656 /// "repayAmount",
18657 /// "repayStatus",
18658 /// "repayTime"
18659 /// ],
18660 /// "properties": {
18661 /// "collateralCoin": {
18662 /// "examples": [
18663 /// "BNB"
18664 /// ],
18665 /// "type": "string"
18666 /// },
18667 /// "collateralReturn": {
18668 /// "examples": [
18669 /// "100"
18670 /// ],
18671 /// "type": "string"
18672 /// },
18673 /// "loanCoin": {
18674 /// "examples": [
18675 /// "BUSD"
18676 /// ],
18677 /// "type": "string"
18678 /// },
18679 /// "repayAmount": {
18680 /// "examples": [
18681 /// "10000"
18682 /// ],
18683 /// "type": "string"
18684 /// },
18685 /// "repayStatus": {
18686 /// "examples": [
18687 /// "Repaid"
18688 /// ],
18689 /// "type": "string"
18690 /// },
18691 /// "repayTime": {
18692 /// "examples": [
18693 /// 1575018510000
18694 /// ],
18695 /// "type": "integer",
18696 /// "format": "int64"
18697 /// }
18698 /// }
18699 /// }
18700 /// },
18701 /// "total": {
18702 /// "examples": [
18703 /// 1
18704 /// ],
18705 /// "type": "integer",
18706 /// "format": "int32"
18707 /// }
18708 /// }
18709 ///}
18710 /// ```
18711 /// </details>
18712 #[derive(Clone, Debug, Deserialize, Serialize)]
18713 pub struct LoanFlexibleRepayHistoryResponse {
18714 pub rows: Vec<LoanFlexibleRepayHistoryResponseRowsItem>,
18715 pub total: i32,
18716 }
18717 impl From<&LoanFlexibleRepayHistoryResponse> for LoanFlexibleRepayHistoryResponse {
18718 fn from(value: &LoanFlexibleRepayHistoryResponse) -> Self {
18719 value.clone()
18720 }
18721 }
18722 ///LoanFlexibleRepayHistoryResponseRowsItem
18723 ///
18724 /// <details><summary>JSON schema</summary>
18725 ///
18726 /// ```json
18727 ///{
18728 /// "type": "object",
18729 /// "required": [
18730 /// "collateralCoin",
18731 /// "collateralReturn",
18732 /// "loanCoin",
18733 /// "repayAmount",
18734 /// "repayStatus",
18735 /// "repayTime"
18736 /// ],
18737 /// "properties": {
18738 /// "collateralCoin": {
18739 /// "examples": [
18740 /// "BNB"
18741 /// ],
18742 /// "type": "string"
18743 /// },
18744 /// "collateralReturn": {
18745 /// "examples": [
18746 /// "100"
18747 /// ],
18748 /// "type": "string"
18749 /// },
18750 /// "loanCoin": {
18751 /// "examples": [
18752 /// "BUSD"
18753 /// ],
18754 /// "type": "string"
18755 /// },
18756 /// "repayAmount": {
18757 /// "examples": [
18758 /// "10000"
18759 /// ],
18760 /// "type": "string"
18761 /// },
18762 /// "repayStatus": {
18763 /// "examples": [
18764 /// "Repaid"
18765 /// ],
18766 /// "type": "string"
18767 /// },
18768 /// "repayTime": {
18769 /// "examples": [
18770 /// 1575018510000
18771 /// ],
18772 /// "type": "integer",
18773 /// "format": "int64"
18774 /// }
18775 /// }
18776 ///}
18777 /// ```
18778 /// </details>
18779 #[derive(Clone, Debug, Deserialize, Serialize)]
18780 pub struct LoanFlexibleRepayHistoryResponseRowsItem {
18781 #[serde(rename = "collateralCoin")]
18782 pub collateral_coin: String,
18783 #[serde(rename = "collateralReturn")]
18784 pub collateral_return: String,
18785 #[serde(rename = "loanCoin")]
18786 pub loan_coin: String,
18787 #[serde(rename = "repayAmount")]
18788 pub repay_amount: String,
18789 #[serde(rename = "repayStatus")]
18790 pub repay_status: String,
18791 #[serde(rename = "repayTime")]
18792 pub repay_time: i64,
18793 }
18794 impl From<&LoanFlexibleRepayHistoryResponseRowsItem>
18795 for LoanFlexibleRepayHistoryResponseRowsItem {
18796 fn from(value: &LoanFlexibleRepayHistoryResponseRowsItem) -> Self {
18797 value.clone()
18798 }
18799 }
18800 ///LoanFlexibleRepayResponse
18801 ///
18802 /// <details><summary>JSON schema</summary>
18803 ///
18804 /// ```json
18805 ///{
18806 /// "type": "object",
18807 /// "required": [
18808 /// "collateralCoin",
18809 /// "currentLTV",
18810 /// "fullRepayment",
18811 /// "loanCoin",
18812 /// "remainingCollateral",
18813 /// "remainingDebt",
18814 /// "repayStatus"
18815 /// ],
18816 /// "properties": {
18817 /// "collateralCoin": {
18818 /// "examples": [
18819 /// "BNB"
18820 /// ],
18821 /// "type": "string"
18822 /// },
18823 /// "currentLTV": {
18824 /// "examples": [
18825 /// "50.5"
18826 /// ],
18827 /// "type": "string"
18828 /// },
18829 /// "fullRepayment": {
18830 /// "examples": [
18831 /// false
18832 /// ],
18833 /// "type": "boolean"
18834 /// },
18835 /// "loanCoin": {
18836 /// "examples": [
18837 /// "BUSD"
18838 /// ],
18839 /// "type": "string"
18840 /// },
18841 /// "remainingCollateral": {
18842 /// "examples": [
18843 /// "50.5"
18844 /// ],
18845 /// "type": "string"
18846 /// },
18847 /// "remainingDebt": {
18848 /// "examples": [
18849 /// "50.5"
18850 /// ],
18851 /// "type": "string"
18852 /// },
18853 /// "repayStatus": {
18854 /// "examples": [
18855 /// "Repaid"
18856 /// ],
18857 /// "type": "string"
18858 /// }
18859 /// }
18860 ///}
18861 /// ```
18862 /// </details>
18863 #[derive(Clone, Debug, Deserialize, Serialize)]
18864 pub struct LoanFlexibleRepayResponse {
18865 #[serde(rename = "collateralCoin")]
18866 pub collateral_coin: String,
18867 #[serde(rename = "currentLTV")]
18868 pub current_ltv: String,
18869 #[serde(rename = "fullRepayment")]
18870 pub full_repayment: bool,
18871 #[serde(rename = "loanCoin")]
18872 pub loan_coin: String,
18873 #[serde(rename = "remainingCollateral")]
18874 pub remaining_collateral: String,
18875 #[serde(rename = "remainingDebt")]
18876 pub remaining_debt: String,
18877 #[serde(rename = "repayStatus")]
18878 pub repay_status: String,
18879 }
18880 impl From<&LoanFlexibleRepayResponse> for LoanFlexibleRepayResponse {
18881 fn from(value: &LoanFlexibleRepayResponse) -> Self {
18882 value.clone()
18883 }
18884 }
18885 ///LoanIncomeResponseItem
18886 ///
18887 /// <details><summary>JSON schema</summary>
18888 ///
18889 /// ```json
18890 ///{
18891 /// "type": "object",
18892 /// "required": [
18893 /// "amount",
18894 /// "asset",
18895 /// "timestamp",
18896 /// "tranId",
18897 /// "type"
18898 /// ],
18899 /// "properties": {
18900 /// "amount": {
18901 /// "examples": [
18902 /// "100"
18903 /// ],
18904 /// "type": "string"
18905 /// },
18906 /// "asset": {
18907 /// "examples": [
18908 /// "BUSD"
18909 /// ],
18910 /// "type": "string"
18911 /// },
18912 /// "timestamp": {
18913 /// "examples": [
18914 /// 1633771139847
18915 /// ],
18916 /// "type": "integer",
18917 /// "format": "int64"
18918 /// },
18919 /// "tranId": {
18920 /// "examples": [
18921 /// "80423589583"
18922 /// ],
18923 /// "type": "string"
18924 /// },
18925 /// "type": {
18926 /// "examples": [
18927 /// "borrowIn"
18928 /// ],
18929 /// "type": "string"
18930 /// }
18931 /// }
18932 ///}
18933 /// ```
18934 /// </details>
18935 #[derive(Clone, Debug, Deserialize, Serialize)]
18936 pub struct LoanIncomeResponseItem {
18937 pub amount: String,
18938 pub asset: String,
18939 pub timestamp: i64,
18940 #[serde(rename = "tranId")]
18941 pub tran_id: String,
18942 #[serde(rename = "type")]
18943 pub type_: String,
18944 }
18945 impl From<&LoanIncomeResponseItem> for LoanIncomeResponseItem {
18946 fn from(value: &LoanIncomeResponseItem) -> Self {
18947 value.clone()
18948 }
18949 }
18950 ///LoanIncomeType
18951 ///
18952 /// <details><summary>JSON schema</summary>
18953 ///
18954 /// ```json
18955 ///{
18956 /// "type": "string",
18957 /// "enum": [
18958 /// "borrowIn",
18959 /// "collateralSpent",
18960 /// "repayAmount",
18961 /// "collateralReturn",
18962 /// "addCollateral",
18963 /// "removeCollateral",
18964 /// "collateralReturnAfterLiquidation"
18965 /// ]
18966 ///}
18967 /// ```
18968 /// </details>
18969 #[derive(
18970 Clone,
18971 Copy,
18972 Debug,
18973 Deserialize,
18974 Eq,
18975 Hash,
18976 Ord,
18977 PartialEq,
18978 PartialOrd,
18979 Serialize
18980 )]
18981 pub enum LoanIncomeType {
18982 #[serde(rename = "borrowIn")]
18983 BorrowIn,
18984 #[serde(rename = "collateralSpent")]
18985 CollateralSpent,
18986 #[serde(rename = "repayAmount")]
18987 RepayAmount,
18988 #[serde(rename = "collateralReturn")]
18989 CollateralReturn,
18990 #[serde(rename = "addCollateral")]
18991 AddCollateral,
18992 #[serde(rename = "removeCollateral")]
18993 RemoveCollateral,
18994 #[serde(rename = "collateralReturnAfterLiquidation")]
18995 CollateralReturnAfterLiquidation,
18996 }
18997 impl From<&LoanIncomeType> for LoanIncomeType {
18998 fn from(value: &LoanIncomeType) -> Self {
18999 value.clone()
19000 }
19001 }
19002 impl ToString for LoanIncomeType {
19003 fn to_string(&self) -> String {
19004 match *self {
19005 Self::BorrowIn => "borrowIn".to_string(),
19006 Self::CollateralSpent => "collateralSpent".to_string(),
19007 Self::RepayAmount => "repayAmount".to_string(),
19008 Self::CollateralReturn => "collateralReturn".to_string(),
19009 Self::AddCollateral => "addCollateral".to_string(),
19010 Self::RemoveCollateral => "removeCollateral".to_string(),
19011 Self::CollateralReturnAfterLiquidation => {
19012 "collateralReturnAfterLiquidation".to_string()
19013 }
19014 }
19015 }
19016 }
19017 impl std::str::FromStr for LoanIncomeType {
19018 type Err = self::error::ConversionError;
19019 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
19020 match value {
19021 "borrowIn" => Ok(Self::BorrowIn),
19022 "collateralSpent" => Ok(Self::CollateralSpent),
19023 "repayAmount" => Ok(Self::RepayAmount),
19024 "collateralReturn" => Ok(Self::CollateralReturn),
19025 "addCollateral" => Ok(Self::AddCollateral),
19026 "removeCollateral" => Ok(Self::RemoveCollateral),
19027 "collateralReturnAfterLiquidation" => {
19028 Ok(Self::CollateralReturnAfterLiquidation)
19029 }
19030 _ => Err("invalid value".into()),
19031 }
19032 }
19033 }
19034 impl std::convert::TryFrom<&str> for LoanIncomeType {
19035 type Error = self::error::ConversionError;
19036 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
19037 value.parse()
19038 }
19039 }
19040 impl std::convert::TryFrom<&String> for LoanIncomeType {
19041 type Error = self::error::ConversionError;
19042 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
19043 value.parse()
19044 }
19045 }
19046 impl std::convert::TryFrom<String> for LoanIncomeType {
19047 type Error = self::error::ConversionError;
19048 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
19049 value.parse()
19050 }
19051 }
19052 ///LoanLoanableDataResponse
19053 ///
19054 /// <details><summary>JSON schema</summary>
19055 ///
19056 /// ```json
19057 ///{
19058 /// "type": "object",
19059 /// "required": [
19060 /// "rows",
19061 /// "total"
19062 /// ],
19063 /// "properties": {
19064 /// "rows": {
19065 /// "type": "array",
19066 /// "items": {
19067 /// "type": "object",
19068 /// "required": [
19069 /// "_14dDailyInterestRate",
19070 /// "_14dHourlyInterestRate",
19071 /// "_180dDailyInterestRate",
19072 /// "_180dHourlyInterestRate",
19073 /// "_30dDailyInterestRate",
19074 /// "_30dHourlyInterestRate",
19075 /// "_7dDailyInterestRate",
19076 /// "_7dHourlyInterestRate",
19077 /// "_90dDailyInterestRate",
19078 /// "_90dHourlyInterestRate",
19079 /// "loanCoin",
19080 /// "maxLimit",
19081 /// "minLimit",
19082 /// "vipLevel"
19083 /// ],
19084 /// "properties": {
19085 /// "_14dDailyInterestRate": {
19086 /// "examples": [
19087 /// "0.000118"
19088 /// ],
19089 /// "type": "string"
19090 /// },
19091 /// "_14dHourlyInterestRate": {
19092 /// "examples": [
19093 /// "0.00000491"
19094 /// ],
19095 /// "type": "string"
19096 /// },
19097 /// "_180dDailyInterestRate": {
19098 /// "examples": [
19099 /// "0.000151"
19100 /// ],
19101 /// "type": "string"
19102 /// },
19103 /// "_180dHourlyInterestRate": {
19104 /// "examples": [
19105 /// "0.00000631"
19106 /// ],
19107 /// "type": "string"
19108 /// },
19109 /// "_30dDailyInterestRate": {
19110 /// "examples": [
19111 /// "0.000136"
19112 /// ],
19113 /// "type": "string"
19114 /// },
19115 /// "_30dHourlyInterestRate": {
19116 /// "examples": [
19117 /// "0.00000567"
19118 /// ],
19119 /// "type": "string"
19120 /// },
19121 /// "_7dDailyInterestRate": {
19122 /// "examples": [
19123 /// "0.000118"
19124 /// ],
19125 /// "type": "string"
19126 /// },
19127 /// "_7dHourlyInterestRate": {
19128 /// "examples": [
19129 /// "0.00000491"
19130 /// ],
19131 /// "type": "string"
19132 /// },
19133 /// "_90dDailyInterestRate": {
19134 /// "examples": [
19135 /// "0.000143"
19136 /// ],
19137 /// "type": "string"
19138 /// },
19139 /// "_90dHourlyInterestRate": {
19140 /// "examples": [
19141 /// "0.00000596"
19142 /// ],
19143 /// "type": "string"
19144 /// },
19145 /// "loanCoin": {
19146 /// "examples": [
19147 /// "BUSD"
19148 /// ],
19149 /// "type": "string"
19150 /// },
19151 /// "maxLimit": {
19152 /// "examples": [
19153 /// "1000000"
19154 /// ],
19155 /// "type": "string"
19156 /// },
19157 /// "minLimit": {
19158 /// "examples": [
19159 /// "100"
19160 /// ],
19161 /// "type": "string"
19162 /// },
19163 /// "vipLevel": {
19164 /// "examples": [
19165 /// 1
19166 /// ],
19167 /// "type": "integer",
19168 /// "format": "int32"
19169 /// }
19170 /// }
19171 /// }
19172 /// },
19173 /// "total": {
19174 /// "examples": [
19175 /// 1
19176 /// ],
19177 /// "type": "integer",
19178 /// "format": "int32"
19179 /// }
19180 /// }
19181 ///}
19182 /// ```
19183 /// </details>
19184 #[derive(Clone, Debug, Deserialize, Serialize)]
19185 pub struct LoanLoanableDataResponse {
19186 pub rows: Vec<LoanLoanableDataResponseRowsItem>,
19187 pub total: i32,
19188 }
19189 impl From<&LoanLoanableDataResponse> for LoanLoanableDataResponse {
19190 fn from(value: &LoanLoanableDataResponse) -> Self {
19191 value.clone()
19192 }
19193 }
19194 ///LoanLoanableDataResponseRowsItem
19195 ///
19196 /// <details><summary>JSON schema</summary>
19197 ///
19198 /// ```json
19199 ///{
19200 /// "type": "object",
19201 /// "required": [
19202 /// "_14dDailyInterestRate",
19203 /// "_14dHourlyInterestRate",
19204 /// "_180dDailyInterestRate",
19205 /// "_180dHourlyInterestRate",
19206 /// "_30dDailyInterestRate",
19207 /// "_30dHourlyInterestRate",
19208 /// "_7dDailyInterestRate",
19209 /// "_7dHourlyInterestRate",
19210 /// "_90dDailyInterestRate",
19211 /// "_90dHourlyInterestRate",
19212 /// "loanCoin",
19213 /// "maxLimit",
19214 /// "minLimit",
19215 /// "vipLevel"
19216 /// ],
19217 /// "properties": {
19218 /// "_14dDailyInterestRate": {
19219 /// "examples": [
19220 /// "0.000118"
19221 /// ],
19222 /// "type": "string"
19223 /// },
19224 /// "_14dHourlyInterestRate": {
19225 /// "examples": [
19226 /// "0.00000491"
19227 /// ],
19228 /// "type": "string"
19229 /// },
19230 /// "_180dDailyInterestRate": {
19231 /// "examples": [
19232 /// "0.000151"
19233 /// ],
19234 /// "type": "string"
19235 /// },
19236 /// "_180dHourlyInterestRate": {
19237 /// "examples": [
19238 /// "0.00000631"
19239 /// ],
19240 /// "type": "string"
19241 /// },
19242 /// "_30dDailyInterestRate": {
19243 /// "examples": [
19244 /// "0.000136"
19245 /// ],
19246 /// "type": "string"
19247 /// },
19248 /// "_30dHourlyInterestRate": {
19249 /// "examples": [
19250 /// "0.00000567"
19251 /// ],
19252 /// "type": "string"
19253 /// },
19254 /// "_7dDailyInterestRate": {
19255 /// "examples": [
19256 /// "0.000118"
19257 /// ],
19258 /// "type": "string"
19259 /// },
19260 /// "_7dHourlyInterestRate": {
19261 /// "examples": [
19262 /// "0.00000491"
19263 /// ],
19264 /// "type": "string"
19265 /// },
19266 /// "_90dDailyInterestRate": {
19267 /// "examples": [
19268 /// "0.000143"
19269 /// ],
19270 /// "type": "string"
19271 /// },
19272 /// "_90dHourlyInterestRate": {
19273 /// "examples": [
19274 /// "0.00000596"
19275 /// ],
19276 /// "type": "string"
19277 /// },
19278 /// "loanCoin": {
19279 /// "examples": [
19280 /// "BUSD"
19281 /// ],
19282 /// "type": "string"
19283 /// },
19284 /// "maxLimit": {
19285 /// "examples": [
19286 /// "1000000"
19287 /// ],
19288 /// "type": "string"
19289 /// },
19290 /// "minLimit": {
19291 /// "examples": [
19292 /// "100"
19293 /// ],
19294 /// "type": "string"
19295 /// },
19296 /// "vipLevel": {
19297 /// "examples": [
19298 /// 1
19299 /// ],
19300 /// "type": "integer",
19301 /// "format": "int32"
19302 /// }
19303 /// }
19304 ///}
19305 /// ```
19306 /// </details>
19307 #[derive(Clone, Debug, Deserialize, Serialize)]
19308 pub struct LoanLoanableDataResponseRowsItem {
19309 #[serde(rename = "_14dDailyInterestRate")]
19310 pub _14d_daily_interest_rate: String,
19311 #[serde(rename = "_14dHourlyInterestRate")]
19312 pub _14d_hourly_interest_rate: String,
19313 #[serde(rename = "_180dDailyInterestRate")]
19314 pub _180d_daily_interest_rate: String,
19315 #[serde(rename = "_180dHourlyInterestRate")]
19316 pub _180d_hourly_interest_rate: String,
19317 #[serde(rename = "_30dDailyInterestRate")]
19318 pub _30d_daily_interest_rate: String,
19319 #[serde(rename = "_30dHourlyInterestRate")]
19320 pub _30d_hourly_interest_rate: String,
19321 #[serde(rename = "_7dDailyInterestRate")]
19322 pub _7d_daily_interest_rate: String,
19323 #[serde(rename = "_7dHourlyInterestRate")]
19324 pub _7d_hourly_interest_rate: String,
19325 #[serde(rename = "_90dDailyInterestRate")]
19326 pub _90d_daily_interest_rate: String,
19327 #[serde(rename = "_90dHourlyInterestRate")]
19328 pub _90d_hourly_interest_rate: String,
19329 #[serde(rename = "loanCoin")]
19330 pub loan_coin: String,
19331 #[serde(rename = "maxLimit")]
19332 pub max_limit: String,
19333 #[serde(rename = "minLimit")]
19334 pub min_limit: String,
19335 #[serde(rename = "vipLevel")]
19336 pub vip_level: i32,
19337 }
19338 impl From<&LoanLoanableDataResponseRowsItem> for LoanLoanableDataResponseRowsItem {
19339 fn from(value: &LoanLoanableDataResponseRowsItem) -> Self {
19340 value.clone()
19341 }
19342 }
19343 ///LoanLtvAdjustmentHistoryResponse
19344 ///
19345 /// <details><summary>JSON schema</summary>
19346 ///
19347 /// ```json
19348 ///{
19349 /// "type": "object",
19350 /// "required": [
19351 /// "rows",
19352 /// "total"
19353 /// ],
19354 /// "properties": {
19355 /// "rows": {
19356 /// "type": "array",
19357 /// "items": {
19358 /// "type": "object",
19359 /// "required": [
19360 /// "adjustTime",
19361 /// "afterLTV",
19362 /// "amount",
19363 /// "collateralCoin",
19364 /// "direction",
19365 /// "loanCoin",
19366 /// "orderId",
19367 /// "preLTV"
19368 /// ],
19369 /// "properties": {
19370 /// "adjustTime": {
19371 /// "examples": [
19372 /// 1575018510000
19373 /// ],
19374 /// "type": "integer",
19375 /// "format": "int64"
19376 /// },
19377 /// "afterLTV": {
19378 /// "examples": [
19379 /// "0.56"
19380 /// ],
19381 /// "type": "string"
19382 /// },
19383 /// "amount": {
19384 /// "examples": [
19385 /// "5.235"
19386 /// ],
19387 /// "type": "string"
19388 /// },
19389 /// "collateralCoin": {
19390 /// "examples": [
19391 /// "BNB"
19392 /// ],
19393 /// "type": "string"
19394 /// },
19395 /// "direction": {
19396 /// "examples": [
19397 /// "ADDITIONAL"
19398 /// ],
19399 /// "type": "string"
19400 /// },
19401 /// "loanCoin": {
19402 /// "examples": [
19403 /// "BUSD"
19404 /// ],
19405 /// "type": "string"
19406 /// },
19407 /// "orderId": {
19408 /// "examples": [
19409 /// 756783308056935434
19410 /// ],
19411 /// "type": "integer",
19412 /// "format": "int64"
19413 /// },
19414 /// "preLTV": {
19415 /// "examples": [
19416 /// "0.78"
19417 /// ],
19418 /// "type": "string"
19419 /// }
19420 /// }
19421 /// }
19422 /// },
19423 /// "total": {
19424 /// "examples": [
19425 /// 1
19426 /// ],
19427 /// "type": "integer",
19428 /// "format": "int32"
19429 /// }
19430 /// }
19431 ///}
19432 /// ```
19433 /// </details>
19434 #[derive(Clone, Debug, Deserialize, Serialize)]
19435 pub struct LoanLtvAdjustmentHistoryResponse {
19436 pub rows: Vec<LoanLtvAdjustmentHistoryResponseRowsItem>,
19437 pub total: i32,
19438 }
19439 impl From<&LoanLtvAdjustmentHistoryResponse> for LoanLtvAdjustmentHistoryResponse {
19440 fn from(value: &LoanLtvAdjustmentHistoryResponse) -> Self {
19441 value.clone()
19442 }
19443 }
19444 ///LoanLtvAdjustmentHistoryResponseRowsItem
19445 ///
19446 /// <details><summary>JSON schema</summary>
19447 ///
19448 /// ```json
19449 ///{
19450 /// "type": "object",
19451 /// "required": [
19452 /// "adjustTime",
19453 /// "afterLTV",
19454 /// "amount",
19455 /// "collateralCoin",
19456 /// "direction",
19457 /// "loanCoin",
19458 /// "orderId",
19459 /// "preLTV"
19460 /// ],
19461 /// "properties": {
19462 /// "adjustTime": {
19463 /// "examples": [
19464 /// 1575018510000
19465 /// ],
19466 /// "type": "integer",
19467 /// "format": "int64"
19468 /// },
19469 /// "afterLTV": {
19470 /// "examples": [
19471 /// "0.56"
19472 /// ],
19473 /// "type": "string"
19474 /// },
19475 /// "amount": {
19476 /// "examples": [
19477 /// "5.235"
19478 /// ],
19479 /// "type": "string"
19480 /// },
19481 /// "collateralCoin": {
19482 /// "examples": [
19483 /// "BNB"
19484 /// ],
19485 /// "type": "string"
19486 /// },
19487 /// "direction": {
19488 /// "examples": [
19489 /// "ADDITIONAL"
19490 /// ],
19491 /// "type": "string"
19492 /// },
19493 /// "loanCoin": {
19494 /// "examples": [
19495 /// "BUSD"
19496 /// ],
19497 /// "type": "string"
19498 /// },
19499 /// "orderId": {
19500 /// "examples": [
19501 /// 756783308056935434
19502 /// ],
19503 /// "type": "integer",
19504 /// "format": "int64"
19505 /// },
19506 /// "preLTV": {
19507 /// "examples": [
19508 /// "0.78"
19509 /// ],
19510 /// "type": "string"
19511 /// }
19512 /// }
19513 ///}
19514 /// ```
19515 /// </details>
19516 #[derive(Clone, Debug, Deserialize, Serialize)]
19517 pub struct LoanLtvAdjustmentHistoryResponseRowsItem {
19518 #[serde(rename = "adjustTime")]
19519 pub adjust_time: i64,
19520 #[serde(rename = "afterLTV")]
19521 pub after_ltv: String,
19522 pub amount: String,
19523 #[serde(rename = "collateralCoin")]
19524 pub collateral_coin: String,
19525 pub direction: String,
19526 #[serde(rename = "loanCoin")]
19527 pub loan_coin: String,
19528 #[serde(rename = "orderId")]
19529 pub order_id: i64,
19530 #[serde(rename = "preLTV")]
19531 pub pre_ltv: String,
19532 }
19533 impl From<&LoanLtvAdjustmentHistoryResponseRowsItem>
19534 for LoanLtvAdjustmentHistoryResponseRowsItem {
19535 fn from(value: &LoanLtvAdjustmentHistoryResponseRowsItem) -> Self {
19536 value.clone()
19537 }
19538 }
19539 ///LoanOngoingOrdersResponse
19540 ///
19541 /// <details><summary>JSON schema</summary>
19542 ///
19543 /// ```json
19544 ///{
19545 /// "type": "object",
19546 /// "required": [
19547 /// "rows",
19548 /// "total"
19549 /// ],
19550 /// "properties": {
19551 /// "rows": {
19552 /// "type": "array",
19553 /// "items": {
19554 /// "type": "object",
19555 /// "required": [
19556 /// "collateralAmount",
19557 /// "collateralCoin",
19558 /// "currentLTV",
19559 /// "expirationTime",
19560 /// "loanCoin",
19561 /// "orderId",
19562 /// "residualInterest",
19563 /// "totalDebt"
19564 /// ],
19565 /// "properties": {
19566 /// "collateralAmount": {
19567 /// "examples": [
19568 /// "49.27565492"
19569 /// ],
19570 /// "type": "string"
19571 /// },
19572 /// "collateralCoin": {
19573 /// "examples": [
19574 /// "BNB"
19575 /// ],
19576 /// "type": "string"
19577 /// },
19578 /// "currentLTV": {
19579 /// "examples": [
19580 /// "0.57"
19581 /// ],
19582 /// "type": "string"
19583 /// },
19584 /// "expirationTime": {
19585 /// "examples": [
19586 /// 1575018510000
19587 /// ],
19588 /// "type": "integer",
19589 /// "format": "int64"
19590 /// },
19591 /// "loanCoin": {
19592 /// "examples": [
19593 /// "BUSD"
19594 /// ],
19595 /// "type": "string"
19596 /// },
19597 /// "orderId": {
19598 /// "examples": [
19599 /// 100000001
19600 /// ],
19601 /// "type": "integer",
19602 /// "format": "int64"
19603 /// },
19604 /// "residualInterest": {
19605 /// "examples": [
19606 /// "10.27687923"
19607 /// ],
19608 /// "type": "string"
19609 /// },
19610 /// "totalDebt": {
19611 /// "examples": [
19612 /// "10000"
19613 /// ],
19614 /// "type": "string"
19615 /// }
19616 /// }
19617 /// }
19618 /// },
19619 /// "total": {
19620 /// "examples": [
19621 /// 1
19622 /// ],
19623 /// "type": "integer",
19624 /// "format": "int32"
19625 /// }
19626 /// }
19627 ///}
19628 /// ```
19629 /// </details>
19630 #[derive(Clone, Debug, Deserialize, Serialize)]
19631 pub struct LoanOngoingOrdersResponse {
19632 pub rows: Vec<LoanOngoingOrdersResponseRowsItem>,
19633 pub total: i32,
19634 }
19635 impl From<&LoanOngoingOrdersResponse> for LoanOngoingOrdersResponse {
19636 fn from(value: &LoanOngoingOrdersResponse) -> Self {
19637 value.clone()
19638 }
19639 }
19640 ///LoanOngoingOrdersResponseRowsItem
19641 ///
19642 /// <details><summary>JSON schema</summary>
19643 ///
19644 /// ```json
19645 ///{
19646 /// "type": "object",
19647 /// "required": [
19648 /// "collateralAmount",
19649 /// "collateralCoin",
19650 /// "currentLTV",
19651 /// "expirationTime",
19652 /// "loanCoin",
19653 /// "orderId",
19654 /// "residualInterest",
19655 /// "totalDebt"
19656 /// ],
19657 /// "properties": {
19658 /// "collateralAmount": {
19659 /// "examples": [
19660 /// "49.27565492"
19661 /// ],
19662 /// "type": "string"
19663 /// },
19664 /// "collateralCoin": {
19665 /// "examples": [
19666 /// "BNB"
19667 /// ],
19668 /// "type": "string"
19669 /// },
19670 /// "currentLTV": {
19671 /// "examples": [
19672 /// "0.57"
19673 /// ],
19674 /// "type": "string"
19675 /// },
19676 /// "expirationTime": {
19677 /// "examples": [
19678 /// 1575018510000
19679 /// ],
19680 /// "type": "integer",
19681 /// "format": "int64"
19682 /// },
19683 /// "loanCoin": {
19684 /// "examples": [
19685 /// "BUSD"
19686 /// ],
19687 /// "type": "string"
19688 /// },
19689 /// "orderId": {
19690 /// "examples": [
19691 /// 100000001
19692 /// ],
19693 /// "type": "integer",
19694 /// "format": "int64"
19695 /// },
19696 /// "residualInterest": {
19697 /// "examples": [
19698 /// "10.27687923"
19699 /// ],
19700 /// "type": "string"
19701 /// },
19702 /// "totalDebt": {
19703 /// "examples": [
19704 /// "10000"
19705 /// ],
19706 /// "type": "string"
19707 /// }
19708 /// }
19709 ///}
19710 /// ```
19711 /// </details>
19712 #[derive(Clone, Debug, Deserialize, Serialize)]
19713 pub struct LoanOngoingOrdersResponseRowsItem {
19714 #[serde(rename = "collateralAmount")]
19715 pub collateral_amount: String,
19716 #[serde(rename = "collateralCoin")]
19717 pub collateral_coin: String,
19718 #[serde(rename = "currentLTV")]
19719 pub current_ltv: String,
19720 #[serde(rename = "expirationTime")]
19721 pub expiration_time: i64,
19722 #[serde(rename = "loanCoin")]
19723 pub loan_coin: String,
19724 #[serde(rename = "orderId")]
19725 pub order_id: i64,
19726 #[serde(rename = "residualInterest")]
19727 pub residual_interest: String,
19728 #[serde(rename = "totalDebt")]
19729 pub total_debt: String,
19730 }
19731 impl From<&LoanOngoingOrdersResponseRowsItem> for LoanOngoingOrdersResponseRowsItem {
19732 fn from(value: &LoanOngoingOrdersResponseRowsItem) -> Self {
19733 value.clone()
19734 }
19735 }
19736 ///LoanRepayCollateralRateResponse
19737 ///
19738 /// <details><summary>JSON schema</summary>
19739 ///
19740 /// ```json
19741 ///{
19742 /// "type": "object",
19743 /// "required": [
19744 /// "collateralCoin",
19745 /// "loanCoin",
19746 /// "rate",
19747 /// "repayAmount"
19748 /// ],
19749 /// "properties": {
19750 /// "collateralCoin": {
19751 /// "examples": [
19752 /// "BUSD"
19753 /// ],
19754 /// "type": "string"
19755 /// },
19756 /// "loanCoin": {
19757 /// "examples": [
19758 /// "BUSD"
19759 /// ],
19760 /// "type": "string"
19761 /// },
19762 /// "rate": {
19763 /// "description": "rate of collateral coin/loan coin",
19764 /// "examples": [
19765 /// "300.36781234"
19766 /// ],
19767 /// "type": "string"
19768 /// },
19769 /// "repayAmount": {
19770 /// "examples": [
19771 /// "1000"
19772 /// ],
19773 /// "type": "string"
19774 /// }
19775 /// }
19776 ///}
19777 /// ```
19778 /// </details>
19779 #[derive(Clone, Debug, Deserialize, Serialize)]
19780 pub struct LoanRepayCollateralRateResponse {
19781 #[serde(rename = "collateralCoin")]
19782 pub collateral_coin: String,
19783 #[serde(rename = "loanCoin")]
19784 pub loan_coin: String,
19785 ///rate of collateral coin/loan coin
19786 pub rate: String,
19787 #[serde(rename = "repayAmount")]
19788 pub repay_amount: String,
19789 }
19790 impl From<&LoanRepayCollateralRateResponse> for LoanRepayCollateralRateResponse {
19791 fn from(value: &LoanRepayCollateralRateResponse) -> Self {
19792 value.clone()
19793 }
19794 }
19795 ///LoanRepayHistoryResponse
19796 ///
19797 /// <details><summary>JSON schema</summary>
19798 ///
19799 /// ```json
19800 ///{
19801 /// "type": "object",
19802 /// "required": [
19803 /// "rows",
19804 /// "total"
19805 /// ],
19806 /// "properties": {
19807 /// "rows": {
19808 /// "type": "array",
19809 /// "items": {
19810 /// "type": "object",
19811 /// "required": [
19812 /// "collateralCoin",
19813 /// "collateralReturn",
19814 /// "collateralUsed",
19815 /// "loanCoin",
19816 /// "orderId",
19817 /// "repayAmount",
19818 /// "repayStatus",
19819 /// "repayTime",
19820 /// "repayType"
19821 /// ],
19822 /// "properties": {
19823 /// "collateralCoin": {
19824 /// "examples": [
19825 /// "BNB"
19826 /// ],
19827 /// "type": "string"
19828 /// },
19829 /// "collateralReturn": {
19830 /// "examples": [
19831 /// "49.27565492"
19832 /// ],
19833 /// "type": "string"
19834 /// },
19835 /// "collateralUsed": {
19836 /// "examples": [
19837 /// "0"
19838 /// ],
19839 /// "type": "string"
19840 /// },
19841 /// "loanCoin": {
19842 /// "examples": [
19843 /// "BUSD"
19844 /// ],
19845 /// "type": "string"
19846 /// },
19847 /// "orderId": {
19848 /// "examples": [
19849 /// 756783308056935434
19850 /// ],
19851 /// "type": "integer",
19852 /// "format": "int64"
19853 /// },
19854 /// "repayAmount": {
19855 /// "examples": [
19856 /// "10000"
19857 /// ],
19858 /// "type": "string"
19859 /// },
19860 /// "repayStatus": {
19861 /// "description": "'repayType': '1' // 1 for 'repay with borrowed coin', 2 for 'repay with collateral' 'repayStatus': 'Repaid' // Repaid, Repaying, Failed",
19862 /// "examples": [
19863 /// "Repaid"
19864 /// ],
19865 /// "type": "string"
19866 /// },
19867 /// "repayTime": {
19868 /// "examples": [
19869 /// 1575018510000
19870 /// ],
19871 /// "type": "integer",
19872 /// "format": "int64"
19873 /// },
19874 /// "repayType": {
19875 /// "examples": [
19876 /// "1"
19877 /// ],
19878 /// "type": "string"
19879 /// }
19880 /// }
19881 /// }
19882 /// },
19883 /// "total": {
19884 /// "examples": [
19885 /// 1
19886 /// ],
19887 /// "type": "integer",
19888 /// "format": "int32"
19889 /// }
19890 /// }
19891 ///}
19892 /// ```
19893 /// </details>
19894 #[derive(Clone, Debug, Deserialize, Serialize)]
19895 pub struct LoanRepayHistoryResponse {
19896 pub rows: Vec<LoanRepayHistoryResponseRowsItem>,
19897 pub total: i32,
19898 }
19899 impl From<&LoanRepayHistoryResponse> for LoanRepayHistoryResponse {
19900 fn from(value: &LoanRepayHistoryResponse) -> Self {
19901 value.clone()
19902 }
19903 }
19904 ///LoanRepayHistoryResponseRowsItem
19905 ///
19906 /// <details><summary>JSON schema</summary>
19907 ///
19908 /// ```json
19909 ///{
19910 /// "type": "object",
19911 /// "required": [
19912 /// "collateralCoin",
19913 /// "collateralReturn",
19914 /// "collateralUsed",
19915 /// "loanCoin",
19916 /// "orderId",
19917 /// "repayAmount",
19918 /// "repayStatus",
19919 /// "repayTime",
19920 /// "repayType"
19921 /// ],
19922 /// "properties": {
19923 /// "collateralCoin": {
19924 /// "examples": [
19925 /// "BNB"
19926 /// ],
19927 /// "type": "string"
19928 /// },
19929 /// "collateralReturn": {
19930 /// "examples": [
19931 /// "49.27565492"
19932 /// ],
19933 /// "type": "string"
19934 /// },
19935 /// "collateralUsed": {
19936 /// "examples": [
19937 /// "0"
19938 /// ],
19939 /// "type": "string"
19940 /// },
19941 /// "loanCoin": {
19942 /// "examples": [
19943 /// "BUSD"
19944 /// ],
19945 /// "type": "string"
19946 /// },
19947 /// "orderId": {
19948 /// "examples": [
19949 /// 756783308056935434
19950 /// ],
19951 /// "type": "integer",
19952 /// "format": "int64"
19953 /// },
19954 /// "repayAmount": {
19955 /// "examples": [
19956 /// "10000"
19957 /// ],
19958 /// "type": "string"
19959 /// },
19960 /// "repayStatus": {
19961 /// "description": "'repayType': '1' // 1 for 'repay with borrowed coin', 2 for 'repay with collateral' 'repayStatus': 'Repaid' // Repaid, Repaying, Failed",
19962 /// "examples": [
19963 /// "Repaid"
19964 /// ],
19965 /// "type": "string"
19966 /// },
19967 /// "repayTime": {
19968 /// "examples": [
19969 /// 1575018510000
19970 /// ],
19971 /// "type": "integer",
19972 /// "format": "int64"
19973 /// },
19974 /// "repayType": {
19975 /// "examples": [
19976 /// "1"
19977 /// ],
19978 /// "type": "string"
19979 /// }
19980 /// }
19981 ///}
19982 /// ```
19983 /// </details>
19984 #[derive(Clone, Debug, Deserialize, Serialize)]
19985 pub struct LoanRepayHistoryResponseRowsItem {
19986 #[serde(rename = "collateralCoin")]
19987 pub collateral_coin: String,
19988 #[serde(rename = "collateralReturn")]
19989 pub collateral_return: String,
19990 #[serde(rename = "collateralUsed")]
19991 pub collateral_used: String,
19992 #[serde(rename = "loanCoin")]
19993 pub loan_coin: String,
19994 #[serde(rename = "orderId")]
19995 pub order_id: i64,
19996 #[serde(rename = "repayAmount")]
19997 pub repay_amount: String,
19998 ///'repayType': '1' // 1 for 'repay with borrowed coin', 2 for 'repay with collateral' 'repayStatus': 'Repaid' // Repaid, Repaying, Failed
19999 #[serde(rename = "repayStatus")]
20000 pub repay_status: String,
20001 #[serde(rename = "repayTime")]
20002 pub repay_time: i64,
20003 #[serde(rename = "repayType")]
20004 pub repay_type: String,
20005 }
20006 impl From<&LoanRepayHistoryResponseRowsItem> for LoanRepayHistoryResponseRowsItem {
20007 fn from(value: &LoanRepayHistoryResponseRowsItem) -> Self {
20008 value.clone()
20009 }
20010 }
20011 ///LoanRepayResponse
20012 ///
20013 /// <details><summary>JSON schema</summary>
20014 ///
20015 /// ```json
20016 ///{
20017 /// "oneOf": [
20018 /// {
20019 /// "$ref": "#/components/schemas/repaymentInfo"
20020 /// },
20021 /// {
20022 /// "$ref": "#/components/schemas/repaymentInfo2"
20023 /// }
20024 /// ]
20025 ///}
20026 /// ```
20027 /// </details>
20028 #[derive(Clone, Debug, Deserialize, Serialize)]
20029 #[serde(untagged)]
20030 pub enum LoanRepayResponse {
20031 Info(RepaymentInfo),
20032 Info2(RepaymentInfo2),
20033 }
20034 impl From<&LoanRepayResponse> for LoanRepayResponse {
20035 fn from(value: &LoanRepayResponse) -> Self {
20036 value.clone()
20037 }
20038 }
20039 impl From<RepaymentInfo> for LoanRepayResponse {
20040 fn from(value: RepaymentInfo) -> Self {
20041 Self::Info(value)
20042 }
20043 }
20044 impl From<RepaymentInfo2> for LoanRepayResponse {
20045 fn from(value: RepaymentInfo2) -> Self {
20046 Self::Info2(value)
20047 }
20048 }
20049 ///LoanVipBorrowIsFlexibleRate
20050 ///
20051 /// <details><summary>JSON schema</summary>
20052 ///
20053 /// ```json
20054 ///{
20055 /// "examples": [
20056 /// "TRUE"
20057 /// ],
20058 /// "type": "string",
20059 /// "enum": [
20060 /// "TRUE",
20061 /// "FALSE"
20062 /// ]
20063 ///}
20064 /// ```
20065 /// </details>
20066 #[derive(
20067 Clone,
20068 Copy,
20069 Debug,
20070 Deserialize,
20071 Eq,
20072 Hash,
20073 Ord,
20074 PartialEq,
20075 PartialOrd,
20076 Serialize
20077 )]
20078 pub enum LoanVipBorrowIsFlexibleRate {
20079 #[serde(rename = "TRUE")]
20080 True,
20081 #[serde(rename = "FALSE")]
20082 False,
20083 }
20084 impl From<&LoanVipBorrowIsFlexibleRate> for LoanVipBorrowIsFlexibleRate {
20085 fn from(value: &LoanVipBorrowIsFlexibleRate) -> Self {
20086 value.clone()
20087 }
20088 }
20089 impl ToString for LoanVipBorrowIsFlexibleRate {
20090 fn to_string(&self) -> String {
20091 match *self {
20092 Self::True => "TRUE".to_string(),
20093 Self::False => "FALSE".to_string(),
20094 }
20095 }
20096 }
20097 impl std::str::FromStr for LoanVipBorrowIsFlexibleRate {
20098 type Err = self::error::ConversionError;
20099 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
20100 match value {
20101 "TRUE" => Ok(Self::True),
20102 "FALSE" => Ok(Self::False),
20103 _ => Err("invalid value".into()),
20104 }
20105 }
20106 }
20107 impl std::convert::TryFrom<&str> for LoanVipBorrowIsFlexibleRate {
20108 type Error = self::error::ConversionError;
20109 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
20110 value.parse()
20111 }
20112 }
20113 impl std::convert::TryFrom<&String> for LoanVipBorrowIsFlexibleRate {
20114 type Error = self::error::ConversionError;
20115 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
20116 value.parse()
20117 }
20118 }
20119 impl std::convert::TryFrom<String> for LoanVipBorrowIsFlexibleRate {
20120 type Error = self::error::ConversionError;
20121 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
20122 value.parse()
20123 }
20124 }
20125 ///LoanVipBorrowResponse
20126 ///
20127 /// <details><summary>JSON schema</summary>
20128 ///
20129 /// ```json
20130 ///{
20131 /// "type": "object",
20132 /// "required": [
20133 /// "collateralAccountId",
20134 /// "collateralCoin",
20135 /// "isFlexibleRate",
20136 /// "loanAccountId",
20137 /// "loanAmount",
20138 /// "loanCoin",
20139 /// "requestId"
20140 /// ],
20141 /// "properties": {
20142 /// "collateralAccountId": {
20143 /// "examples": [
20144 /// "12345678,12345678,12345678"
20145 /// ],
20146 /// "type": "string"
20147 /// },
20148 /// "collateralCoin": {
20149 /// "examples": [
20150 /// "BUSD,USDT,ETH"
20151 /// ],
20152 /// "type": "string"
20153 /// },
20154 /// "isFlexibleRate": {
20155 /// "examples": [
20156 /// "No"
20157 /// ],
20158 /// "type": "string"
20159 /// },
20160 /// "loanAccountId": {
20161 /// "examples": [
20162 /// "12345678"
20163 /// ],
20164 /// "type": "string"
20165 /// },
20166 /// "loanAmount": {
20167 /// "examples": [
20168 /// "100.55"
20169 /// ],
20170 /// "type": "string"
20171 /// },
20172 /// "loanCoin": {
20173 /// "examples": [
20174 /// "BTC"
20175 /// ],
20176 /// "type": "string"
20177 /// },
20178 /// "loanTerm": {
20179 /// "examples": [
20180 /// "30"
20181 /// ],
20182 /// "type": "string"
20183 /// },
20184 /// "requestId": {
20185 /// "examples": [
20186 /// "12345678"
20187 /// ],
20188 /// "type": "string"
20189 /// }
20190 /// }
20191 ///}
20192 /// ```
20193 /// </details>
20194 #[derive(Clone, Debug, Deserialize, Serialize)]
20195 pub struct LoanVipBorrowResponse {
20196 #[serde(rename = "collateralAccountId")]
20197 pub collateral_account_id: String,
20198 #[serde(rename = "collateralCoin")]
20199 pub collateral_coin: String,
20200 #[serde(rename = "isFlexibleRate")]
20201 pub is_flexible_rate: String,
20202 #[serde(rename = "loanAccountId")]
20203 pub loan_account_id: String,
20204 #[serde(rename = "loanAmount")]
20205 pub loan_amount: String,
20206 #[serde(rename = "loanCoin")]
20207 pub loan_coin: String,
20208 #[serde(rename = "loanTerm", default, skip_serializing_if = "Option::is_none")]
20209 pub loan_term: Option<String>,
20210 #[serde(rename = "requestId")]
20211 pub request_id: String,
20212 }
20213 impl From<&LoanVipBorrowResponse> for LoanVipBorrowResponse {
20214 fn from(value: &LoanVipBorrowResponse) -> Self {
20215 value.clone()
20216 }
20217 }
20218 ///LoanVipCollateralAccountResponse
20219 ///
20220 /// <details><summary>JSON schema</summary>
20221 ///
20222 /// ```json
20223 ///{
20224 /// "type": "object",
20225 /// "required": [
20226 /// "rows",
20227 /// "total"
20228 /// ],
20229 /// "properties": {
20230 /// "rows": {
20231 /// "type": "array",
20232 /// "items": {
20233 /// "type": "object",
20234 /// "required": [
20235 /// "collateralAccountId",
20236 /// "collateralCoin",
20237 /// "collateralValue"
20238 /// ],
20239 /// "properties": {
20240 /// "collateralAccountId": {
20241 /// "examples": [
20242 /// "12345678"
20243 /// ],
20244 /// "type": "string"
20245 /// },
20246 /// "collateralCoin": {
20247 /// "examples": [
20248 /// "BNB,BTC,ETH"
20249 /// ],
20250 /// "type": "string"
20251 /// },
20252 /// "collateralValue": {
20253 /// "description": "locked collateral value shown in USD value",
20254 /// "examples": [
20255 /// "500.27565492"
20256 /// ],
20257 /// "type": "string"
20258 /// }
20259 /// }
20260 /// }
20261 /// },
20262 /// "total": {
20263 /// "examples": [
20264 /// 1
20265 /// ],
20266 /// "type": "integer",
20267 /// "format": "int32"
20268 /// }
20269 /// }
20270 ///}
20271 /// ```
20272 /// </details>
20273 #[derive(Clone, Debug, Deserialize, Serialize)]
20274 pub struct LoanVipCollateralAccountResponse {
20275 pub rows: Vec<LoanVipCollateralAccountResponseRowsItem>,
20276 pub total: i32,
20277 }
20278 impl From<&LoanVipCollateralAccountResponse> for LoanVipCollateralAccountResponse {
20279 fn from(value: &LoanVipCollateralAccountResponse) -> Self {
20280 value.clone()
20281 }
20282 }
20283 ///LoanVipCollateralAccountResponseRowsItem
20284 ///
20285 /// <details><summary>JSON schema</summary>
20286 ///
20287 /// ```json
20288 ///{
20289 /// "type": "object",
20290 /// "required": [
20291 /// "collateralAccountId",
20292 /// "collateralCoin",
20293 /// "collateralValue"
20294 /// ],
20295 /// "properties": {
20296 /// "collateralAccountId": {
20297 /// "examples": [
20298 /// "12345678"
20299 /// ],
20300 /// "type": "string"
20301 /// },
20302 /// "collateralCoin": {
20303 /// "examples": [
20304 /// "BNB,BTC,ETH"
20305 /// ],
20306 /// "type": "string"
20307 /// },
20308 /// "collateralValue": {
20309 /// "description": "locked collateral value shown in USD value",
20310 /// "examples": [
20311 /// "500.27565492"
20312 /// ],
20313 /// "type": "string"
20314 /// }
20315 /// }
20316 ///}
20317 /// ```
20318 /// </details>
20319 #[derive(Clone, Debug, Deserialize, Serialize)]
20320 pub struct LoanVipCollateralAccountResponseRowsItem {
20321 #[serde(rename = "collateralAccountId")]
20322 pub collateral_account_id: String,
20323 #[serde(rename = "collateralCoin")]
20324 pub collateral_coin: String,
20325 ///locked collateral value shown in USD value
20326 #[serde(rename = "collateralValue")]
20327 pub collateral_value: String,
20328 }
20329 impl From<&LoanVipCollateralAccountResponseRowsItem>
20330 for LoanVipCollateralAccountResponseRowsItem {
20331 fn from(value: &LoanVipCollateralAccountResponseRowsItem) -> Self {
20332 value.clone()
20333 }
20334 }
20335 ///LoanVipCollateralDataResponse
20336 ///
20337 /// <details><summary>JSON schema</summary>
20338 ///
20339 /// ```json
20340 ///{
20341 /// "type": "object",
20342 /// "required": [
20343 /// "rows",
20344 /// "total"
20345 /// ],
20346 /// "properties": {
20347 /// "rows": {
20348 /// "type": "array",
20349 /// "items": {
20350 /// "type": "object",
20351 /// "required": [
20352 /// "_1stCollateralRange",
20353 /// "_1stCollateralRatio",
20354 /// "_2ndCollateralRange",
20355 /// "_2ndCollateralRatio",
20356 /// "_3rdCollateralRange",
20357 /// "_3rdCollateralRatio",
20358 /// "_4thCollateralRange",
20359 /// "_4thCollateralRatio",
20360 /// "collateralCoin"
20361 /// ],
20362 /// "properties": {
20363 /// "_1stCollateralRange": {
20364 /// "examples": [
20365 /// "1-10000000"
20366 /// ],
20367 /// "type": "string"
20368 /// },
20369 /// "_1stCollateralRatio": {
20370 /// "examples": [
20371 /// "100%"
20372 /// ],
20373 /// "type": "string"
20374 /// },
20375 /// "_2ndCollateralRange": {
20376 /// "examples": [
20377 /// "10000000-100000000"
20378 /// ],
20379 /// "type": "string"
20380 /// },
20381 /// "_2ndCollateralRatio": {
20382 /// "examples": [
20383 /// "80%"
20384 /// ],
20385 /// "type": "string"
20386 /// },
20387 /// "_3rdCollateralRange": {
20388 /// "examples": [
20389 /// "100000000-1000000000"
20390 /// ],
20391 /// "type": "string"
20392 /// },
20393 /// "_3rdCollateralRatio": {
20394 /// "examples": [
20395 /// "60%"
20396 /// ],
20397 /// "type": "string"
20398 /// },
20399 /// "_4thCollateralRange": {
20400 /// "examples": [
20401 /// ">10000000000"
20402 /// ],
20403 /// "type": "string"
20404 /// },
20405 /// "_4thCollateralRatio": {
20406 /// "examples": [
20407 /// "0%"
20408 /// ],
20409 /// "type": "string"
20410 /// },
20411 /// "collateralCoin": {
20412 /// "examples": [
20413 /// "BUSD"
20414 /// ],
20415 /// "type": "string"
20416 /// }
20417 /// }
20418 /// }
20419 /// },
20420 /// "total": {
20421 /// "examples": [
20422 /// 1
20423 /// ],
20424 /// "type": "integer",
20425 /// "format": "int32"
20426 /// }
20427 /// }
20428 ///}
20429 /// ```
20430 /// </details>
20431 #[derive(Clone, Debug, Deserialize, Serialize)]
20432 pub struct LoanVipCollateralDataResponse {
20433 pub rows: Vec<LoanVipCollateralDataResponseRowsItem>,
20434 pub total: i32,
20435 }
20436 impl From<&LoanVipCollateralDataResponse> for LoanVipCollateralDataResponse {
20437 fn from(value: &LoanVipCollateralDataResponse) -> Self {
20438 value.clone()
20439 }
20440 }
20441 ///LoanVipCollateralDataResponseRowsItem
20442 ///
20443 /// <details><summary>JSON schema</summary>
20444 ///
20445 /// ```json
20446 ///{
20447 /// "type": "object",
20448 /// "required": [
20449 /// "_1stCollateralRange",
20450 /// "_1stCollateralRatio",
20451 /// "_2ndCollateralRange",
20452 /// "_2ndCollateralRatio",
20453 /// "_3rdCollateralRange",
20454 /// "_3rdCollateralRatio",
20455 /// "_4thCollateralRange",
20456 /// "_4thCollateralRatio",
20457 /// "collateralCoin"
20458 /// ],
20459 /// "properties": {
20460 /// "_1stCollateralRange": {
20461 /// "examples": [
20462 /// "1-10000000"
20463 /// ],
20464 /// "type": "string"
20465 /// },
20466 /// "_1stCollateralRatio": {
20467 /// "examples": [
20468 /// "100%"
20469 /// ],
20470 /// "type": "string"
20471 /// },
20472 /// "_2ndCollateralRange": {
20473 /// "examples": [
20474 /// "10000000-100000000"
20475 /// ],
20476 /// "type": "string"
20477 /// },
20478 /// "_2ndCollateralRatio": {
20479 /// "examples": [
20480 /// "80%"
20481 /// ],
20482 /// "type": "string"
20483 /// },
20484 /// "_3rdCollateralRange": {
20485 /// "examples": [
20486 /// "100000000-1000000000"
20487 /// ],
20488 /// "type": "string"
20489 /// },
20490 /// "_3rdCollateralRatio": {
20491 /// "examples": [
20492 /// "60%"
20493 /// ],
20494 /// "type": "string"
20495 /// },
20496 /// "_4thCollateralRange": {
20497 /// "examples": [
20498 /// ">10000000000"
20499 /// ],
20500 /// "type": "string"
20501 /// },
20502 /// "_4thCollateralRatio": {
20503 /// "examples": [
20504 /// "0%"
20505 /// ],
20506 /// "type": "string"
20507 /// },
20508 /// "collateralCoin": {
20509 /// "examples": [
20510 /// "BUSD"
20511 /// ],
20512 /// "type": "string"
20513 /// }
20514 /// }
20515 ///}
20516 /// ```
20517 /// </details>
20518 #[derive(Clone, Debug, Deserialize, Serialize)]
20519 pub struct LoanVipCollateralDataResponseRowsItem {
20520 #[serde(rename = "_1stCollateralRange")]
20521 pub _1st_collateral_range: String,
20522 #[serde(rename = "_1stCollateralRatio")]
20523 pub _1st_collateral_ratio: String,
20524 #[serde(rename = "_2ndCollateralRange")]
20525 pub _2nd_collateral_range: String,
20526 #[serde(rename = "_2ndCollateralRatio")]
20527 pub _2nd_collateral_ratio: String,
20528 #[serde(rename = "_3rdCollateralRange")]
20529 pub _3rd_collateral_range: String,
20530 #[serde(rename = "_3rdCollateralRatio")]
20531 pub _3rd_collateral_ratio: String,
20532 #[serde(rename = "_4thCollateralRange")]
20533 pub _4th_collateral_range: String,
20534 #[serde(rename = "_4thCollateralRatio")]
20535 pub _4th_collateral_ratio: String,
20536 #[serde(rename = "collateralCoin")]
20537 pub collateral_coin: String,
20538 }
20539 impl From<&LoanVipCollateralDataResponseRowsItem>
20540 for LoanVipCollateralDataResponseRowsItem {
20541 fn from(value: &LoanVipCollateralDataResponseRowsItem) -> Self {
20542 value.clone()
20543 }
20544 }
20545 ///LoanVipLoanableDataResponse
20546 ///
20547 /// <details><summary>JSON schema</summary>
20548 ///
20549 /// ```json
20550 ///{
20551 /// "type": "object",
20552 /// "required": [
20553 /// "rows",
20554 /// "total"
20555 /// ],
20556 /// "properties": {
20557 /// "rows": {
20558 /// "type": "array",
20559 /// "items": {
20560 /// "type": "object",
20561 /// "required": [
20562 /// "_30dDailyInterestRate",
20563 /// "_30dYearlyInterestRate",
20564 /// "_60dDailyInterestRate",
20565 /// "_60dYearlyInterestRate",
20566 /// "_flexibleDailyInterestRate",
20567 /// "_flexibleYearlyInterestRate",
20568 /// "loanCoin",
20569 /// "maxLimit",
20570 /// "minLimit",
20571 /// "vipLevel"
20572 /// ],
20573 /// "properties": {
20574 /// "_30dDailyInterestRate": {
20575 /// "examples": [
20576 /// "0.000136"
20577 /// ],
20578 /// "type": "string"
20579 /// },
20580 /// "_30dYearlyInterestRate": {
20581 /// "examples": [
20582 /// "0.03450"
20583 /// ],
20584 /// "type": "string"
20585 /// },
20586 /// "_60dDailyInterestRate": {
20587 /// "examples": [
20588 /// "0.000145"
20589 /// ],
20590 /// "type": "string"
20591 /// },
20592 /// "_60dYearlyInterestRate": {
20593 /// "examples": [
20594 /// "0.04103"
20595 /// ],
20596 /// "type": "string"
20597 /// },
20598 /// "_flexibleDailyInterestRate": {
20599 /// "examples": [
20600 /// "0.001503"
20601 /// ],
20602 /// "type": "string"
20603 /// },
20604 /// "_flexibleYearlyInterestRate": {
20605 /// "examples": [
20606 /// "0.548595"
20607 /// ],
20608 /// "type": "string"
20609 /// },
20610 /// "loanCoin": {
20611 /// "examples": [
20612 /// "BUSD"
20613 /// ],
20614 /// "type": "string"
20615 /// },
20616 /// "maxLimit": {
20617 /// "examples": [
20618 /// "1000000"
20619 /// ],
20620 /// "type": "string"
20621 /// },
20622 /// "minLimit": {
20623 /// "examples": [
20624 /// "100"
20625 /// ],
20626 /// "type": "string"
20627 /// },
20628 /// "vipLevel": {
20629 /// "examples": [
20630 /// 1
20631 /// ],
20632 /// "type": "integer"
20633 /// }
20634 /// }
20635 /// }
20636 /// },
20637 /// "total": {
20638 /// "examples": [
20639 /// 1
20640 /// ],
20641 /// "type": "integer"
20642 /// }
20643 /// }
20644 ///}
20645 /// ```
20646 /// </details>
20647 #[derive(Clone, Debug, Deserialize, Serialize)]
20648 pub struct LoanVipLoanableDataResponse {
20649 pub rows: Vec<LoanVipLoanableDataResponseRowsItem>,
20650 pub total: i64,
20651 }
20652 impl From<&LoanVipLoanableDataResponse> for LoanVipLoanableDataResponse {
20653 fn from(value: &LoanVipLoanableDataResponse) -> Self {
20654 value.clone()
20655 }
20656 }
20657 ///LoanVipLoanableDataResponseRowsItem
20658 ///
20659 /// <details><summary>JSON schema</summary>
20660 ///
20661 /// ```json
20662 ///{
20663 /// "type": "object",
20664 /// "required": [
20665 /// "_30dDailyInterestRate",
20666 /// "_30dYearlyInterestRate",
20667 /// "_60dDailyInterestRate",
20668 /// "_60dYearlyInterestRate",
20669 /// "_flexibleDailyInterestRate",
20670 /// "_flexibleYearlyInterestRate",
20671 /// "loanCoin",
20672 /// "maxLimit",
20673 /// "minLimit",
20674 /// "vipLevel"
20675 /// ],
20676 /// "properties": {
20677 /// "_30dDailyInterestRate": {
20678 /// "examples": [
20679 /// "0.000136"
20680 /// ],
20681 /// "type": "string"
20682 /// },
20683 /// "_30dYearlyInterestRate": {
20684 /// "examples": [
20685 /// "0.03450"
20686 /// ],
20687 /// "type": "string"
20688 /// },
20689 /// "_60dDailyInterestRate": {
20690 /// "examples": [
20691 /// "0.000145"
20692 /// ],
20693 /// "type": "string"
20694 /// },
20695 /// "_60dYearlyInterestRate": {
20696 /// "examples": [
20697 /// "0.04103"
20698 /// ],
20699 /// "type": "string"
20700 /// },
20701 /// "_flexibleDailyInterestRate": {
20702 /// "examples": [
20703 /// "0.001503"
20704 /// ],
20705 /// "type": "string"
20706 /// },
20707 /// "_flexibleYearlyInterestRate": {
20708 /// "examples": [
20709 /// "0.548595"
20710 /// ],
20711 /// "type": "string"
20712 /// },
20713 /// "loanCoin": {
20714 /// "examples": [
20715 /// "BUSD"
20716 /// ],
20717 /// "type": "string"
20718 /// },
20719 /// "maxLimit": {
20720 /// "examples": [
20721 /// "1000000"
20722 /// ],
20723 /// "type": "string"
20724 /// },
20725 /// "minLimit": {
20726 /// "examples": [
20727 /// "100"
20728 /// ],
20729 /// "type": "string"
20730 /// },
20731 /// "vipLevel": {
20732 /// "examples": [
20733 /// 1
20734 /// ],
20735 /// "type": "integer"
20736 /// }
20737 /// }
20738 ///}
20739 /// ```
20740 /// </details>
20741 #[derive(Clone, Debug, Deserialize, Serialize)]
20742 pub struct LoanVipLoanableDataResponseRowsItem {
20743 #[serde(rename = "_30dDailyInterestRate")]
20744 pub _30d_daily_interest_rate: String,
20745 #[serde(rename = "_30dYearlyInterestRate")]
20746 pub _30d_yearly_interest_rate: String,
20747 #[serde(rename = "_60dDailyInterestRate")]
20748 pub _60d_daily_interest_rate: String,
20749 #[serde(rename = "_60dYearlyInterestRate")]
20750 pub _60d_yearly_interest_rate: String,
20751 #[serde(rename = "_flexibleDailyInterestRate")]
20752 pub flexible_daily_interest_rate: String,
20753 #[serde(rename = "_flexibleYearlyInterestRate")]
20754 pub flexible_yearly_interest_rate: String,
20755 #[serde(rename = "loanCoin")]
20756 pub loan_coin: String,
20757 #[serde(rename = "maxLimit")]
20758 pub max_limit: String,
20759 #[serde(rename = "minLimit")]
20760 pub min_limit: String,
20761 #[serde(rename = "vipLevel")]
20762 pub vip_level: i64,
20763 }
20764 impl From<&LoanVipLoanableDataResponseRowsItem>
20765 for LoanVipLoanableDataResponseRowsItem {
20766 fn from(value: &LoanVipLoanableDataResponseRowsItem) -> Self {
20767 value.clone()
20768 }
20769 }
20770 ///LoanVipOngoingOrdersResponse
20771 ///
20772 /// <details><summary>JSON schema</summary>
20773 ///
20774 /// ```json
20775 ///{
20776 /// "type": "object",
20777 /// "required": [
20778 /// "rows",
20779 /// "total"
20780 /// ],
20781 /// "properties": {
20782 /// "rows": {
20783 /// "type": "array",
20784 /// "items": {
20785 /// "type": "object",
20786 /// "required": [
20787 /// "collateralAccountId",
20788 /// "collateralCoin",
20789 /// "collateralValue",
20790 /// "currentLTV",
20791 /// "expirationTime",
20792 /// "loanCoin",
20793 /// "loanDate",
20794 /// "loanRate",
20795 /// "loanTerm",
20796 /// "orderId",
20797 /// "residualInterest",
20798 /// "totalDebt"
20799 /// ],
20800 /// "properties": {
20801 /// "collateralAccountId": {
20802 /// "examples": [
20803 /// "12345678, 23456789"
20804 /// ],
20805 /// "type": "string"
20806 /// },
20807 /// "collateralCoin": {
20808 /// "examples": [
20809 /// "BNB,BTC,ETH"
20810 /// ],
20811 /// "type": "string"
20812 /// },
20813 /// "collateralValue": {
20814 /// "description": "locked collateral value shown in USD value",
20815 /// "examples": [
20816 /// "25000.27565492"
20817 /// ],
20818 /// "type": "string"
20819 /// },
20820 /// "currentLTV": {
20821 /// "examples": [
20822 /// "0.57"
20823 /// ],
20824 /// "type": "string"
20825 /// },
20826 /// "expirationTime": {
20827 /// "examples": [
20828 /// 1575018510000
20829 /// ],
20830 /// "type": "integer",
20831 /// "format": "int64"
20832 /// },
20833 /// "loanCoin": {
20834 /// "examples": [
20835 /// "BUSD"
20836 /// ],
20837 /// "type": "string"
20838 /// },
20839 /// "loanDate": {
20840 /// "examples": [
20841 /// "1676851200000"
20842 /// ],
20843 /// "type": "string"
20844 /// },
20845 /// "loanRate": {
20846 /// "examples": [
20847 /// "0.0123"
20848 /// ],
20849 /// "type": "string"
20850 /// },
20851 /// "loanTerm": {
20852 /// "examples": [
20853 /// "30days"
20854 /// ],
20855 /// "type": "string"
20856 /// },
20857 /// "lockedCollateralValue": {
20858 /// "examples": [
20859 /// "25000.27565492"
20860 /// ],
20861 /// "type": "string"
20862 /// },
20863 /// "orderId": {
20864 /// "examples": [
20865 /// 100000001
20866 /// ],
20867 /// "type": "integer",
20868 /// "format": "int64"
20869 /// },
20870 /// "residualInterest": {
20871 /// "examples": [
20872 /// "10.27687923"
20873 /// ],
20874 /// "type": "string"
20875 /// },
20876 /// "totalCollateralValueAfterHaircut": {
20877 /// "examples": [
20878 /// "25000.27565492"
20879 /// ],
20880 /// "type": "string"
20881 /// },
20882 /// "totalDebt": {
20883 /// "examples": [
20884 /// "10000"
20885 /// ],
20886 /// "type": "string"
20887 /// }
20888 /// }
20889 /// }
20890 /// },
20891 /// "total": {
20892 /// "examples": [
20893 /// 1
20894 /// ],
20895 /// "type": "integer",
20896 /// "format": "int32"
20897 /// }
20898 /// }
20899 ///}
20900 /// ```
20901 /// </details>
20902 #[derive(Clone, Debug, Deserialize, Serialize)]
20903 pub struct LoanVipOngoingOrdersResponse {
20904 pub rows: Vec<LoanVipOngoingOrdersResponseRowsItem>,
20905 pub total: i32,
20906 }
20907 impl From<&LoanVipOngoingOrdersResponse> for LoanVipOngoingOrdersResponse {
20908 fn from(value: &LoanVipOngoingOrdersResponse) -> Self {
20909 value.clone()
20910 }
20911 }
20912 ///LoanVipOngoingOrdersResponseRowsItem
20913 ///
20914 /// <details><summary>JSON schema</summary>
20915 ///
20916 /// ```json
20917 ///{
20918 /// "type": "object",
20919 /// "required": [
20920 /// "collateralAccountId",
20921 /// "collateralCoin",
20922 /// "collateralValue",
20923 /// "currentLTV",
20924 /// "expirationTime",
20925 /// "loanCoin",
20926 /// "loanDate",
20927 /// "loanRate",
20928 /// "loanTerm",
20929 /// "orderId",
20930 /// "residualInterest",
20931 /// "totalDebt"
20932 /// ],
20933 /// "properties": {
20934 /// "collateralAccountId": {
20935 /// "examples": [
20936 /// "12345678, 23456789"
20937 /// ],
20938 /// "type": "string"
20939 /// },
20940 /// "collateralCoin": {
20941 /// "examples": [
20942 /// "BNB,BTC,ETH"
20943 /// ],
20944 /// "type": "string"
20945 /// },
20946 /// "collateralValue": {
20947 /// "description": "locked collateral value shown in USD value",
20948 /// "examples": [
20949 /// "25000.27565492"
20950 /// ],
20951 /// "type": "string"
20952 /// },
20953 /// "currentLTV": {
20954 /// "examples": [
20955 /// "0.57"
20956 /// ],
20957 /// "type": "string"
20958 /// },
20959 /// "expirationTime": {
20960 /// "examples": [
20961 /// 1575018510000
20962 /// ],
20963 /// "type": "integer",
20964 /// "format": "int64"
20965 /// },
20966 /// "loanCoin": {
20967 /// "examples": [
20968 /// "BUSD"
20969 /// ],
20970 /// "type": "string"
20971 /// },
20972 /// "loanDate": {
20973 /// "examples": [
20974 /// "1676851200000"
20975 /// ],
20976 /// "type": "string"
20977 /// },
20978 /// "loanRate": {
20979 /// "examples": [
20980 /// "0.0123"
20981 /// ],
20982 /// "type": "string"
20983 /// },
20984 /// "loanTerm": {
20985 /// "examples": [
20986 /// "30days"
20987 /// ],
20988 /// "type": "string"
20989 /// },
20990 /// "lockedCollateralValue": {
20991 /// "examples": [
20992 /// "25000.27565492"
20993 /// ],
20994 /// "type": "string"
20995 /// },
20996 /// "orderId": {
20997 /// "examples": [
20998 /// 100000001
20999 /// ],
21000 /// "type": "integer",
21001 /// "format": "int64"
21002 /// },
21003 /// "residualInterest": {
21004 /// "examples": [
21005 /// "10.27687923"
21006 /// ],
21007 /// "type": "string"
21008 /// },
21009 /// "totalCollateralValueAfterHaircut": {
21010 /// "examples": [
21011 /// "25000.27565492"
21012 /// ],
21013 /// "type": "string"
21014 /// },
21015 /// "totalDebt": {
21016 /// "examples": [
21017 /// "10000"
21018 /// ],
21019 /// "type": "string"
21020 /// }
21021 /// }
21022 ///}
21023 /// ```
21024 /// </details>
21025 #[derive(Clone, Debug, Deserialize, Serialize)]
21026 pub struct LoanVipOngoingOrdersResponseRowsItem {
21027 #[serde(rename = "collateralAccountId")]
21028 pub collateral_account_id: String,
21029 #[serde(rename = "collateralCoin")]
21030 pub collateral_coin: String,
21031 ///locked collateral value shown in USD value
21032 #[serde(rename = "collateralValue")]
21033 pub collateral_value: String,
21034 #[serde(rename = "currentLTV")]
21035 pub current_ltv: String,
21036 #[serde(rename = "expirationTime")]
21037 pub expiration_time: i64,
21038 #[serde(rename = "loanCoin")]
21039 pub loan_coin: String,
21040 #[serde(rename = "loanDate")]
21041 pub loan_date: String,
21042 #[serde(rename = "loanRate")]
21043 pub loan_rate: String,
21044 #[serde(rename = "loanTerm")]
21045 pub loan_term: String,
21046 #[serde(
21047 rename = "lockedCollateralValue",
21048 default,
21049 skip_serializing_if = "Option::is_none"
21050 )]
21051 pub locked_collateral_value: Option<String>,
21052 #[serde(rename = "orderId")]
21053 pub order_id: i64,
21054 #[serde(rename = "residualInterest")]
21055 pub residual_interest: String,
21056 #[serde(
21057 rename = "totalCollateralValueAfterHaircut",
21058 default,
21059 skip_serializing_if = "Option::is_none"
21060 )]
21061 pub total_collateral_value_after_haircut: Option<String>,
21062 #[serde(rename = "totalDebt")]
21063 pub total_debt: String,
21064 }
21065 impl From<&LoanVipOngoingOrdersResponseRowsItem>
21066 for LoanVipOngoingOrdersResponseRowsItem {
21067 fn from(value: &LoanVipOngoingOrdersResponseRowsItem) -> Self {
21068 value.clone()
21069 }
21070 }
21071 ///LoanVipRenewResponse
21072 ///
21073 /// <details><summary>JSON schema</summary>
21074 ///
21075 /// ```json
21076 ///{
21077 /// "type": "object",
21078 /// "required": [
21079 /// "collateralAccountId",
21080 /// "collateralCoin",
21081 /// "loanAccountId",
21082 /// "loanAmount",
21083 /// "loanCoin",
21084 /// "loanTerm"
21085 /// ],
21086 /// "properties": {
21087 /// "collateralAccountId": {
21088 /// "examples": [
21089 /// "12345677,12345678,12345679"
21090 /// ],
21091 /// "type": "string"
21092 /// },
21093 /// "collateralCoin": {
21094 /// "examples": [
21095 /// "BUSD,USDT,ETH"
21096 /// ],
21097 /// "type": "string"
21098 /// },
21099 /// "loanAccountId": {
21100 /// "examples": [
21101 /// "12345678"
21102 /// ],
21103 /// "type": "string"
21104 /// },
21105 /// "loanAmount": {
21106 /// "examples": [
21107 /// "100.55"
21108 /// ],
21109 /// "type": "string"
21110 /// },
21111 /// "loanCoin": {
21112 /// "examples": [
21113 /// "BTC"
21114 /// ],
21115 /// "type": "string"
21116 /// },
21117 /// "loanTerm": {
21118 /// "examples": [
21119 /// "30"
21120 /// ],
21121 /// "type": "string"
21122 /// }
21123 /// }
21124 ///}
21125 /// ```
21126 /// </details>
21127 #[derive(Clone, Debug, Deserialize, Serialize)]
21128 pub struct LoanVipRenewResponse {
21129 #[serde(rename = "collateralAccountId")]
21130 pub collateral_account_id: String,
21131 #[serde(rename = "collateralCoin")]
21132 pub collateral_coin: String,
21133 #[serde(rename = "loanAccountId")]
21134 pub loan_account_id: String,
21135 #[serde(rename = "loanAmount")]
21136 pub loan_amount: String,
21137 #[serde(rename = "loanCoin")]
21138 pub loan_coin: String,
21139 #[serde(rename = "loanTerm")]
21140 pub loan_term: String,
21141 }
21142 impl From<&LoanVipRenewResponse> for LoanVipRenewResponse {
21143 fn from(value: &LoanVipRenewResponse) -> Self {
21144 value.clone()
21145 }
21146 }
21147 ///LoanVipRepayHistoryResponse
21148 ///
21149 /// <details><summary>JSON schema</summary>
21150 ///
21151 /// ```json
21152 ///{
21153 /// "type": "object",
21154 /// "required": [
21155 /// "rows",
21156 /// "total"
21157 /// ],
21158 /// "properties": {
21159 /// "rows": {
21160 /// "type": "array",
21161 /// "items": {
21162 /// "type": "object",
21163 /// "required": [
21164 /// "collateralCoin",
21165 /// "loanCoin",
21166 /// "orderId",
21167 /// "repayAmount",
21168 /// "repayStatus",
21169 /// "repayTime"
21170 /// ],
21171 /// "properties": {
21172 /// "collateralCoin": {
21173 /// "examples": [
21174 /// "BNB,BTC,ETH"
21175 /// ],
21176 /// "type": "string"
21177 /// },
21178 /// "loanCoin": {
21179 /// "examples": [
21180 /// "BUSD"
21181 /// ],
21182 /// "type": "string"
21183 /// },
21184 /// "orderId": {
21185 /// "examples": [
21186 /// "756783308056935434"
21187 /// ],
21188 /// "type": "string"
21189 /// },
21190 /// "repayAmount": {
21191 /// "examples": [
21192 /// "10000"
21193 /// ],
21194 /// "type": "string"
21195 /// },
21196 /// "repayStatus": {
21197 /// "description": "Repaid, Repaying, Failed",
21198 /// "examples": [
21199 /// "Repaid"
21200 /// ],
21201 /// "type": "string"
21202 /// },
21203 /// "repayTime": {
21204 /// "examples": [
21205 /// "1575018510000"
21206 /// ],
21207 /// "type": "string"
21208 /// }
21209 /// }
21210 /// }
21211 /// },
21212 /// "total": {
21213 /// "examples": [
21214 /// 1
21215 /// ],
21216 /// "type": "integer",
21217 /// "format": "int32"
21218 /// }
21219 /// }
21220 ///}
21221 /// ```
21222 /// </details>
21223 #[derive(Clone, Debug, Deserialize, Serialize)]
21224 pub struct LoanVipRepayHistoryResponse {
21225 pub rows: Vec<LoanVipRepayHistoryResponseRowsItem>,
21226 pub total: i32,
21227 }
21228 impl From<&LoanVipRepayHistoryResponse> for LoanVipRepayHistoryResponse {
21229 fn from(value: &LoanVipRepayHistoryResponse) -> Self {
21230 value.clone()
21231 }
21232 }
21233 ///LoanVipRepayHistoryResponseRowsItem
21234 ///
21235 /// <details><summary>JSON schema</summary>
21236 ///
21237 /// ```json
21238 ///{
21239 /// "type": "object",
21240 /// "required": [
21241 /// "collateralCoin",
21242 /// "loanCoin",
21243 /// "orderId",
21244 /// "repayAmount",
21245 /// "repayStatus",
21246 /// "repayTime"
21247 /// ],
21248 /// "properties": {
21249 /// "collateralCoin": {
21250 /// "examples": [
21251 /// "BNB,BTC,ETH"
21252 /// ],
21253 /// "type": "string"
21254 /// },
21255 /// "loanCoin": {
21256 /// "examples": [
21257 /// "BUSD"
21258 /// ],
21259 /// "type": "string"
21260 /// },
21261 /// "orderId": {
21262 /// "examples": [
21263 /// "756783308056935434"
21264 /// ],
21265 /// "type": "string"
21266 /// },
21267 /// "repayAmount": {
21268 /// "examples": [
21269 /// "10000"
21270 /// ],
21271 /// "type": "string"
21272 /// },
21273 /// "repayStatus": {
21274 /// "description": "Repaid, Repaying, Failed",
21275 /// "examples": [
21276 /// "Repaid"
21277 /// ],
21278 /// "type": "string"
21279 /// },
21280 /// "repayTime": {
21281 /// "examples": [
21282 /// "1575018510000"
21283 /// ],
21284 /// "type": "string"
21285 /// }
21286 /// }
21287 ///}
21288 /// ```
21289 /// </details>
21290 #[derive(Clone, Debug, Deserialize, Serialize)]
21291 pub struct LoanVipRepayHistoryResponseRowsItem {
21292 #[serde(rename = "collateralCoin")]
21293 pub collateral_coin: String,
21294 #[serde(rename = "loanCoin")]
21295 pub loan_coin: String,
21296 #[serde(rename = "orderId")]
21297 pub order_id: String,
21298 #[serde(rename = "repayAmount")]
21299 pub repay_amount: String,
21300 ///Repaid, Repaying, Failed
21301 #[serde(rename = "repayStatus")]
21302 pub repay_status: String,
21303 #[serde(rename = "repayTime")]
21304 pub repay_time: String,
21305 }
21306 impl From<&LoanVipRepayHistoryResponseRowsItem>
21307 for LoanVipRepayHistoryResponseRowsItem {
21308 fn from(value: &LoanVipRepayHistoryResponseRowsItem) -> Self {
21309 value.clone()
21310 }
21311 }
21312 ///LoanVipRepayResponse
21313 ///
21314 /// <details><summary>JSON schema</summary>
21315 ///
21316 /// ```json
21317 ///{
21318 /// "type": "object",
21319 /// "required": [
21320 /// "collateralCoin",
21321 /// "currentLTV",
21322 /// "loanCoin",
21323 /// "remainingInterest",
21324 /// "remainingPrincipal",
21325 /// "repayAmount",
21326 /// "repayStatus"
21327 /// ],
21328 /// "properties": {
21329 /// "collateralCoin": {
21330 /// "examples": [
21331 /// "BNB,BTC,ETH"
21332 /// ],
21333 /// "type": "string"
21334 /// },
21335 /// "currentLTV": {
21336 /// "examples": [
21337 /// "0.25"
21338 /// ],
21339 /// "type": "string"
21340 /// },
21341 /// "loanCoin": {
21342 /// "examples": [
21343 /// "BUSD"
21344 /// ],
21345 /// "type": "string"
21346 /// },
21347 /// "remainingInterest": {
21348 /// "examples": [
21349 /// "0"
21350 /// ],
21351 /// "type": "string"
21352 /// },
21353 /// "remainingPrincipal": {
21354 /// "examples": [
21355 /// "100.5"
21356 /// ],
21357 /// "type": "string"
21358 /// },
21359 /// "repayAmount": {
21360 /// "examples": [
21361 /// "200.5"
21362 /// ],
21363 /// "type": "string"
21364 /// },
21365 /// "repayStatus": {
21366 /// "description": "Repaid, Repaying, Failed",
21367 /// "examples": [
21368 /// "Repaid"
21369 /// ],
21370 /// "type": "string"
21371 /// }
21372 /// }
21373 ///}
21374 /// ```
21375 /// </details>
21376 #[derive(Clone, Debug, Deserialize, Serialize)]
21377 pub struct LoanVipRepayResponse {
21378 #[serde(rename = "collateralCoin")]
21379 pub collateral_coin: String,
21380 #[serde(rename = "currentLTV")]
21381 pub current_ltv: String,
21382 #[serde(rename = "loanCoin")]
21383 pub loan_coin: String,
21384 #[serde(rename = "remainingInterest")]
21385 pub remaining_interest: String,
21386 #[serde(rename = "remainingPrincipal")]
21387 pub remaining_principal: String,
21388 #[serde(rename = "repayAmount")]
21389 pub repay_amount: String,
21390 ///Repaid, Repaying, Failed
21391 #[serde(rename = "repayStatus")]
21392 pub repay_status: String,
21393 }
21394 impl From<&LoanVipRepayResponse> for LoanVipRepayResponse {
21395 fn from(value: &LoanVipRepayResponse) -> Self {
21396 value.clone()
21397 }
21398 }
21399 ///LoanVipRequestDataResponse
21400 ///
21401 /// <details><summary>JSON schema</summary>
21402 ///
21403 /// ```json
21404 ///{
21405 /// "type": "object",
21406 /// "required": [
21407 /// "rows",
21408 /// "total"
21409 /// ],
21410 /// "properties": {
21411 /// "rows": {
21412 /// "type": "array",
21413 /// "items": {
21414 /// "type": "object",
21415 /// "required": [
21416 /// "collateralAccountId",
21417 /// "collateralCoin",
21418 /// "loanAccountId",
21419 /// "loanAmount",
21420 /// "loanCoin",
21421 /// "loanTerm",
21422 /// "orderId",
21423 /// "requestId",
21424 /// "status"
21425 /// ],
21426 /// "properties": {
21427 /// "collateralAccountId": {
21428 /// "examples": [
21429 /// "12345678,12345678,12345678"
21430 /// ],
21431 /// "type": "string"
21432 /// },
21433 /// "collateralCoin": {
21434 /// "examples": [
21435 /// "BUSD,USDT,ETH"
21436 /// ],
21437 /// "type": "string"
21438 /// },
21439 /// "loanAccountId": {
21440 /// "examples": [
21441 /// "12345678"
21442 /// ],
21443 /// "type": "string"
21444 /// },
21445 /// "loanAmount": {
21446 /// "examples": [
21447 /// "100.5"
21448 /// ],
21449 /// "type": "string"
21450 /// },
21451 /// "loanCoin": {
21452 /// "examples": [
21453 /// "BTC"
21454 /// ],
21455 /// "type": "string"
21456 /// },
21457 /// "loanTerm": {
21458 /// "examples": [
21459 /// "30"
21460 /// ],
21461 /// "type": "integer"
21462 /// },
21463 /// "orderId": {
21464 /// "examples": [
21465 /// "12345678"
21466 /// ],
21467 /// "type": "string"
21468 /// },
21469 /// "requestId": {
21470 /// "examples": [
21471 /// "12345678"
21472 /// ],
21473 /// "type": "string"
21474 /// },
21475 /// "status": {
21476 /// "examples": [
21477 /// "Repaid"
21478 /// ],
21479 /// "type": "integer"
21480 /// }
21481 /// }
21482 /// }
21483 /// },
21484 /// "total": {
21485 /// "examples": [
21486 /// 1
21487 /// ],
21488 /// "type": "integer"
21489 /// }
21490 /// }
21491 ///}
21492 /// ```
21493 /// </details>
21494 #[derive(Clone, Debug, Deserialize, Serialize)]
21495 pub struct LoanVipRequestDataResponse {
21496 pub rows: Vec<LoanVipRequestDataResponseRowsItem>,
21497 pub total: i64,
21498 }
21499 impl From<&LoanVipRequestDataResponse> for LoanVipRequestDataResponse {
21500 fn from(value: &LoanVipRequestDataResponse) -> Self {
21501 value.clone()
21502 }
21503 }
21504 ///LoanVipRequestDataResponseRowsItem
21505 ///
21506 /// <details><summary>JSON schema</summary>
21507 ///
21508 /// ```json
21509 ///{
21510 /// "type": "object",
21511 /// "required": [
21512 /// "collateralAccountId",
21513 /// "collateralCoin",
21514 /// "loanAccountId",
21515 /// "loanAmount",
21516 /// "loanCoin",
21517 /// "loanTerm",
21518 /// "orderId",
21519 /// "requestId",
21520 /// "status"
21521 /// ],
21522 /// "properties": {
21523 /// "collateralAccountId": {
21524 /// "examples": [
21525 /// "12345678,12345678,12345678"
21526 /// ],
21527 /// "type": "string"
21528 /// },
21529 /// "collateralCoin": {
21530 /// "examples": [
21531 /// "BUSD,USDT,ETH"
21532 /// ],
21533 /// "type": "string"
21534 /// },
21535 /// "loanAccountId": {
21536 /// "examples": [
21537 /// "12345678"
21538 /// ],
21539 /// "type": "string"
21540 /// },
21541 /// "loanAmount": {
21542 /// "examples": [
21543 /// "100.5"
21544 /// ],
21545 /// "type": "string"
21546 /// },
21547 /// "loanCoin": {
21548 /// "examples": [
21549 /// "BTC"
21550 /// ],
21551 /// "type": "string"
21552 /// },
21553 /// "loanTerm": {
21554 /// "examples": [
21555 /// "30"
21556 /// ],
21557 /// "type": "integer"
21558 /// },
21559 /// "orderId": {
21560 /// "examples": [
21561 /// "12345678"
21562 /// ],
21563 /// "type": "string"
21564 /// },
21565 /// "requestId": {
21566 /// "examples": [
21567 /// "12345678"
21568 /// ],
21569 /// "type": "string"
21570 /// },
21571 /// "status": {
21572 /// "examples": [
21573 /// "Repaid"
21574 /// ],
21575 /// "type": "integer"
21576 /// }
21577 /// }
21578 ///}
21579 /// ```
21580 /// </details>
21581 #[derive(Clone, Debug, Deserialize, Serialize)]
21582 pub struct LoanVipRequestDataResponseRowsItem {
21583 #[serde(rename = "collateralAccountId")]
21584 pub collateral_account_id: String,
21585 #[serde(rename = "collateralCoin")]
21586 pub collateral_coin: String,
21587 #[serde(rename = "loanAccountId")]
21588 pub loan_account_id: String,
21589 #[serde(rename = "loanAmount")]
21590 pub loan_amount: String,
21591 #[serde(rename = "loanCoin")]
21592 pub loan_coin: String,
21593 #[serde(rename = "loanTerm")]
21594 pub loan_term: i64,
21595 #[serde(rename = "orderId")]
21596 pub order_id: String,
21597 #[serde(rename = "requestId")]
21598 pub request_id: String,
21599 pub status: i64,
21600 }
21601 impl From<&LoanVipRequestDataResponseRowsItem>
21602 for LoanVipRequestDataResponseRowsItem {
21603 fn from(value: &LoanVipRequestDataResponseRowsItem) -> Self {
21604 value.clone()
21605 }
21606 }
21607 ///LoanVipRequestInterestRateResponseItem
21608 ///
21609 /// <details><summary>JSON schema</summary>
21610 ///
21611 /// ```json
21612 ///{
21613 /// "type": "object",
21614 /// "required": [
21615 /// "asset",
21616 /// "flexibleDailyInterestRate",
21617 /// "flexibleYearlyInterestRate",
21618 /// "time"
21619 /// ],
21620 /// "properties": {
21621 /// "asset": {
21622 /// "examples": [
21623 /// "BUSD"
21624 /// ],
21625 /// "type": "string"
21626 /// },
21627 /// "flexibleDailyInterestRate": {
21628 /// "examples": [
21629 /// "0.001503"
21630 /// ],
21631 /// "type": "string"
21632 /// },
21633 /// "flexibleYearlyInterestRate": {
21634 /// "examples": [
21635 /// "0.548595"
21636 /// ],
21637 /// "type": "string"
21638 /// },
21639 /// "time": {
21640 /// "examples": [
21641 /// 1577233578000
21642 /// ],
21643 /// "type": "integer",
21644 /// "format": "int64"
21645 /// }
21646 /// }
21647 ///}
21648 /// ```
21649 /// </details>
21650 #[derive(Clone, Debug, Deserialize, Serialize)]
21651 pub struct LoanVipRequestInterestRateResponseItem {
21652 pub asset: String,
21653 #[serde(rename = "flexibleDailyInterestRate")]
21654 pub flexible_daily_interest_rate: String,
21655 #[serde(rename = "flexibleYearlyInterestRate")]
21656 pub flexible_yearly_interest_rate: String,
21657 pub time: i64,
21658 }
21659 impl From<&LoanVipRequestInterestRateResponseItem>
21660 for LoanVipRequestInterestRateResponseItem {
21661 fn from(value: &LoanVipRequestInterestRateResponseItem) -> Self {
21662 value.clone()
21663 }
21664 }
21665 ///ManagedSubaccountAccountSnapshotResponse
21666 ///
21667 /// <details><summary>JSON schema</summary>
21668 ///
21669 /// ```json
21670 ///{
21671 /// "type": "object",
21672 /// "required": [
21673 /// "code",
21674 /// "msg",
21675 /// "snapshotVos"
21676 /// ],
21677 /// "properties": {
21678 /// "code": {
21679 /// "examples": [
21680 /// 200
21681 /// ],
21682 /// "type": "integer",
21683 /// "format": "int32"
21684 /// },
21685 /// "msg": {
21686 /// "examples": [
21687 /// ""
21688 /// ],
21689 /// "type": "string"
21690 /// },
21691 /// "snapshotVos": {
21692 /// "type": "array",
21693 /// "items": {
21694 /// "type": "object",
21695 /// "required": [
21696 /// "data",
21697 /// "type",
21698 /// "updateTime"
21699 /// ],
21700 /// "properties": {
21701 /// "data": {
21702 /// "type": "object",
21703 /// "required": [
21704 /// "balances",
21705 /// "totalAssetOfBtc"
21706 /// ],
21707 /// "properties": {
21708 /// "balances": {
21709 /// "type": "array",
21710 /// "items": {
21711 /// "type": "object",
21712 /// "required": [
21713 /// "asset",
21714 /// "free",
21715 /// "locked"
21716 /// ],
21717 /// "properties": {
21718 /// "asset": {
21719 /// "examples": [
21720 /// "BTC"
21721 /// ],
21722 /// "type": "string"
21723 /// },
21724 /// "free": {
21725 /// "examples": [
21726 /// "0.09905021"
21727 /// ],
21728 /// "type": "string"
21729 /// },
21730 /// "locked": {
21731 /// "examples": [
21732 /// "0.00000000"
21733 /// ],
21734 /// "type": "string"
21735 /// }
21736 /// }
21737 /// }
21738 /// },
21739 /// "totalAssetOfBtc": {
21740 /// "examples": [
21741 /// "0.09942700"
21742 /// ],
21743 /// "type": "string"
21744 /// }
21745 /// }
21746 /// },
21747 /// "type": {
21748 /// "examples": [
21749 /// "spot"
21750 /// ],
21751 /// "type": "string"
21752 /// },
21753 /// "updateTime": {
21754 /// "examples": [
21755 /// 1576281599000
21756 /// ],
21757 /// "type": "integer",
21758 /// "format": "int64"
21759 /// }
21760 /// }
21761 /// }
21762 /// }
21763 /// }
21764 ///}
21765 /// ```
21766 /// </details>
21767 #[derive(Clone, Debug, Deserialize, Serialize)]
21768 pub struct ManagedSubaccountAccountSnapshotResponse {
21769 pub code: i32,
21770 pub msg: String,
21771 #[serde(rename = "snapshotVos")]
21772 pub snapshot_vos: Vec<ManagedSubaccountAccountSnapshotResponseSnapshotVosItem>,
21773 }
21774 impl From<&ManagedSubaccountAccountSnapshotResponse>
21775 for ManagedSubaccountAccountSnapshotResponse {
21776 fn from(value: &ManagedSubaccountAccountSnapshotResponse) -> Self {
21777 value.clone()
21778 }
21779 }
21780 ///ManagedSubaccountAccountSnapshotResponseSnapshotVosItem
21781 ///
21782 /// <details><summary>JSON schema</summary>
21783 ///
21784 /// ```json
21785 ///{
21786 /// "type": "object",
21787 /// "required": [
21788 /// "data",
21789 /// "type",
21790 /// "updateTime"
21791 /// ],
21792 /// "properties": {
21793 /// "data": {
21794 /// "type": "object",
21795 /// "required": [
21796 /// "balances",
21797 /// "totalAssetOfBtc"
21798 /// ],
21799 /// "properties": {
21800 /// "balances": {
21801 /// "type": "array",
21802 /// "items": {
21803 /// "type": "object",
21804 /// "required": [
21805 /// "asset",
21806 /// "free",
21807 /// "locked"
21808 /// ],
21809 /// "properties": {
21810 /// "asset": {
21811 /// "examples": [
21812 /// "BTC"
21813 /// ],
21814 /// "type": "string"
21815 /// },
21816 /// "free": {
21817 /// "examples": [
21818 /// "0.09905021"
21819 /// ],
21820 /// "type": "string"
21821 /// },
21822 /// "locked": {
21823 /// "examples": [
21824 /// "0.00000000"
21825 /// ],
21826 /// "type": "string"
21827 /// }
21828 /// }
21829 /// }
21830 /// },
21831 /// "totalAssetOfBtc": {
21832 /// "examples": [
21833 /// "0.09942700"
21834 /// ],
21835 /// "type": "string"
21836 /// }
21837 /// }
21838 /// },
21839 /// "type": {
21840 /// "examples": [
21841 /// "spot"
21842 /// ],
21843 /// "type": "string"
21844 /// },
21845 /// "updateTime": {
21846 /// "examples": [
21847 /// 1576281599000
21848 /// ],
21849 /// "type": "integer",
21850 /// "format": "int64"
21851 /// }
21852 /// }
21853 ///}
21854 /// ```
21855 /// </details>
21856 #[derive(Clone, Debug, Deserialize, Serialize)]
21857 pub struct ManagedSubaccountAccountSnapshotResponseSnapshotVosItem {
21858 pub data: ManagedSubaccountAccountSnapshotResponseSnapshotVosItemData,
21859 #[serde(rename = "type")]
21860 pub type_: String,
21861 #[serde(rename = "updateTime")]
21862 pub update_time: i64,
21863 }
21864 impl From<&ManagedSubaccountAccountSnapshotResponseSnapshotVosItem>
21865 for ManagedSubaccountAccountSnapshotResponseSnapshotVosItem {
21866 fn from(
21867 value: &ManagedSubaccountAccountSnapshotResponseSnapshotVosItem,
21868 ) -> Self {
21869 value.clone()
21870 }
21871 }
21872 ///ManagedSubaccountAccountSnapshotResponseSnapshotVosItemData
21873 ///
21874 /// <details><summary>JSON schema</summary>
21875 ///
21876 /// ```json
21877 ///{
21878 /// "type": "object",
21879 /// "required": [
21880 /// "balances",
21881 /// "totalAssetOfBtc"
21882 /// ],
21883 /// "properties": {
21884 /// "balances": {
21885 /// "type": "array",
21886 /// "items": {
21887 /// "type": "object",
21888 /// "required": [
21889 /// "asset",
21890 /// "free",
21891 /// "locked"
21892 /// ],
21893 /// "properties": {
21894 /// "asset": {
21895 /// "examples": [
21896 /// "BTC"
21897 /// ],
21898 /// "type": "string"
21899 /// },
21900 /// "free": {
21901 /// "examples": [
21902 /// "0.09905021"
21903 /// ],
21904 /// "type": "string"
21905 /// },
21906 /// "locked": {
21907 /// "examples": [
21908 /// "0.00000000"
21909 /// ],
21910 /// "type": "string"
21911 /// }
21912 /// }
21913 /// }
21914 /// },
21915 /// "totalAssetOfBtc": {
21916 /// "examples": [
21917 /// "0.09942700"
21918 /// ],
21919 /// "type": "string"
21920 /// }
21921 /// }
21922 ///}
21923 /// ```
21924 /// </details>
21925 #[derive(Clone, Debug, Deserialize, Serialize)]
21926 pub struct ManagedSubaccountAccountSnapshotResponseSnapshotVosItemData {
21927 pub balances: Vec<
21928 ManagedSubaccountAccountSnapshotResponseSnapshotVosItemDataBalancesItem,
21929 >,
21930 #[serde(rename = "totalAssetOfBtc")]
21931 pub total_asset_of_btc: String,
21932 }
21933 impl From<&ManagedSubaccountAccountSnapshotResponseSnapshotVosItemData>
21934 for ManagedSubaccountAccountSnapshotResponseSnapshotVosItemData {
21935 fn from(
21936 value: &ManagedSubaccountAccountSnapshotResponseSnapshotVosItemData,
21937 ) -> Self {
21938 value.clone()
21939 }
21940 }
21941 ///ManagedSubaccountAccountSnapshotResponseSnapshotVosItemDataBalancesItem
21942 ///
21943 /// <details><summary>JSON schema</summary>
21944 ///
21945 /// ```json
21946 ///{
21947 /// "type": "object",
21948 /// "required": [
21949 /// "asset",
21950 /// "free",
21951 /// "locked"
21952 /// ],
21953 /// "properties": {
21954 /// "asset": {
21955 /// "examples": [
21956 /// "BTC"
21957 /// ],
21958 /// "type": "string"
21959 /// },
21960 /// "free": {
21961 /// "examples": [
21962 /// "0.09905021"
21963 /// ],
21964 /// "type": "string"
21965 /// },
21966 /// "locked": {
21967 /// "examples": [
21968 /// "0.00000000"
21969 /// ],
21970 /// "type": "string"
21971 /// }
21972 /// }
21973 ///}
21974 /// ```
21975 /// </details>
21976 #[derive(Clone, Debug, Deserialize, Serialize)]
21977 pub struct ManagedSubaccountAccountSnapshotResponseSnapshotVosItemDataBalancesItem {
21978 pub asset: String,
21979 pub free: String,
21980 pub locked: String,
21981 }
21982 impl From<&ManagedSubaccountAccountSnapshotResponseSnapshotVosItemDataBalancesItem>
21983 for ManagedSubaccountAccountSnapshotResponseSnapshotVosItemDataBalancesItem {
21984 fn from(
21985 value: &ManagedSubaccountAccountSnapshotResponseSnapshotVosItemDataBalancesItem,
21986 ) -> Self {
21987 value.clone()
21988 }
21989 }
21990 ///ManagedSubaccountAssetResponseItem
21991 ///
21992 /// <details><summary>JSON schema</summary>
21993 ///
21994 /// ```json
21995 ///{
21996 /// "type": "object",
21997 /// "required": [
21998 /// "availableBalance",
21999 /// "btcValue",
22000 /// "coin",
22001 /// "inOrder",
22002 /// "name",
22003 /// "totalBalance"
22004 /// ],
22005 /// "properties": {
22006 /// "availableBalance": {
22007 /// "examples": [
22008 /// "0"
22009 /// ],
22010 /// "type": "string"
22011 /// },
22012 /// "btcValue": {
22013 /// "examples": [
22014 /// "0"
22015 /// ],
22016 /// "type": "string"
22017 /// },
22018 /// "coin": {
22019 /// "examples": [
22020 /// "INJ"
22021 /// ],
22022 /// "type": "string"
22023 /// },
22024 /// "inOrder": {
22025 /// "examples": [
22026 /// "0"
22027 /// ],
22028 /// "type": "string"
22029 /// },
22030 /// "name": {
22031 /// "examples": [
22032 /// "Injective Protocol"
22033 /// ],
22034 /// "type": "string"
22035 /// },
22036 /// "totalBalance": {
22037 /// "examples": [
22038 /// "0"
22039 /// ],
22040 /// "type": "string"
22041 /// }
22042 /// }
22043 ///}
22044 /// ```
22045 /// </details>
22046 #[derive(Clone, Debug, Deserialize, Serialize)]
22047 pub struct ManagedSubaccountAssetResponseItem {
22048 #[serde(rename = "availableBalance")]
22049 pub available_balance: String,
22050 #[serde(rename = "btcValue")]
22051 pub btc_value: String,
22052 pub coin: String,
22053 #[serde(rename = "inOrder")]
22054 pub in_order: String,
22055 pub name: String,
22056 #[serde(rename = "totalBalance")]
22057 pub total_balance: String,
22058 }
22059 impl From<&ManagedSubaccountAssetResponseItem>
22060 for ManagedSubaccountAssetResponseItem {
22061 fn from(value: &ManagedSubaccountAssetResponseItem) -> Self {
22062 value.clone()
22063 }
22064 }
22065 ///ManagedSubaccountDepositAddressResponse
22066 ///
22067 /// <details><summary>JSON schema</summary>
22068 ///
22069 /// ```json
22070 ///{
22071 /// "type": "object",
22072 /// "required": [
22073 /// "address",
22074 /// "coin",
22075 /// "tag",
22076 /// "url"
22077 /// ],
22078 /// "properties": {
22079 /// "address": {
22080 /// "examples": [
22081 /// "0x206c22d833bb0bb2102da6b7c7d4c3eb14bcf73d"
22082 /// ],
22083 /// "type": "string"
22084 /// },
22085 /// "coin": {
22086 /// "examples": [
22087 /// "USDT"
22088 /// ],
22089 /// "type": "string"
22090 /// },
22091 /// "tag": {
22092 /// "type": "string"
22093 /// },
22094 /// "url": {
22095 /// "examples": [
22096 /// "https://etherscan.io/address/0x206c22d833bb0bb2102da6b7c7d4c3eb14bcf73d"
22097 /// ],
22098 /// "type": "string"
22099 /// }
22100 /// }
22101 ///}
22102 /// ```
22103 /// </details>
22104 #[derive(Clone, Debug, Deserialize, Serialize)]
22105 pub struct ManagedSubaccountDepositAddressResponse {
22106 pub address: String,
22107 pub coin: String,
22108 pub tag: String,
22109 pub url: String,
22110 }
22111 impl From<&ManagedSubaccountDepositAddressResponse>
22112 for ManagedSubaccountDepositAddressResponse {
22113 fn from(value: &ManagedSubaccountDepositAddressResponse) -> Self {
22114 value.clone()
22115 }
22116 }
22117 ///ManagedSubaccountDepositResponse
22118 ///
22119 /// <details><summary>JSON schema</summary>
22120 ///
22121 /// ```json
22122 ///{
22123 /// "type": "object",
22124 /// "required": [
22125 /// "tranId"
22126 /// ],
22127 /// "properties": {
22128 /// "tranId": {
22129 /// "examples": [
22130 /// 66157362489
22131 /// ],
22132 /// "type": "integer",
22133 /// "format": "int64"
22134 /// }
22135 /// }
22136 ///}
22137 /// ```
22138 /// </details>
22139 #[derive(Clone, Debug, Deserialize, Serialize)]
22140 pub struct ManagedSubaccountDepositResponse {
22141 #[serde(rename = "tranId")]
22142 pub tran_id: i64,
22143 }
22144 impl From<&ManagedSubaccountDepositResponse> for ManagedSubaccountDepositResponse {
22145 fn from(value: &ManagedSubaccountDepositResponse) -> Self {
22146 value.clone()
22147 }
22148 }
22149 ///ManagedSubaccountFetchFutureAssetResponse
22150 ///
22151 /// <details><summary>JSON schema</summary>
22152 ///
22153 /// ```json
22154 ///{
22155 /// "type": "object",
22156 /// "required": [
22157 /// "code",
22158 /// "message",
22159 /// "snapshotVos"
22160 /// ],
22161 /// "properties": {
22162 /// "code": {
22163 /// "examples": [
22164 /// 200
22165 /// ],
22166 /// "type": "integer",
22167 /// "format": "int32"
22168 /// },
22169 /// "message": {
22170 /// "examples": [
22171 /// "OK"
22172 /// ],
22173 /// "type": "string"
22174 /// },
22175 /// "snapshotVos": {
22176 /// "type": "array",
22177 /// "items": {
22178 /// "type": "object",
22179 /// "required": [
22180 /// "data",
22181 /// "type",
22182 /// "updateTime"
22183 /// ],
22184 /// "properties": {
22185 /// "data": {
22186 /// "type": "object",
22187 /// "required": [
22188 /// "assets",
22189 /// "position"
22190 /// ],
22191 /// "properties": {
22192 /// "assets": {
22193 /// "type": "array",
22194 /// "items": {
22195 /// "type": "object",
22196 /// "required": [
22197 /// "asset",
22198 /// "marginBalance",
22199 /// "walletBalance"
22200 /// ],
22201 /// "properties": {
22202 /// "asset": {
22203 /// "examples": [
22204 /// "USDT"
22205 /// ],
22206 /// "type": "string"
22207 /// },
22208 /// "marginBalance": {
22209 /// "examples": [
22210 /// 100
22211 /// ],
22212 /// "type": "number",
22213 /// "format": "float"
22214 /// },
22215 /// "walletBalance": {
22216 /// "examples": [
22217 /// 100
22218 /// ],
22219 /// "type": "number",
22220 /// "format": "float"
22221 /// }
22222 /// }
22223 /// }
22224 /// },
22225 /// "position": {
22226 /// "type": "array",
22227 /// "items": {
22228 /// "type": "object",
22229 /// "required": [
22230 /// "entryPrice",
22231 /// "markPrice",
22232 /// "positionAmt",
22233 /// "symbol"
22234 /// ],
22235 /// "properties": {
22236 /// "entryPrice": {
22237 /// "examples": [
22238 /// 17000
22239 /// ],
22240 /// "type": "number",
22241 /// "format": "float"
22242 /// },
22243 /// "markPrice": {
22244 /// "examples": [
22245 /// 17000
22246 /// ],
22247 /// "type": "number",
22248 /// "format": "float"
22249 /// },
22250 /// "positionAmt": {
22251 /// "examples": [
22252 /// 0.1
22253 /// ],
22254 /// "type": "number",
22255 /// "format": "float"
22256 /// },
22257 /// "symbol": {
22258 /// "examples": [
22259 /// "BTCUSDT"
22260 /// ],
22261 /// "type": "string"
22262 /// }
22263 /// }
22264 /// }
22265 /// }
22266 /// }
22267 /// },
22268 /// "type": {
22269 /// "examples": [
22270 /// "FUTURES"
22271 /// ],
22272 /// "type": "string"
22273 /// },
22274 /// "updateTime": {
22275 /// "examples": [
22276 /// 1626400907000
22277 /// ],
22278 /// "type": "integer",
22279 /// "format": "int64"
22280 /// }
22281 /// }
22282 /// }
22283 /// }
22284 /// }
22285 ///}
22286 /// ```
22287 /// </details>
22288 #[derive(Clone, Debug, Deserialize, Serialize)]
22289 pub struct ManagedSubaccountFetchFutureAssetResponse {
22290 pub code: i32,
22291 pub message: String,
22292 #[serde(rename = "snapshotVos")]
22293 pub snapshot_vos: Vec<ManagedSubaccountFetchFutureAssetResponseSnapshotVosItem>,
22294 }
22295 impl From<&ManagedSubaccountFetchFutureAssetResponse>
22296 for ManagedSubaccountFetchFutureAssetResponse {
22297 fn from(value: &ManagedSubaccountFetchFutureAssetResponse) -> Self {
22298 value.clone()
22299 }
22300 }
22301 ///ManagedSubaccountFetchFutureAssetResponseSnapshotVosItem
22302 ///
22303 /// <details><summary>JSON schema</summary>
22304 ///
22305 /// ```json
22306 ///{
22307 /// "type": "object",
22308 /// "required": [
22309 /// "data",
22310 /// "type",
22311 /// "updateTime"
22312 /// ],
22313 /// "properties": {
22314 /// "data": {
22315 /// "type": "object",
22316 /// "required": [
22317 /// "assets",
22318 /// "position"
22319 /// ],
22320 /// "properties": {
22321 /// "assets": {
22322 /// "type": "array",
22323 /// "items": {
22324 /// "type": "object",
22325 /// "required": [
22326 /// "asset",
22327 /// "marginBalance",
22328 /// "walletBalance"
22329 /// ],
22330 /// "properties": {
22331 /// "asset": {
22332 /// "examples": [
22333 /// "USDT"
22334 /// ],
22335 /// "type": "string"
22336 /// },
22337 /// "marginBalance": {
22338 /// "examples": [
22339 /// 100
22340 /// ],
22341 /// "type": "number",
22342 /// "format": "float"
22343 /// },
22344 /// "walletBalance": {
22345 /// "examples": [
22346 /// 100
22347 /// ],
22348 /// "type": "number",
22349 /// "format": "float"
22350 /// }
22351 /// }
22352 /// }
22353 /// },
22354 /// "position": {
22355 /// "type": "array",
22356 /// "items": {
22357 /// "type": "object",
22358 /// "required": [
22359 /// "entryPrice",
22360 /// "markPrice",
22361 /// "positionAmt",
22362 /// "symbol"
22363 /// ],
22364 /// "properties": {
22365 /// "entryPrice": {
22366 /// "examples": [
22367 /// 17000
22368 /// ],
22369 /// "type": "number",
22370 /// "format": "float"
22371 /// },
22372 /// "markPrice": {
22373 /// "examples": [
22374 /// 17000
22375 /// ],
22376 /// "type": "number",
22377 /// "format": "float"
22378 /// },
22379 /// "positionAmt": {
22380 /// "examples": [
22381 /// 0.1
22382 /// ],
22383 /// "type": "number",
22384 /// "format": "float"
22385 /// },
22386 /// "symbol": {
22387 /// "examples": [
22388 /// "BTCUSDT"
22389 /// ],
22390 /// "type": "string"
22391 /// }
22392 /// }
22393 /// }
22394 /// }
22395 /// }
22396 /// },
22397 /// "type": {
22398 /// "examples": [
22399 /// "FUTURES"
22400 /// ],
22401 /// "type": "string"
22402 /// },
22403 /// "updateTime": {
22404 /// "examples": [
22405 /// 1626400907000
22406 /// ],
22407 /// "type": "integer",
22408 /// "format": "int64"
22409 /// }
22410 /// }
22411 ///}
22412 /// ```
22413 /// </details>
22414 #[derive(Clone, Debug, Deserialize, Serialize)]
22415 pub struct ManagedSubaccountFetchFutureAssetResponseSnapshotVosItem {
22416 pub data: ManagedSubaccountFetchFutureAssetResponseSnapshotVosItemData,
22417 #[serde(rename = "type")]
22418 pub type_: String,
22419 #[serde(rename = "updateTime")]
22420 pub update_time: i64,
22421 }
22422 impl From<&ManagedSubaccountFetchFutureAssetResponseSnapshotVosItem>
22423 for ManagedSubaccountFetchFutureAssetResponseSnapshotVosItem {
22424 fn from(
22425 value: &ManagedSubaccountFetchFutureAssetResponseSnapshotVosItem,
22426 ) -> Self {
22427 value.clone()
22428 }
22429 }
22430 ///ManagedSubaccountFetchFutureAssetResponseSnapshotVosItemData
22431 ///
22432 /// <details><summary>JSON schema</summary>
22433 ///
22434 /// ```json
22435 ///{
22436 /// "type": "object",
22437 /// "required": [
22438 /// "assets",
22439 /// "position"
22440 /// ],
22441 /// "properties": {
22442 /// "assets": {
22443 /// "type": "array",
22444 /// "items": {
22445 /// "type": "object",
22446 /// "required": [
22447 /// "asset",
22448 /// "marginBalance",
22449 /// "walletBalance"
22450 /// ],
22451 /// "properties": {
22452 /// "asset": {
22453 /// "examples": [
22454 /// "USDT"
22455 /// ],
22456 /// "type": "string"
22457 /// },
22458 /// "marginBalance": {
22459 /// "examples": [
22460 /// 100
22461 /// ],
22462 /// "type": "number",
22463 /// "format": "float"
22464 /// },
22465 /// "walletBalance": {
22466 /// "examples": [
22467 /// 100
22468 /// ],
22469 /// "type": "number",
22470 /// "format": "float"
22471 /// }
22472 /// }
22473 /// }
22474 /// },
22475 /// "position": {
22476 /// "type": "array",
22477 /// "items": {
22478 /// "type": "object",
22479 /// "required": [
22480 /// "entryPrice",
22481 /// "markPrice",
22482 /// "positionAmt",
22483 /// "symbol"
22484 /// ],
22485 /// "properties": {
22486 /// "entryPrice": {
22487 /// "examples": [
22488 /// 17000
22489 /// ],
22490 /// "type": "number",
22491 /// "format": "float"
22492 /// },
22493 /// "markPrice": {
22494 /// "examples": [
22495 /// 17000
22496 /// ],
22497 /// "type": "number",
22498 /// "format": "float"
22499 /// },
22500 /// "positionAmt": {
22501 /// "examples": [
22502 /// 0.1
22503 /// ],
22504 /// "type": "number",
22505 /// "format": "float"
22506 /// },
22507 /// "symbol": {
22508 /// "examples": [
22509 /// "BTCUSDT"
22510 /// ],
22511 /// "type": "string"
22512 /// }
22513 /// }
22514 /// }
22515 /// }
22516 /// }
22517 ///}
22518 /// ```
22519 /// </details>
22520 #[derive(Clone, Debug, Deserialize, Serialize)]
22521 pub struct ManagedSubaccountFetchFutureAssetResponseSnapshotVosItemData {
22522 pub assets: Vec<
22523 ManagedSubaccountFetchFutureAssetResponseSnapshotVosItemDataAssetsItem,
22524 >,
22525 pub position: Vec<
22526 ManagedSubaccountFetchFutureAssetResponseSnapshotVosItemDataPositionItem,
22527 >,
22528 }
22529 impl From<&ManagedSubaccountFetchFutureAssetResponseSnapshotVosItemData>
22530 for ManagedSubaccountFetchFutureAssetResponseSnapshotVosItemData {
22531 fn from(
22532 value: &ManagedSubaccountFetchFutureAssetResponseSnapshotVosItemData,
22533 ) -> Self {
22534 value.clone()
22535 }
22536 }
22537 ///ManagedSubaccountFetchFutureAssetResponseSnapshotVosItemDataAssetsItem
22538 ///
22539 /// <details><summary>JSON schema</summary>
22540 ///
22541 /// ```json
22542 ///{
22543 /// "type": "object",
22544 /// "required": [
22545 /// "asset",
22546 /// "marginBalance",
22547 /// "walletBalance"
22548 /// ],
22549 /// "properties": {
22550 /// "asset": {
22551 /// "examples": [
22552 /// "USDT"
22553 /// ],
22554 /// "type": "string"
22555 /// },
22556 /// "marginBalance": {
22557 /// "examples": [
22558 /// 100
22559 /// ],
22560 /// "type": "number",
22561 /// "format": "float"
22562 /// },
22563 /// "walletBalance": {
22564 /// "examples": [
22565 /// 100
22566 /// ],
22567 /// "type": "number",
22568 /// "format": "float"
22569 /// }
22570 /// }
22571 ///}
22572 /// ```
22573 /// </details>
22574 #[derive(Clone, Debug, Deserialize, Serialize)]
22575 pub struct ManagedSubaccountFetchFutureAssetResponseSnapshotVosItemDataAssetsItem {
22576 pub asset: String,
22577 #[serde(rename = "marginBalance")]
22578 pub margin_balance: f32,
22579 #[serde(rename = "walletBalance")]
22580 pub wallet_balance: f32,
22581 }
22582 impl From<&ManagedSubaccountFetchFutureAssetResponseSnapshotVosItemDataAssetsItem>
22583 for ManagedSubaccountFetchFutureAssetResponseSnapshotVosItemDataAssetsItem {
22584 fn from(
22585 value: &ManagedSubaccountFetchFutureAssetResponseSnapshotVosItemDataAssetsItem,
22586 ) -> Self {
22587 value.clone()
22588 }
22589 }
22590 ///ManagedSubaccountFetchFutureAssetResponseSnapshotVosItemDataPositionItem
22591 ///
22592 /// <details><summary>JSON schema</summary>
22593 ///
22594 /// ```json
22595 ///{
22596 /// "type": "object",
22597 /// "required": [
22598 /// "entryPrice",
22599 /// "markPrice",
22600 /// "positionAmt",
22601 /// "symbol"
22602 /// ],
22603 /// "properties": {
22604 /// "entryPrice": {
22605 /// "examples": [
22606 /// 17000
22607 /// ],
22608 /// "type": "number",
22609 /// "format": "float"
22610 /// },
22611 /// "markPrice": {
22612 /// "examples": [
22613 /// 17000
22614 /// ],
22615 /// "type": "number",
22616 /// "format": "float"
22617 /// },
22618 /// "positionAmt": {
22619 /// "examples": [
22620 /// 0.1
22621 /// ],
22622 /// "type": "number",
22623 /// "format": "float"
22624 /// },
22625 /// "symbol": {
22626 /// "examples": [
22627 /// "BTCUSDT"
22628 /// ],
22629 /// "type": "string"
22630 /// }
22631 /// }
22632 ///}
22633 /// ```
22634 /// </details>
22635 #[derive(Clone, Debug, Deserialize, Serialize)]
22636 pub struct ManagedSubaccountFetchFutureAssetResponseSnapshotVosItemDataPositionItem {
22637 #[serde(rename = "entryPrice")]
22638 pub entry_price: f32,
22639 #[serde(rename = "markPrice")]
22640 pub mark_price: f32,
22641 #[serde(rename = "positionAmt")]
22642 pub position_amt: f32,
22643 pub symbol: String,
22644 }
22645 impl From<&ManagedSubaccountFetchFutureAssetResponseSnapshotVosItemDataPositionItem>
22646 for ManagedSubaccountFetchFutureAssetResponseSnapshotVosItemDataPositionItem {
22647 fn from(
22648 value: &ManagedSubaccountFetchFutureAssetResponseSnapshotVosItemDataPositionItem,
22649 ) -> Self {
22650 value.clone()
22651 }
22652 }
22653 ///ManagedSubaccountInfoResponse
22654 ///
22655 /// <details><summary>JSON schema</summary>
22656 ///
22657 /// ```json
22658 ///{
22659 /// "type": "object",
22660 /// "required": [
22661 /// "managerSubUserInfoVoList",
22662 /// "total"
22663 /// ],
22664 /// "properties": {
22665 /// "managerSubUserInfoVoList": {
22666 /// "type": "array",
22667 /// "items": {
22668 /// "type": "object",
22669 /// "required": [
22670 /// "bindParentEmail",
22671 /// "bindParentUserId",
22672 /// "insertTimeStamp",
22673 /// "isFutureEnabled",
22674 /// "isMarginEnabled",
22675 /// "isSignedLVTRiskAgreement",
22676 /// "isSubUserEnabled",
22677 /// "isUserActive",
22678 /// "managersubUserId",
22679 /// "rootUserId"
22680 /// ],
22681 /// "properties": {
22682 /// "bindParentEmail": {
22683 /// "examples": [
22684 /// "wdyw8xsh8pey@test.com"
22685 /// ],
22686 /// "type": "string"
22687 /// },
22688 /// "bindParentUserId": {
22689 /// "examples": [
22690 /// 1000138475669
22691 /// ],
22692 /// "type": "integer",
22693 /// "format": "int64"
22694 /// },
22695 /// "email": {
22696 /// "examples": [
22697 /// "test_0_virtual@kq3kno9imanagedsub.com"
22698 /// ],
22699 /// "type": "string"
22700 /// },
22701 /// "insertTimeStamp": {
22702 /// "examples": [
22703 /// 1678435149000
22704 /// ],
22705 /// "type": "integer",
22706 /// "format": "int64"
22707 /// },
22708 /// "isFutureEnabled": {
22709 /// "examples": [
22710 /// true
22711 /// ],
22712 /// "type": "boolean"
22713 /// },
22714 /// "isMarginEnabled": {
22715 /// "examples": [
22716 /// true
22717 /// ],
22718 /// "type": "boolean"
22719 /// },
22720 /// "isSignedLVTRiskAgreement": {
22721 /// "examples": [
22722 /// true
22723 /// ],
22724 /// "type": "boolean"
22725 /// },
22726 /// "isSubUserEnabled": {
22727 /// "examples": [
22728 /// true
22729 /// ],
22730 /// "type": "boolean"
22731 /// },
22732 /// "isUserActive": {
22733 /// "examples": [
22734 /// true
22735 /// ],
22736 /// "type": "boolean"
22737 /// },
22738 /// "managersubUserId": {
22739 /// "examples": [
22740 /// 1000137842513
22741 /// ],
22742 /// "type": "integer",
22743 /// "format": "int64"
22744 /// },
22745 /// "rootUserId": {
22746 /// "examples": [
22747 /// 1000138475670
22748 /// ],
22749 /// "type": "integer",
22750 /// "format": "int64"
22751 /// }
22752 /// }
22753 /// }
22754 /// },
22755 /// "total": {
22756 /// "examples": [
22757 /// 3
22758 /// ],
22759 /// "type": "integer"
22760 /// }
22761 /// }
22762 ///}
22763 /// ```
22764 /// </details>
22765 #[derive(Clone, Debug, Deserialize, Serialize)]
22766 pub struct ManagedSubaccountInfoResponse {
22767 #[serde(rename = "managerSubUserInfoVoList")]
22768 pub manager_sub_user_info_vo_list: Vec<
22769 ManagedSubaccountInfoResponseManagerSubUserInfoVoListItem,
22770 >,
22771 pub total: i64,
22772 }
22773 impl From<&ManagedSubaccountInfoResponse> for ManagedSubaccountInfoResponse {
22774 fn from(value: &ManagedSubaccountInfoResponse) -> Self {
22775 value.clone()
22776 }
22777 }
22778 ///ManagedSubaccountInfoResponseManagerSubUserInfoVoListItem
22779 ///
22780 /// <details><summary>JSON schema</summary>
22781 ///
22782 /// ```json
22783 ///{
22784 /// "type": "object",
22785 /// "required": [
22786 /// "bindParentEmail",
22787 /// "bindParentUserId",
22788 /// "insertTimeStamp",
22789 /// "isFutureEnabled",
22790 /// "isMarginEnabled",
22791 /// "isSignedLVTRiskAgreement",
22792 /// "isSubUserEnabled",
22793 /// "isUserActive",
22794 /// "managersubUserId",
22795 /// "rootUserId"
22796 /// ],
22797 /// "properties": {
22798 /// "bindParentEmail": {
22799 /// "examples": [
22800 /// "wdyw8xsh8pey@test.com"
22801 /// ],
22802 /// "type": "string"
22803 /// },
22804 /// "bindParentUserId": {
22805 /// "examples": [
22806 /// 1000138475669
22807 /// ],
22808 /// "type": "integer",
22809 /// "format": "int64"
22810 /// },
22811 /// "email": {
22812 /// "examples": [
22813 /// "test_0_virtual@kq3kno9imanagedsub.com"
22814 /// ],
22815 /// "type": "string"
22816 /// },
22817 /// "insertTimeStamp": {
22818 /// "examples": [
22819 /// 1678435149000
22820 /// ],
22821 /// "type": "integer",
22822 /// "format": "int64"
22823 /// },
22824 /// "isFutureEnabled": {
22825 /// "examples": [
22826 /// true
22827 /// ],
22828 /// "type": "boolean"
22829 /// },
22830 /// "isMarginEnabled": {
22831 /// "examples": [
22832 /// true
22833 /// ],
22834 /// "type": "boolean"
22835 /// },
22836 /// "isSignedLVTRiskAgreement": {
22837 /// "examples": [
22838 /// true
22839 /// ],
22840 /// "type": "boolean"
22841 /// },
22842 /// "isSubUserEnabled": {
22843 /// "examples": [
22844 /// true
22845 /// ],
22846 /// "type": "boolean"
22847 /// },
22848 /// "isUserActive": {
22849 /// "examples": [
22850 /// true
22851 /// ],
22852 /// "type": "boolean"
22853 /// },
22854 /// "managersubUserId": {
22855 /// "examples": [
22856 /// 1000137842513
22857 /// ],
22858 /// "type": "integer",
22859 /// "format": "int64"
22860 /// },
22861 /// "rootUserId": {
22862 /// "examples": [
22863 /// 1000138475670
22864 /// ],
22865 /// "type": "integer",
22866 /// "format": "int64"
22867 /// }
22868 /// }
22869 ///}
22870 /// ```
22871 /// </details>
22872 #[derive(Clone, Debug, Deserialize, Serialize)]
22873 pub struct ManagedSubaccountInfoResponseManagerSubUserInfoVoListItem {
22874 #[serde(rename = "bindParentEmail")]
22875 pub bind_parent_email: String,
22876 #[serde(rename = "bindParentUserId")]
22877 pub bind_parent_user_id: i64,
22878 #[serde(default, skip_serializing_if = "Option::is_none")]
22879 pub email: Option<String>,
22880 #[serde(rename = "insertTimeStamp")]
22881 pub insert_time_stamp: i64,
22882 #[serde(rename = "isFutureEnabled")]
22883 pub is_future_enabled: bool,
22884 #[serde(rename = "isMarginEnabled")]
22885 pub is_margin_enabled: bool,
22886 #[serde(rename = "isSignedLVTRiskAgreement")]
22887 pub is_signed_lvt_risk_agreement: bool,
22888 #[serde(rename = "isSubUserEnabled")]
22889 pub is_sub_user_enabled: bool,
22890 #[serde(rename = "isUserActive")]
22891 pub is_user_active: bool,
22892 #[serde(rename = "managersubUserId")]
22893 pub managersub_user_id: i64,
22894 #[serde(rename = "rootUserId")]
22895 pub root_user_id: i64,
22896 }
22897 impl From<&ManagedSubaccountInfoResponseManagerSubUserInfoVoListItem>
22898 for ManagedSubaccountInfoResponseManagerSubUserInfoVoListItem {
22899 fn from(
22900 value: &ManagedSubaccountInfoResponseManagerSubUserInfoVoListItem,
22901 ) -> Self {
22902 value.clone()
22903 }
22904 }
22905 ///ManagedSubaccountMarginAssetResponse
22906 ///
22907 /// <details><summary>JSON schema</summary>
22908 ///
22909 /// ```json
22910 ///{
22911 /// "type": "object",
22912 /// "required": [
22913 /// "marginLevel",
22914 /// "totalAssetOfBtc",
22915 /// "totalLiabilityOfBtc",
22916 /// "totalNetAssetOfBtc",
22917 /// "userAssets"
22918 /// ],
22919 /// "properties": {
22920 /// "marginLevel": {
22921 /// "examples": [
22922 /// "999"
22923 /// ],
22924 /// "type": "string"
22925 /// },
22926 /// "totalAssetOfBtc": {
22927 /// "examples": [
22928 /// "0"
22929 /// ],
22930 /// "type": "string"
22931 /// },
22932 /// "totalLiabilityOfBtc": {
22933 /// "examples": [
22934 /// "0"
22935 /// ],
22936 /// "type": "string"
22937 /// },
22938 /// "totalNetAssetOfBtc": {
22939 /// "examples": [
22940 /// "0"
22941 /// ],
22942 /// "type": "string"
22943 /// },
22944 /// "userAssets": {
22945 /// "type": "array",
22946 /// "items": {
22947 /// "type": "object",
22948 /// "required": [
22949 /// "asset",
22950 /// "borrowed",
22951 /// "free",
22952 /// "interest",
22953 /// "locked",
22954 /// "netAsset"
22955 /// ],
22956 /// "properties": {
22957 /// "asset": {
22958 /// "examples": [
22959 /// "BTC"
22960 /// ],
22961 /// "type": "string"
22962 /// },
22963 /// "borrowed": {
22964 /// "examples": [
22965 /// "0"
22966 /// ],
22967 /// "type": "string"
22968 /// },
22969 /// "free": {
22970 /// "examples": [
22971 /// "0"
22972 /// ],
22973 /// "type": "string"
22974 /// },
22975 /// "interest": {
22976 /// "examples": [
22977 /// "0"
22978 /// ],
22979 /// "type": "string"
22980 /// },
22981 /// "locked": {
22982 /// "examples": [
22983 /// "0"
22984 /// ],
22985 /// "type": "string"
22986 /// },
22987 /// "netAsset": {
22988 /// "examples": [
22989 /// "0"
22990 /// ],
22991 /// "type": "string"
22992 /// }
22993 /// }
22994 /// }
22995 /// }
22996 /// }
22997 ///}
22998 /// ```
22999 /// </details>
23000 #[derive(Clone, Debug, Deserialize, Serialize)]
23001 pub struct ManagedSubaccountMarginAssetResponse {
23002 #[serde(rename = "marginLevel")]
23003 pub margin_level: String,
23004 #[serde(rename = "totalAssetOfBtc")]
23005 pub total_asset_of_btc: String,
23006 #[serde(rename = "totalLiabilityOfBtc")]
23007 pub total_liability_of_btc: String,
23008 #[serde(rename = "totalNetAssetOfBtc")]
23009 pub total_net_asset_of_btc: String,
23010 #[serde(rename = "userAssets")]
23011 pub user_assets: Vec<ManagedSubaccountMarginAssetResponseUserAssetsItem>,
23012 }
23013 impl From<&ManagedSubaccountMarginAssetResponse>
23014 for ManagedSubaccountMarginAssetResponse {
23015 fn from(value: &ManagedSubaccountMarginAssetResponse) -> Self {
23016 value.clone()
23017 }
23018 }
23019 ///ManagedSubaccountMarginAssetResponseUserAssetsItem
23020 ///
23021 /// <details><summary>JSON schema</summary>
23022 ///
23023 /// ```json
23024 ///{
23025 /// "type": "object",
23026 /// "required": [
23027 /// "asset",
23028 /// "borrowed",
23029 /// "free",
23030 /// "interest",
23031 /// "locked",
23032 /// "netAsset"
23033 /// ],
23034 /// "properties": {
23035 /// "asset": {
23036 /// "examples": [
23037 /// "BTC"
23038 /// ],
23039 /// "type": "string"
23040 /// },
23041 /// "borrowed": {
23042 /// "examples": [
23043 /// "0"
23044 /// ],
23045 /// "type": "string"
23046 /// },
23047 /// "free": {
23048 /// "examples": [
23049 /// "0"
23050 /// ],
23051 /// "type": "string"
23052 /// },
23053 /// "interest": {
23054 /// "examples": [
23055 /// "0"
23056 /// ],
23057 /// "type": "string"
23058 /// },
23059 /// "locked": {
23060 /// "examples": [
23061 /// "0"
23062 /// ],
23063 /// "type": "string"
23064 /// },
23065 /// "netAsset": {
23066 /// "examples": [
23067 /// "0"
23068 /// ],
23069 /// "type": "string"
23070 /// }
23071 /// }
23072 ///}
23073 /// ```
23074 /// </details>
23075 #[derive(Clone, Debug, Deserialize, Serialize)]
23076 pub struct ManagedSubaccountMarginAssetResponseUserAssetsItem {
23077 pub asset: String,
23078 pub borrowed: String,
23079 pub free: String,
23080 pub interest: String,
23081 pub locked: String,
23082 #[serde(rename = "netAsset")]
23083 pub net_asset: String,
23084 }
23085 impl From<&ManagedSubaccountMarginAssetResponseUserAssetsItem>
23086 for ManagedSubaccountMarginAssetResponseUserAssetsItem {
23087 fn from(value: &ManagedSubaccountMarginAssetResponseUserAssetsItem) -> Self {
23088 value.clone()
23089 }
23090 }
23091 ///ManagedSubaccountQueryTransLogForInvestorResponse
23092 ///
23093 /// <details><summary>JSON schema</summary>
23094 ///
23095 /// ```json
23096 ///{
23097 /// "type": "object",
23098 /// "required": [
23099 /// "count",
23100 /// "managerSubTransferHistoryVos"
23101 /// ],
23102 /// "properties": {
23103 /// "count": {
23104 /// "examples": [
23105 /// 2
23106 /// ],
23107 /// "type": "integer",
23108 /// "format": "int32"
23109 /// },
23110 /// "managerSubTransferHistoryVos": {
23111 /// "type": "array",
23112 /// "items": {
23113 /// "type": "object",
23114 /// "required": [
23115 /// "amount",
23116 /// "asset",
23117 /// "createTime",
23118 /// "fromAccountType",
23119 /// "fromEmail",
23120 /// "scheduledData",
23121 /// "status",
23122 /// "toAccountType",
23123 /// "toEmail",
23124 /// "tranId"
23125 /// ],
23126 /// "properties": {
23127 /// "amount": {
23128 /// "examples": [
23129 /// "0.01"
23130 /// ],
23131 /// "type": "string"
23132 /// },
23133 /// "asset": {
23134 /// "examples": [
23135 /// "BNB"
23136 /// ],
23137 /// "type": "string"
23138 /// },
23139 /// "createTime": {
23140 /// "examples": [
23141 /// 1626144956000
23142 /// ],
23143 /// "type": "integer",
23144 /// "format": "int64"
23145 /// },
23146 /// "fromAccountType": {
23147 /// "examples": [
23148 /// "SPOT"
23149 /// ],
23150 /// "type": "string"
23151 /// },
23152 /// "fromEmail": {
23153 /// "examples": [
23154 /// "test_0_virtual@kq3kno9imanagedsub.com"
23155 /// ],
23156 /// "type": "string"
23157 /// },
23158 /// "scheduledData": {
23159 /// "examples": [
23160 /// 1626144956000
23161 /// ],
23162 /// "type": "integer",
23163 /// "format": "int64"
23164 /// },
23165 /// "status": {
23166 /// "examples": [
23167 /// "SUCCESS"
23168 /// ],
23169 /// "type": "string"
23170 /// },
23171 /// "toAccountType": {
23172 /// "examples": [
23173 /// "SPOT"
23174 /// ],
23175 /// "type": "string"
23176 /// },
23177 /// "toEmail": {
23178 /// "examples": [
23179 /// "wdywl0lddakh@test.com"
23180 /// ],
23181 /// "type": "string"
23182 /// },
23183 /// "tranId": {
23184 /// "examples": [
23185 /// 91077779
23186 /// ],
23187 /// "type": "integer"
23188 /// }
23189 /// }
23190 /// }
23191 /// }
23192 /// }
23193 ///}
23194 /// ```
23195 /// </details>
23196 #[derive(Clone, Debug, Deserialize, Serialize)]
23197 pub struct ManagedSubaccountQueryTransLogForInvestorResponse {
23198 pub count: i32,
23199 #[serde(rename = "managerSubTransferHistoryVos")]
23200 pub manager_sub_transfer_history_vos: Vec<
23201 ManagedSubaccountQueryTransLogForInvestorResponseManagerSubTransferHistoryVosItem,
23202 >,
23203 }
23204 impl From<&ManagedSubaccountQueryTransLogForInvestorResponse>
23205 for ManagedSubaccountQueryTransLogForInvestorResponse {
23206 fn from(value: &ManagedSubaccountQueryTransLogForInvestorResponse) -> Self {
23207 value.clone()
23208 }
23209 }
23210 ///ManagedSubaccountQueryTransLogForInvestorResponseManagerSubTransferHistoryVosItem
23211 ///
23212 /// <details><summary>JSON schema</summary>
23213 ///
23214 /// ```json
23215 ///{
23216 /// "type": "object",
23217 /// "required": [
23218 /// "amount",
23219 /// "asset",
23220 /// "createTime",
23221 /// "fromAccountType",
23222 /// "fromEmail",
23223 /// "scheduledData",
23224 /// "status",
23225 /// "toAccountType",
23226 /// "toEmail",
23227 /// "tranId"
23228 /// ],
23229 /// "properties": {
23230 /// "amount": {
23231 /// "examples": [
23232 /// "0.01"
23233 /// ],
23234 /// "type": "string"
23235 /// },
23236 /// "asset": {
23237 /// "examples": [
23238 /// "BNB"
23239 /// ],
23240 /// "type": "string"
23241 /// },
23242 /// "createTime": {
23243 /// "examples": [
23244 /// 1626144956000
23245 /// ],
23246 /// "type": "integer",
23247 /// "format": "int64"
23248 /// },
23249 /// "fromAccountType": {
23250 /// "examples": [
23251 /// "SPOT"
23252 /// ],
23253 /// "type": "string"
23254 /// },
23255 /// "fromEmail": {
23256 /// "examples": [
23257 /// "test_0_virtual@kq3kno9imanagedsub.com"
23258 /// ],
23259 /// "type": "string"
23260 /// },
23261 /// "scheduledData": {
23262 /// "examples": [
23263 /// 1626144956000
23264 /// ],
23265 /// "type": "integer",
23266 /// "format": "int64"
23267 /// },
23268 /// "status": {
23269 /// "examples": [
23270 /// "SUCCESS"
23271 /// ],
23272 /// "type": "string"
23273 /// },
23274 /// "toAccountType": {
23275 /// "examples": [
23276 /// "SPOT"
23277 /// ],
23278 /// "type": "string"
23279 /// },
23280 /// "toEmail": {
23281 /// "examples": [
23282 /// "wdywl0lddakh@test.com"
23283 /// ],
23284 /// "type": "string"
23285 /// },
23286 /// "tranId": {
23287 /// "examples": [
23288 /// 91077779
23289 /// ],
23290 /// "type": "integer"
23291 /// }
23292 /// }
23293 ///}
23294 /// ```
23295 /// </details>
23296 #[derive(Clone, Debug, Deserialize, Serialize)]
23297 pub struct ManagedSubaccountQueryTransLogForInvestorResponseManagerSubTransferHistoryVosItem {
23298 pub amount: String,
23299 pub asset: String,
23300 #[serde(rename = "createTime")]
23301 pub create_time: i64,
23302 #[serde(rename = "fromAccountType")]
23303 pub from_account_type: String,
23304 #[serde(rename = "fromEmail")]
23305 pub from_email: String,
23306 #[serde(rename = "scheduledData")]
23307 pub scheduled_data: i64,
23308 pub status: String,
23309 #[serde(rename = "toAccountType")]
23310 pub to_account_type: String,
23311 #[serde(rename = "toEmail")]
23312 pub to_email: String,
23313 #[serde(rename = "tranId")]
23314 pub tran_id: i64,
23315 }
23316 impl From<
23317 &ManagedSubaccountQueryTransLogForInvestorResponseManagerSubTransferHistoryVosItem,
23318 >
23319 for ManagedSubaccountQueryTransLogForInvestorResponseManagerSubTransferHistoryVosItem {
23320 fn from(
23321 value: &ManagedSubaccountQueryTransLogForInvestorResponseManagerSubTransferHistoryVosItem,
23322 ) -> Self {
23323 value.clone()
23324 }
23325 }
23326 ///ManagedSubaccountQueryTransLogForTradeParentResponse
23327 ///
23328 /// <details><summary>JSON schema</summary>
23329 ///
23330 /// ```json
23331 ///{
23332 /// "type": "object",
23333 /// "required": [
23334 /// "count",
23335 /// "managerSubTransferHistoryVos"
23336 /// ],
23337 /// "properties": {
23338 /// "count": {
23339 /// "examples": [
23340 /// 2
23341 /// ],
23342 /// "type": "integer",
23343 /// "format": "int32"
23344 /// },
23345 /// "managerSubTransferHistoryVos": {
23346 /// "type": "array",
23347 /// "items": {
23348 /// "type": "object",
23349 /// "required": [
23350 /// "amount",
23351 /// "asset",
23352 /// "createTime",
23353 /// "fromAccountType",
23354 /// "fromEmail",
23355 /// "scheduledData",
23356 /// "status",
23357 /// "toAccountType",
23358 /// "toEmail",
23359 /// "tranId"
23360 /// ],
23361 /// "properties": {
23362 /// "amount": {
23363 /// "examples": [
23364 /// "0.01"
23365 /// ],
23366 /// "type": "string"
23367 /// },
23368 /// "asset": {
23369 /// "examples": [
23370 /// "BNB"
23371 /// ],
23372 /// "type": "string"
23373 /// },
23374 /// "createTime": {
23375 /// "examples": [
23376 /// 1626144956000
23377 /// ],
23378 /// "type": "integer",
23379 /// "format": "int64"
23380 /// },
23381 /// "fromAccountType": {
23382 /// "examples": [
23383 /// "SPOT"
23384 /// ],
23385 /// "type": "string"
23386 /// },
23387 /// "fromEmail": {
23388 /// "examples": [
23389 /// "test_0_virtual@kq3kno9imanagedsub.com"
23390 /// ],
23391 /// "type": "string"
23392 /// },
23393 /// "scheduledData": {
23394 /// "examples": [
23395 /// 1626144956000
23396 /// ],
23397 /// "type": "integer",
23398 /// "format": "int64"
23399 /// },
23400 /// "status": {
23401 /// "examples": [
23402 /// "SUCCESS"
23403 /// ],
23404 /// "type": "string"
23405 /// },
23406 /// "toAccountType": {
23407 /// "examples": [
23408 /// "SPOT"
23409 /// ],
23410 /// "type": "string"
23411 /// },
23412 /// "toEmail": {
23413 /// "examples": [
23414 /// "wdywl0lddakh@test.com"
23415 /// ],
23416 /// "type": "string"
23417 /// },
23418 /// "tranId": {
23419 /// "examples": [
23420 /// 91077779
23421 /// ],
23422 /// "type": "integer"
23423 /// }
23424 /// }
23425 /// }
23426 /// }
23427 /// }
23428 ///}
23429 /// ```
23430 /// </details>
23431 #[derive(Clone, Debug, Deserialize, Serialize)]
23432 pub struct ManagedSubaccountQueryTransLogForTradeParentResponse {
23433 pub count: i32,
23434 #[serde(rename = "managerSubTransferHistoryVos")]
23435 pub manager_sub_transfer_history_vos: Vec<
23436 ManagedSubaccountQueryTransLogForTradeParentResponseManagerSubTransferHistoryVosItem,
23437 >,
23438 }
23439 impl From<&ManagedSubaccountQueryTransLogForTradeParentResponse>
23440 for ManagedSubaccountQueryTransLogForTradeParentResponse {
23441 fn from(value: &ManagedSubaccountQueryTransLogForTradeParentResponse) -> Self {
23442 value.clone()
23443 }
23444 }
23445 ///ManagedSubaccountQueryTransLogForTradeParentResponseManagerSubTransferHistoryVosItem
23446 ///
23447 /// <details><summary>JSON schema</summary>
23448 ///
23449 /// ```json
23450 ///{
23451 /// "type": "object",
23452 /// "required": [
23453 /// "amount",
23454 /// "asset",
23455 /// "createTime",
23456 /// "fromAccountType",
23457 /// "fromEmail",
23458 /// "scheduledData",
23459 /// "status",
23460 /// "toAccountType",
23461 /// "toEmail",
23462 /// "tranId"
23463 /// ],
23464 /// "properties": {
23465 /// "amount": {
23466 /// "examples": [
23467 /// "0.01"
23468 /// ],
23469 /// "type": "string"
23470 /// },
23471 /// "asset": {
23472 /// "examples": [
23473 /// "BNB"
23474 /// ],
23475 /// "type": "string"
23476 /// },
23477 /// "createTime": {
23478 /// "examples": [
23479 /// 1626144956000
23480 /// ],
23481 /// "type": "integer",
23482 /// "format": "int64"
23483 /// },
23484 /// "fromAccountType": {
23485 /// "examples": [
23486 /// "SPOT"
23487 /// ],
23488 /// "type": "string"
23489 /// },
23490 /// "fromEmail": {
23491 /// "examples": [
23492 /// "test_0_virtual@kq3kno9imanagedsub.com"
23493 /// ],
23494 /// "type": "string"
23495 /// },
23496 /// "scheduledData": {
23497 /// "examples": [
23498 /// 1626144956000
23499 /// ],
23500 /// "type": "integer",
23501 /// "format": "int64"
23502 /// },
23503 /// "status": {
23504 /// "examples": [
23505 /// "SUCCESS"
23506 /// ],
23507 /// "type": "string"
23508 /// },
23509 /// "toAccountType": {
23510 /// "examples": [
23511 /// "SPOT"
23512 /// ],
23513 /// "type": "string"
23514 /// },
23515 /// "toEmail": {
23516 /// "examples": [
23517 /// "wdywl0lddakh@test.com"
23518 /// ],
23519 /// "type": "string"
23520 /// },
23521 /// "tranId": {
23522 /// "examples": [
23523 /// 91077779
23524 /// ],
23525 /// "type": "integer"
23526 /// }
23527 /// }
23528 ///}
23529 /// ```
23530 /// </details>
23531 #[derive(Clone, Debug, Deserialize, Serialize)]
23532 pub struct ManagedSubaccountQueryTransLogForTradeParentResponseManagerSubTransferHistoryVosItem {
23533 pub amount: String,
23534 pub asset: String,
23535 #[serde(rename = "createTime")]
23536 pub create_time: i64,
23537 #[serde(rename = "fromAccountType")]
23538 pub from_account_type: String,
23539 #[serde(rename = "fromEmail")]
23540 pub from_email: String,
23541 #[serde(rename = "scheduledData")]
23542 pub scheduled_data: i64,
23543 pub status: String,
23544 #[serde(rename = "toAccountType")]
23545 pub to_account_type: String,
23546 #[serde(rename = "toEmail")]
23547 pub to_email: String,
23548 #[serde(rename = "tranId")]
23549 pub tran_id: i64,
23550 }
23551 impl From<
23552 &ManagedSubaccountQueryTransLogForTradeParentResponseManagerSubTransferHistoryVosItem,
23553 >
23554 for ManagedSubaccountQueryTransLogForTradeParentResponseManagerSubTransferHistoryVosItem {
23555 fn from(
23556 value: &ManagedSubaccountQueryTransLogForTradeParentResponseManagerSubTransferHistoryVosItem,
23557 ) -> Self {
23558 value.clone()
23559 }
23560 }
23561 ///ManagedSubaccountQueryTransLogResponse
23562 ///
23563 /// <details><summary>JSON schema</summary>
23564 ///
23565 /// ```json
23566 ///{
23567 /// "type": "object",
23568 /// "required": [
23569 /// "count",
23570 /// "managerSubTransferHistoryVos"
23571 /// ],
23572 /// "properties": {
23573 /// "count": {
23574 /// "examples": [
23575 /// 2
23576 /// ],
23577 /// "type": "integer"
23578 /// },
23579 /// "managerSubTransferHistoryVos": {
23580 /// "type": "array",
23581 /// "items": {
23582 /// "type": "object",
23583 /// "required": [
23584 /// "amount",
23585 /// "asset",
23586 /// "createTime",
23587 /// "fromAccountType",
23588 /// "fromEmail",
23589 /// "scheduledData",
23590 /// "status",
23591 /// "toAccountType",
23592 /// "toEmail",
23593 /// "tranId"
23594 /// ],
23595 /// "properties": {
23596 /// "amount": {
23597 /// "examples": [
23598 /// "0.01"
23599 /// ],
23600 /// "type": "string"
23601 /// },
23602 /// "asset": {
23603 /// "examples": [
23604 /// "BNB"
23605 /// ],
23606 /// "type": "string"
23607 /// },
23608 /// "createTime": {
23609 /// "examples": [
23610 /// 1679416673000
23611 /// ],
23612 /// "type": "integer",
23613 /// "format": "int64"
23614 /// },
23615 /// "fromAccountType": {
23616 /// "examples": [
23617 /// "SPOT"
23618 /// ],
23619 /// "type": "string"
23620 /// },
23621 /// "fromEmail": {
23622 /// "examples": [
23623 /// "test_0_virtual@kq3kno9imanagedsub.com"
23624 /// ],
23625 /// "type": "string"
23626 /// },
23627 /// "scheduledData": {
23628 /// "examples": [
23629 /// 1679416673000
23630 /// ],
23631 /// "type": "integer",
23632 /// "format": "int64"
23633 /// },
23634 /// "status": {
23635 /// "examples": [
23636 /// "SUCCESS"
23637 /// ],
23638 /// "type": "string"
23639 /// },
23640 /// "toAccountType": {
23641 /// "examples": [
23642 /// "SPOT"
23643 /// ],
23644 /// "type": "string"
23645 /// },
23646 /// "toEmail": {
23647 /// "examples": [
23648 /// "wdywl0lddakh@test.com"
23649 /// ],
23650 /// "type": "string"
23651 /// },
23652 /// "tranId": {
23653 /// "examples": [
23654 /// 91077779
23655 /// ],
23656 /// "type": "integer",
23657 /// "format": "int64"
23658 /// }
23659 /// }
23660 /// }
23661 /// }
23662 /// }
23663 ///}
23664 /// ```
23665 /// </details>
23666 #[derive(Clone, Debug, Deserialize, Serialize)]
23667 pub struct ManagedSubaccountQueryTransLogResponse {
23668 pub count: i64,
23669 #[serde(rename = "managerSubTransferHistoryVos")]
23670 pub manager_sub_transfer_history_vos: Vec<
23671 ManagedSubaccountQueryTransLogResponseManagerSubTransferHistoryVosItem,
23672 >,
23673 }
23674 impl From<&ManagedSubaccountQueryTransLogResponse>
23675 for ManagedSubaccountQueryTransLogResponse {
23676 fn from(value: &ManagedSubaccountQueryTransLogResponse) -> Self {
23677 value.clone()
23678 }
23679 }
23680 ///ManagedSubaccountQueryTransLogResponseManagerSubTransferHistoryVosItem
23681 ///
23682 /// <details><summary>JSON schema</summary>
23683 ///
23684 /// ```json
23685 ///{
23686 /// "type": "object",
23687 /// "required": [
23688 /// "amount",
23689 /// "asset",
23690 /// "createTime",
23691 /// "fromAccountType",
23692 /// "fromEmail",
23693 /// "scheduledData",
23694 /// "status",
23695 /// "toAccountType",
23696 /// "toEmail",
23697 /// "tranId"
23698 /// ],
23699 /// "properties": {
23700 /// "amount": {
23701 /// "examples": [
23702 /// "0.01"
23703 /// ],
23704 /// "type": "string"
23705 /// },
23706 /// "asset": {
23707 /// "examples": [
23708 /// "BNB"
23709 /// ],
23710 /// "type": "string"
23711 /// },
23712 /// "createTime": {
23713 /// "examples": [
23714 /// 1679416673000
23715 /// ],
23716 /// "type": "integer",
23717 /// "format": "int64"
23718 /// },
23719 /// "fromAccountType": {
23720 /// "examples": [
23721 /// "SPOT"
23722 /// ],
23723 /// "type": "string"
23724 /// },
23725 /// "fromEmail": {
23726 /// "examples": [
23727 /// "test_0_virtual@kq3kno9imanagedsub.com"
23728 /// ],
23729 /// "type": "string"
23730 /// },
23731 /// "scheduledData": {
23732 /// "examples": [
23733 /// 1679416673000
23734 /// ],
23735 /// "type": "integer",
23736 /// "format": "int64"
23737 /// },
23738 /// "status": {
23739 /// "examples": [
23740 /// "SUCCESS"
23741 /// ],
23742 /// "type": "string"
23743 /// },
23744 /// "toAccountType": {
23745 /// "examples": [
23746 /// "SPOT"
23747 /// ],
23748 /// "type": "string"
23749 /// },
23750 /// "toEmail": {
23751 /// "examples": [
23752 /// "wdywl0lddakh@test.com"
23753 /// ],
23754 /// "type": "string"
23755 /// },
23756 /// "tranId": {
23757 /// "examples": [
23758 /// 91077779
23759 /// ],
23760 /// "type": "integer",
23761 /// "format": "int64"
23762 /// }
23763 /// }
23764 ///}
23765 /// ```
23766 /// </details>
23767 #[derive(Clone, Debug, Deserialize, Serialize)]
23768 pub struct ManagedSubaccountQueryTransLogResponseManagerSubTransferHistoryVosItem {
23769 pub amount: String,
23770 pub asset: String,
23771 #[serde(rename = "createTime")]
23772 pub create_time: i64,
23773 #[serde(rename = "fromAccountType")]
23774 pub from_account_type: String,
23775 #[serde(rename = "fromEmail")]
23776 pub from_email: String,
23777 #[serde(rename = "scheduledData")]
23778 pub scheduled_data: i64,
23779 pub status: String,
23780 #[serde(rename = "toAccountType")]
23781 pub to_account_type: String,
23782 #[serde(rename = "toEmail")]
23783 pub to_email: String,
23784 #[serde(rename = "tranId")]
23785 pub tran_id: i64,
23786 }
23787 impl From<&ManagedSubaccountQueryTransLogResponseManagerSubTransferHistoryVosItem>
23788 for ManagedSubaccountQueryTransLogResponseManagerSubTransferHistoryVosItem {
23789 fn from(
23790 value: &ManagedSubaccountQueryTransLogResponseManagerSubTransferHistoryVosItem,
23791 ) -> Self {
23792 value.clone()
23793 }
23794 }
23795 ///ManagedSubaccountQueryTransLogTransferFunctionAccountType
23796 ///
23797 /// <details><summary>JSON schema</summary>
23798 ///
23799 /// ```json
23800 ///{
23801 /// "type": "string",
23802 /// "enum": [
23803 /// "SPOT",
23804 /// "MARGIN",
23805 /// "ISOLATED_MARGIN",
23806 /// "USDT_FUTURE",
23807 /// "COIN_FUTURE"
23808 /// ]
23809 ///}
23810 /// ```
23811 /// </details>
23812 #[derive(
23813 Clone,
23814 Copy,
23815 Debug,
23816 Deserialize,
23817 Eq,
23818 Hash,
23819 Ord,
23820 PartialEq,
23821 PartialOrd,
23822 Serialize
23823 )]
23824 pub enum ManagedSubaccountQueryTransLogTransferFunctionAccountType {
23825 #[serde(rename = "SPOT")]
23826 Spot,
23827 #[serde(rename = "MARGIN")]
23828 Margin,
23829 #[serde(rename = "ISOLATED_MARGIN")]
23830 IsolatedMargin,
23831 #[serde(rename = "USDT_FUTURE")]
23832 UsdtFuture,
23833 #[serde(rename = "COIN_FUTURE")]
23834 CoinFuture,
23835 }
23836 impl From<&ManagedSubaccountQueryTransLogTransferFunctionAccountType>
23837 for ManagedSubaccountQueryTransLogTransferFunctionAccountType {
23838 fn from(
23839 value: &ManagedSubaccountQueryTransLogTransferFunctionAccountType,
23840 ) -> Self {
23841 value.clone()
23842 }
23843 }
23844 impl ToString for ManagedSubaccountQueryTransLogTransferFunctionAccountType {
23845 fn to_string(&self) -> String {
23846 match *self {
23847 Self::Spot => "SPOT".to_string(),
23848 Self::Margin => "MARGIN".to_string(),
23849 Self::IsolatedMargin => "ISOLATED_MARGIN".to_string(),
23850 Self::UsdtFuture => "USDT_FUTURE".to_string(),
23851 Self::CoinFuture => "COIN_FUTURE".to_string(),
23852 }
23853 }
23854 }
23855 impl std::str::FromStr
23856 for ManagedSubaccountQueryTransLogTransferFunctionAccountType {
23857 type Err = self::error::ConversionError;
23858 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
23859 match value {
23860 "SPOT" => Ok(Self::Spot),
23861 "MARGIN" => Ok(Self::Margin),
23862 "ISOLATED_MARGIN" => Ok(Self::IsolatedMargin),
23863 "USDT_FUTURE" => Ok(Self::UsdtFuture),
23864 "COIN_FUTURE" => Ok(Self::CoinFuture),
23865 _ => Err("invalid value".into()),
23866 }
23867 }
23868 }
23869 impl std::convert::TryFrom<&str>
23870 for ManagedSubaccountQueryTransLogTransferFunctionAccountType {
23871 type Error = self::error::ConversionError;
23872 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
23873 value.parse()
23874 }
23875 }
23876 impl std::convert::TryFrom<&String>
23877 for ManagedSubaccountQueryTransLogTransferFunctionAccountType {
23878 type Error = self::error::ConversionError;
23879 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
23880 value.parse()
23881 }
23882 }
23883 impl std::convert::TryFrom<String>
23884 for ManagedSubaccountQueryTransLogTransferFunctionAccountType {
23885 type Error = self::error::ConversionError;
23886 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
23887 value.parse()
23888 }
23889 }
23890 ///ManagedSubaccountQueryTransLogTransfers
23891 ///
23892 /// <details><summary>JSON schema</summary>
23893 ///
23894 /// ```json
23895 ///{
23896 /// "type": "string",
23897 /// "enum": [
23898 /// "FROM",
23899 /// "TO"
23900 /// ]
23901 ///}
23902 /// ```
23903 /// </details>
23904 #[derive(
23905 Clone,
23906 Copy,
23907 Debug,
23908 Deserialize,
23909 Eq,
23910 Hash,
23911 Ord,
23912 PartialEq,
23913 PartialOrd,
23914 Serialize
23915 )]
23916 pub enum ManagedSubaccountQueryTransLogTransfers {
23917 #[serde(rename = "FROM")]
23918 From,
23919 #[serde(rename = "TO")]
23920 To,
23921 }
23922 impl From<&ManagedSubaccountQueryTransLogTransfers>
23923 for ManagedSubaccountQueryTransLogTransfers {
23924 fn from(value: &ManagedSubaccountQueryTransLogTransfers) -> Self {
23925 value.clone()
23926 }
23927 }
23928 impl ToString for ManagedSubaccountQueryTransLogTransfers {
23929 fn to_string(&self) -> String {
23930 match *self {
23931 Self::From => "FROM".to_string(),
23932 Self::To => "TO".to_string(),
23933 }
23934 }
23935 }
23936 impl std::str::FromStr for ManagedSubaccountQueryTransLogTransfers {
23937 type Err = self::error::ConversionError;
23938 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
23939 match value {
23940 "FROM" => Ok(Self::From),
23941 "TO" => Ok(Self::To),
23942 _ => Err("invalid value".into()),
23943 }
23944 }
23945 }
23946 impl std::convert::TryFrom<&str> for ManagedSubaccountQueryTransLogTransfers {
23947 type Error = self::error::ConversionError;
23948 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
23949 value.parse()
23950 }
23951 }
23952 impl std::convert::TryFrom<&String> for ManagedSubaccountQueryTransLogTransfers {
23953 type Error = self::error::ConversionError;
23954 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
23955 value.parse()
23956 }
23957 }
23958 impl std::convert::TryFrom<String> for ManagedSubaccountQueryTransLogTransfers {
23959 type Error = self::error::ConversionError;
23960 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
23961 value.parse()
23962 }
23963 }
23964 ///ManagedSubaccountWithdrawResponse
23965 ///
23966 /// <details><summary>JSON schema</summary>
23967 ///
23968 /// ```json
23969 ///{
23970 /// "type": "object",
23971 /// "required": [
23972 /// "tranId"
23973 /// ],
23974 /// "properties": {
23975 /// "tranId": {
23976 /// "examples": [
23977 /// 66157362489
23978 /// ],
23979 /// "type": "integer",
23980 /// "format": "int64"
23981 /// }
23982 /// }
23983 ///}
23984 /// ```
23985 /// </details>
23986 #[derive(Clone, Debug, Deserialize, Serialize)]
23987 pub struct ManagedSubaccountWithdrawResponse {
23988 #[serde(rename = "tranId")]
23989 pub tran_id: i64,
23990 }
23991 impl From<&ManagedSubaccountWithdrawResponse> for ManagedSubaccountWithdrawResponse {
23992 fn from(value: &ManagedSubaccountWithdrawResponse) -> Self {
23993 value.clone()
23994 }
23995 }
23996 ///MarginAccountResponse
23997 ///
23998 /// <details><summary>JSON schema</summary>
23999 ///
24000 /// ```json
24001 ///{
24002 /// "type": "object",
24003 /// "required": [
24004 /// "borrowEnabled",
24005 /// "marginLevel",
24006 /// "totalAssetOfBtc",
24007 /// "totalLiabilityOfBtc",
24008 /// "totalNetAssetOfBtc",
24009 /// "tradeEnabled",
24010 /// "transferEnabled",
24011 /// "userAssets"
24012 /// ],
24013 /// "properties": {
24014 /// "borrowEnabled": {
24015 /// "type": "boolean"
24016 /// },
24017 /// "marginLevel": {
24018 /// "examples": [
24019 /// "11.64405625"
24020 /// ],
24021 /// "type": "string"
24022 /// },
24023 /// "totalAssetOfBtc": {
24024 /// "examples": [
24025 /// "6.82728457"
24026 /// ],
24027 /// "type": "string"
24028 /// },
24029 /// "totalLiabilityOfBtc": {
24030 /// "examples": [
24031 /// "0.58633215"
24032 /// ],
24033 /// "type": "string"
24034 /// },
24035 /// "totalNetAssetOfBtc": {
24036 /// "examples": [
24037 /// "6.24095242"
24038 /// ],
24039 /// "type": "string"
24040 /// },
24041 /// "tradeEnabled": {
24042 /// "type": "boolean"
24043 /// },
24044 /// "transferEnabled": {
24045 /// "type": "boolean"
24046 /// },
24047 /// "userAssets": {
24048 /// "type": "array",
24049 /// "items": {
24050 /// "type": "object",
24051 /// "required": [
24052 /// "asset",
24053 /// "borrowed",
24054 /// "free",
24055 /// "interest",
24056 /// "locked",
24057 /// "netAsset"
24058 /// ],
24059 /// "properties": {
24060 /// "asset": {
24061 /// "examples": [
24062 /// "BTC"
24063 /// ],
24064 /// "type": "string"
24065 /// },
24066 /// "borrowed": {
24067 /// "examples": [
24068 /// "0.00000000"
24069 /// ],
24070 /// "type": "string"
24071 /// },
24072 /// "free": {
24073 /// "examples": [
24074 /// "0.00499500"
24075 /// ],
24076 /// "type": "string"
24077 /// },
24078 /// "interest": {
24079 /// "examples": [
24080 /// "0.00000000"
24081 /// ],
24082 /// "type": "string"
24083 /// },
24084 /// "locked": {
24085 /// "examples": [
24086 /// "0.00000000"
24087 /// ],
24088 /// "type": "string"
24089 /// },
24090 /// "netAsset": {
24091 /// "examples": [
24092 /// "0.00499500"
24093 /// ],
24094 /// "type": "string"
24095 /// }
24096 /// }
24097 /// }
24098 /// }
24099 /// }
24100 ///}
24101 /// ```
24102 /// </details>
24103 #[derive(Clone, Debug, Deserialize, Serialize)]
24104 pub struct MarginAccountResponse {
24105 #[serde(rename = "borrowEnabled")]
24106 pub borrow_enabled: bool,
24107 #[serde(rename = "marginLevel")]
24108 pub margin_level: String,
24109 #[serde(rename = "totalAssetOfBtc")]
24110 pub total_asset_of_btc: String,
24111 #[serde(rename = "totalLiabilityOfBtc")]
24112 pub total_liability_of_btc: String,
24113 #[serde(rename = "totalNetAssetOfBtc")]
24114 pub total_net_asset_of_btc: String,
24115 #[serde(rename = "tradeEnabled")]
24116 pub trade_enabled: bool,
24117 #[serde(rename = "transferEnabled")]
24118 pub transfer_enabled: bool,
24119 #[serde(rename = "userAssets")]
24120 pub user_assets: Vec<MarginAccountResponseUserAssetsItem>,
24121 }
24122 impl From<&MarginAccountResponse> for MarginAccountResponse {
24123 fn from(value: &MarginAccountResponse) -> Self {
24124 value.clone()
24125 }
24126 }
24127 ///MarginAccountResponseUserAssetsItem
24128 ///
24129 /// <details><summary>JSON schema</summary>
24130 ///
24131 /// ```json
24132 ///{
24133 /// "type": "object",
24134 /// "required": [
24135 /// "asset",
24136 /// "borrowed",
24137 /// "free",
24138 /// "interest",
24139 /// "locked",
24140 /// "netAsset"
24141 /// ],
24142 /// "properties": {
24143 /// "asset": {
24144 /// "examples": [
24145 /// "BTC"
24146 /// ],
24147 /// "type": "string"
24148 /// },
24149 /// "borrowed": {
24150 /// "examples": [
24151 /// "0.00000000"
24152 /// ],
24153 /// "type": "string"
24154 /// },
24155 /// "free": {
24156 /// "examples": [
24157 /// "0.00499500"
24158 /// ],
24159 /// "type": "string"
24160 /// },
24161 /// "interest": {
24162 /// "examples": [
24163 /// "0.00000000"
24164 /// ],
24165 /// "type": "string"
24166 /// },
24167 /// "locked": {
24168 /// "examples": [
24169 /// "0.00000000"
24170 /// ],
24171 /// "type": "string"
24172 /// },
24173 /// "netAsset": {
24174 /// "examples": [
24175 /// "0.00499500"
24176 /// ],
24177 /// "type": "string"
24178 /// }
24179 /// }
24180 ///}
24181 /// ```
24182 /// </details>
24183 #[derive(Clone, Debug, Deserialize, Serialize)]
24184 pub struct MarginAccountResponseUserAssetsItem {
24185 pub asset: String,
24186 pub borrowed: String,
24187 pub free: String,
24188 pub interest: String,
24189 pub locked: String,
24190 #[serde(rename = "netAsset")]
24191 pub net_asset: String,
24192 }
24193 impl From<&MarginAccountResponseUserAssetsItem>
24194 for MarginAccountResponseUserAssetsItem {
24195 fn from(value: &MarginAccountResponseUserAssetsItem) -> Self {
24196 value.clone()
24197 }
24198 }
24199 ///MarginAllAssetsResponseItem
24200 ///
24201 /// <details><summary>JSON schema</summary>
24202 ///
24203 /// ```json
24204 ///{
24205 /// "type": "object",
24206 /// "required": [
24207 /// "assetFullName",
24208 /// "assetName",
24209 /// "isBorrowable",
24210 /// "isMortgageable",
24211 /// "userMinBorrow",
24212 /// "userMinRepay"
24213 /// ],
24214 /// "properties": {
24215 /// "assetFullName": {
24216 /// "examples": [
24217 /// "Binance coin"
24218 /// ],
24219 /// "type": "string"
24220 /// },
24221 /// "assetName": {
24222 /// "examples": [
24223 /// "BNB"
24224 /// ],
24225 /// "type": "string"
24226 /// },
24227 /// "isBorrowable": {
24228 /// "type": "boolean"
24229 /// },
24230 /// "isMortgageable": {
24231 /// "type": "boolean"
24232 /// },
24233 /// "userMinBorrow": {
24234 /// "examples": [
24235 /// "0.00000000"
24236 /// ],
24237 /// "type": "string"
24238 /// },
24239 /// "userMinRepay": {
24240 /// "examples": [
24241 /// "0.00000000"
24242 /// ],
24243 /// "type": "string"
24244 /// }
24245 /// }
24246 ///}
24247 /// ```
24248 /// </details>
24249 #[derive(Clone, Debug, Deserialize, Serialize)]
24250 pub struct MarginAllAssetsResponseItem {
24251 #[serde(rename = "assetFullName")]
24252 pub asset_full_name: String,
24253 #[serde(rename = "assetName")]
24254 pub asset_name: String,
24255 #[serde(rename = "isBorrowable")]
24256 pub is_borrowable: bool,
24257 #[serde(rename = "isMortgageable")]
24258 pub is_mortgageable: bool,
24259 #[serde(rename = "userMinBorrow")]
24260 pub user_min_borrow: String,
24261 #[serde(rename = "userMinRepay")]
24262 pub user_min_repay: String,
24263 }
24264 impl From<&MarginAllAssetsResponseItem> for MarginAllAssetsResponseItem {
24265 fn from(value: &MarginAllAssetsResponseItem) -> Self {
24266 value.clone()
24267 }
24268 }
24269 ///MarginAllOrderListIsIsolated
24270 ///
24271 /// <details><summary>JSON schema</summary>
24272 ///
24273 /// ```json
24274 ///{
24275 /// "type": "string",
24276 /// "enum": [
24277 /// "TRUE",
24278 /// "FALSE"
24279 /// ]
24280 ///}
24281 /// ```
24282 /// </details>
24283 #[derive(
24284 Clone,
24285 Copy,
24286 Debug,
24287 Deserialize,
24288 Eq,
24289 Hash,
24290 Ord,
24291 PartialEq,
24292 PartialOrd,
24293 Serialize
24294 )]
24295 pub enum MarginAllOrderListIsIsolated {
24296 #[serde(rename = "TRUE")]
24297 True,
24298 #[serde(rename = "FALSE")]
24299 False,
24300 }
24301 impl From<&MarginAllOrderListIsIsolated> for MarginAllOrderListIsIsolated {
24302 fn from(value: &MarginAllOrderListIsIsolated) -> Self {
24303 value.clone()
24304 }
24305 }
24306 impl ToString for MarginAllOrderListIsIsolated {
24307 fn to_string(&self) -> String {
24308 match *self {
24309 Self::True => "TRUE".to_string(),
24310 Self::False => "FALSE".to_string(),
24311 }
24312 }
24313 }
24314 impl std::str::FromStr for MarginAllOrderListIsIsolated {
24315 type Err = self::error::ConversionError;
24316 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
24317 match value {
24318 "TRUE" => Ok(Self::True),
24319 "FALSE" => Ok(Self::False),
24320 _ => Err("invalid value".into()),
24321 }
24322 }
24323 }
24324 impl std::convert::TryFrom<&str> for MarginAllOrderListIsIsolated {
24325 type Error = self::error::ConversionError;
24326 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
24327 value.parse()
24328 }
24329 }
24330 impl std::convert::TryFrom<&String> for MarginAllOrderListIsIsolated {
24331 type Error = self::error::ConversionError;
24332 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
24333 value.parse()
24334 }
24335 }
24336 impl std::convert::TryFrom<String> for MarginAllOrderListIsIsolated {
24337 type Error = self::error::ConversionError;
24338 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
24339 value.parse()
24340 }
24341 }
24342 ///MarginAllOrderListResponseItem
24343 ///
24344 /// <details><summary>JSON schema</summary>
24345 ///
24346 /// ```json
24347 ///{
24348 /// "type": "object",
24349 /// "required": [
24350 /// "contingencyType",
24351 /// "isIsolated",
24352 /// "listClientOrderId",
24353 /// "listOrderStatus",
24354 /// "listStatusType",
24355 /// "orderListId",
24356 /// "orders",
24357 /// "symbol",
24358 /// "transactionTime"
24359 /// ],
24360 /// "properties": {
24361 /// "contingencyType": {
24362 /// "examples": [
24363 /// "OCO"
24364 /// ],
24365 /// "type": "string"
24366 /// },
24367 /// "isIsolated": {
24368 /// "type": "boolean"
24369 /// },
24370 /// "listClientOrderId": {
24371 /// "examples": [
24372 /// "amEEAXryFzFwYF1FeRpUoZ"
24373 /// ],
24374 /// "type": "string"
24375 /// },
24376 /// "listOrderStatus": {
24377 /// "examples": [
24378 /// "EXECUTING"
24379 /// ],
24380 /// "type": "string"
24381 /// },
24382 /// "listStatusType": {
24383 /// "examples": [
24384 /// "EXEC_STARTED"
24385 /// ],
24386 /// "type": "string"
24387 /// },
24388 /// "orderListId": {
24389 /// "examples": [
24390 /// 29
24391 /// ],
24392 /// "type": "integer",
24393 /// "format": "int64"
24394 /// },
24395 /// "orders": {
24396 /// "type": "array",
24397 /// "items": {
24398 /// "examples": [
24399 /// [
24400 /// {
24401 /// "clientOrderId": "oD7aesZqjEGlZrbtRpy5zB",
24402 /// "orderId": 4,
24403 /// "symbol": "LTCBTC"
24404 /// },
24405 /// {
24406 /// "clientOrderId": "Jr1h6xirOxgeJOUuYQS7V3",
24407 /// "orderId": 5,
24408 /// "symbol": "LTCBTC"
24409 /// }
24410 /// ]
24411 /// ],
24412 /// "type": "object",
24413 /// "required": [
24414 /// "clientOrderId",
24415 /// "orderId",
24416 /// "symbol"
24417 /// ],
24418 /// "properties": {
24419 /// "clientOrderId": {
24420 /// "type": "string"
24421 /// },
24422 /// "orderId": {
24423 /// "type": "integer",
24424 /// "format": "int64"
24425 /// },
24426 /// "symbol": {
24427 /// "type": "string"
24428 /// }
24429 /// }
24430 /// }
24431 /// },
24432 /// "symbol": {
24433 /// "examples": [
24434 /// "LTCBTC"
24435 /// ],
24436 /// "type": "string"
24437 /// },
24438 /// "transactionTime": {
24439 /// "examples": [
24440 /// 1565245913483
24441 /// ],
24442 /// "type": "integer",
24443 /// "format": "int64"
24444 /// }
24445 /// }
24446 ///}
24447 /// ```
24448 /// </details>
24449 #[derive(Clone, Debug, Deserialize, Serialize)]
24450 pub struct MarginAllOrderListResponseItem {
24451 #[serde(rename = "contingencyType")]
24452 pub contingency_type: String,
24453 #[serde(rename = "isIsolated")]
24454 pub is_isolated: bool,
24455 #[serde(rename = "listClientOrderId")]
24456 pub list_client_order_id: String,
24457 #[serde(rename = "listOrderStatus")]
24458 pub list_order_status: String,
24459 #[serde(rename = "listStatusType")]
24460 pub list_status_type: String,
24461 #[serde(rename = "orderListId")]
24462 pub order_list_id: i64,
24463 pub orders: Vec<MarginAllOrderListResponseItemOrdersItem>,
24464 pub symbol: String,
24465 #[serde(rename = "transactionTime")]
24466 pub transaction_time: i64,
24467 }
24468 impl From<&MarginAllOrderListResponseItem> for MarginAllOrderListResponseItem {
24469 fn from(value: &MarginAllOrderListResponseItem) -> Self {
24470 value.clone()
24471 }
24472 }
24473 ///MarginAllOrderListResponseItemOrdersItem
24474 ///
24475 /// <details><summary>JSON schema</summary>
24476 ///
24477 /// ```json
24478 ///{
24479 /// "examples": [
24480 /// [
24481 /// {
24482 /// "clientOrderId": "oD7aesZqjEGlZrbtRpy5zB",
24483 /// "orderId": 4,
24484 /// "symbol": "LTCBTC"
24485 /// },
24486 /// {
24487 /// "clientOrderId": "Jr1h6xirOxgeJOUuYQS7V3",
24488 /// "orderId": 5,
24489 /// "symbol": "LTCBTC"
24490 /// }
24491 /// ]
24492 /// ],
24493 /// "type": "object",
24494 /// "required": [
24495 /// "clientOrderId",
24496 /// "orderId",
24497 /// "symbol"
24498 /// ],
24499 /// "properties": {
24500 /// "clientOrderId": {
24501 /// "type": "string"
24502 /// },
24503 /// "orderId": {
24504 /// "type": "integer",
24505 /// "format": "int64"
24506 /// },
24507 /// "symbol": {
24508 /// "type": "string"
24509 /// }
24510 /// }
24511 ///}
24512 /// ```
24513 /// </details>
24514 #[derive(Clone, Debug, Deserialize, Serialize)]
24515 pub struct MarginAllOrderListResponseItemOrdersItem {
24516 #[serde(rename = "clientOrderId")]
24517 pub client_order_id: String,
24518 #[serde(rename = "orderId")]
24519 pub order_id: i64,
24520 pub symbol: String,
24521 }
24522 impl From<&MarginAllOrderListResponseItemOrdersItem>
24523 for MarginAllOrderListResponseItemOrdersItem {
24524 fn from(value: &MarginAllOrderListResponseItemOrdersItem) -> Self {
24525 value.clone()
24526 }
24527 }
24528 ///MarginAllPairsResponseItem
24529 ///
24530 /// <details><summary>JSON schema</summary>
24531 ///
24532 /// ```json
24533 ///{
24534 /// "type": "object",
24535 /// "required": [
24536 /// "base",
24537 /// "id",
24538 /// "isBuyAllowed",
24539 /// "isMarginTrade",
24540 /// "isSellAllowed",
24541 /// "quote",
24542 /// "symbol"
24543 /// ],
24544 /// "properties": {
24545 /// "base": {
24546 /// "examples": [
24547 /// "BNB"
24548 /// ],
24549 /// "type": "string"
24550 /// },
24551 /// "id": {
24552 /// "examples": [
24553 /// 351637150141315861
24554 /// ],
24555 /// "type": "integer",
24556 /// "format": "int64"
24557 /// },
24558 /// "isBuyAllowed": {
24559 /// "type": "boolean"
24560 /// },
24561 /// "isMarginTrade": {
24562 /// "type": "boolean"
24563 /// },
24564 /// "isSellAllowed": {
24565 /// "type": "boolean"
24566 /// },
24567 /// "quote": {
24568 /// "examples": [
24569 /// "BTC"
24570 /// ],
24571 /// "type": "string"
24572 /// },
24573 /// "symbol": {
24574 /// "examples": [
24575 /// "BNBBTC"
24576 /// ],
24577 /// "type": "string"
24578 /// }
24579 /// }
24580 ///}
24581 /// ```
24582 /// </details>
24583 #[derive(Clone, Debug, Deserialize, Serialize)]
24584 pub struct MarginAllPairsResponseItem {
24585 pub base: String,
24586 pub id: i64,
24587 #[serde(rename = "isBuyAllowed")]
24588 pub is_buy_allowed: bool,
24589 #[serde(rename = "isMarginTrade")]
24590 pub is_margin_trade: bool,
24591 #[serde(rename = "isSellAllowed")]
24592 pub is_sell_allowed: bool,
24593 pub quote: String,
24594 pub symbol: String,
24595 }
24596 impl From<&MarginAllPairsResponseItem> for MarginAllPairsResponseItem {
24597 fn from(value: &MarginAllPairsResponseItem) -> Self {
24598 value.clone()
24599 }
24600 }
24601 ///MarginAssetResponse
24602 ///
24603 /// <details><summary>JSON schema</summary>
24604 ///
24605 /// ```json
24606 ///{
24607 /// "type": "object",
24608 /// "required": [
24609 /// "assetFullName",
24610 /// "assetName",
24611 /// "isBorrowable",
24612 /// "isMortgageable",
24613 /// "userMinBorrow",
24614 /// "userMinRepay"
24615 /// ],
24616 /// "properties": {
24617 /// "assetFullName": {
24618 /// "examples": [
24619 /// "Binance Coin"
24620 /// ],
24621 /// "type": "string"
24622 /// },
24623 /// "assetName": {
24624 /// "examples": [
24625 /// "BNB"
24626 /// ],
24627 /// "type": "string"
24628 /// },
24629 /// "isBorrowable": {
24630 /// "examples": [
24631 /// false
24632 /// ],
24633 /// "type": "boolean"
24634 /// },
24635 /// "isMortgageable": {
24636 /// "type": "boolean"
24637 /// },
24638 /// "userMinBorrow": {
24639 /// "examples": [
24640 /// "0.00000000"
24641 /// ],
24642 /// "type": "string"
24643 /// },
24644 /// "userMinRepay": {
24645 /// "examples": [
24646 /// "0.00000000"
24647 /// ],
24648 /// "type": "string"
24649 /// }
24650 /// }
24651 ///}
24652 /// ```
24653 /// </details>
24654 #[derive(Clone, Debug, Deserialize, Serialize)]
24655 pub struct MarginAssetResponse {
24656 #[serde(rename = "assetFullName")]
24657 pub asset_full_name: String,
24658 #[serde(rename = "assetName")]
24659 pub asset_name: String,
24660 #[serde(rename = "isBorrowable")]
24661 pub is_borrowable: bool,
24662 #[serde(rename = "isMortgageable")]
24663 pub is_mortgageable: bool,
24664 #[serde(rename = "userMinBorrow")]
24665 pub user_min_borrow: String,
24666 #[serde(rename = "userMinRepay")]
24667 pub user_min_repay: String,
24668 }
24669 impl From<&MarginAssetResponse> for MarginAssetResponse {
24670 fn from(value: &MarginAssetResponse) -> Self {
24671 value.clone()
24672 }
24673 }
24674 ///MarginAvailableInventoryResponse
24675 ///
24676 /// <details><summary>JSON schema</summary>
24677 ///
24678 /// ```json
24679 ///{
24680 /// "type": "object",
24681 /// "required": [
24682 /// "assets",
24683 /// "updateTime"
24684 /// ],
24685 /// "properties": {
24686 /// "assets": {
24687 /// "type": "object",
24688 /// "required": [
24689 /// "MATIC",
24690 /// "SHIB",
24691 /// "STPT",
24692 /// "TVK"
24693 /// ],
24694 /// "properties": {
24695 /// "MATIC": {
24696 /// "examples": [
24697 /// "100000000"
24698 /// ],
24699 /// "type": "string"
24700 /// },
24701 /// "SHIB": {
24702 /// "examples": [
24703 /// "97409653"
24704 /// ],
24705 /// "type": "string"
24706 /// },
24707 /// "STPT": {
24708 /// "examples": [
24709 /// "100000000"
24710 /// ],
24711 /// "type": "string"
24712 /// },
24713 /// "TVK": {
24714 /// "examples": [
24715 /// "100000000"
24716 /// ],
24717 /// "type": "string"
24718 /// }
24719 /// }
24720 /// },
24721 /// "updateTime": {
24722 /// "examples": [
24723 /// 1699272487
24724 /// ],
24725 /// "type": "integer",
24726 /// "format": "int64"
24727 /// }
24728 /// }
24729 ///}
24730 /// ```
24731 /// </details>
24732 #[derive(Clone, Debug, Deserialize, Serialize)]
24733 pub struct MarginAvailableInventoryResponse {
24734 pub assets: MarginAvailableInventoryResponseAssets,
24735 #[serde(rename = "updateTime")]
24736 pub update_time: i64,
24737 }
24738 impl From<&MarginAvailableInventoryResponse> for MarginAvailableInventoryResponse {
24739 fn from(value: &MarginAvailableInventoryResponse) -> Self {
24740 value.clone()
24741 }
24742 }
24743 ///MarginAvailableInventoryResponseAssets
24744 ///
24745 /// <details><summary>JSON schema</summary>
24746 ///
24747 /// ```json
24748 ///{
24749 /// "type": "object",
24750 /// "required": [
24751 /// "MATIC",
24752 /// "SHIB",
24753 /// "STPT",
24754 /// "TVK"
24755 /// ],
24756 /// "properties": {
24757 /// "MATIC": {
24758 /// "examples": [
24759 /// "100000000"
24760 /// ],
24761 /// "type": "string"
24762 /// },
24763 /// "SHIB": {
24764 /// "examples": [
24765 /// "97409653"
24766 /// ],
24767 /// "type": "string"
24768 /// },
24769 /// "STPT": {
24770 /// "examples": [
24771 /// "100000000"
24772 /// ],
24773 /// "type": "string"
24774 /// },
24775 /// "TVK": {
24776 /// "examples": [
24777 /// "100000000"
24778 /// ],
24779 /// "type": "string"
24780 /// }
24781 /// }
24782 ///}
24783 /// ```
24784 /// </details>
24785 #[derive(Clone, Debug, Deserialize, Serialize)]
24786 pub struct MarginAvailableInventoryResponseAssets {
24787 #[serde(rename = "MATIC")]
24788 pub matic: String,
24789 #[serde(rename = "SHIB")]
24790 pub shib: String,
24791 #[serde(rename = "STPT")]
24792 pub stpt: String,
24793 #[serde(rename = "TVK")]
24794 pub tvk: String,
24795 }
24796 impl From<&MarginAvailableInventoryResponseAssets>
24797 for MarginAvailableInventoryResponseAssets {
24798 fn from(value: &MarginAvailableInventoryResponseAssets) -> Self {
24799 value.clone()
24800 }
24801 }
24802 ///MarginAvailableInventoryType
24803 ///
24804 /// <details><summary>JSON schema</summary>
24805 ///
24806 /// ```json
24807 ///{
24808 /// "type": "string",
24809 /// "enum": [
24810 /// "MARGIN",
24811 /// "ISOLATED"
24812 /// ]
24813 ///}
24814 /// ```
24815 /// </details>
24816 #[derive(
24817 Clone,
24818 Copy,
24819 Debug,
24820 Deserialize,
24821 Eq,
24822 Hash,
24823 Ord,
24824 PartialEq,
24825 PartialOrd,
24826 Serialize
24827 )]
24828 pub enum MarginAvailableInventoryType {
24829 #[serde(rename = "MARGIN")]
24830 Margin,
24831 #[serde(rename = "ISOLATED")]
24832 Isolated,
24833 }
24834 impl From<&MarginAvailableInventoryType> for MarginAvailableInventoryType {
24835 fn from(value: &MarginAvailableInventoryType) -> Self {
24836 value.clone()
24837 }
24838 }
24839 impl ToString for MarginAvailableInventoryType {
24840 fn to_string(&self) -> String {
24841 match *self {
24842 Self::Margin => "MARGIN".to_string(),
24843 Self::Isolated => "ISOLATED".to_string(),
24844 }
24845 }
24846 }
24847 impl std::str::FromStr for MarginAvailableInventoryType {
24848 type Err = self::error::ConversionError;
24849 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
24850 match value {
24851 "MARGIN" => Ok(Self::Margin),
24852 "ISOLATED" => Ok(Self::Isolated),
24853 _ => Err("invalid value".into()),
24854 }
24855 }
24856 }
24857 impl std::convert::TryFrom<&str> for MarginAvailableInventoryType {
24858 type Error = self::error::ConversionError;
24859 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
24860 value.parse()
24861 }
24862 }
24863 impl std::convert::TryFrom<&String> for MarginAvailableInventoryType {
24864 type Error = self::error::ConversionError;
24865 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
24866 value.parse()
24867 }
24868 }
24869 impl std::convert::TryFrom<String> for MarginAvailableInventoryType {
24870 type Error = self::error::ConversionError;
24871 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
24872 value.parse()
24873 }
24874 }
24875 ///MarginCancelOrdersIsIsolated
24876 ///
24877 /// <details><summary>JSON schema</summary>
24878 ///
24879 /// ```json
24880 ///{
24881 /// "type": "string",
24882 /// "enum": [
24883 /// "TRUE",
24884 /// "FALSE"
24885 /// ]
24886 ///}
24887 /// ```
24888 /// </details>
24889 #[derive(
24890 Clone,
24891 Copy,
24892 Debug,
24893 Deserialize,
24894 Eq,
24895 Hash,
24896 Ord,
24897 PartialEq,
24898 PartialOrd,
24899 Serialize
24900 )]
24901 pub enum MarginCancelOrdersIsIsolated {
24902 #[serde(rename = "TRUE")]
24903 True,
24904 #[serde(rename = "FALSE")]
24905 False,
24906 }
24907 impl From<&MarginCancelOrdersIsIsolated> for MarginCancelOrdersIsIsolated {
24908 fn from(value: &MarginCancelOrdersIsIsolated) -> Self {
24909 value.clone()
24910 }
24911 }
24912 impl ToString for MarginCancelOrdersIsIsolated {
24913 fn to_string(&self) -> String {
24914 match *self {
24915 Self::True => "TRUE".to_string(),
24916 Self::False => "FALSE".to_string(),
24917 }
24918 }
24919 }
24920 impl std::str::FromStr for MarginCancelOrdersIsIsolated {
24921 type Err = self::error::ConversionError;
24922 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
24923 match value {
24924 "TRUE" => Ok(Self::True),
24925 "FALSE" => Ok(Self::False),
24926 _ => Err("invalid value".into()),
24927 }
24928 }
24929 }
24930 impl std::convert::TryFrom<&str> for MarginCancelOrdersIsIsolated {
24931 type Error = self::error::ConversionError;
24932 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
24933 value.parse()
24934 }
24935 }
24936 impl std::convert::TryFrom<&String> for MarginCancelOrdersIsIsolated {
24937 type Error = self::error::ConversionError;
24938 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
24939 value.parse()
24940 }
24941 }
24942 impl std::convert::TryFrom<String> for MarginCancelOrdersIsIsolated {
24943 type Error = self::error::ConversionError;
24944 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
24945 value.parse()
24946 }
24947 }
24948 ///MarginCancelOrdersResponseItem
24949 ///
24950 /// <details><summary>JSON schema</summary>
24951 ///
24952 /// ```json
24953 ///{
24954 /// "anyOf": [
24955 /// {
24956 /// "$ref": "#/components/schemas/canceledMarginOrderDetail"
24957 /// },
24958 /// {
24959 /// "$ref": "#/components/schemas/marginOcoOrder"
24960 /// }
24961 /// ]
24962 ///}
24963 /// ```
24964 /// </details>
24965 #[derive(Clone, Debug, Deserialize, Serialize)]
24966 #[serde(untagged)]
24967 pub enum MarginCancelOrdersResponseItem {
24968 CanceledMarginOrderDetail(CanceledMarginOrderDetail),
24969 MarginOcoOrder(MarginOcoOrder),
24970 }
24971 impl From<&MarginCancelOrdersResponseItem> for MarginCancelOrdersResponseItem {
24972 fn from(value: &MarginCancelOrdersResponseItem) -> Self {
24973 value.clone()
24974 }
24975 }
24976 impl From<CanceledMarginOrderDetail> for MarginCancelOrdersResponseItem {
24977 fn from(value: CanceledMarginOrderDetail) -> Self {
24978 Self::CanceledMarginOrderDetail(value)
24979 }
24980 }
24981 impl From<MarginOcoOrder> for MarginCancelOrdersResponseItem {
24982 fn from(value: MarginOcoOrder) -> Self {
24983 Self::MarginOcoOrder(value)
24984 }
24985 }
24986 ///MarginCapitalFlowResponseItem
24987 ///
24988 /// <details><summary>JSON schema</summary>
24989 ///
24990 /// ```json
24991 ///{
24992 /// "type": "object",
24993 /// "required": [
24994 /// "amount",
24995 /// "asset",
24996 /// "id",
24997 /// "symbol",
24998 /// "timestamp",
24999 /// "tranId",
25000 /// "type"
25001 /// ],
25002 /// "properties": {
25003 /// "amount": {
25004 /// "examples": [
25005 /// "101"
25006 /// ],
25007 /// "type": "string"
25008 /// },
25009 /// "asset": {
25010 /// "examples": [
25011 /// "USDT"
25012 /// ],
25013 /// "type": "string"
25014 /// },
25015 /// "id": {
25016 /// "examples": [
25017 /// 123456
25018 /// ],
25019 /// "type": "integer",
25020 /// "format": "int64"
25021 /// },
25022 /// "symbol": {
25023 /// "examples": [
25024 /// "BTCUSDT"
25025 /// ],
25026 /// "type": "string"
25027 /// },
25028 /// "timestamp": {
25029 /// "examples": [
25030 /// 1691116657000
25031 /// ],
25032 /// "type": "integer",
25033 /// "format": "int64"
25034 /// },
25035 /// "tranId": {
25036 /// "examples": [
25037 /// 123123
25038 /// ],
25039 /// "type": "integer",
25040 /// "format": "int64"
25041 /// },
25042 /// "type": {
25043 /// "examples": [
25044 /// "BORROW"
25045 /// ],
25046 /// "type": "string"
25047 /// }
25048 /// }
25049 ///}
25050 /// ```
25051 /// </details>
25052 #[derive(Clone, Debug, Deserialize, Serialize)]
25053 pub struct MarginCapitalFlowResponseItem {
25054 pub amount: String,
25055 pub asset: String,
25056 pub id: i64,
25057 pub symbol: String,
25058 pub timestamp: i64,
25059 #[serde(rename = "tranId")]
25060 pub tran_id: i64,
25061 #[serde(rename = "type")]
25062 pub type_: String,
25063 }
25064 impl From<&MarginCapitalFlowResponseItem> for MarginCapitalFlowResponseItem {
25065 fn from(value: &MarginCapitalFlowResponseItem) -> Self {
25066 value.clone()
25067 }
25068 }
25069 ///MarginCapitalFlowType
25070 ///
25071 /// <details><summary>JSON schema</summary>
25072 ///
25073 /// ```json
25074 ///{
25075 /// "type": "string",
25076 /// "enum": [
25077 /// "TRANSFER",
25078 /// "BORROW",
25079 /// "REPAY",
25080 /// "BUY_INCOME",
25081 /// "BUY_EXPENSE",
25082 /// "SELL_INCOME",
25083 /// "SELL_EXPENSE",
25084 /// "TRADING_COMMISSION",
25085 /// "BUY_LIQUIDATION",
25086 /// "SELL_LIQUIDATION",
25087 /// "REPAY_LIQUIDATION",
25088 /// "OTHER_LIQUIDATION",
25089 /// "LIQUIDATION_FEE",
25090 /// "SMALL_BALANCE_CONVERT",
25091 /// "COMMISSION_RETURN",
25092 /// "SMALL_CONVERT"
25093 /// ]
25094 ///}
25095 /// ```
25096 /// </details>
25097 #[derive(
25098 Clone,
25099 Copy,
25100 Debug,
25101 Deserialize,
25102 Eq,
25103 Hash,
25104 Ord,
25105 PartialEq,
25106 PartialOrd,
25107 Serialize
25108 )]
25109 pub enum MarginCapitalFlowType {
25110 #[serde(rename = "TRANSFER")]
25111 Transfer,
25112 #[serde(rename = "BORROW")]
25113 Borrow,
25114 #[serde(rename = "REPAY")]
25115 Repay,
25116 #[serde(rename = "BUY_INCOME")]
25117 BuyIncome,
25118 #[serde(rename = "BUY_EXPENSE")]
25119 BuyExpense,
25120 #[serde(rename = "SELL_INCOME")]
25121 SellIncome,
25122 #[serde(rename = "SELL_EXPENSE")]
25123 SellExpense,
25124 #[serde(rename = "TRADING_COMMISSION")]
25125 TradingCommission,
25126 #[serde(rename = "BUY_LIQUIDATION")]
25127 BuyLiquidation,
25128 #[serde(rename = "SELL_LIQUIDATION")]
25129 SellLiquidation,
25130 #[serde(rename = "REPAY_LIQUIDATION")]
25131 RepayLiquidation,
25132 #[serde(rename = "OTHER_LIQUIDATION")]
25133 OtherLiquidation,
25134 #[serde(rename = "LIQUIDATION_FEE")]
25135 LiquidationFee,
25136 #[serde(rename = "SMALL_BALANCE_CONVERT")]
25137 SmallBalanceConvert,
25138 #[serde(rename = "COMMISSION_RETURN")]
25139 CommissionReturn,
25140 #[serde(rename = "SMALL_CONVERT")]
25141 SmallConvert,
25142 }
25143 impl From<&MarginCapitalFlowType> for MarginCapitalFlowType {
25144 fn from(value: &MarginCapitalFlowType) -> Self {
25145 value.clone()
25146 }
25147 }
25148 impl ToString for MarginCapitalFlowType {
25149 fn to_string(&self) -> String {
25150 match *self {
25151 Self::Transfer => "TRANSFER".to_string(),
25152 Self::Borrow => "BORROW".to_string(),
25153 Self::Repay => "REPAY".to_string(),
25154 Self::BuyIncome => "BUY_INCOME".to_string(),
25155 Self::BuyExpense => "BUY_EXPENSE".to_string(),
25156 Self::SellIncome => "SELL_INCOME".to_string(),
25157 Self::SellExpense => "SELL_EXPENSE".to_string(),
25158 Self::TradingCommission => "TRADING_COMMISSION".to_string(),
25159 Self::BuyLiquidation => "BUY_LIQUIDATION".to_string(),
25160 Self::SellLiquidation => "SELL_LIQUIDATION".to_string(),
25161 Self::RepayLiquidation => "REPAY_LIQUIDATION".to_string(),
25162 Self::OtherLiquidation => "OTHER_LIQUIDATION".to_string(),
25163 Self::LiquidationFee => "LIQUIDATION_FEE".to_string(),
25164 Self::SmallBalanceConvert => "SMALL_BALANCE_CONVERT".to_string(),
25165 Self::CommissionReturn => "COMMISSION_RETURN".to_string(),
25166 Self::SmallConvert => "SMALL_CONVERT".to_string(),
25167 }
25168 }
25169 }
25170 impl std::str::FromStr for MarginCapitalFlowType {
25171 type Err = self::error::ConversionError;
25172 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
25173 match value {
25174 "TRANSFER" => Ok(Self::Transfer),
25175 "BORROW" => Ok(Self::Borrow),
25176 "REPAY" => Ok(Self::Repay),
25177 "BUY_INCOME" => Ok(Self::BuyIncome),
25178 "BUY_EXPENSE" => Ok(Self::BuyExpense),
25179 "SELL_INCOME" => Ok(Self::SellIncome),
25180 "SELL_EXPENSE" => Ok(Self::SellExpense),
25181 "TRADING_COMMISSION" => Ok(Self::TradingCommission),
25182 "BUY_LIQUIDATION" => Ok(Self::BuyLiquidation),
25183 "SELL_LIQUIDATION" => Ok(Self::SellLiquidation),
25184 "REPAY_LIQUIDATION" => Ok(Self::RepayLiquidation),
25185 "OTHER_LIQUIDATION" => Ok(Self::OtherLiquidation),
25186 "LIQUIDATION_FEE" => Ok(Self::LiquidationFee),
25187 "SMALL_BALANCE_CONVERT" => Ok(Self::SmallBalanceConvert),
25188 "COMMISSION_RETURN" => Ok(Self::CommissionReturn),
25189 "SMALL_CONVERT" => Ok(Self::SmallConvert),
25190 _ => Err("invalid value".into()),
25191 }
25192 }
25193 }
25194 impl std::convert::TryFrom<&str> for MarginCapitalFlowType {
25195 type Error = self::error::ConversionError;
25196 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
25197 value.parse()
25198 }
25199 }
25200 impl std::convert::TryFrom<&String> for MarginCapitalFlowType {
25201 type Error = self::error::ConversionError;
25202 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
25203 value.parse()
25204 }
25205 }
25206 impl std::convert::TryFrom<String> for MarginCapitalFlowType {
25207 type Error = self::error::ConversionError;
25208 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
25209 value.parse()
25210 }
25211 }
25212 ///MarginCrossMarginCollateralRatioResponseItem
25213 ///
25214 /// <details><summary>JSON schema</summary>
25215 ///
25216 /// ```json
25217 ///{
25218 /// "type": "object",
25219 /// "required": [
25220 /// "assetNames",
25221 /// "collaterals"
25222 /// ],
25223 /// "properties": {
25224 /// "assetNames": {
25225 /// "type": "array",
25226 /// "items": {
25227 /// "examples": [
25228 /// "BNX"
25229 /// ],
25230 /// "type": "string"
25231 /// }
25232 /// },
25233 /// "collaterals": {
25234 /// "type": "array",
25235 /// "items": {
25236 /// "type": "object",
25237 /// "required": [
25238 /// "discountRate",
25239 /// "maxUsdValue",
25240 /// "minUsdValue"
25241 /// ],
25242 /// "properties": {
25243 /// "discountRate": {
25244 /// "examples": [
25245 /// "1"
25246 /// ],
25247 /// "type": "string"
25248 /// },
25249 /// "maxUsdValue": {
25250 /// "examples": [
25251 /// "13000000"
25252 /// ],
25253 /// "type": "string"
25254 /// },
25255 /// "minUsdValue": {
25256 /// "examples": [
25257 /// "0"
25258 /// ],
25259 /// "type": "string"
25260 /// }
25261 /// }
25262 /// }
25263 /// }
25264 /// }
25265 ///}
25266 /// ```
25267 /// </details>
25268 #[derive(Clone, Debug, Deserialize, Serialize)]
25269 pub struct MarginCrossMarginCollateralRatioResponseItem {
25270 #[serde(rename = "assetNames")]
25271 pub asset_names: Vec<String>,
25272 pub collaterals: Vec<
25273 MarginCrossMarginCollateralRatioResponseItemCollateralsItem,
25274 >,
25275 }
25276 impl From<&MarginCrossMarginCollateralRatioResponseItem>
25277 for MarginCrossMarginCollateralRatioResponseItem {
25278 fn from(value: &MarginCrossMarginCollateralRatioResponseItem) -> Self {
25279 value.clone()
25280 }
25281 }
25282 ///MarginCrossMarginCollateralRatioResponseItemCollateralsItem
25283 ///
25284 /// <details><summary>JSON schema</summary>
25285 ///
25286 /// ```json
25287 ///{
25288 /// "type": "object",
25289 /// "required": [
25290 /// "discountRate",
25291 /// "maxUsdValue",
25292 /// "minUsdValue"
25293 /// ],
25294 /// "properties": {
25295 /// "discountRate": {
25296 /// "examples": [
25297 /// "1"
25298 /// ],
25299 /// "type": "string"
25300 /// },
25301 /// "maxUsdValue": {
25302 /// "examples": [
25303 /// "13000000"
25304 /// ],
25305 /// "type": "string"
25306 /// },
25307 /// "minUsdValue": {
25308 /// "examples": [
25309 /// "0"
25310 /// ],
25311 /// "type": "string"
25312 /// }
25313 /// }
25314 ///}
25315 /// ```
25316 /// </details>
25317 #[derive(Clone, Debug, Deserialize, Serialize)]
25318 pub struct MarginCrossMarginCollateralRatioResponseItemCollateralsItem {
25319 #[serde(rename = "discountRate")]
25320 pub discount_rate: String,
25321 #[serde(rename = "maxUsdValue")]
25322 pub max_usd_value: String,
25323 #[serde(rename = "minUsdValue")]
25324 pub min_usd_value: String,
25325 }
25326 impl From<&MarginCrossMarginCollateralRatioResponseItemCollateralsItem>
25327 for MarginCrossMarginCollateralRatioResponseItemCollateralsItem {
25328 fn from(
25329 value: &MarginCrossMarginCollateralRatioResponseItemCollateralsItem,
25330 ) -> Self {
25331 value.clone()
25332 }
25333 }
25334 ///MarginCrossMarginDataResponseItem
25335 ///
25336 /// <details><summary>JSON schema</summary>
25337 ///
25338 /// ```json
25339 ///{
25340 /// "type": "object",
25341 /// "required": [
25342 /// "borrowLimit",
25343 /// "borrowable",
25344 /// "coin",
25345 /// "dailyInterest",
25346 /// "marginablePairs",
25347 /// "transferIn",
25348 /// "vipLevel",
25349 /// "yearlyInterest"
25350 /// ],
25351 /// "properties": {
25352 /// "borrowLimit": {
25353 /// "examples": [
25354 /// "180"
25355 /// ],
25356 /// "type": "string"
25357 /// },
25358 /// "borrowable": {
25359 /// "type": "boolean"
25360 /// },
25361 /// "coin": {
25362 /// "examples": [
25363 /// "BTC"
25364 /// ],
25365 /// "type": "string"
25366 /// },
25367 /// "dailyInterest": {
25368 /// "examples": [
25369 /// "0.00026125"
25370 /// ],
25371 /// "type": "string"
25372 /// },
25373 /// "marginablePairs": {
25374 /// "examples": [
25375 /// [
25376 /// "BNBBTC",
25377 /// "TRXBTC",
25378 /// "ETHBTC",
25379 /// "BTCUSDT"
25380 /// ]
25381 /// ],
25382 /// "type": "array",
25383 /// "items": {
25384 /// "type": "string"
25385 /// }
25386 /// },
25387 /// "transferIn": {
25388 /// "type": "boolean"
25389 /// },
25390 /// "vipLevel": {
25391 /// "examples": [
25392 /// 0
25393 /// ],
25394 /// "type": "integer",
25395 /// "format": "int32"
25396 /// },
25397 /// "yearlyInterest": {
25398 /// "examples": [
25399 /// "0.0953"
25400 /// ],
25401 /// "type": "string"
25402 /// }
25403 /// }
25404 ///}
25405 /// ```
25406 /// </details>
25407 #[derive(Clone, Debug, Deserialize, Serialize)]
25408 pub struct MarginCrossMarginDataResponseItem {
25409 #[serde(rename = "borrowLimit")]
25410 pub borrow_limit: String,
25411 pub borrowable: bool,
25412 pub coin: String,
25413 #[serde(rename = "dailyInterest")]
25414 pub daily_interest: String,
25415 #[serde(rename = "marginablePairs")]
25416 pub marginable_pairs: Vec<String>,
25417 #[serde(rename = "transferIn")]
25418 pub transfer_in: bool,
25419 #[serde(rename = "vipLevel")]
25420 pub vip_level: i32,
25421 #[serde(rename = "yearlyInterest")]
25422 pub yearly_interest: String,
25423 }
25424 impl From<&MarginCrossMarginDataResponseItem> for MarginCrossMarginDataResponseItem {
25425 fn from(value: &MarginCrossMarginDataResponseItem) -> Self {
25426 value.clone()
25427 }
25428 }
25429 ///MarginDelistScheduleResponseItem
25430 ///
25431 /// <details><summary>JSON schema</summary>
25432 ///
25433 /// ```json
25434 ///{
25435 /// "type": "object",
25436 /// "properties": {
25437 /// "crossMarginAssets": {
25438 /// "type": "array",
25439 /// "items": {
25440 /// "examples": [
25441 /// "BTC"
25442 /// ],
25443 /// "type": "string"
25444 /// }
25445 /// },
25446 /// "delistTime": {
25447 /// "examples": [
25448 /// 1686161202000
25449 /// ],
25450 /// "type": "integer",
25451 /// "format": "int64"
25452 /// },
25453 /// "isolatedMarginSymbols": {
25454 /// "type": "array",
25455 /// "items": {
25456 /// "examples": [
25457 /// "BNBUSDT"
25458 /// ],
25459 /// "type": "string"
25460 /// }
25461 /// }
25462 /// }
25463 ///}
25464 /// ```
25465 /// </details>
25466 #[derive(Clone, Debug, Deserialize, Serialize)]
25467 pub struct MarginDelistScheduleResponseItem {
25468 #[serde(
25469 rename = "crossMarginAssets",
25470 default,
25471 skip_serializing_if = "Vec::is_empty"
25472 )]
25473 pub cross_margin_assets: Vec<String>,
25474 #[serde(rename = "delistTime", default, skip_serializing_if = "Option::is_none")]
25475 pub delist_time: Option<i64>,
25476 #[serde(
25477 rename = "isolatedMarginSymbols",
25478 default,
25479 skip_serializing_if = "Vec::is_empty"
25480 )]
25481 pub isolated_margin_symbols: Vec<String>,
25482 }
25483 impl From<&MarginDelistScheduleResponseItem> for MarginDelistScheduleResponseItem {
25484 fn from(value: &MarginDelistScheduleResponseItem) -> Self {
25485 value.clone()
25486 }
25487 }
25488 ///MarginDribbletResponse
25489 ///
25490 /// <details><summary>JSON schema</summary>
25491 ///
25492 /// ```json
25493 ///{
25494 /// "type": "object",
25495 /// "required": [
25496 /// "total",
25497 /// "userAssetDribblets"
25498 /// ],
25499 /// "properties": {
25500 /// "total": {
25501 /// "examples": [
25502 /// 8
25503 /// ],
25504 /// "type": "integer",
25505 /// "format": "int64"
25506 /// },
25507 /// "userAssetDribblets": {
25508 /// "type": "array",
25509 /// "items": {
25510 /// "type": "object",
25511 /// "required": [
25512 /// "operateTime",
25513 /// "totalServiceChargeAmount",
25514 /// "totalTransferedAmount",
25515 /// "transId",
25516 /// "userAssetDribbletDetails"
25517 /// ],
25518 /// "properties": {
25519 /// "operateTime": {
25520 /// "examples": [
25521 /// 1615985535000
25522 /// ],
25523 /// "type": "integer",
25524 /// "format": "int64"
25525 /// },
25526 /// "totalServiceChargeAmount": {
25527 /// "examples": [
25528 /// "0.00002699"
25529 /// ],
25530 /// "type": "string"
25531 /// },
25532 /// "totalTransferedAmount": {
25533 /// "examples": [
25534 /// "0.00132256"
25535 /// ],
25536 /// "type": "string"
25537 /// },
25538 /// "transId": {
25539 /// "examples": [
25540 /// 45178372831
25541 /// ],
25542 /// "type": "integer",
25543 /// "format": "int64"
25544 /// },
25545 /// "userAssetDribbletDetails": {
25546 /// "type": "array",
25547 /// "items": {
25548 /// "type": "object",
25549 /// "required": [
25550 /// "amount",
25551 /// "fromAsset",
25552 /// "operateTime",
25553 /// "serviceChargeAmount",
25554 /// "transId",
25555 /// "transferedAmount"
25556 /// ],
25557 /// "properties": {
25558 /// "amount": {
25559 /// "examples": [
25560 /// "0.0009"
25561 /// ],
25562 /// "type": "string"
25563 /// },
25564 /// "fromAsset": {
25565 /// "examples": [
25566 /// "USDT"
25567 /// ],
25568 /// "type": "string"
25569 /// },
25570 /// "operateTime": {
25571 /// "examples": [
25572 /// 1615985535000
25573 /// ],
25574 /// "type": "integer",
25575 /// "format": "int64"
25576 /// },
25577 /// "serviceChargeAmount": {
25578 /// "examples": [
25579 /// "0.000009"
25580 /// ],
25581 /// "type": "string"
25582 /// },
25583 /// "transId": {
25584 /// "examples": [
25585 /// 4359321
25586 /// ],
25587 /// "type": "integer",
25588 /// "format": "int64"
25589 /// },
25590 /// "transferedAmount": {
25591 /// "examples": [
25592 /// "0.000441"
25593 /// ],
25594 /// "type": "string"
25595 /// }
25596 /// }
25597 /// }
25598 /// }
25599 /// }
25600 /// }
25601 /// }
25602 /// }
25603 ///}
25604 /// ```
25605 /// </details>
25606 #[derive(Clone, Debug, Deserialize, Serialize)]
25607 pub struct MarginDribbletResponse {
25608 pub total: i64,
25609 #[serde(rename = "userAssetDribblets")]
25610 pub user_asset_dribblets: Vec<MarginDribbletResponseUserAssetDribbletsItem>,
25611 }
25612 impl From<&MarginDribbletResponse> for MarginDribbletResponse {
25613 fn from(value: &MarginDribbletResponse) -> Self {
25614 value.clone()
25615 }
25616 }
25617 ///MarginDribbletResponseUserAssetDribbletsItem
25618 ///
25619 /// <details><summary>JSON schema</summary>
25620 ///
25621 /// ```json
25622 ///{
25623 /// "type": "object",
25624 /// "required": [
25625 /// "operateTime",
25626 /// "totalServiceChargeAmount",
25627 /// "totalTransferedAmount",
25628 /// "transId",
25629 /// "userAssetDribbletDetails"
25630 /// ],
25631 /// "properties": {
25632 /// "operateTime": {
25633 /// "examples": [
25634 /// 1615985535000
25635 /// ],
25636 /// "type": "integer",
25637 /// "format": "int64"
25638 /// },
25639 /// "totalServiceChargeAmount": {
25640 /// "examples": [
25641 /// "0.00002699"
25642 /// ],
25643 /// "type": "string"
25644 /// },
25645 /// "totalTransferedAmount": {
25646 /// "examples": [
25647 /// "0.00132256"
25648 /// ],
25649 /// "type": "string"
25650 /// },
25651 /// "transId": {
25652 /// "examples": [
25653 /// 45178372831
25654 /// ],
25655 /// "type": "integer",
25656 /// "format": "int64"
25657 /// },
25658 /// "userAssetDribbletDetails": {
25659 /// "type": "array",
25660 /// "items": {
25661 /// "type": "object",
25662 /// "required": [
25663 /// "amount",
25664 /// "fromAsset",
25665 /// "operateTime",
25666 /// "serviceChargeAmount",
25667 /// "transId",
25668 /// "transferedAmount"
25669 /// ],
25670 /// "properties": {
25671 /// "amount": {
25672 /// "examples": [
25673 /// "0.0009"
25674 /// ],
25675 /// "type": "string"
25676 /// },
25677 /// "fromAsset": {
25678 /// "examples": [
25679 /// "USDT"
25680 /// ],
25681 /// "type": "string"
25682 /// },
25683 /// "operateTime": {
25684 /// "examples": [
25685 /// 1615985535000
25686 /// ],
25687 /// "type": "integer",
25688 /// "format": "int64"
25689 /// },
25690 /// "serviceChargeAmount": {
25691 /// "examples": [
25692 /// "0.000009"
25693 /// ],
25694 /// "type": "string"
25695 /// },
25696 /// "transId": {
25697 /// "examples": [
25698 /// 4359321
25699 /// ],
25700 /// "type": "integer",
25701 /// "format": "int64"
25702 /// },
25703 /// "transferedAmount": {
25704 /// "examples": [
25705 /// "0.000441"
25706 /// ],
25707 /// "type": "string"
25708 /// }
25709 /// }
25710 /// }
25711 /// }
25712 /// }
25713 ///}
25714 /// ```
25715 /// </details>
25716 #[derive(Clone, Debug, Deserialize, Serialize)]
25717 pub struct MarginDribbletResponseUserAssetDribbletsItem {
25718 #[serde(rename = "operateTime")]
25719 pub operate_time: i64,
25720 #[serde(rename = "totalServiceChargeAmount")]
25721 pub total_service_charge_amount: String,
25722 #[serde(rename = "totalTransferedAmount")]
25723 pub total_transfered_amount: String,
25724 #[serde(rename = "transId")]
25725 pub trans_id: i64,
25726 #[serde(rename = "userAssetDribbletDetails")]
25727 pub user_asset_dribblet_details: Vec<
25728 MarginDribbletResponseUserAssetDribbletsItemUserAssetDribbletDetailsItem,
25729 >,
25730 }
25731 impl From<&MarginDribbletResponseUserAssetDribbletsItem>
25732 for MarginDribbletResponseUserAssetDribbletsItem {
25733 fn from(value: &MarginDribbletResponseUserAssetDribbletsItem) -> Self {
25734 value.clone()
25735 }
25736 }
25737 ///MarginDribbletResponseUserAssetDribbletsItemUserAssetDribbletDetailsItem
25738 ///
25739 /// <details><summary>JSON schema</summary>
25740 ///
25741 /// ```json
25742 ///{
25743 /// "type": "object",
25744 /// "required": [
25745 /// "amount",
25746 /// "fromAsset",
25747 /// "operateTime",
25748 /// "serviceChargeAmount",
25749 /// "transId",
25750 /// "transferedAmount"
25751 /// ],
25752 /// "properties": {
25753 /// "amount": {
25754 /// "examples": [
25755 /// "0.0009"
25756 /// ],
25757 /// "type": "string"
25758 /// },
25759 /// "fromAsset": {
25760 /// "examples": [
25761 /// "USDT"
25762 /// ],
25763 /// "type": "string"
25764 /// },
25765 /// "operateTime": {
25766 /// "examples": [
25767 /// 1615985535000
25768 /// ],
25769 /// "type": "integer",
25770 /// "format": "int64"
25771 /// },
25772 /// "serviceChargeAmount": {
25773 /// "examples": [
25774 /// "0.000009"
25775 /// ],
25776 /// "type": "string"
25777 /// },
25778 /// "transId": {
25779 /// "examples": [
25780 /// 4359321
25781 /// ],
25782 /// "type": "integer",
25783 /// "format": "int64"
25784 /// },
25785 /// "transferedAmount": {
25786 /// "examples": [
25787 /// "0.000441"
25788 /// ],
25789 /// "type": "string"
25790 /// }
25791 /// }
25792 ///}
25793 /// ```
25794 /// </details>
25795 #[derive(Clone, Debug, Deserialize, Serialize)]
25796 pub struct MarginDribbletResponseUserAssetDribbletsItemUserAssetDribbletDetailsItem {
25797 pub amount: String,
25798 #[serde(rename = "fromAsset")]
25799 pub from_asset: String,
25800 #[serde(rename = "operateTime")]
25801 pub operate_time: i64,
25802 #[serde(rename = "serviceChargeAmount")]
25803 pub service_charge_amount: String,
25804 #[serde(rename = "transId")]
25805 pub trans_id: i64,
25806 #[serde(rename = "transferedAmount")]
25807 pub transfered_amount: String,
25808 }
25809 impl From<&MarginDribbletResponseUserAssetDribbletsItemUserAssetDribbletDetailsItem>
25810 for MarginDribbletResponseUserAssetDribbletsItemUserAssetDribbletDetailsItem {
25811 fn from(
25812 value: &MarginDribbletResponseUserAssetDribbletsItemUserAssetDribbletDetailsItem,
25813 ) -> Self {
25814 value.clone()
25815 }
25816 }
25817 ///MarginDustResponse
25818 ///
25819 /// <details><summary>JSON schema</summary>
25820 ///
25821 /// ```json
25822 ///{
25823 /// "type": "object",
25824 /// "required": [
25825 /// "details",
25826 /// "dribbletPercentage",
25827 /// "totalTransferBNB",
25828 /// "totalTransferBtc"
25829 /// ],
25830 /// "properties": {
25831 /// "details": {
25832 /// "type": "array",
25833 /// "items": {
25834 /// "type": "object",
25835 /// "required": [
25836 /// "amountFree",
25837 /// "asset",
25838 /// "assetFullName",
25839 /// "exchange",
25840 /// "toBNB",
25841 /// "toBNBOffExchange",
25842 /// "toBTC"
25843 /// ],
25844 /// "properties": {
25845 /// "amountFree": {
25846 /// "examples": [
25847 /// "6.21"
25848 /// ],
25849 /// "type": "string"
25850 /// },
25851 /// "asset": {
25852 /// "examples": [
25853 /// "BTC"
25854 /// ],
25855 /// "type": "string"
25856 /// },
25857 /// "assetFullName": {
25858 /// "examples": [
25859 /// "ADA"
25860 /// ],
25861 /// "type": "string"
25862 /// },
25863 /// "exchange": {
25864 /// "examples": [
25865 /// "0.00035546"
25866 /// ],
25867 /// "type": "string"
25868 /// },
25869 /// "toBNB": {
25870 /// "examples": [
25871 /// "0.01777302"
25872 /// ],
25873 /// "type": "string"
25874 /// },
25875 /// "toBNBOffExchange": {
25876 /// "examples": [
25877 /// "0.01741756"
25878 /// ],
25879 /// "type": "string"
25880 /// },
25881 /// "toBTC": {
25882 /// "examples": [
25883 /// "0.00016848"
25884 /// ],
25885 /// "type": "string"
25886 /// }
25887 /// }
25888 /// }
25889 /// },
25890 /// "dribbletPercentage": {
25891 /// "examples": [
25892 /// "0.02"
25893 /// ],
25894 /// "type": "string"
25895 /// },
25896 /// "totalTransferBNB": {
25897 /// "examples": [
25898 /// "0.01777302"
25899 /// ],
25900 /// "type": "string"
25901 /// },
25902 /// "totalTransferBtc": {
25903 /// "examples": [
25904 /// "0.00016848"
25905 /// ],
25906 /// "type": "string"
25907 /// }
25908 /// }
25909 ///}
25910 /// ```
25911 /// </details>
25912 #[derive(Clone, Debug, Deserialize, Serialize)]
25913 pub struct MarginDustResponse {
25914 pub details: Vec<MarginDustResponseDetailsItem>,
25915 #[serde(rename = "dribbletPercentage")]
25916 pub dribblet_percentage: String,
25917 #[serde(rename = "totalTransferBNB")]
25918 pub total_transfer_bnb: String,
25919 #[serde(rename = "totalTransferBtc")]
25920 pub total_transfer_btc: String,
25921 }
25922 impl From<&MarginDustResponse> for MarginDustResponse {
25923 fn from(value: &MarginDustResponse) -> Self {
25924 value.clone()
25925 }
25926 }
25927 ///MarginDustResponseDetailsItem
25928 ///
25929 /// <details><summary>JSON schema</summary>
25930 ///
25931 /// ```json
25932 ///{
25933 /// "type": "object",
25934 /// "required": [
25935 /// "amountFree",
25936 /// "asset",
25937 /// "assetFullName",
25938 /// "exchange",
25939 /// "toBNB",
25940 /// "toBNBOffExchange",
25941 /// "toBTC"
25942 /// ],
25943 /// "properties": {
25944 /// "amountFree": {
25945 /// "examples": [
25946 /// "6.21"
25947 /// ],
25948 /// "type": "string"
25949 /// },
25950 /// "asset": {
25951 /// "examples": [
25952 /// "BTC"
25953 /// ],
25954 /// "type": "string"
25955 /// },
25956 /// "assetFullName": {
25957 /// "examples": [
25958 /// "ADA"
25959 /// ],
25960 /// "type": "string"
25961 /// },
25962 /// "exchange": {
25963 /// "examples": [
25964 /// "0.00035546"
25965 /// ],
25966 /// "type": "string"
25967 /// },
25968 /// "toBNB": {
25969 /// "examples": [
25970 /// "0.01777302"
25971 /// ],
25972 /// "type": "string"
25973 /// },
25974 /// "toBNBOffExchange": {
25975 /// "examples": [
25976 /// "0.01741756"
25977 /// ],
25978 /// "type": "string"
25979 /// },
25980 /// "toBTC": {
25981 /// "examples": [
25982 /// "0.00016848"
25983 /// ],
25984 /// "type": "string"
25985 /// }
25986 /// }
25987 ///}
25988 /// ```
25989 /// </details>
25990 #[derive(Clone, Debug, Deserialize, Serialize)]
25991 pub struct MarginDustResponseDetailsItem {
25992 #[serde(rename = "amountFree")]
25993 pub amount_free: String,
25994 pub asset: String,
25995 #[serde(rename = "assetFullName")]
25996 pub asset_full_name: String,
25997 pub exchange: String,
25998 #[serde(rename = "toBNB")]
25999 pub to_bnb: String,
26000 #[serde(rename = "toBNBOffExchange")]
26001 pub to_bnb_off_exchange: String,
26002 #[serde(rename = "toBTC")]
26003 pub to_btc: String,
26004 }
26005 impl From<&MarginDustResponseDetailsItem> for MarginDustResponseDetailsItem {
26006 fn from(value: &MarginDustResponseDetailsItem) -> Self {
26007 value.clone()
26008 }
26009 }
26010 ///MarginExchangeSmallLiabilityHistoryResponse
26011 ///
26012 /// <details><summary>JSON schema</summary>
26013 ///
26014 /// ```json
26015 ///{
26016 /// "type": "object",
26017 /// "required": [
26018 /// "rows",
26019 /// "total"
26020 /// ],
26021 /// "properties": {
26022 /// "rows": {
26023 /// "type": "array",
26024 /// "items": {
26025 /// "type": "object",
26026 /// "required": [
26027 /// "amount",
26028 /// "asset",
26029 /// "bizType",
26030 /// "targetAmount",
26031 /// "targetAsset",
26032 /// "timestamp"
26033 /// ],
26034 /// "properties": {
26035 /// "amount": {
26036 /// "examples": [
26037 /// "0.00083434"
26038 /// ],
26039 /// "type": "string"
26040 /// },
26041 /// "asset": {
26042 /// "examples": [
26043 /// "ETH"
26044 /// ],
26045 /// "type": "string"
26046 /// },
26047 /// "bizType": {
26048 /// "examples": [
26049 /// "EXCHANGE_SMALL_LIABILITY"
26050 /// ],
26051 /// "type": "string"
26052 /// },
26053 /// "targetAmount": {
26054 /// "examples": [
26055 /// "1.37576819"
26056 /// ],
26057 /// "type": "string"
26058 /// },
26059 /// "targetAsset": {
26060 /// "examples": [
26061 /// "BUSD"
26062 /// ],
26063 /// "type": "string"
26064 /// },
26065 /// "timestamp": {
26066 /// "examples": [
26067 /// 1672801339253
26068 /// ],
26069 /// "type": "integer",
26070 /// "format": "int64"
26071 /// }
26072 /// }
26073 /// }
26074 /// },
26075 /// "total": {
26076 /// "examples": [
26077 /// 1
26078 /// ],
26079 /// "type": "integer"
26080 /// }
26081 /// }
26082 ///}
26083 /// ```
26084 /// </details>
26085 #[derive(Clone, Debug, Deserialize, Serialize)]
26086 pub struct MarginExchangeSmallLiabilityHistoryResponse {
26087 pub rows: Vec<MarginExchangeSmallLiabilityHistoryResponseRowsItem>,
26088 pub total: i64,
26089 }
26090 impl From<&MarginExchangeSmallLiabilityHistoryResponse>
26091 for MarginExchangeSmallLiabilityHistoryResponse {
26092 fn from(value: &MarginExchangeSmallLiabilityHistoryResponse) -> Self {
26093 value.clone()
26094 }
26095 }
26096 ///MarginExchangeSmallLiabilityHistoryResponseRowsItem
26097 ///
26098 /// <details><summary>JSON schema</summary>
26099 ///
26100 /// ```json
26101 ///{
26102 /// "type": "object",
26103 /// "required": [
26104 /// "amount",
26105 /// "asset",
26106 /// "bizType",
26107 /// "targetAmount",
26108 /// "targetAsset",
26109 /// "timestamp"
26110 /// ],
26111 /// "properties": {
26112 /// "amount": {
26113 /// "examples": [
26114 /// "0.00083434"
26115 /// ],
26116 /// "type": "string"
26117 /// },
26118 /// "asset": {
26119 /// "examples": [
26120 /// "ETH"
26121 /// ],
26122 /// "type": "string"
26123 /// },
26124 /// "bizType": {
26125 /// "examples": [
26126 /// "EXCHANGE_SMALL_LIABILITY"
26127 /// ],
26128 /// "type": "string"
26129 /// },
26130 /// "targetAmount": {
26131 /// "examples": [
26132 /// "1.37576819"
26133 /// ],
26134 /// "type": "string"
26135 /// },
26136 /// "targetAsset": {
26137 /// "examples": [
26138 /// "BUSD"
26139 /// ],
26140 /// "type": "string"
26141 /// },
26142 /// "timestamp": {
26143 /// "examples": [
26144 /// 1672801339253
26145 /// ],
26146 /// "type": "integer",
26147 /// "format": "int64"
26148 /// }
26149 /// }
26150 ///}
26151 /// ```
26152 /// </details>
26153 #[derive(Clone, Debug, Deserialize, Serialize)]
26154 pub struct MarginExchangeSmallLiabilityHistoryResponseRowsItem {
26155 pub amount: String,
26156 pub asset: String,
26157 #[serde(rename = "bizType")]
26158 pub biz_type: String,
26159 #[serde(rename = "targetAmount")]
26160 pub target_amount: String,
26161 #[serde(rename = "targetAsset")]
26162 pub target_asset: String,
26163 pub timestamp: i64,
26164 }
26165 impl From<&MarginExchangeSmallLiabilityHistoryResponseRowsItem>
26166 for MarginExchangeSmallLiabilityHistoryResponseRowsItem {
26167 fn from(value: &MarginExchangeSmallLiabilityHistoryResponseRowsItem) -> Self {
26168 value.clone()
26169 }
26170 }
26171 ///MarginExchangeSmallLiabilityResponseItem
26172 ///
26173 /// <details><summary>JSON schema</summary>
26174 ///
26175 /// ```json
26176 ///{
26177 /// "type": "object",
26178 /// "required": [
26179 /// "asset",
26180 /// "interest",
26181 /// "liabilityAsset",
26182 /// "liabilityQty",
26183 /// "principal"
26184 /// ],
26185 /// "properties": {
26186 /// "asset": {
26187 /// "examples": [
26188 /// "ETH"
26189 /// ],
26190 /// "type": "string"
26191 /// },
26192 /// "interest": {
26193 /// "examples": [
26194 /// "0.00083334"
26195 /// ],
26196 /// "type": "string"
26197 /// },
26198 /// "liabilityAsset": {
26199 /// "examples": [
26200 /// "USDT"
26201 /// ],
26202 /// "type": "string"
26203 /// },
26204 /// "liabilityQty": {
26205 /// "examples": [
26206 /// 0.3552
26207 /// ],
26208 /// "type": "number",
26209 /// "format": "float"
26210 /// },
26211 /// "principal": {
26212 /// "examples": [
26213 /// "0.001"
26214 /// ],
26215 /// "type": "string"
26216 /// }
26217 /// }
26218 ///}
26219 /// ```
26220 /// </details>
26221 #[derive(Clone, Debug, Deserialize, Serialize)]
26222 pub struct MarginExchangeSmallLiabilityResponseItem {
26223 pub asset: String,
26224 pub interest: String,
26225 #[serde(rename = "liabilityAsset")]
26226 pub liability_asset: String,
26227 #[serde(rename = "liabilityQty")]
26228 pub liability_qty: f32,
26229 pub principal: String,
26230 }
26231 impl From<&MarginExchangeSmallLiabilityResponseItem>
26232 for MarginExchangeSmallLiabilityResponseItem {
26233 fn from(value: &MarginExchangeSmallLiabilityResponseItem) -> Self {
26234 value.clone()
26235 }
26236 }
26237 ///MarginForceLiquidationRecResponse
26238 ///
26239 /// <details><summary>JSON schema</summary>
26240 ///
26241 /// ```json
26242 ///{
26243 /// "examples": [
26244 /// {
26245 /// "rows": [
26246 /// {
26247 /// "avgPrice": "0.00388359",
26248 /// "executedQty": "31.39000000",
26249 /// "isIsolated": true,
26250 /// "orderId": 180015097,
26251 /// "price": "0.00388110",
26252 /// "qty": "31.39000000",
26253 /// "side": "SELL",
26254 /// "symbol": "BNBBTC",
26255 /// "timeInForce": "GTC",
26256 /// "updatedTime": 1558941374745
26257 /// }
26258 /// ],
26259 /// "total": 1
26260 /// }
26261 /// ],
26262 /// "type": "object",
26263 /// "required": [
26264 /// "rows",
26265 /// "total"
26266 /// ],
26267 /// "properties": {
26268 /// "rows": {
26269 /// "type": "array",
26270 /// "items": {
26271 /// "type": "object",
26272 /// "required": [
26273 /// "avgPrice",
26274 /// "executedQty",
26275 /// "isIsolated",
26276 /// "orderId",
26277 /// "price",
26278 /// "qty",
26279 /// "side",
26280 /// "symbol",
26281 /// "timeInForce",
26282 /// "updatedTime"
26283 /// ],
26284 /// "properties": {
26285 /// "avgPrice": {
26286 /// "type": "string"
26287 /// },
26288 /// "executedQty": {
26289 /// "type": "string"
26290 /// },
26291 /// "isIsolated": {
26292 /// "type": "boolean"
26293 /// },
26294 /// "orderId": {
26295 /// "type": "integer",
26296 /// "format": "int64"
26297 /// },
26298 /// "price": {
26299 /// "type": "string"
26300 /// },
26301 /// "qty": {
26302 /// "type": "string"
26303 /// },
26304 /// "side": {
26305 /// "type": "string"
26306 /// },
26307 /// "symbol": {
26308 /// "type": "string"
26309 /// },
26310 /// "timeInForce": {
26311 /// "type": "string"
26312 /// },
26313 /// "updatedTime": {
26314 /// "type": "integer",
26315 /// "format": "int64"
26316 /// }
26317 /// }
26318 /// }
26319 /// },
26320 /// "total": {
26321 /// "examples": [
26322 /// 1
26323 /// ],
26324 /// "type": "integer",
26325 /// "format": "int32"
26326 /// }
26327 /// }
26328 ///}
26329 /// ```
26330 /// </details>
26331 #[derive(Clone, Debug, Deserialize, Serialize)]
26332 pub struct MarginForceLiquidationRecResponse {
26333 pub rows: Vec<MarginForceLiquidationRecResponseRowsItem>,
26334 pub total: i32,
26335 }
26336 impl From<&MarginForceLiquidationRecResponse> for MarginForceLiquidationRecResponse {
26337 fn from(value: &MarginForceLiquidationRecResponse) -> Self {
26338 value.clone()
26339 }
26340 }
26341 ///MarginForceLiquidationRecResponseRowsItem
26342 ///
26343 /// <details><summary>JSON schema</summary>
26344 ///
26345 /// ```json
26346 ///{
26347 /// "type": "object",
26348 /// "required": [
26349 /// "avgPrice",
26350 /// "executedQty",
26351 /// "isIsolated",
26352 /// "orderId",
26353 /// "price",
26354 /// "qty",
26355 /// "side",
26356 /// "symbol",
26357 /// "timeInForce",
26358 /// "updatedTime"
26359 /// ],
26360 /// "properties": {
26361 /// "avgPrice": {
26362 /// "type": "string"
26363 /// },
26364 /// "executedQty": {
26365 /// "type": "string"
26366 /// },
26367 /// "isIsolated": {
26368 /// "type": "boolean"
26369 /// },
26370 /// "orderId": {
26371 /// "type": "integer",
26372 /// "format": "int64"
26373 /// },
26374 /// "price": {
26375 /// "type": "string"
26376 /// },
26377 /// "qty": {
26378 /// "type": "string"
26379 /// },
26380 /// "side": {
26381 /// "type": "string"
26382 /// },
26383 /// "symbol": {
26384 /// "type": "string"
26385 /// },
26386 /// "timeInForce": {
26387 /// "type": "string"
26388 /// },
26389 /// "updatedTime": {
26390 /// "type": "integer",
26391 /// "format": "int64"
26392 /// }
26393 /// }
26394 ///}
26395 /// ```
26396 /// </details>
26397 #[derive(Clone, Debug, Deserialize, Serialize)]
26398 pub struct MarginForceLiquidationRecResponseRowsItem {
26399 #[serde(rename = "avgPrice")]
26400 pub avg_price: String,
26401 #[serde(rename = "executedQty")]
26402 pub executed_qty: String,
26403 #[serde(rename = "isIsolated")]
26404 pub is_isolated: bool,
26405 #[serde(rename = "orderId")]
26406 pub order_id: i64,
26407 pub price: String,
26408 pub qty: String,
26409 pub side: String,
26410 pub symbol: String,
26411 #[serde(rename = "timeInForce")]
26412 pub time_in_force: String,
26413 #[serde(rename = "updatedTime")]
26414 pub updated_time: i64,
26415 }
26416 impl From<&MarginForceLiquidationRecResponseRowsItem>
26417 for MarginForceLiquidationRecResponseRowsItem {
26418 fn from(value: &MarginForceLiquidationRecResponseRowsItem) -> Self {
26419 value.clone()
26420 }
26421 }
26422 ///MarginInterestHistoryResponse
26423 ///
26424 /// <details><summary>JSON schema</summary>
26425 ///
26426 /// ```json
26427 ///{
26428 /// "type": "object",
26429 /// "required": [
26430 /// "rows",
26431 /// "total"
26432 /// ],
26433 /// "properties": {
26434 /// "rows": {
26435 /// "type": "array",
26436 /// "items": {
26437 /// "type": "object",
26438 /// "required": [
26439 /// "asset",
26440 /// "interest",
26441 /// "interestAccuredTime",
26442 /// "interestRate",
26443 /// "isolatedSymbol",
26444 /// "principal",
26445 /// "type"
26446 /// ],
26447 /// "properties": {
26448 /// "asset": {
26449 /// "examples": [
26450 /// "BNB"
26451 /// ],
26452 /// "type": "string"
26453 /// },
26454 /// "interest": {
26455 /// "examples": [
26456 /// "0.01866667"
26457 /// ],
26458 /// "type": "string"
26459 /// },
26460 /// "interestAccuredTime": {
26461 /// "examples": [
26462 /// 1566813600
26463 /// ],
26464 /// "type": "integer",
26465 /// "format": "int64"
26466 /// },
26467 /// "interestRate": {
26468 /// "examples": [
26469 /// "0.01600000"
26470 /// ],
26471 /// "type": "string"
26472 /// },
26473 /// "isolatedSymbol": {
26474 /// "examples": [
26475 /// "BNBUSDT"
26476 /// ],
26477 /// "type": "string"
26478 /// },
26479 /// "principal": {
26480 /// "examples": [
26481 /// "36.22000000"
26482 /// ],
26483 /// "type": "string"
26484 /// },
26485 /// "type": {
26486 /// "examples": [
26487 /// "ON_BORROW"
26488 /// ],
26489 /// "type": "string"
26490 /// }
26491 /// }
26492 /// }
26493 /// },
26494 /// "total": {
26495 /// "examples": [
26496 /// 1
26497 /// ],
26498 /// "type": "integer",
26499 /// "format": "int32"
26500 /// }
26501 /// }
26502 ///}
26503 /// ```
26504 /// </details>
26505 #[derive(Clone, Debug, Deserialize, Serialize)]
26506 pub struct MarginInterestHistoryResponse {
26507 pub rows: Vec<MarginInterestHistoryResponseRowsItem>,
26508 pub total: i32,
26509 }
26510 impl From<&MarginInterestHistoryResponse> for MarginInterestHistoryResponse {
26511 fn from(value: &MarginInterestHistoryResponse) -> Self {
26512 value.clone()
26513 }
26514 }
26515 ///MarginInterestHistoryResponseRowsItem
26516 ///
26517 /// <details><summary>JSON schema</summary>
26518 ///
26519 /// ```json
26520 ///{
26521 /// "type": "object",
26522 /// "required": [
26523 /// "asset",
26524 /// "interest",
26525 /// "interestAccuredTime",
26526 /// "interestRate",
26527 /// "isolatedSymbol",
26528 /// "principal",
26529 /// "type"
26530 /// ],
26531 /// "properties": {
26532 /// "asset": {
26533 /// "examples": [
26534 /// "BNB"
26535 /// ],
26536 /// "type": "string"
26537 /// },
26538 /// "interest": {
26539 /// "examples": [
26540 /// "0.01866667"
26541 /// ],
26542 /// "type": "string"
26543 /// },
26544 /// "interestAccuredTime": {
26545 /// "examples": [
26546 /// 1566813600
26547 /// ],
26548 /// "type": "integer",
26549 /// "format": "int64"
26550 /// },
26551 /// "interestRate": {
26552 /// "examples": [
26553 /// "0.01600000"
26554 /// ],
26555 /// "type": "string"
26556 /// },
26557 /// "isolatedSymbol": {
26558 /// "examples": [
26559 /// "BNBUSDT"
26560 /// ],
26561 /// "type": "string"
26562 /// },
26563 /// "principal": {
26564 /// "examples": [
26565 /// "36.22000000"
26566 /// ],
26567 /// "type": "string"
26568 /// },
26569 /// "type": {
26570 /// "examples": [
26571 /// "ON_BORROW"
26572 /// ],
26573 /// "type": "string"
26574 /// }
26575 /// }
26576 ///}
26577 /// ```
26578 /// </details>
26579 #[derive(Clone, Debug, Deserialize, Serialize)]
26580 pub struct MarginInterestHistoryResponseRowsItem {
26581 pub asset: String,
26582 pub interest: String,
26583 #[serde(rename = "interestAccuredTime")]
26584 pub interest_accured_time: i64,
26585 #[serde(rename = "interestRate")]
26586 pub interest_rate: String,
26587 #[serde(rename = "isolatedSymbol")]
26588 pub isolated_symbol: String,
26589 pub principal: String,
26590 #[serde(rename = "type")]
26591 pub type_: String,
26592 }
26593 impl From<&MarginInterestHistoryResponseRowsItem>
26594 for MarginInterestHistoryResponseRowsItem {
26595 fn from(value: &MarginInterestHistoryResponseRowsItem) -> Self {
26596 value.clone()
26597 }
26598 }
26599 ///MarginInterestRateHistoryResponseItem
26600 ///
26601 /// <details><summary>JSON schema</summary>
26602 ///
26603 /// ```json
26604 ///{
26605 /// "type": "object",
26606 /// "required": [
26607 /// "asset",
26608 /// "dailyInterestRate",
26609 /// "timestamp",
26610 /// "vipLevel"
26611 /// ],
26612 /// "properties": {
26613 /// "asset": {
26614 /// "examples": [
26615 /// "BTC"
26616 /// ],
26617 /// "type": "string"
26618 /// },
26619 /// "dailyInterestRate": {
26620 /// "examples": [
26621 /// "0.00025000"
26622 /// ],
26623 /// "type": "string"
26624 /// },
26625 /// "timestamp": {
26626 /// "examples": [
26627 /// 1611544731000
26628 /// ],
26629 /// "type": "integer",
26630 /// "format": "int64"
26631 /// },
26632 /// "vipLevel": {
26633 /// "examples": [
26634 /// 1
26635 /// ],
26636 /// "type": "integer",
26637 /// "format": "int32"
26638 /// }
26639 /// }
26640 ///}
26641 /// ```
26642 /// </details>
26643 #[derive(Clone, Debug, Deserialize, Serialize)]
26644 pub struct MarginInterestRateHistoryResponseItem {
26645 pub asset: String,
26646 #[serde(rename = "dailyInterestRate")]
26647 pub daily_interest_rate: String,
26648 pub timestamp: i64,
26649 #[serde(rename = "vipLevel")]
26650 pub vip_level: i32,
26651 }
26652 impl From<&MarginInterestRateHistoryResponseItem>
26653 for MarginInterestRateHistoryResponseItem {
26654 fn from(value: &MarginInterestRateHistoryResponseItem) -> Self {
26655 value.clone()
26656 }
26657 }
26658 ///MarginIsolatedAccountLimitResponse
26659 ///
26660 /// <details><summary>JSON schema</summary>
26661 ///
26662 /// ```json
26663 ///{
26664 /// "type": "object",
26665 /// "required": [
26666 /// "enabledAccount",
26667 /// "maxAccount"
26668 /// ],
26669 /// "properties": {
26670 /// "enabledAccount": {
26671 /// "examples": [
26672 /// 5
26673 /// ],
26674 /// "type": "integer",
26675 /// "format": "int64"
26676 /// },
26677 /// "maxAccount": {
26678 /// "examples": [
26679 /// 20
26680 /// ],
26681 /// "type": "integer",
26682 /// "format": "int64"
26683 /// }
26684 /// }
26685 ///}
26686 /// ```
26687 /// </details>
26688 #[derive(Clone, Debug, Deserialize, Serialize)]
26689 pub struct MarginIsolatedAccountLimitResponse {
26690 #[serde(rename = "enabledAccount")]
26691 pub enabled_account: i64,
26692 #[serde(rename = "maxAccount")]
26693 pub max_account: i64,
26694 }
26695 impl From<&MarginIsolatedAccountLimitResponse>
26696 for MarginIsolatedAccountLimitResponse {
26697 fn from(value: &MarginIsolatedAccountLimitResponse) -> Self {
26698 value.clone()
26699 }
26700 }
26701 ///MarginIsolatedAllPairsResponseItem
26702 ///
26703 /// <details><summary>JSON schema</summary>
26704 ///
26705 /// ```json
26706 ///{
26707 /// "type": "object",
26708 /// "required": [
26709 /// "base",
26710 /// "isBuyAllowed",
26711 /// "isMarginTrade",
26712 /// "isSellAllowed",
26713 /// "quote",
26714 /// "symbol"
26715 /// ],
26716 /// "properties": {
26717 /// "base": {
26718 /// "examples": [
26719 /// "BTC"
26720 /// ],
26721 /// "type": "string"
26722 /// },
26723 /// "isBuyAllowed": {
26724 /// "type": "boolean"
26725 /// },
26726 /// "isMarginTrade": {
26727 /// "type": "boolean"
26728 /// },
26729 /// "isSellAllowed": {
26730 /// "type": "boolean"
26731 /// },
26732 /// "quote": {
26733 /// "examples": [
26734 /// "USDT"
26735 /// ],
26736 /// "type": "string"
26737 /// },
26738 /// "symbol": {
26739 /// "examples": [
26740 /// "BTCUSDT"
26741 /// ],
26742 /// "type": "string"
26743 /// }
26744 /// }
26745 ///}
26746 /// ```
26747 /// </details>
26748 #[derive(Clone, Debug, Deserialize, Serialize)]
26749 pub struct MarginIsolatedAllPairsResponseItem {
26750 pub base: String,
26751 #[serde(rename = "isBuyAllowed")]
26752 pub is_buy_allowed: bool,
26753 #[serde(rename = "isMarginTrade")]
26754 pub is_margin_trade: bool,
26755 #[serde(rename = "isSellAllowed")]
26756 pub is_sell_allowed: bool,
26757 pub quote: String,
26758 pub symbol: String,
26759 }
26760 impl From<&MarginIsolatedAllPairsResponseItem>
26761 for MarginIsolatedAllPairsResponseItem {
26762 fn from(value: &MarginIsolatedAllPairsResponseItem) -> Self {
26763 value.clone()
26764 }
26765 }
26766 ///MarginIsolatedMarginDataResponseItem
26767 ///
26768 /// <details><summary>JSON schema</summary>
26769 ///
26770 /// ```json
26771 ///{
26772 /// "type": "object",
26773 /// "properties": {
26774 /// "data": {
26775 /// "examples": [
26776 /// [
26777 /// {
26778 /// "borrowLimit": "270",
26779 /// "coin": "BTC",
26780 /// "dailyInterest": "0.00026125"
26781 /// },
26782 /// {
26783 /// "borrowLimit": "2100000",
26784 /// "coin": "USDT",
26785 /// "dailyInterest": "0.000475"
26786 /// }
26787 /// ]
26788 /// ],
26789 /// "type": "array",
26790 /// "items": {
26791 /// "type": "object",
26792 /// "properties": {
26793 /// "borrowLimit": {
26794 /// "type": "string"
26795 /// },
26796 /// "coin": {
26797 /// "type": "string"
26798 /// },
26799 /// "dailyInterest": {
26800 /// "type": "string"
26801 /// }
26802 /// }
26803 /// }
26804 /// },
26805 /// "leverage": {
26806 /// "examples": [
26807 /// "10"
26808 /// ],
26809 /// "type": "string"
26810 /// },
26811 /// "symbol": {
26812 /// "examples": [
26813 /// "BTCUSDT"
26814 /// ],
26815 /// "type": "string"
26816 /// },
26817 /// "vipLevel": {
26818 /// "examples": [
26819 /// 0
26820 /// ],
26821 /// "type": "integer",
26822 /// "format": "int32"
26823 /// }
26824 /// }
26825 ///}
26826 /// ```
26827 /// </details>
26828 #[derive(Clone, Debug, Deserialize, Serialize)]
26829 pub struct MarginIsolatedMarginDataResponseItem {
26830 #[serde(default, skip_serializing_if = "Vec::is_empty")]
26831 pub data: Vec<MarginIsolatedMarginDataResponseItemDataItem>,
26832 #[serde(default, skip_serializing_if = "Option::is_none")]
26833 pub leverage: Option<String>,
26834 #[serde(default, skip_serializing_if = "Option::is_none")]
26835 pub symbol: Option<String>,
26836 #[serde(rename = "vipLevel", default, skip_serializing_if = "Option::is_none")]
26837 pub vip_level: Option<i32>,
26838 }
26839 impl From<&MarginIsolatedMarginDataResponseItem>
26840 for MarginIsolatedMarginDataResponseItem {
26841 fn from(value: &MarginIsolatedMarginDataResponseItem) -> Self {
26842 value.clone()
26843 }
26844 }
26845 ///MarginIsolatedMarginDataResponseItemDataItem
26846 ///
26847 /// <details><summary>JSON schema</summary>
26848 ///
26849 /// ```json
26850 ///{
26851 /// "type": "object",
26852 /// "properties": {
26853 /// "borrowLimit": {
26854 /// "type": "string"
26855 /// },
26856 /// "coin": {
26857 /// "type": "string"
26858 /// },
26859 /// "dailyInterest": {
26860 /// "type": "string"
26861 /// }
26862 /// }
26863 ///}
26864 /// ```
26865 /// </details>
26866 #[derive(Clone, Debug, Deserialize, Serialize)]
26867 pub struct MarginIsolatedMarginDataResponseItemDataItem {
26868 #[serde(
26869 rename = "borrowLimit",
26870 default,
26871 skip_serializing_if = "Option::is_none"
26872 )]
26873 pub borrow_limit: Option<String>,
26874 #[serde(default, skip_serializing_if = "Option::is_none")]
26875 pub coin: Option<String>,
26876 #[serde(
26877 rename = "dailyInterest",
26878 default,
26879 skip_serializing_if = "Option::is_none"
26880 )]
26881 pub daily_interest: Option<String>,
26882 }
26883 impl From<&MarginIsolatedMarginDataResponseItemDataItem>
26884 for MarginIsolatedMarginDataResponseItemDataItem {
26885 fn from(value: &MarginIsolatedMarginDataResponseItemDataItem) -> Self {
26886 value.clone()
26887 }
26888 }
26889 ///MarginIsolatedMarginTierResponseItem
26890 ///
26891 /// <details><summary>JSON schema</summary>
26892 ///
26893 /// ```json
26894 ///{
26895 /// "type": "object",
26896 /// "properties": {
26897 /// "baseAssetMaxBorrowable": {
26898 /// "examples": [
26899 /// "9"
26900 /// ],
26901 /// "type": "string"
26902 /// },
26903 /// "effectiveMultiple": {
26904 /// "examples": [
26905 /// "10"
26906 /// ],
26907 /// "type": "string"
26908 /// },
26909 /// "initialRiskRatio": {
26910 /// "examples": [
26911 /// "1.111"
26912 /// ],
26913 /// "type": "string"
26914 /// },
26915 /// "liquidationRiskRatio": {
26916 /// "examples": [
26917 /// "1.05"
26918 /// ],
26919 /// "type": "string"
26920 /// },
26921 /// "quoteAssetMaxBorrowable": {
26922 /// "examples": [
26923 /// "70000"
26924 /// ],
26925 /// "type": "string"
26926 /// },
26927 /// "symbol": {
26928 /// "examples": [
26929 /// "BTCUSDT"
26930 /// ],
26931 /// "type": "string"
26932 /// },
26933 /// "tier": {
26934 /// "examples": [
26935 /// 1
26936 /// ],
26937 /// "type": "integer",
26938 /// "format": "int32"
26939 /// }
26940 /// }
26941 ///}
26942 /// ```
26943 /// </details>
26944 #[derive(Clone, Debug, Deserialize, Serialize)]
26945 pub struct MarginIsolatedMarginTierResponseItem {
26946 #[serde(
26947 rename = "baseAssetMaxBorrowable",
26948 default,
26949 skip_serializing_if = "Option::is_none"
26950 )]
26951 pub base_asset_max_borrowable: Option<String>,
26952 #[serde(
26953 rename = "effectiveMultiple",
26954 default,
26955 skip_serializing_if = "Option::is_none"
26956 )]
26957 pub effective_multiple: Option<String>,
26958 #[serde(
26959 rename = "initialRiskRatio",
26960 default,
26961 skip_serializing_if = "Option::is_none"
26962 )]
26963 pub initial_risk_ratio: Option<String>,
26964 #[serde(
26965 rename = "liquidationRiskRatio",
26966 default,
26967 skip_serializing_if = "Option::is_none"
26968 )]
26969 pub liquidation_risk_ratio: Option<String>,
26970 #[serde(
26971 rename = "quoteAssetMaxBorrowable",
26972 default,
26973 skip_serializing_if = "Option::is_none"
26974 )]
26975 pub quote_asset_max_borrowable: Option<String>,
26976 #[serde(default, skip_serializing_if = "Option::is_none")]
26977 pub symbol: Option<String>,
26978 #[serde(default, skip_serializing_if = "Option::is_none")]
26979 pub tier: Option<i32>,
26980 }
26981 impl From<&MarginIsolatedMarginTierResponseItem>
26982 for MarginIsolatedMarginTierResponseItem {
26983 fn from(value: &MarginIsolatedMarginTierResponseItem) -> Self {
26984 value.clone()
26985 }
26986 }
26987 ///MarginIsolatedPairResponse
26988 ///
26989 /// <details><summary>JSON schema</summary>
26990 ///
26991 /// ```json
26992 ///{
26993 /// "type": "object",
26994 /// "required": [
26995 /// "base",
26996 /// "isBuyAllowed",
26997 /// "isMarginTrade",
26998 /// "isSellAllowed",
26999 /// "quote",
27000 /// "symbol"
27001 /// ],
27002 /// "properties": {
27003 /// "base": {
27004 /// "examples": [
27005 /// "BTC"
27006 /// ],
27007 /// "type": "string"
27008 /// },
27009 /// "isBuyAllowed": {
27010 /// "type": "boolean"
27011 /// },
27012 /// "isMarginTrade": {
27013 /// "type": "boolean"
27014 /// },
27015 /// "isSellAllowed": {
27016 /// "type": "boolean"
27017 /// },
27018 /// "quote": {
27019 /// "examples": [
27020 /// "USDT"
27021 /// ],
27022 /// "type": "string"
27023 /// },
27024 /// "symbol": {
27025 /// "examples": [
27026 /// "BTCUSDT"
27027 /// ],
27028 /// "type": "string"
27029 /// }
27030 /// }
27031 ///}
27032 /// ```
27033 /// </details>
27034 #[derive(Clone, Debug, Deserialize, Serialize)]
27035 pub struct MarginIsolatedPairResponse {
27036 pub base: String,
27037 #[serde(rename = "isBuyAllowed")]
27038 pub is_buy_allowed: bool,
27039 #[serde(rename = "isMarginTrade")]
27040 pub is_margin_trade: bool,
27041 #[serde(rename = "isSellAllowed")]
27042 pub is_sell_allowed: bool,
27043 pub quote: String,
27044 pub symbol: String,
27045 }
27046 impl From<&MarginIsolatedPairResponse> for MarginIsolatedPairResponse {
27047 fn from(value: &MarginIsolatedPairResponse) -> Self {
27048 value.clone()
27049 }
27050 }
27051 ///MarginLeverageBracketResponseItem
27052 ///
27053 /// <details><summary>JSON schema</summary>
27054 ///
27055 /// ```json
27056 ///{
27057 /// "type": "object",
27058 /// "required": [
27059 /// "assetNames",
27060 /// "brackets",
27061 /// "rank"
27062 /// ],
27063 /// "properties": {
27064 /// "assetNames": {
27065 /// "type": "array",
27066 /// "items": {
27067 /// "examples": [
27068 /// "BTC"
27069 /// ],
27070 /// "type": "string"
27071 /// }
27072 /// },
27073 /// "brackets": {
27074 /// "type": "array",
27075 /// "items": {
27076 /// "type": "object",
27077 /// "properties": {
27078 /// "fastNum": {
27079 /// "examples": [
27080 /// 60000.0
27081 /// ],
27082 /// "type": "number",
27083 /// "format": "double"
27084 /// },
27085 /// "initialMarginRate": {
27086 /// "examples": [
27087 /// 0.1112
27088 /// ],
27089 /// "type": "number",
27090 /// "format": "double"
27091 /// },
27092 /// "leverage": {
27093 /// "examples": [
27094 /// 10
27095 /// ],
27096 /// "type": "integer"
27097 /// },
27098 /// "maintenanceMarginRate": {
27099 /// "examples": [
27100 /// 0.02
27101 /// ],
27102 /// "type": "number",
27103 /// "format": "double"
27104 /// },
27105 /// "maxDebt": {
27106 /// "examples": [
27107 /// 1000000.0
27108 /// ],
27109 /// "type": "number",
27110 /// "format": "double"
27111 /// }
27112 /// }
27113 /// },
27114 /// "required": [
27115 /// "fastNum",
27116 /// "initialMarginRate",
27117 /// "leverage",
27118 /// "maintenanceMarginRate",
27119 /// "maxDebt"
27120 /// ]
27121 /// },
27122 /// "rank": {
27123 /// "examples": [
27124 /// 1
27125 /// ],
27126 /// "type": "integer"
27127 /// }
27128 /// }
27129 ///}
27130 /// ```
27131 /// </details>
27132 #[derive(Clone, Debug, Deserialize, Serialize)]
27133 pub struct MarginLeverageBracketResponseItem {
27134 #[serde(rename = "assetNames")]
27135 pub asset_names: Vec<String>,
27136 pub brackets: Vec<MarginLeverageBracketResponseItemBracketsItem>,
27137 pub rank: i64,
27138 }
27139 impl From<&MarginLeverageBracketResponseItem> for MarginLeverageBracketResponseItem {
27140 fn from(value: &MarginLeverageBracketResponseItem) -> Self {
27141 value.clone()
27142 }
27143 }
27144 ///MarginLeverageBracketResponseItemBracketsItem
27145 ///
27146 /// <details><summary>JSON schema</summary>
27147 ///
27148 /// ```json
27149 ///{
27150 /// "type": "object",
27151 /// "properties": {
27152 /// "fastNum": {
27153 /// "examples": [
27154 /// 60000.0
27155 /// ],
27156 /// "type": "number",
27157 /// "format": "double"
27158 /// },
27159 /// "initialMarginRate": {
27160 /// "examples": [
27161 /// 0.1112
27162 /// ],
27163 /// "type": "number",
27164 /// "format": "double"
27165 /// },
27166 /// "leverage": {
27167 /// "examples": [
27168 /// 10
27169 /// ],
27170 /// "type": "integer"
27171 /// },
27172 /// "maintenanceMarginRate": {
27173 /// "examples": [
27174 /// 0.02
27175 /// ],
27176 /// "type": "number",
27177 /// "format": "double"
27178 /// },
27179 /// "maxDebt": {
27180 /// "examples": [
27181 /// 1000000.0
27182 /// ],
27183 /// "type": "number",
27184 /// "format": "double"
27185 /// }
27186 /// }
27187 ///}
27188 /// ```
27189 /// </details>
27190 #[derive(Clone, Debug, Deserialize, Serialize)]
27191 pub struct MarginLeverageBracketResponseItemBracketsItem {
27192 #[serde(rename = "fastNum", default, skip_serializing_if = "Option::is_none")]
27193 pub fast_num: Option<f64>,
27194 #[serde(
27195 rename = "initialMarginRate",
27196 default,
27197 skip_serializing_if = "Option::is_none"
27198 )]
27199 pub initial_margin_rate: Option<f64>,
27200 #[serde(default, skip_serializing_if = "Option::is_none")]
27201 pub leverage: Option<i64>,
27202 #[serde(
27203 rename = "maintenanceMarginRate",
27204 default,
27205 skip_serializing_if = "Option::is_none"
27206 )]
27207 pub maintenance_margin_rate: Option<f64>,
27208 #[serde(rename = "maxDebt", default, skip_serializing_if = "Option::is_none")]
27209 pub max_debt: Option<f64>,
27210 }
27211 impl From<&MarginLeverageBracketResponseItemBracketsItem>
27212 for MarginLeverageBracketResponseItemBracketsItem {
27213 fn from(value: &MarginLeverageBracketResponseItemBracketsItem) -> Self {
27214 value.clone()
27215 }
27216 }
27217 ///MarginManualLiquidationResponseItem
27218 ///
27219 /// <details><summary>JSON schema</summary>
27220 ///
27221 /// ```json
27222 ///{
27223 /// "type": "object",
27224 /// "required": [
27225 /// "asset",
27226 /// "interest",
27227 /// "liabilityAsset",
27228 /// "liabilityQty",
27229 /// "principal"
27230 /// ],
27231 /// "properties": {
27232 /// "asset": {
27233 /// "examples": [
27234 /// "ETH"
27235 /// ],
27236 /// "type": "string"
27237 /// },
27238 /// "interest": {
27239 /// "examples": [
27240 /// "0.00083334"
27241 /// ],
27242 /// "type": "string"
27243 /// },
27244 /// "liabilityAsset": {
27245 /// "examples": [
27246 /// "USDT"
27247 /// ],
27248 /// "type": "string"
27249 /// },
27250 /// "liabilityQty": {
27251 /// "examples": [
27252 /// 0.3552
27253 /// ],
27254 /// "type": "number",
27255 /// "format": "float"
27256 /// },
27257 /// "principal": {
27258 /// "examples": [
27259 /// "0.001"
27260 /// ],
27261 /// "type": "string"
27262 /// }
27263 /// }
27264 ///}
27265 /// ```
27266 /// </details>
27267 #[derive(Clone, Debug, Deserialize, Serialize)]
27268 pub struct MarginManualLiquidationResponseItem {
27269 pub asset: String,
27270 pub interest: String,
27271 #[serde(rename = "liabilityAsset")]
27272 pub liability_asset: String,
27273 #[serde(rename = "liabilityQty")]
27274 pub liability_qty: f32,
27275 pub principal: String,
27276 }
27277 impl From<&MarginManualLiquidationResponseItem>
27278 for MarginManualLiquidationResponseItem {
27279 fn from(value: &MarginManualLiquidationResponseItem) -> Self {
27280 value.clone()
27281 }
27282 }
27283 ///MarginManualLiquidationType
27284 ///
27285 /// <details><summary>JSON schema</summary>
27286 ///
27287 /// ```json
27288 ///{
27289 /// "type": "string",
27290 /// "enum": [
27291 /// "MARGIN",
27292 /// "ISOLATED"
27293 /// ]
27294 ///}
27295 /// ```
27296 /// </details>
27297 #[derive(
27298 Clone,
27299 Copy,
27300 Debug,
27301 Deserialize,
27302 Eq,
27303 Hash,
27304 Ord,
27305 PartialEq,
27306 PartialOrd,
27307 Serialize
27308 )]
27309 pub enum MarginManualLiquidationType {
27310 #[serde(rename = "MARGIN")]
27311 Margin,
27312 #[serde(rename = "ISOLATED")]
27313 Isolated,
27314 }
27315 impl From<&MarginManualLiquidationType> for MarginManualLiquidationType {
27316 fn from(value: &MarginManualLiquidationType) -> Self {
27317 value.clone()
27318 }
27319 }
27320 impl ToString for MarginManualLiquidationType {
27321 fn to_string(&self) -> String {
27322 match *self {
27323 Self::Margin => "MARGIN".to_string(),
27324 Self::Isolated => "ISOLATED".to_string(),
27325 }
27326 }
27327 }
27328 impl std::str::FromStr for MarginManualLiquidationType {
27329 type Err = self::error::ConversionError;
27330 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
27331 match value {
27332 "MARGIN" => Ok(Self::Margin),
27333 "ISOLATED" => Ok(Self::Isolated),
27334 _ => Err("invalid value".into()),
27335 }
27336 }
27337 }
27338 impl std::convert::TryFrom<&str> for MarginManualLiquidationType {
27339 type Error = self::error::ConversionError;
27340 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
27341 value.parse()
27342 }
27343 }
27344 impl std::convert::TryFrom<&String> for MarginManualLiquidationType {
27345 type Error = self::error::ConversionError;
27346 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
27347 value.parse()
27348 }
27349 }
27350 impl std::convert::TryFrom<String> for MarginManualLiquidationType {
27351 type Error = self::error::ConversionError;
27352 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
27353 value.parse()
27354 }
27355 }
27356 ///MarginMaxBorrowableResponse
27357 ///
27358 /// <details><summary>JSON schema</summary>
27359 ///
27360 /// ```json
27361 ///{
27362 /// "type": "object",
27363 /// "required": [
27364 /// "amount",
27365 /// "borrowLimit"
27366 /// ],
27367 /// "properties": {
27368 /// "amount": {
27369 /// "description": "account's currently max borrowable amount with sufficient system availability",
27370 /// "examples": [
27371 /// "1.69248805"
27372 /// ],
27373 /// "type": "string"
27374 /// },
27375 /// "borrowLimit": {
27376 /// "description": "max borrowable amount limited by the account level",
27377 /// "examples": [
27378 /// "60"
27379 /// ],
27380 /// "type": "string"
27381 /// }
27382 /// }
27383 ///}
27384 /// ```
27385 /// </details>
27386 #[derive(Clone, Debug, Deserialize, Serialize)]
27387 pub struct MarginMaxBorrowableResponse {
27388 ///account's currently max borrowable amount with sufficient system availability
27389 pub amount: String,
27390 ///max borrowable amount limited by the account level
27391 #[serde(rename = "borrowLimit")]
27392 pub borrow_limit: String,
27393 }
27394 impl From<&MarginMaxBorrowableResponse> for MarginMaxBorrowableResponse {
27395 fn from(value: &MarginMaxBorrowableResponse) -> Self {
27396 value.clone()
27397 }
27398 }
27399 ///MarginMaxLeverageResponse
27400 ///
27401 /// <details><summary>JSON schema</summary>
27402 ///
27403 /// ```json
27404 ///{
27405 /// "type": "object",
27406 /// "required": [
27407 /// "success"
27408 /// ],
27409 /// "properties": {
27410 /// "success": {
27411 /// "examples": [
27412 /// true
27413 /// ],
27414 /// "type": "boolean"
27415 /// }
27416 /// }
27417 ///}
27418 /// ```
27419 /// </details>
27420 #[derive(Clone, Debug, Deserialize, Serialize)]
27421 pub struct MarginMaxLeverageResponse {
27422 pub success: bool,
27423 }
27424 impl From<&MarginMaxLeverageResponse> for MarginMaxLeverageResponse {
27425 fn from(value: &MarginMaxLeverageResponse) -> Self {
27426 value.clone()
27427 }
27428 }
27429 ///MarginMaxTransferableResponse
27430 ///
27431 /// <details><summary>JSON schema</summary>
27432 ///
27433 /// ```json
27434 ///{
27435 /// "examples": [
27436 /// {
27437 /// "amount": "1.69248805",
27438 /// "borrowLimit": "60"
27439 /// }
27440 /// ],
27441 /// "type": "object",
27442 /// "required": [
27443 /// "amount",
27444 /// "borrowLimit"
27445 /// ],
27446 /// "properties": {
27447 /// "amount": {
27448 /// "description": "Account's currently max borrowable amount with sufficient system availability",
27449 /// "type": "string"
27450 /// },
27451 /// "borrowLimit": {
27452 /// "description": "Max borrowable amount limited by the account level",
27453 /// "type": "string"
27454 /// }
27455 /// }
27456 ///}
27457 /// ```
27458 /// </details>
27459 #[derive(Clone, Debug, Deserialize, Serialize)]
27460 pub struct MarginMaxTransferableResponse {
27461 ///Account's currently max borrowable amount with sufficient system availability
27462 pub amount: String,
27463 ///Max borrowable amount limited by the account level
27464 #[serde(rename = "borrowLimit")]
27465 pub borrow_limit: String,
27466 }
27467 impl From<&MarginMaxTransferableResponse> for MarginMaxTransferableResponse {
27468 fn from(value: &MarginMaxTransferableResponse) -> Self {
27469 value.clone()
27470 }
27471 }
27472 ///MarginMyTradesIsIsolated
27473 ///
27474 /// <details><summary>JSON schema</summary>
27475 ///
27476 /// ```json
27477 ///{
27478 /// "type": "string",
27479 /// "enum": [
27480 /// "TRUE",
27481 /// "FALSE"
27482 /// ]
27483 ///}
27484 /// ```
27485 /// </details>
27486 #[derive(
27487 Clone,
27488 Copy,
27489 Debug,
27490 Deserialize,
27491 Eq,
27492 Hash,
27493 Ord,
27494 PartialEq,
27495 PartialOrd,
27496 Serialize
27497 )]
27498 pub enum MarginMyTradesIsIsolated {
27499 #[serde(rename = "TRUE")]
27500 True,
27501 #[serde(rename = "FALSE")]
27502 False,
27503 }
27504 impl From<&MarginMyTradesIsIsolated> for MarginMyTradesIsIsolated {
27505 fn from(value: &MarginMyTradesIsIsolated) -> Self {
27506 value.clone()
27507 }
27508 }
27509 impl ToString for MarginMyTradesIsIsolated {
27510 fn to_string(&self) -> String {
27511 match *self {
27512 Self::True => "TRUE".to_string(),
27513 Self::False => "FALSE".to_string(),
27514 }
27515 }
27516 }
27517 impl std::str::FromStr for MarginMyTradesIsIsolated {
27518 type Err = self::error::ConversionError;
27519 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
27520 match value {
27521 "TRUE" => Ok(Self::True),
27522 "FALSE" => Ok(Self::False),
27523 _ => Err("invalid value".into()),
27524 }
27525 }
27526 }
27527 impl std::convert::TryFrom<&str> for MarginMyTradesIsIsolated {
27528 type Error = self::error::ConversionError;
27529 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
27530 value.parse()
27531 }
27532 }
27533 impl std::convert::TryFrom<&String> for MarginMyTradesIsIsolated {
27534 type Error = self::error::ConversionError;
27535 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
27536 value.parse()
27537 }
27538 }
27539 impl std::convert::TryFrom<String> for MarginMyTradesIsIsolated {
27540 type Error = self::error::ConversionError;
27541 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
27542 value.parse()
27543 }
27544 }
27545 ///MarginNextHourlyInterestRateIsIsolated
27546 ///
27547 /// <details><summary>JSON schema</summary>
27548 ///
27549 /// ```json
27550 ///{
27551 /// "examples": [
27552 /// "TRUE"
27553 /// ],
27554 /// "type": "string",
27555 /// "enum": [
27556 /// "TRUE",
27557 /// "FALSE"
27558 /// ]
27559 ///}
27560 /// ```
27561 /// </details>
27562 #[derive(
27563 Clone,
27564 Copy,
27565 Debug,
27566 Deserialize,
27567 Eq,
27568 Hash,
27569 Ord,
27570 PartialEq,
27571 PartialOrd,
27572 Serialize
27573 )]
27574 pub enum MarginNextHourlyInterestRateIsIsolated {
27575 #[serde(rename = "TRUE")]
27576 True,
27577 #[serde(rename = "FALSE")]
27578 False,
27579 }
27580 impl From<&MarginNextHourlyInterestRateIsIsolated>
27581 for MarginNextHourlyInterestRateIsIsolated {
27582 fn from(value: &MarginNextHourlyInterestRateIsIsolated) -> Self {
27583 value.clone()
27584 }
27585 }
27586 impl ToString for MarginNextHourlyInterestRateIsIsolated {
27587 fn to_string(&self) -> String {
27588 match *self {
27589 Self::True => "TRUE".to_string(),
27590 Self::False => "FALSE".to_string(),
27591 }
27592 }
27593 }
27594 impl std::str::FromStr for MarginNextHourlyInterestRateIsIsolated {
27595 type Err = self::error::ConversionError;
27596 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
27597 match value {
27598 "TRUE" => Ok(Self::True),
27599 "FALSE" => Ok(Self::False),
27600 _ => Err("invalid value".into()),
27601 }
27602 }
27603 }
27604 impl std::convert::TryFrom<&str> for MarginNextHourlyInterestRateIsIsolated {
27605 type Error = self::error::ConversionError;
27606 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
27607 value.parse()
27608 }
27609 }
27610 impl std::convert::TryFrom<&String> for MarginNextHourlyInterestRateIsIsolated {
27611 type Error = self::error::ConversionError;
27612 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
27613 value.parse()
27614 }
27615 }
27616 impl std::convert::TryFrom<String> for MarginNextHourlyInterestRateIsIsolated {
27617 type Error = self::error::ConversionError;
27618 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
27619 value.parse()
27620 }
27621 }
27622 ///MarginNextHourlyInterestRateResponseItem
27623 ///
27624 /// <details><summary>JSON schema</summary>
27625 ///
27626 /// ```json
27627 ///{
27628 /// "type": "object",
27629 /// "required": [
27630 /// "asset",
27631 /// "nextHourlyInterestRate"
27632 /// ],
27633 /// "properties": {
27634 /// "asset": {
27635 /// "examples": [
27636 /// "BTC"
27637 /// ],
27638 /// "type": "string"
27639 /// },
27640 /// "nextHourlyInterestRate": {
27641 /// "examples": [
27642 /// "0.00000571"
27643 /// ],
27644 /// "type": "string"
27645 /// }
27646 /// }
27647 ///}
27648 /// ```
27649 /// </details>
27650 #[derive(Clone, Debug, Deserialize, Serialize)]
27651 pub struct MarginNextHourlyInterestRateResponseItem {
27652 pub asset: String,
27653 #[serde(rename = "nextHourlyInterestRate")]
27654 pub next_hourly_interest_rate: String,
27655 }
27656 impl From<&MarginNextHourlyInterestRateResponseItem>
27657 for MarginNextHourlyInterestRateResponseItem {
27658 fn from(value: &MarginNextHourlyInterestRateResponseItem) -> Self {
27659 value.clone()
27660 }
27661 }
27662 ///MarginOcoOrder
27663 ///
27664 /// <details><summary>JSON schema</summary>
27665 ///
27666 /// ```json
27667 ///{
27668 /// "type": "object",
27669 /// "required": [
27670 /// "contingencyType",
27671 /// "isIsolated",
27672 /// "listClientOrderId",
27673 /// "listOrderStatus",
27674 /// "listStatusType",
27675 /// "orderListId",
27676 /// "orderReports",
27677 /// "orders",
27678 /// "symbol",
27679 /// "transactionTime"
27680 /// ],
27681 /// "properties": {
27682 /// "contingencyType": {
27683 /// "examples": [
27684 /// "OCO"
27685 /// ],
27686 /// "type": "string"
27687 /// },
27688 /// "isIsolated": {
27689 /// "examples": [
27690 /// false
27691 /// ],
27692 /// "type": "boolean"
27693 /// },
27694 /// "listClientOrderId": {
27695 /// "examples": [
27696 /// "C3wyj4WVEktd7u9aVBRXcN"
27697 /// ],
27698 /// "type": "string"
27699 /// },
27700 /// "listOrderStatus": {
27701 /// "examples": [
27702 /// "ALL_DONE"
27703 /// ],
27704 /// "type": "string"
27705 /// },
27706 /// "listStatusType": {
27707 /// "examples": [
27708 /// "ALL_DONE"
27709 /// ],
27710 /// "type": "string"
27711 /// },
27712 /// "orderListId": {
27713 /// "examples": [
27714 /// 0
27715 /// ],
27716 /// "type": "integer",
27717 /// "format": "int64"
27718 /// },
27719 /// "orderReports": {
27720 /// "type": "array",
27721 /// "items": {
27722 /// "examples": [
27723 /// [
27724 /// {
27725 /// "clientOrderId": "unfWT8ig8i0uj6lPuYLez6",
27726 /// "cummulativeQuoteQty": "0.00000000",
27727 /// "executedQty": "0.00000000",
27728 /// "orderId": 2,
27729 /// "orderListId": 0,
27730 /// "origClientOrderId": "pO9ufTiFGg3nw2fOdgeOXa",
27731 /// "origQty": "10.00000000",
27732 /// "price": "1.00000000",
27733 /// "side": "SELL",
27734 /// "status": "CANCELED",
27735 /// "stopPrice": "1.00000000",
27736 /// "symbol": "BNBUSDT",
27737 /// "timeInForce": "GTC",
27738 /// "type": "STOP_LOSS_LIMIT"
27739 /// },
27740 /// {
27741 /// "clientOrderId": "unfWT8ig8i0uj6lPuYLez6",
27742 /// "cummulativeQuoteQty": "0.00000000",
27743 /// "executedQty": "0.00000000",
27744 /// "orderId": 3,
27745 /// "orderListId": 0,
27746 /// "origClientOrderId": "TXOvglzXuaubXAaENpaRCB",
27747 /// "origQty": "10.00000000",
27748 /// "price": "3.00000000",
27749 /// "side": "SELL",
27750 /// "status": "CANCELED",
27751 /// "symbol": "BNBUSDT",
27752 /// "timeInForce": "GTC",
27753 /// "type": "LIMIT_MAKER"
27754 /// }
27755 /// ]
27756 /// ],
27757 /// "type": "object",
27758 /// "required": [
27759 /// "clientOrderId",
27760 /// "cummulativeQuoteQty",
27761 /// "executedQty",
27762 /// "orderId",
27763 /// "orderListId",
27764 /// "origClientOrderId",
27765 /// "origQty",
27766 /// "price",
27767 /// "side",
27768 /// "status",
27769 /// "stopPrice",
27770 /// "symbol",
27771 /// "timeInForce",
27772 /// "type"
27773 /// ],
27774 /// "properties": {
27775 /// "clientOrderId": {
27776 /// "type": "string"
27777 /// },
27778 /// "cummulativeQuoteQty": {
27779 /// "type": "string"
27780 /// },
27781 /// "executedQty": {
27782 /// "type": "string"
27783 /// },
27784 /// "orderId": {
27785 /// "type": "integer",
27786 /// "format": "int64"
27787 /// },
27788 /// "orderListId": {
27789 /// "type": "integer",
27790 /// "format": "int64"
27791 /// },
27792 /// "origClientOrderId": {
27793 /// "type": "string"
27794 /// },
27795 /// "origQty": {
27796 /// "type": "string"
27797 /// },
27798 /// "price": {
27799 /// "type": "string"
27800 /// },
27801 /// "side": {
27802 /// "type": "string"
27803 /// },
27804 /// "status": {
27805 /// "type": "string"
27806 /// },
27807 /// "stopPrice": {
27808 /// "type": "string"
27809 /// },
27810 /// "symbol": {
27811 /// "type": "string"
27812 /// },
27813 /// "timeInForce": {
27814 /// "type": "string"
27815 /// },
27816 /// "type": {
27817 /// "type": "string"
27818 /// }
27819 /// }
27820 /// }
27821 /// },
27822 /// "orders": {
27823 /// "type": "array",
27824 /// "items": {
27825 /// "examples": [
27826 /// [
27827 /// {
27828 /// "clientOrderId": "pO9ufTiFGg3nw2fOdgeOXa",
27829 /// "orderId": 2,
27830 /// "symbol": "BNBUSDT"
27831 /// },
27832 /// {
27833 /// "clientOrderId": "TXOvglzXuaubXAaENpaRCB",
27834 /// "orderId": 3,
27835 /// "symbol": "BNBUSDT"
27836 /// }
27837 /// ]
27838 /// ],
27839 /// "type": "object",
27840 /// "required": [
27841 /// "clientOrderId",
27842 /// "orderId",
27843 /// "symbol"
27844 /// ],
27845 /// "properties": {
27846 /// "clientOrderId": {
27847 /// "type": "string"
27848 /// },
27849 /// "orderId": {
27850 /// "type": "integer",
27851 /// "format": "int64"
27852 /// },
27853 /// "symbol": {
27854 /// "type": "string"
27855 /// }
27856 /// }
27857 /// }
27858 /// },
27859 /// "symbol": {
27860 /// "examples": [
27861 /// "BNBUSDT"
27862 /// ],
27863 /// "type": "string"
27864 /// },
27865 /// "transactionTime": {
27866 /// "examples": [
27867 /// 1574040868128
27868 /// ],
27869 /// "type": "integer",
27870 /// "format": "int64"
27871 /// }
27872 /// }
27873 ///}
27874 /// ```
27875 /// </details>
27876 #[derive(Clone, Debug, Deserialize, Serialize)]
27877 pub struct MarginOcoOrder {
27878 #[serde(rename = "contingencyType")]
27879 pub contingency_type: String,
27880 #[serde(rename = "isIsolated")]
27881 pub is_isolated: bool,
27882 #[serde(rename = "listClientOrderId")]
27883 pub list_client_order_id: String,
27884 #[serde(rename = "listOrderStatus")]
27885 pub list_order_status: String,
27886 #[serde(rename = "listStatusType")]
27887 pub list_status_type: String,
27888 #[serde(rename = "orderListId")]
27889 pub order_list_id: i64,
27890 #[serde(rename = "orderReports")]
27891 pub order_reports: Vec<MarginOcoOrderOrderReportsItem>,
27892 pub orders: Vec<MarginOcoOrderOrdersItem>,
27893 pub symbol: String,
27894 #[serde(rename = "transactionTime")]
27895 pub transaction_time: i64,
27896 }
27897 impl From<&MarginOcoOrder> for MarginOcoOrder {
27898 fn from(value: &MarginOcoOrder) -> Self {
27899 value.clone()
27900 }
27901 }
27902 ///MarginOcoOrderOrderReportsItem
27903 ///
27904 /// <details><summary>JSON schema</summary>
27905 ///
27906 /// ```json
27907 ///{
27908 /// "examples": [
27909 /// [
27910 /// {
27911 /// "clientOrderId": "unfWT8ig8i0uj6lPuYLez6",
27912 /// "cummulativeQuoteQty": "0.00000000",
27913 /// "executedQty": "0.00000000",
27914 /// "orderId": 2,
27915 /// "orderListId": 0,
27916 /// "origClientOrderId": "pO9ufTiFGg3nw2fOdgeOXa",
27917 /// "origQty": "10.00000000",
27918 /// "price": "1.00000000",
27919 /// "side": "SELL",
27920 /// "status": "CANCELED",
27921 /// "stopPrice": "1.00000000",
27922 /// "symbol": "BNBUSDT",
27923 /// "timeInForce": "GTC",
27924 /// "type": "STOP_LOSS_LIMIT"
27925 /// },
27926 /// {
27927 /// "clientOrderId": "unfWT8ig8i0uj6lPuYLez6",
27928 /// "cummulativeQuoteQty": "0.00000000",
27929 /// "executedQty": "0.00000000",
27930 /// "orderId": 3,
27931 /// "orderListId": 0,
27932 /// "origClientOrderId": "TXOvglzXuaubXAaENpaRCB",
27933 /// "origQty": "10.00000000",
27934 /// "price": "3.00000000",
27935 /// "side": "SELL",
27936 /// "status": "CANCELED",
27937 /// "symbol": "BNBUSDT",
27938 /// "timeInForce": "GTC",
27939 /// "type": "LIMIT_MAKER"
27940 /// }
27941 /// ]
27942 /// ],
27943 /// "type": "object",
27944 /// "required": [
27945 /// "clientOrderId",
27946 /// "cummulativeQuoteQty",
27947 /// "executedQty",
27948 /// "orderId",
27949 /// "orderListId",
27950 /// "origClientOrderId",
27951 /// "origQty",
27952 /// "price",
27953 /// "side",
27954 /// "status",
27955 /// "stopPrice",
27956 /// "symbol",
27957 /// "timeInForce",
27958 /// "type"
27959 /// ],
27960 /// "properties": {
27961 /// "clientOrderId": {
27962 /// "type": "string"
27963 /// },
27964 /// "cummulativeQuoteQty": {
27965 /// "type": "string"
27966 /// },
27967 /// "executedQty": {
27968 /// "type": "string"
27969 /// },
27970 /// "orderId": {
27971 /// "type": "integer",
27972 /// "format": "int64"
27973 /// },
27974 /// "orderListId": {
27975 /// "type": "integer",
27976 /// "format": "int64"
27977 /// },
27978 /// "origClientOrderId": {
27979 /// "type": "string"
27980 /// },
27981 /// "origQty": {
27982 /// "type": "string"
27983 /// },
27984 /// "price": {
27985 /// "type": "string"
27986 /// },
27987 /// "side": {
27988 /// "type": "string"
27989 /// },
27990 /// "status": {
27991 /// "type": "string"
27992 /// },
27993 /// "stopPrice": {
27994 /// "type": "string"
27995 /// },
27996 /// "symbol": {
27997 /// "type": "string"
27998 /// },
27999 /// "timeInForce": {
28000 /// "type": "string"
28001 /// },
28002 /// "type": {
28003 /// "type": "string"
28004 /// }
28005 /// }
28006 ///}
28007 /// ```
28008 /// </details>
28009 #[derive(Clone, Debug, Deserialize, Serialize)]
28010 pub struct MarginOcoOrderOrderReportsItem {
28011 #[serde(rename = "clientOrderId")]
28012 pub client_order_id: String,
28013 #[serde(rename = "cummulativeQuoteQty")]
28014 pub cummulative_quote_qty: String,
28015 #[serde(rename = "executedQty")]
28016 pub executed_qty: String,
28017 #[serde(rename = "orderId")]
28018 pub order_id: i64,
28019 #[serde(rename = "orderListId")]
28020 pub order_list_id: i64,
28021 #[serde(rename = "origClientOrderId")]
28022 pub orig_client_order_id: String,
28023 #[serde(rename = "origQty")]
28024 pub orig_qty: String,
28025 pub price: String,
28026 pub side: String,
28027 pub status: String,
28028 #[serde(rename = "stopPrice")]
28029 pub stop_price: String,
28030 pub symbol: String,
28031 #[serde(rename = "timeInForce")]
28032 pub time_in_force: String,
28033 #[serde(rename = "type")]
28034 pub type_: String,
28035 }
28036 impl From<&MarginOcoOrderOrderReportsItem> for MarginOcoOrderOrderReportsItem {
28037 fn from(value: &MarginOcoOrderOrderReportsItem) -> Self {
28038 value.clone()
28039 }
28040 }
28041 ///MarginOcoOrderOrdersItem
28042 ///
28043 /// <details><summary>JSON schema</summary>
28044 ///
28045 /// ```json
28046 ///{
28047 /// "examples": [
28048 /// [
28049 /// {
28050 /// "clientOrderId": "pO9ufTiFGg3nw2fOdgeOXa",
28051 /// "orderId": 2,
28052 /// "symbol": "BNBUSDT"
28053 /// },
28054 /// {
28055 /// "clientOrderId": "TXOvglzXuaubXAaENpaRCB",
28056 /// "orderId": 3,
28057 /// "symbol": "BNBUSDT"
28058 /// }
28059 /// ]
28060 /// ],
28061 /// "type": "object",
28062 /// "required": [
28063 /// "clientOrderId",
28064 /// "orderId",
28065 /// "symbol"
28066 /// ],
28067 /// "properties": {
28068 /// "clientOrderId": {
28069 /// "type": "string"
28070 /// },
28071 /// "orderId": {
28072 /// "type": "integer",
28073 /// "format": "int64"
28074 /// },
28075 /// "symbol": {
28076 /// "type": "string"
28077 /// }
28078 /// }
28079 ///}
28080 /// ```
28081 /// </details>
28082 #[derive(Clone, Debug, Deserialize, Serialize)]
28083 pub struct MarginOcoOrderOrdersItem {
28084 #[serde(rename = "clientOrderId")]
28085 pub client_order_id: String,
28086 #[serde(rename = "orderId")]
28087 pub order_id: i64,
28088 pub symbol: String,
28089 }
28090 impl From<&MarginOcoOrderOrdersItem> for MarginOcoOrderOrdersItem {
28091 fn from(value: &MarginOcoOrderOrdersItem) -> Self {
28092 value.clone()
28093 }
28094 }
28095 ///MarginOpenOrderListIsIsolated
28096 ///
28097 /// <details><summary>JSON schema</summary>
28098 ///
28099 /// ```json
28100 ///{
28101 /// "type": "string",
28102 /// "enum": [
28103 /// "TRUE",
28104 /// "FALSE"
28105 /// ]
28106 ///}
28107 /// ```
28108 /// </details>
28109 #[derive(
28110 Clone,
28111 Copy,
28112 Debug,
28113 Deserialize,
28114 Eq,
28115 Hash,
28116 Ord,
28117 PartialEq,
28118 PartialOrd,
28119 Serialize
28120 )]
28121 pub enum MarginOpenOrderListIsIsolated {
28122 #[serde(rename = "TRUE")]
28123 True,
28124 #[serde(rename = "FALSE")]
28125 False,
28126 }
28127 impl From<&MarginOpenOrderListIsIsolated> for MarginOpenOrderListIsIsolated {
28128 fn from(value: &MarginOpenOrderListIsIsolated) -> Self {
28129 value.clone()
28130 }
28131 }
28132 impl ToString for MarginOpenOrderListIsIsolated {
28133 fn to_string(&self) -> String {
28134 match *self {
28135 Self::True => "TRUE".to_string(),
28136 Self::False => "FALSE".to_string(),
28137 }
28138 }
28139 }
28140 impl std::str::FromStr for MarginOpenOrderListIsIsolated {
28141 type Err = self::error::ConversionError;
28142 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
28143 match value {
28144 "TRUE" => Ok(Self::True),
28145 "FALSE" => Ok(Self::False),
28146 _ => Err("invalid value".into()),
28147 }
28148 }
28149 }
28150 impl std::convert::TryFrom<&str> for MarginOpenOrderListIsIsolated {
28151 type Error = self::error::ConversionError;
28152 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
28153 value.parse()
28154 }
28155 }
28156 impl std::convert::TryFrom<&String> for MarginOpenOrderListIsIsolated {
28157 type Error = self::error::ConversionError;
28158 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
28159 value.parse()
28160 }
28161 }
28162 impl std::convert::TryFrom<String> for MarginOpenOrderListIsIsolated {
28163 type Error = self::error::ConversionError;
28164 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
28165 value.parse()
28166 }
28167 }
28168 ///MarginOpenOrderListResponseItem
28169 ///
28170 /// <details><summary>JSON schema</summary>
28171 ///
28172 /// ```json
28173 ///{
28174 /// "type": "object",
28175 /// "required": [
28176 /// "contingencyType",
28177 /// "isIsolated",
28178 /// "listClientOrderId",
28179 /// "listOrderStatus",
28180 /// "listStatusType",
28181 /// "orderListId",
28182 /// "orders",
28183 /// "symbol",
28184 /// "transactionTime"
28185 /// ],
28186 /// "properties": {
28187 /// "contingencyType": {
28188 /// "examples": [
28189 /// "OCO"
28190 /// ],
28191 /// "type": "string"
28192 /// },
28193 /// "isIsolated": {
28194 /// "examples": [
28195 /// false
28196 /// ],
28197 /// "type": "boolean"
28198 /// },
28199 /// "listClientOrderId": {
28200 /// "examples": [
28201 /// "wuB13fmulKj3YjdqWEcsnp"
28202 /// ],
28203 /// "type": "string"
28204 /// },
28205 /// "listOrderStatus": {
28206 /// "examples": [
28207 /// "EXECUTING"
28208 /// ],
28209 /// "type": "string"
28210 /// },
28211 /// "listStatusType": {
28212 /// "examples": [
28213 /// "EXEC_STARTED"
28214 /// ],
28215 /// "type": "string"
28216 /// },
28217 /// "orderListId": {
28218 /// "examples": [
28219 /// 31
28220 /// ],
28221 /// "type": "integer",
28222 /// "format": "int64"
28223 /// },
28224 /// "orders": {
28225 /// "type": "array",
28226 /// "items": {
28227 /// "examples": [
28228 /// [
28229 /// {
28230 /// "clientOrderId": "r3EH2N76dHfLoSZWIUw1bT",
28231 /// "orderId": 4,
28232 /// "symbol": "LTCBTC"
28233 /// },
28234 /// {
28235 /// "clientOrderId": "Cv1SnyPD3qhqpbjpYEHbd2",
28236 /// "orderId": 5,
28237 /// "symbol": "LTCBTC"
28238 /// }
28239 /// ]
28240 /// ],
28241 /// "type": "object",
28242 /// "required": [
28243 /// "clientOrderId",
28244 /// "orderId",
28245 /// "symbol"
28246 /// ],
28247 /// "properties": {
28248 /// "clientOrderId": {
28249 /// "type": "string"
28250 /// },
28251 /// "orderId": {
28252 /// "type": "integer",
28253 /// "format": "int64"
28254 /// },
28255 /// "symbol": {
28256 /// "type": "string"
28257 /// }
28258 /// }
28259 /// }
28260 /// },
28261 /// "symbol": {
28262 /// "examples": [
28263 /// "LTCBTC"
28264 /// ],
28265 /// "type": "string"
28266 /// },
28267 /// "transactionTime": {
28268 /// "examples": [
28269 /// 1565246080644
28270 /// ],
28271 /// "type": "integer",
28272 /// "format": "int64"
28273 /// }
28274 /// }
28275 ///}
28276 /// ```
28277 /// </details>
28278 #[derive(Clone, Debug, Deserialize, Serialize)]
28279 pub struct MarginOpenOrderListResponseItem {
28280 #[serde(rename = "contingencyType")]
28281 pub contingency_type: String,
28282 #[serde(rename = "isIsolated")]
28283 pub is_isolated: bool,
28284 #[serde(rename = "listClientOrderId")]
28285 pub list_client_order_id: String,
28286 #[serde(rename = "listOrderStatus")]
28287 pub list_order_status: String,
28288 #[serde(rename = "listStatusType")]
28289 pub list_status_type: String,
28290 #[serde(rename = "orderListId")]
28291 pub order_list_id: i64,
28292 pub orders: Vec<MarginOpenOrderListResponseItemOrdersItem>,
28293 pub symbol: String,
28294 #[serde(rename = "transactionTime")]
28295 pub transaction_time: i64,
28296 }
28297 impl From<&MarginOpenOrderListResponseItem> for MarginOpenOrderListResponseItem {
28298 fn from(value: &MarginOpenOrderListResponseItem) -> Self {
28299 value.clone()
28300 }
28301 }
28302 ///MarginOpenOrderListResponseItemOrdersItem
28303 ///
28304 /// <details><summary>JSON schema</summary>
28305 ///
28306 /// ```json
28307 ///{
28308 /// "examples": [
28309 /// [
28310 /// {
28311 /// "clientOrderId": "r3EH2N76dHfLoSZWIUw1bT",
28312 /// "orderId": 4,
28313 /// "symbol": "LTCBTC"
28314 /// },
28315 /// {
28316 /// "clientOrderId": "Cv1SnyPD3qhqpbjpYEHbd2",
28317 /// "orderId": 5,
28318 /// "symbol": "LTCBTC"
28319 /// }
28320 /// ]
28321 /// ],
28322 /// "type": "object",
28323 /// "required": [
28324 /// "clientOrderId",
28325 /// "orderId",
28326 /// "symbol"
28327 /// ],
28328 /// "properties": {
28329 /// "clientOrderId": {
28330 /// "type": "string"
28331 /// },
28332 /// "orderId": {
28333 /// "type": "integer",
28334 /// "format": "int64"
28335 /// },
28336 /// "symbol": {
28337 /// "type": "string"
28338 /// }
28339 /// }
28340 ///}
28341 /// ```
28342 /// </details>
28343 #[derive(Clone, Debug, Deserialize, Serialize)]
28344 pub struct MarginOpenOrderListResponseItemOrdersItem {
28345 #[serde(rename = "clientOrderId")]
28346 pub client_order_id: String,
28347 #[serde(rename = "orderId")]
28348 pub order_id: i64,
28349 pub symbol: String,
28350 }
28351 impl From<&MarginOpenOrderListResponseItemOrdersItem>
28352 for MarginOpenOrderListResponseItemOrdersItem {
28353 fn from(value: &MarginOpenOrderListResponseItemOrdersItem) -> Self {
28354 value.clone()
28355 }
28356 }
28357 ///MarginOpenOrdersIsIsolated
28358 ///
28359 /// <details><summary>JSON schema</summary>
28360 ///
28361 /// ```json
28362 ///{
28363 /// "type": "string",
28364 /// "enum": [
28365 /// "TRUE",
28366 /// "FALSE"
28367 /// ]
28368 ///}
28369 /// ```
28370 /// </details>
28371 #[derive(
28372 Clone,
28373 Copy,
28374 Debug,
28375 Deserialize,
28376 Eq,
28377 Hash,
28378 Ord,
28379 PartialEq,
28380 PartialOrd,
28381 Serialize
28382 )]
28383 pub enum MarginOpenOrdersIsIsolated {
28384 #[serde(rename = "TRUE")]
28385 True,
28386 #[serde(rename = "FALSE")]
28387 False,
28388 }
28389 impl From<&MarginOpenOrdersIsIsolated> for MarginOpenOrdersIsIsolated {
28390 fn from(value: &MarginOpenOrdersIsIsolated) -> Self {
28391 value.clone()
28392 }
28393 }
28394 impl ToString for MarginOpenOrdersIsIsolated {
28395 fn to_string(&self) -> String {
28396 match *self {
28397 Self::True => "TRUE".to_string(),
28398 Self::False => "FALSE".to_string(),
28399 }
28400 }
28401 }
28402 impl std::str::FromStr for MarginOpenOrdersIsIsolated {
28403 type Err = self::error::ConversionError;
28404 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
28405 match value {
28406 "TRUE" => Ok(Self::True),
28407 "FALSE" => Ok(Self::False),
28408 _ => Err("invalid value".into()),
28409 }
28410 }
28411 }
28412 impl std::convert::TryFrom<&str> for MarginOpenOrdersIsIsolated {
28413 type Error = self::error::ConversionError;
28414 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
28415 value.parse()
28416 }
28417 }
28418 impl std::convert::TryFrom<&String> for MarginOpenOrdersIsIsolated {
28419 type Error = self::error::ConversionError;
28420 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
28421 value.parse()
28422 }
28423 }
28424 impl std::convert::TryFrom<String> for MarginOpenOrdersIsIsolated {
28425 type Error = self::error::ConversionError;
28426 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
28427 value.parse()
28428 }
28429 }
28430 ///MarginOrder
28431 ///
28432 /// <details><summary>JSON schema</summary>
28433 ///
28434 /// ```json
28435 ///{
28436 /// "type": "object",
28437 /// "required": [
28438 /// "clientOrderId",
28439 /// "cummulativeQuoteQty",
28440 /// "executedQty",
28441 /// "orderId",
28442 /// "origClientOrderId",
28443 /// "origQty",
28444 /// "price",
28445 /// "side",
28446 /// "status",
28447 /// "symbol",
28448 /// "timeInForce",
28449 /// "type"
28450 /// ],
28451 /// "properties": {
28452 /// "clientOrderId": {
28453 /// "examples": [
28454 /// "6gCrw2kRUAF9CvJDGP16IP"
28455 /// ],
28456 /// "type": "string"
28457 /// },
28458 /// "cummulativeQuoteQty": {
28459 /// "examples": [
28460 /// "8.00000000"
28461 /// ],
28462 /// "type": "string"
28463 /// },
28464 /// "executedQty": {
28465 /// "examples": [
28466 /// "8.00000000"
28467 /// ],
28468 /// "type": "string"
28469 /// },
28470 /// "orderId": {
28471 /// "examples": [
28472 /// 28
28473 /// ],
28474 /// "type": "integer",
28475 /// "format": "int64"
28476 /// },
28477 /// "origClientOrderId": {
28478 /// "examples": [
28479 /// "msXkySR3u5uYwpvRMFsi3u"
28480 /// ],
28481 /// "type": "string"
28482 /// },
28483 /// "origQty": {
28484 /// "examples": [
28485 /// "10.00000000"
28486 /// ],
28487 /// "type": "string"
28488 /// },
28489 /// "price": {
28490 /// "examples": [
28491 /// "1.00000000"
28492 /// ],
28493 /// "type": "string"
28494 /// },
28495 /// "side": {
28496 /// "examples": [
28497 /// "SELL"
28498 /// ],
28499 /// "type": "string"
28500 /// },
28501 /// "status": {
28502 /// "examples": [
28503 /// "CANCELED"
28504 /// ],
28505 /// "type": "string"
28506 /// },
28507 /// "symbol": {
28508 /// "examples": [
28509 /// "LTCBTC"
28510 /// ],
28511 /// "type": "string"
28512 /// },
28513 /// "timeInForce": {
28514 /// "examples": [
28515 /// "GTC"
28516 /// ],
28517 /// "type": "string"
28518 /// },
28519 /// "type": {
28520 /// "examples": [
28521 /// "LIMIT"
28522 /// ],
28523 /// "type": "string"
28524 /// }
28525 /// }
28526 ///}
28527 /// ```
28528 /// </details>
28529 #[derive(Clone, Debug, Deserialize, Serialize)]
28530 pub struct MarginOrder {
28531 #[serde(rename = "clientOrderId")]
28532 pub client_order_id: String,
28533 #[serde(rename = "cummulativeQuoteQty")]
28534 pub cummulative_quote_qty: String,
28535 #[serde(rename = "executedQty")]
28536 pub executed_qty: String,
28537 #[serde(rename = "orderId")]
28538 pub order_id: i64,
28539 #[serde(rename = "origClientOrderId")]
28540 pub orig_client_order_id: String,
28541 #[serde(rename = "origQty")]
28542 pub orig_qty: String,
28543 pub price: String,
28544 pub side: String,
28545 pub status: String,
28546 pub symbol: String,
28547 #[serde(rename = "timeInForce")]
28548 pub time_in_force: String,
28549 #[serde(rename = "type")]
28550 pub type_: String,
28551 }
28552 impl From<&MarginOrder> for MarginOrder {
28553 fn from(value: &MarginOrder) -> Self {
28554 value.clone()
28555 }
28556 }
28557 ///MarginOrderDetail
28558 ///
28559 /// <details><summary>JSON schema</summary>
28560 ///
28561 /// ```json
28562 ///{
28563 /// "type": "object",
28564 /// "required": [
28565 /// "clientOrderId",
28566 /// "cummulativeQuoteQty",
28567 /// "executedQty",
28568 /// "icebergQty",
28569 /// "isIsolated",
28570 /// "isWorking",
28571 /// "orderId",
28572 /// "origQty",
28573 /// "price",
28574 /// "selfTradePreventionMode",
28575 /// "side",
28576 /// "status",
28577 /// "stopPrice",
28578 /// "symbol",
28579 /// "time",
28580 /// "timeInForce",
28581 /// "type",
28582 /// "updateTime"
28583 /// ],
28584 /// "properties": {
28585 /// "clientOrderId": {
28586 /// "examples": [
28587 /// "ZwfQzuDIGpceVhKW5DvCmO"
28588 /// ],
28589 /// "type": "string"
28590 /// },
28591 /// "cummulativeQuoteQty": {
28592 /// "examples": [
28593 /// "0.00000000"
28594 /// ],
28595 /// "type": "string"
28596 /// },
28597 /// "executedQty": {
28598 /// "examples": [
28599 /// "0.00000000"
28600 /// ],
28601 /// "type": "string"
28602 /// },
28603 /// "icebergQty": {
28604 /// "examples": [
28605 /// "0.00000000"
28606 /// ],
28607 /// "type": "string"
28608 /// },
28609 /// "isIsolated": {
28610 /// "type": "boolean"
28611 /// },
28612 /// "isWorking": {
28613 /// "type": "boolean"
28614 /// },
28615 /// "orderId": {
28616 /// "examples": [
28617 /// 213205622
28618 /// ],
28619 /// "type": "integer",
28620 /// "format": "int64"
28621 /// },
28622 /// "origQty": {
28623 /// "examples": [
28624 /// "0.30000000"
28625 /// ],
28626 /// "type": "string"
28627 /// },
28628 /// "price": {
28629 /// "examples": [
28630 /// "0.00493630"
28631 /// ],
28632 /// "type": "string"
28633 /// },
28634 /// "selfTradePreventionMode": {
28635 /// "examples": [
28636 /// "NONE"
28637 /// ],
28638 /// "type": "string"
28639 /// },
28640 /// "side": {
28641 /// "examples": [
28642 /// "SELL"
28643 /// ],
28644 /// "type": "string"
28645 /// },
28646 /// "status": {
28647 /// "examples": [
28648 /// "NEW"
28649 /// ],
28650 /// "type": "string"
28651 /// },
28652 /// "stopPrice": {
28653 /// "examples": [
28654 /// "0.00000000"
28655 /// ],
28656 /// "type": "string"
28657 /// },
28658 /// "symbol": {
28659 /// "examples": [
28660 /// "BNBBTC"
28661 /// ],
28662 /// "type": "string"
28663 /// },
28664 /// "time": {
28665 /// "examples": [
28666 /// 1562133008725
28667 /// ],
28668 /// "type": "integer",
28669 /// "format": "int64"
28670 /// },
28671 /// "timeInForce": {
28672 /// "examples": [
28673 /// "GTC"
28674 /// ],
28675 /// "type": "string"
28676 /// },
28677 /// "type": {
28678 /// "examples": [
28679 /// "LIMIT"
28680 /// ],
28681 /// "type": "string"
28682 /// },
28683 /// "updateTime": {
28684 /// "examples": [
28685 /// 1562133008725
28686 /// ],
28687 /// "type": "integer",
28688 /// "format": "int64"
28689 /// }
28690 /// }
28691 ///}
28692 /// ```
28693 /// </details>
28694 #[derive(Clone, Debug, Deserialize, Serialize)]
28695 pub struct MarginOrderDetail {
28696 #[serde(rename = "clientOrderId")]
28697 pub client_order_id: String,
28698 #[serde(rename = "cummulativeQuoteQty")]
28699 pub cummulative_quote_qty: String,
28700 #[serde(rename = "executedQty")]
28701 pub executed_qty: String,
28702 #[serde(rename = "icebergQty")]
28703 pub iceberg_qty: String,
28704 #[serde(rename = "isIsolated")]
28705 pub is_isolated: bool,
28706 #[serde(rename = "isWorking")]
28707 pub is_working: bool,
28708 #[serde(rename = "orderId")]
28709 pub order_id: i64,
28710 #[serde(rename = "origQty")]
28711 pub orig_qty: String,
28712 pub price: String,
28713 #[serde(rename = "selfTradePreventionMode")]
28714 pub self_trade_prevention_mode: String,
28715 pub side: String,
28716 pub status: String,
28717 #[serde(rename = "stopPrice")]
28718 pub stop_price: String,
28719 pub symbol: String,
28720 pub time: i64,
28721 #[serde(rename = "timeInForce")]
28722 pub time_in_force: String,
28723 #[serde(rename = "type")]
28724 pub type_: String,
28725 #[serde(rename = "updateTime")]
28726 pub update_time: i64,
28727 }
28728 impl From<&MarginOrderDetail> for MarginOrderDetail {
28729 fn from(value: &MarginOrderDetail) -> Self {
28730 value.clone()
28731 }
28732 }
28733 ///MarginOrderIsIsolated
28734 ///
28735 /// <details><summary>JSON schema</summary>
28736 ///
28737 /// ```json
28738 ///{
28739 /// "type": "string",
28740 /// "enum": [
28741 /// "TRUE",
28742 /// "FALSE"
28743 /// ]
28744 ///}
28745 /// ```
28746 /// </details>
28747 #[derive(
28748 Clone,
28749 Copy,
28750 Debug,
28751 Deserialize,
28752 Eq,
28753 Hash,
28754 Ord,
28755 PartialEq,
28756 PartialOrd,
28757 Serialize
28758 )]
28759 pub enum MarginOrderIsIsolated {
28760 #[serde(rename = "TRUE")]
28761 True,
28762 #[serde(rename = "FALSE")]
28763 False,
28764 }
28765 impl From<&MarginOrderIsIsolated> for MarginOrderIsIsolated {
28766 fn from(value: &MarginOrderIsIsolated) -> Self {
28767 value.clone()
28768 }
28769 }
28770 impl ToString for MarginOrderIsIsolated {
28771 fn to_string(&self) -> String {
28772 match *self {
28773 Self::True => "TRUE".to_string(),
28774 Self::False => "FALSE".to_string(),
28775 }
28776 }
28777 }
28778 impl std::str::FromStr for MarginOrderIsIsolated {
28779 type Err = self::error::ConversionError;
28780 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
28781 match value {
28782 "TRUE" => Ok(Self::True),
28783 "FALSE" => Ok(Self::False),
28784 _ => Err("invalid value".into()),
28785 }
28786 }
28787 }
28788 impl std::convert::TryFrom<&str> for MarginOrderIsIsolated {
28789 type Error = self::error::ConversionError;
28790 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
28791 value.parse()
28792 }
28793 }
28794 impl std::convert::TryFrom<&String> for MarginOrderIsIsolated {
28795 type Error = self::error::ConversionError;
28796 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
28797 value.parse()
28798 }
28799 }
28800 impl std::convert::TryFrom<String> for MarginOrderIsIsolated {
28801 type Error = self::error::ConversionError;
28802 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
28803 value.parse()
28804 }
28805 }
28806 ///MarginOrderListIsIsolated
28807 ///
28808 /// <details><summary>JSON schema</summary>
28809 ///
28810 /// ```json
28811 ///{
28812 /// "type": "string",
28813 /// "enum": [
28814 /// "TRUE",
28815 /// "FALSE"
28816 /// ]
28817 ///}
28818 /// ```
28819 /// </details>
28820 #[derive(
28821 Clone,
28822 Copy,
28823 Debug,
28824 Deserialize,
28825 Eq,
28826 Hash,
28827 Ord,
28828 PartialEq,
28829 PartialOrd,
28830 Serialize
28831 )]
28832 pub enum MarginOrderListIsIsolated {
28833 #[serde(rename = "TRUE")]
28834 True,
28835 #[serde(rename = "FALSE")]
28836 False,
28837 }
28838 impl From<&MarginOrderListIsIsolated> for MarginOrderListIsIsolated {
28839 fn from(value: &MarginOrderListIsIsolated) -> Self {
28840 value.clone()
28841 }
28842 }
28843 impl ToString for MarginOrderListIsIsolated {
28844 fn to_string(&self) -> String {
28845 match *self {
28846 Self::True => "TRUE".to_string(),
28847 Self::False => "FALSE".to_string(),
28848 }
28849 }
28850 }
28851 impl std::str::FromStr for MarginOrderListIsIsolated {
28852 type Err = self::error::ConversionError;
28853 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
28854 match value {
28855 "TRUE" => Ok(Self::True),
28856 "FALSE" => Ok(Self::False),
28857 _ => Err("invalid value".into()),
28858 }
28859 }
28860 }
28861 impl std::convert::TryFrom<&str> for MarginOrderListIsIsolated {
28862 type Error = self::error::ConversionError;
28863 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
28864 value.parse()
28865 }
28866 }
28867 impl std::convert::TryFrom<&String> for MarginOrderListIsIsolated {
28868 type Error = self::error::ConversionError;
28869 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
28870 value.parse()
28871 }
28872 }
28873 impl std::convert::TryFrom<String> for MarginOrderListIsIsolated {
28874 type Error = self::error::ConversionError;
28875 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
28876 value.parse()
28877 }
28878 }
28879 ///MarginOrderListResponse
28880 ///
28881 /// <details><summary>JSON schema</summary>
28882 ///
28883 /// ```json
28884 ///{
28885 /// "type": "object",
28886 /// "required": [
28887 /// "contingencyType",
28888 /// "isIsolated",
28889 /// "listClientOrderId",
28890 /// "listOrderStatus",
28891 /// "listStatusType",
28892 /// "orderListId",
28893 /// "orders",
28894 /// "symbol",
28895 /// "transactionTime"
28896 /// ],
28897 /// "properties": {
28898 /// "contingencyType": {
28899 /// "examples": [
28900 /// "OCO"
28901 /// ],
28902 /// "type": "string"
28903 /// },
28904 /// "isIsolated": {
28905 /// "examples": [
28906 /// false
28907 /// ],
28908 /// "type": "boolean"
28909 /// },
28910 /// "listClientOrderId": {
28911 /// "examples": [
28912 /// "h2USkA5YQpaXHPIrkd96xE"
28913 /// ],
28914 /// "type": "string"
28915 /// },
28916 /// "listOrderStatus": {
28917 /// "examples": [
28918 /// "EXECUTING"
28919 /// ],
28920 /// "type": "string"
28921 /// },
28922 /// "listStatusType": {
28923 /// "examples": [
28924 /// "EXEC_STARTED"
28925 /// ],
28926 /// "type": "string"
28927 /// },
28928 /// "orderListId": {
28929 /// "examples": [
28930 /// 27
28931 /// ],
28932 /// "type": "integer",
28933 /// "format": "int64"
28934 /// },
28935 /// "orders": {
28936 /// "type": "array",
28937 /// "items": {
28938 /// "examples": [
28939 /// [
28940 /// {
28941 /// "clientOrderId": "qD1gy3kc3Gx0rihm9Y3xwS",
28942 /// "orderId": 4,
28943 /// "symbol": "LTCBTC"
28944 /// },
28945 /// {
28946 /// "clientOrderId": "ARzZ9I00CPM8i3NhmU9Ega",
28947 /// "orderId": 5,
28948 /// "symbol": "LTCBTC"
28949 /// }
28950 /// ]
28951 /// ],
28952 /// "type": "object",
28953 /// "required": [
28954 /// "clientOrderId",
28955 /// "orderId",
28956 /// "symbol"
28957 /// ],
28958 /// "properties": {
28959 /// "clientOrderId": {
28960 /// "type": "string"
28961 /// },
28962 /// "orderId": {
28963 /// "type": "integer",
28964 /// "format": "int64"
28965 /// },
28966 /// "symbol": {
28967 /// "type": "string"
28968 /// }
28969 /// }
28970 /// }
28971 /// },
28972 /// "symbol": {
28973 /// "examples": [
28974 /// "LTCBTC"
28975 /// ],
28976 /// "type": "string"
28977 /// },
28978 /// "transactionTime": {
28979 /// "examples": [
28980 /// 1565245656253
28981 /// ],
28982 /// "type": "integer",
28983 /// "format": "int64"
28984 /// }
28985 /// }
28986 ///}
28987 /// ```
28988 /// </details>
28989 #[derive(Clone, Debug, Deserialize, Serialize)]
28990 pub struct MarginOrderListResponse {
28991 #[serde(rename = "contingencyType")]
28992 pub contingency_type: String,
28993 #[serde(rename = "isIsolated")]
28994 pub is_isolated: bool,
28995 #[serde(rename = "listClientOrderId")]
28996 pub list_client_order_id: String,
28997 #[serde(rename = "listOrderStatus")]
28998 pub list_order_status: String,
28999 #[serde(rename = "listStatusType")]
29000 pub list_status_type: String,
29001 #[serde(rename = "orderListId")]
29002 pub order_list_id: i64,
29003 pub orders: Vec<MarginOrderListResponseOrdersItem>,
29004 pub symbol: String,
29005 #[serde(rename = "transactionTime")]
29006 pub transaction_time: i64,
29007 }
29008 impl From<&MarginOrderListResponse> for MarginOrderListResponse {
29009 fn from(value: &MarginOrderListResponse) -> Self {
29010 value.clone()
29011 }
29012 }
29013 ///MarginOrderListResponseOrdersItem
29014 ///
29015 /// <details><summary>JSON schema</summary>
29016 ///
29017 /// ```json
29018 ///{
29019 /// "examples": [
29020 /// [
29021 /// {
29022 /// "clientOrderId": "qD1gy3kc3Gx0rihm9Y3xwS",
29023 /// "orderId": 4,
29024 /// "symbol": "LTCBTC"
29025 /// },
29026 /// {
29027 /// "clientOrderId": "ARzZ9I00CPM8i3NhmU9Ega",
29028 /// "orderId": 5,
29029 /// "symbol": "LTCBTC"
29030 /// }
29031 /// ]
29032 /// ],
29033 /// "type": "object",
29034 /// "required": [
29035 /// "clientOrderId",
29036 /// "orderId",
29037 /// "symbol"
29038 /// ],
29039 /// "properties": {
29040 /// "clientOrderId": {
29041 /// "type": "string"
29042 /// },
29043 /// "orderId": {
29044 /// "type": "integer",
29045 /// "format": "int64"
29046 /// },
29047 /// "symbol": {
29048 /// "type": "string"
29049 /// }
29050 /// }
29051 ///}
29052 /// ```
29053 /// </details>
29054 #[derive(Clone, Debug, Deserialize, Serialize)]
29055 pub struct MarginOrderListResponseOrdersItem {
29056 #[serde(rename = "clientOrderId")]
29057 pub client_order_id: String,
29058 #[serde(rename = "orderId")]
29059 pub order_id: i64,
29060 pub symbol: String,
29061 }
29062 impl From<&MarginOrderListResponseOrdersItem> for MarginOrderListResponseOrdersItem {
29063 fn from(value: &MarginOrderListResponseOrdersItem) -> Self {
29064 value.clone()
29065 }
29066 }
29067 ///MarginOrderResponseAck
29068 ///
29069 /// <details><summary>JSON schema</summary>
29070 ///
29071 /// ```json
29072 ///{
29073 /// "type": "object",
29074 /// "required": [
29075 /// "clientOrderId",
29076 /// "isIsolated",
29077 /// "orderId",
29078 /// "symbol",
29079 /// "transactTime"
29080 /// ],
29081 /// "properties": {
29082 /// "clientOrderId": {
29083 /// "examples": [
29084 /// "6gCrw2kRUAF9CvJDGP16IP"
29085 /// ],
29086 /// "type": "string"
29087 /// },
29088 /// "isIsolated": {
29089 /// "type": "boolean"
29090 /// },
29091 /// "orderId": {
29092 /// "examples": [
29093 /// 28
29094 /// ],
29095 /// "type": "integer",
29096 /// "format": "int64"
29097 /// },
29098 /// "symbol": {
29099 /// "examples": [
29100 /// "BTCUSDT"
29101 /// ],
29102 /// "type": "string"
29103 /// },
29104 /// "transactTime": {
29105 /// "examples": [
29106 /// 1507725176595
29107 /// ],
29108 /// "type": "integer",
29109 /// "format": "int64"
29110 /// }
29111 /// }
29112 ///}
29113 /// ```
29114 /// </details>
29115 #[derive(Clone, Debug, Deserialize, Serialize)]
29116 pub struct MarginOrderResponseAck {
29117 #[serde(rename = "clientOrderId")]
29118 pub client_order_id: String,
29119 #[serde(rename = "isIsolated")]
29120 pub is_isolated: bool,
29121 #[serde(rename = "orderId")]
29122 pub order_id: i64,
29123 pub symbol: String,
29124 #[serde(rename = "transactTime")]
29125 pub transact_time: i64,
29126 }
29127 impl From<&MarginOrderResponseAck> for MarginOrderResponseAck {
29128 fn from(value: &MarginOrderResponseAck) -> Self {
29129 value.clone()
29130 }
29131 }
29132 ///MarginOrderResponseFull
29133 ///
29134 /// <details><summary>JSON schema</summary>
29135 ///
29136 /// ```json
29137 ///{
29138 /// "type": "object",
29139 /// "required": [
29140 /// "clientOrderId",
29141 /// "cummulativeQuoteQty",
29142 /// "executedQty",
29143 /// "fills",
29144 /// "isIsolated",
29145 /// "marginBuyBorrowAmount",
29146 /// "marginBuyBorrowAsset",
29147 /// "orderId",
29148 /// "origQty",
29149 /// "price",
29150 /// "side",
29151 /// "status",
29152 /// "symbol",
29153 /// "timeInForce",
29154 /// "transactTime",
29155 /// "type"
29156 /// ],
29157 /// "properties": {
29158 /// "clientOrderId": {
29159 /// "examples": [
29160 /// "6gCrw2kRUAF9CvJDGP16IP"
29161 /// ],
29162 /// "type": "string"
29163 /// },
29164 /// "cummulativeQuoteQty": {
29165 /// "examples": [
29166 /// "10.00000000"
29167 /// ],
29168 /// "type": "string"
29169 /// },
29170 /// "executedQty": {
29171 /// "examples": [
29172 /// "10.00000000"
29173 /// ],
29174 /// "type": "string"
29175 /// },
29176 /// "fills": {
29177 /// "type": "array",
29178 /// "items": {
29179 /// "type": "object",
29180 /// "required": [
29181 /// "commission",
29182 /// "commissionAsset",
29183 /// "price",
29184 /// "qty"
29185 /// ],
29186 /// "properties": {
29187 /// "commission": {
29188 /// "examples": [
29189 /// "4.00000000"
29190 /// ],
29191 /// "type": "string"
29192 /// },
29193 /// "commissionAsset": {
29194 /// "examples": [
29195 /// "USDT"
29196 /// ],
29197 /// "type": "string"
29198 /// },
29199 /// "price": {
29200 /// "examples": [
29201 /// "4000.00000000"
29202 /// ],
29203 /// "type": "string"
29204 /// },
29205 /// "qty": {
29206 /// "examples": [
29207 /// "1.00000000"
29208 /// ],
29209 /// "type": "string"
29210 /// }
29211 /// }
29212 /// }
29213 /// },
29214 /// "isIsolated": {
29215 /// "type": "boolean"
29216 /// },
29217 /// "marginBuyBorrowAmount": {
29218 /// "description": "will not return if no margin trade happens",
29219 /// "examples": [
29220 /// 5
29221 /// ],
29222 /// "type": "number",
29223 /// "format": "double"
29224 /// },
29225 /// "marginBuyBorrowAsset": {
29226 /// "description": "will not return if no margin trade happens",
29227 /// "examples": [
29228 /// "BTC"
29229 /// ],
29230 /// "type": "string"
29231 /// },
29232 /// "orderId": {
29233 /// "examples": [
29234 /// 28
29235 /// ],
29236 /// "type": "integer",
29237 /// "format": "int64"
29238 /// },
29239 /// "origQty": {
29240 /// "examples": [
29241 /// "10.00000000"
29242 /// ],
29243 /// "type": "string"
29244 /// },
29245 /// "price": {
29246 /// "examples": [
29247 /// "1.00000000"
29248 /// ],
29249 /// "type": "string"
29250 /// },
29251 /// "side": {
29252 /// "examples": [
29253 /// "SELL"
29254 /// ],
29255 /// "type": "string"
29256 /// },
29257 /// "status": {
29258 /// "examples": [
29259 /// "FILLED"
29260 /// ],
29261 /// "type": "string"
29262 /// },
29263 /// "symbol": {
29264 /// "examples": [
29265 /// "BTCUSDT"
29266 /// ],
29267 /// "type": "string"
29268 /// },
29269 /// "timeInForce": {
29270 /// "examples": [
29271 /// "GTC"
29272 /// ],
29273 /// "type": "string"
29274 /// },
29275 /// "transactTime": {
29276 /// "examples": [
29277 /// 1507725176595
29278 /// ],
29279 /// "type": "integer",
29280 /// "format": "int64"
29281 /// },
29282 /// "type": {
29283 /// "examples": [
29284 /// "MARKET"
29285 /// ],
29286 /// "type": "string"
29287 /// }
29288 /// }
29289 ///}
29290 /// ```
29291 /// </details>
29292 #[derive(Clone, Debug, Deserialize, Serialize)]
29293 pub struct MarginOrderResponseFull {
29294 #[serde(rename = "clientOrderId")]
29295 pub client_order_id: String,
29296 #[serde(rename = "cummulativeQuoteQty")]
29297 pub cummulative_quote_qty: String,
29298 #[serde(rename = "executedQty")]
29299 pub executed_qty: String,
29300 pub fills: Vec<MarginOrderResponseFullFillsItem>,
29301 #[serde(rename = "isIsolated")]
29302 pub is_isolated: bool,
29303 #[serde(rename = "marginBuyBorrowAmount")]
29304 pub margin_buy_borrow_amount: f64,
29305 ///will not return if no margin trade happens
29306 #[serde(rename = "marginBuyBorrowAsset")]
29307 pub margin_buy_borrow_asset: String,
29308 #[serde(rename = "orderId")]
29309 pub order_id: i64,
29310 #[serde(rename = "origQty")]
29311 pub orig_qty: String,
29312 pub price: String,
29313 pub side: String,
29314 pub status: String,
29315 pub symbol: String,
29316 #[serde(rename = "timeInForce")]
29317 pub time_in_force: String,
29318 #[serde(rename = "transactTime")]
29319 pub transact_time: i64,
29320 #[serde(rename = "type")]
29321 pub type_: String,
29322 }
29323 impl From<&MarginOrderResponseFull> for MarginOrderResponseFull {
29324 fn from(value: &MarginOrderResponseFull) -> Self {
29325 value.clone()
29326 }
29327 }
29328 ///MarginOrderResponseFullFillsItem
29329 ///
29330 /// <details><summary>JSON schema</summary>
29331 ///
29332 /// ```json
29333 ///{
29334 /// "type": "object",
29335 /// "required": [
29336 /// "commission",
29337 /// "commissionAsset",
29338 /// "price",
29339 /// "qty"
29340 /// ],
29341 /// "properties": {
29342 /// "commission": {
29343 /// "examples": [
29344 /// "4.00000000"
29345 /// ],
29346 /// "type": "string"
29347 /// },
29348 /// "commissionAsset": {
29349 /// "examples": [
29350 /// "USDT"
29351 /// ],
29352 /// "type": "string"
29353 /// },
29354 /// "price": {
29355 /// "examples": [
29356 /// "4000.00000000"
29357 /// ],
29358 /// "type": "string"
29359 /// },
29360 /// "qty": {
29361 /// "examples": [
29362 /// "1.00000000"
29363 /// ],
29364 /// "type": "string"
29365 /// }
29366 /// }
29367 ///}
29368 /// ```
29369 /// </details>
29370 #[derive(Clone, Debug, Deserialize, Serialize)]
29371 pub struct MarginOrderResponseFullFillsItem {
29372 pub commission: String,
29373 #[serde(rename = "commissionAsset")]
29374 pub commission_asset: String,
29375 pub price: String,
29376 pub qty: String,
29377 }
29378 impl From<&MarginOrderResponseFullFillsItem> for MarginOrderResponseFullFillsItem {
29379 fn from(value: &MarginOrderResponseFullFillsItem) -> Self {
29380 value.clone()
29381 }
29382 }
29383 ///MarginOrderResponseResult
29384 ///
29385 /// <details><summary>JSON schema</summary>
29386 ///
29387 /// ```json
29388 ///{
29389 /// "type": "object",
29390 /// "required": [
29391 /// "clientOrderId",
29392 /// "cummulativeQuoteQty",
29393 /// "executedQty",
29394 /// "isIsolated",
29395 /// "orderId",
29396 /// "origQty",
29397 /// "price",
29398 /// "side",
29399 /// "status",
29400 /// "symbol",
29401 /// "timeInForce",
29402 /// "transactTime",
29403 /// "type"
29404 /// ],
29405 /// "properties": {
29406 /// "clientOrderId": {
29407 /// "examples": [
29408 /// "6gCrw2kRUAF9CvJDGP16IP"
29409 /// ],
29410 /// "type": "string"
29411 /// },
29412 /// "cummulativeQuoteQty": {
29413 /// "examples": [
29414 /// "10.00000000"
29415 /// ],
29416 /// "type": "string"
29417 /// },
29418 /// "executedQty": {
29419 /// "examples": [
29420 /// "10.00000000"
29421 /// ],
29422 /// "type": "string"
29423 /// },
29424 /// "isIsolated": {
29425 /// "type": "boolean"
29426 /// },
29427 /// "orderId": {
29428 /// "examples": [
29429 /// 28
29430 /// ],
29431 /// "type": "integer",
29432 /// "format": "int64"
29433 /// },
29434 /// "origQty": {
29435 /// "examples": [
29436 /// "10.00000000"
29437 /// ],
29438 /// "type": "string"
29439 /// },
29440 /// "price": {
29441 /// "examples": [
29442 /// "1.00000000"
29443 /// ],
29444 /// "type": "string"
29445 /// },
29446 /// "side": {
29447 /// "examples": [
29448 /// "SELL"
29449 /// ],
29450 /// "type": "string"
29451 /// },
29452 /// "status": {
29453 /// "examples": [
29454 /// "FILLED"
29455 /// ],
29456 /// "type": "string"
29457 /// },
29458 /// "symbol": {
29459 /// "examples": [
29460 /// "BTCUSDT"
29461 /// ],
29462 /// "type": "string"
29463 /// },
29464 /// "timeInForce": {
29465 /// "examples": [
29466 /// "GTC"
29467 /// ],
29468 /// "type": "string"
29469 /// },
29470 /// "transactTime": {
29471 /// "examples": [
29472 /// 1507725176595
29473 /// ],
29474 /// "type": "integer",
29475 /// "format": "int64"
29476 /// },
29477 /// "type": {
29478 /// "examples": [
29479 /// "MARKET"
29480 /// ],
29481 /// "type": "string"
29482 /// }
29483 /// }
29484 ///}
29485 /// ```
29486 /// </details>
29487 #[derive(Clone, Debug, Deserialize, Serialize)]
29488 pub struct MarginOrderResponseResult {
29489 #[serde(rename = "clientOrderId")]
29490 pub client_order_id: String,
29491 #[serde(rename = "cummulativeQuoteQty")]
29492 pub cummulative_quote_qty: String,
29493 #[serde(rename = "executedQty")]
29494 pub executed_qty: String,
29495 #[serde(rename = "isIsolated")]
29496 pub is_isolated: bool,
29497 #[serde(rename = "orderId")]
29498 pub order_id: i64,
29499 #[serde(rename = "origQty")]
29500 pub orig_qty: String,
29501 pub price: String,
29502 pub side: String,
29503 pub status: String,
29504 pub symbol: String,
29505 #[serde(rename = "timeInForce")]
29506 pub time_in_force: String,
29507 #[serde(rename = "transactTime")]
29508 pub transact_time: i64,
29509 #[serde(rename = "type")]
29510 pub type_: String,
29511 }
29512 impl From<&MarginOrderResponseResult> for MarginOrderResponseResult {
29513 fn from(value: &MarginOrderResponseResult) -> Self {
29514 value.clone()
29515 }
29516 }
29517 ///MarginPairResponse
29518 ///
29519 /// <details><summary>JSON schema</summary>
29520 ///
29521 /// ```json
29522 ///{
29523 /// "type": "object",
29524 /// "required": [
29525 /// "base",
29526 /// "id",
29527 /// "isBuyAllowed",
29528 /// "isMarginTrade",
29529 /// "isSellAllowed",
29530 /// "quote",
29531 /// "symbol"
29532 /// ],
29533 /// "properties": {
29534 /// "base": {
29535 /// "examples": [
29536 /// "BTC"
29537 /// ],
29538 /// "type": "string"
29539 /// },
29540 /// "id": {
29541 /// "examples": [
29542 /// 323355778339572400
29543 /// ],
29544 /// "type": "integer",
29545 /// "format": "int64"
29546 /// },
29547 /// "isBuyAllowed": {
29548 /// "type": "boolean"
29549 /// },
29550 /// "isMarginTrade": {
29551 /// "type": "boolean"
29552 /// },
29553 /// "isSellAllowed": {
29554 /// "type": "boolean"
29555 /// },
29556 /// "quote": {
29557 /// "examples": [
29558 /// "USDT"
29559 /// ],
29560 /// "type": "string"
29561 /// },
29562 /// "symbol": {
29563 /// "examples": [
29564 /// "BNBUSDT"
29565 /// ],
29566 /// "type": "string"
29567 /// }
29568 /// }
29569 ///}
29570 /// ```
29571 /// </details>
29572 #[derive(Clone, Debug, Deserialize, Serialize)]
29573 pub struct MarginPairResponse {
29574 pub base: String,
29575 pub id: i64,
29576 #[serde(rename = "isBuyAllowed")]
29577 pub is_buy_allowed: bool,
29578 #[serde(rename = "isMarginTrade")]
29579 pub is_margin_trade: bool,
29580 #[serde(rename = "isSellAllowed")]
29581 pub is_sell_allowed: bool,
29582 pub quote: String,
29583 pub symbol: String,
29584 }
29585 impl From<&MarginPairResponse> for MarginPairResponse {
29586 fn from(value: &MarginPairResponse) -> Self {
29587 value.clone()
29588 }
29589 }
29590 ///MarginPriceIndexResponse
29591 ///
29592 /// <details><summary>JSON schema</summary>
29593 ///
29594 /// ```json
29595 ///{
29596 /// "type": "object",
29597 /// "required": [
29598 /// "calcTime",
29599 /// "price",
29600 /// "symbol"
29601 /// ],
29602 /// "properties": {
29603 /// "calcTime": {
29604 /// "examples": [
29605 /// 1562046418000
29606 /// ],
29607 /// "type": "integer",
29608 /// "format": "int64"
29609 /// },
29610 /// "price": {
29611 /// "examples": [
29612 /// "0.00333930"
29613 /// ],
29614 /// "type": "string"
29615 /// },
29616 /// "symbol": {
29617 /// "examples": [
29618 /// "BNBBTC"
29619 /// ],
29620 /// "type": "string"
29621 /// }
29622 /// }
29623 ///}
29624 /// ```
29625 /// </details>
29626 #[derive(Clone, Debug, Deserialize, Serialize)]
29627 pub struct MarginPriceIndexResponse {
29628 #[serde(rename = "calcTime")]
29629 pub calc_time: i64,
29630 pub price: String,
29631 pub symbol: String,
29632 }
29633 impl From<&MarginPriceIndexResponse> for MarginPriceIndexResponse {
29634 fn from(value: &MarginPriceIndexResponse) -> Self {
29635 value.clone()
29636 }
29637 }
29638 ///MarginQueryAllOrdersIsIsolated
29639 ///
29640 /// <details><summary>JSON schema</summary>
29641 ///
29642 /// ```json
29643 ///{
29644 /// "type": "string",
29645 /// "enum": [
29646 /// "TRUE",
29647 /// "FALSE"
29648 /// ]
29649 ///}
29650 /// ```
29651 /// </details>
29652 #[derive(
29653 Clone,
29654 Copy,
29655 Debug,
29656 Deserialize,
29657 Eq,
29658 Hash,
29659 Ord,
29660 PartialEq,
29661 PartialOrd,
29662 Serialize
29663 )]
29664 pub enum MarginQueryAllOrdersIsIsolated {
29665 #[serde(rename = "TRUE")]
29666 True,
29667 #[serde(rename = "FALSE")]
29668 False,
29669 }
29670 impl From<&MarginQueryAllOrdersIsIsolated> for MarginQueryAllOrdersIsIsolated {
29671 fn from(value: &MarginQueryAllOrdersIsIsolated) -> Self {
29672 value.clone()
29673 }
29674 }
29675 impl ToString for MarginQueryAllOrdersIsIsolated {
29676 fn to_string(&self) -> String {
29677 match *self {
29678 Self::True => "TRUE".to_string(),
29679 Self::False => "FALSE".to_string(),
29680 }
29681 }
29682 }
29683 impl std::str::FromStr for MarginQueryAllOrdersIsIsolated {
29684 type Err = self::error::ConversionError;
29685 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
29686 match value {
29687 "TRUE" => Ok(Self::True),
29688 "FALSE" => Ok(Self::False),
29689 _ => Err("invalid value".into()),
29690 }
29691 }
29692 }
29693 impl std::convert::TryFrom<&str> for MarginQueryAllOrdersIsIsolated {
29694 type Error = self::error::ConversionError;
29695 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
29696 value.parse()
29697 }
29698 }
29699 impl std::convert::TryFrom<&String> for MarginQueryAllOrdersIsIsolated {
29700 type Error = self::error::ConversionError;
29701 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
29702 value.parse()
29703 }
29704 }
29705 impl std::convert::TryFrom<String> for MarginQueryAllOrdersIsIsolated {
29706 type Error = self::error::ConversionError;
29707 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
29708 value.parse()
29709 }
29710 }
29711 ///MarginRateLimitOrderResponseItem
29712 ///
29713 /// <details><summary>JSON schema</summary>
29714 ///
29715 /// ```json
29716 ///{
29717 /// "type": "object",
29718 /// "required": [
29719 /// "count",
29720 /// "interval",
29721 /// "intervalNum",
29722 /// "limit",
29723 /// "rateLimitType"
29724 /// ],
29725 /// "properties": {
29726 /// "count": {
29727 /// "examples": [
29728 /// 0
29729 /// ],
29730 /// "type": "integer",
29731 /// "format": "int64"
29732 /// },
29733 /// "interval": {
29734 /// "examples": [
29735 /// "SECOND"
29736 /// ],
29737 /// "type": "string"
29738 /// },
29739 /// "intervalNum": {
29740 /// "examples": [
29741 /// 10
29742 /// ],
29743 /// "type": "integer",
29744 /// "format": "int64"
29745 /// },
29746 /// "limit": {
29747 /// "examples": [
29748 /// 10000
29749 /// ],
29750 /// "type": "integer",
29751 /// "format": "int64"
29752 /// },
29753 /// "rateLimitType": {
29754 /// "examples": [
29755 /// "ORDERS"
29756 /// ],
29757 /// "type": "string"
29758 /// }
29759 /// }
29760 ///}
29761 /// ```
29762 /// </details>
29763 #[derive(Clone, Debug, Deserialize, Serialize)]
29764 pub struct MarginRateLimitOrderResponseItem {
29765 pub count: i64,
29766 pub interval: String,
29767 #[serde(rename = "intervalNum")]
29768 pub interval_num: i64,
29769 pub limit: i64,
29770 #[serde(rename = "rateLimitType")]
29771 pub rate_limit_type: String,
29772 }
29773 impl From<&MarginRateLimitOrderResponseItem> for MarginRateLimitOrderResponseItem {
29774 fn from(value: &MarginRateLimitOrderResponseItem) -> Self {
29775 value.clone()
29776 }
29777 }
29778 ///MarginRepayIsIsolated
29779 ///
29780 /// <details><summary>JSON schema</summary>
29781 ///
29782 /// ```json
29783 ///{
29784 /// "type": "string",
29785 /// "enum": [
29786 /// "TRUE",
29787 /// "FALSE"
29788 /// ]
29789 ///}
29790 /// ```
29791 /// </details>
29792 #[derive(
29793 Clone,
29794 Copy,
29795 Debug,
29796 Deserialize,
29797 Eq,
29798 Hash,
29799 Ord,
29800 PartialEq,
29801 PartialOrd,
29802 Serialize
29803 )]
29804 pub enum MarginRepayIsIsolated {
29805 #[serde(rename = "TRUE")]
29806 True,
29807 #[serde(rename = "FALSE")]
29808 False,
29809 }
29810 impl From<&MarginRepayIsIsolated> for MarginRepayIsIsolated {
29811 fn from(value: &MarginRepayIsIsolated) -> Self {
29812 value.clone()
29813 }
29814 }
29815 impl ToString for MarginRepayIsIsolated {
29816 fn to_string(&self) -> String {
29817 match *self {
29818 Self::True => "TRUE".to_string(),
29819 Self::False => "FALSE".to_string(),
29820 }
29821 }
29822 }
29823 impl std::str::FromStr for MarginRepayIsIsolated {
29824 type Err = self::error::ConversionError;
29825 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
29826 match value {
29827 "TRUE" => Ok(Self::True),
29828 "FALSE" => Ok(Self::False),
29829 _ => Err("invalid value".into()),
29830 }
29831 }
29832 }
29833 impl std::convert::TryFrom<&str> for MarginRepayIsIsolated {
29834 type Error = self::error::ConversionError;
29835 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
29836 value.parse()
29837 }
29838 }
29839 impl std::convert::TryFrom<&String> for MarginRepayIsIsolated {
29840 type Error = self::error::ConversionError;
29841 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
29842 value.parse()
29843 }
29844 }
29845 impl std::convert::TryFrom<String> for MarginRepayIsIsolated {
29846 type Error = self::error::ConversionError;
29847 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
29848 value.parse()
29849 }
29850 }
29851 ///MarginTrade
29852 ///
29853 /// <details><summary>JSON schema</summary>
29854 ///
29855 /// ```json
29856 ///{
29857 /// "type": "object",
29858 /// "required": [
29859 /// "commission",
29860 /// "commissionAsset",
29861 /// "id",
29862 /// "isBestMatch",
29863 /// "isBuyer",
29864 /// "isIsolated",
29865 /// "isMaker",
29866 /// "orderId",
29867 /// "price",
29868 /// "qty",
29869 /// "symbol",
29870 /// "time"
29871 /// ],
29872 /// "properties": {
29873 /// "commission": {
29874 /// "examples": [
29875 /// "0.00006000"
29876 /// ],
29877 /// "type": "string"
29878 /// },
29879 /// "commissionAsset": {
29880 /// "examples": [
29881 /// "BTC"
29882 /// ],
29883 /// "type": "string"
29884 /// },
29885 /// "id": {
29886 /// "examples": [
29887 /// 28
29888 /// ],
29889 /// "type": "integer",
29890 /// "format": "int64"
29891 /// },
29892 /// "isBestMatch": {
29893 /// "type": "boolean"
29894 /// },
29895 /// "isBuyer": {
29896 /// "type": "boolean"
29897 /// },
29898 /// "isIsolated": {
29899 /// "examples": [
29900 /// false
29901 /// ],
29902 /// "type": "boolean"
29903 /// },
29904 /// "isMaker": {
29905 /// "type": "boolean"
29906 /// },
29907 /// "orderId": {
29908 /// "examples": [
29909 /// 28
29910 /// ],
29911 /// "type": "integer",
29912 /// "format": "int64"
29913 /// },
29914 /// "price": {
29915 /// "examples": [
29916 /// "0.02000000"
29917 /// ],
29918 /// "type": "string"
29919 /// },
29920 /// "qty": {
29921 /// "examples": [
29922 /// "1.02000000"
29923 /// ],
29924 /// "type": "string"
29925 /// },
29926 /// "symbol": {
29927 /// "examples": [
29928 /// "BNBBTC"
29929 /// ],
29930 /// "type": "string"
29931 /// },
29932 /// "time": {
29933 /// "examples": [
29934 /// 1507725176595
29935 /// ],
29936 /// "type": "integer",
29937 /// "format": "int64"
29938 /// }
29939 /// }
29940 ///}
29941 /// ```
29942 /// </details>
29943 #[derive(Clone, Debug, Deserialize, Serialize)]
29944 pub struct MarginTrade {
29945 pub commission: String,
29946 #[serde(rename = "commissionAsset")]
29947 pub commission_asset: String,
29948 pub id: i64,
29949 #[serde(rename = "isBestMatch")]
29950 pub is_best_match: bool,
29951 #[serde(rename = "isBuyer")]
29952 pub is_buyer: bool,
29953 #[serde(rename = "isIsolated")]
29954 pub is_isolated: bool,
29955 #[serde(rename = "isMaker")]
29956 pub is_maker: bool,
29957 #[serde(rename = "orderId")]
29958 pub order_id: i64,
29959 pub price: String,
29960 pub qty: String,
29961 pub symbol: String,
29962 pub time: i64,
29963 }
29964 impl From<&MarginTrade> for MarginTrade {
29965 fn from(value: &MarginTrade) -> Self {
29966 value.clone()
29967 }
29968 }
29969 ///MarginTradeCoeffResponse
29970 ///
29971 /// <details><summary>JSON schema</summary>
29972 ///
29973 /// ```json
29974 ///{
29975 /// "type": "object",
29976 /// "required": [
29977 /// "amount",
29978 /// "borrowLimit"
29979 /// ],
29980 /// "properties": {
29981 /// "forceLiquidationBar": {
29982 /// "description": "Liquidation Margin Ratio",
29983 /// "examples": [
29984 /// "1.1"
29985 /// ],
29986 /// "type": "string"
29987 /// },
29988 /// "marginCallBar": {
29989 /// "description": "Max borrowable amount limited by the account level",
29990 /// "examples": [
29991 /// "1.3"
29992 /// ],
29993 /// "type": "string"
29994 /// },
29995 /// "normalBar": {
29996 /// "description": "Account's currently max borrowable amount with sufficient system availability",
29997 /// "examples": [
29998 /// "1.5"
29999 /// ],
30000 /// "type": "string"
30001 /// }
30002 /// }
30003 ///}
30004 /// ```
30005 /// </details>
30006 #[derive(Clone, Debug, Deserialize, Serialize)]
30007 pub struct MarginTradeCoeffResponse {
30008 pub amount: serde_json::Value,
30009 #[serde(rename = "borrowLimit")]
30010 pub borrow_limit: serde_json::Value,
30011 ///Liquidation Margin Ratio
30012 #[serde(
30013 rename = "forceLiquidationBar",
30014 default,
30015 skip_serializing_if = "Option::is_none"
30016 )]
30017 pub force_liquidation_bar: Option<String>,
30018 ///Max borrowable amount limited by the account level
30019 #[serde(
30020 rename = "marginCallBar",
30021 default,
30022 skip_serializing_if = "Option::is_none"
30023 )]
30024 pub margin_call_bar: Option<String>,
30025 ///Account's currently max borrowable amount with sufficient system availability
30026 #[serde(rename = "normalBar", default, skip_serializing_if = "Option::is_none")]
30027 pub normal_bar: Option<String>,
30028 }
30029 impl From<&MarginTradeCoeffResponse> for MarginTradeCoeffResponse {
30030 fn from(value: &MarginTradeCoeffResponse) -> Self {
30031 value.clone()
30032 }
30033 }
30034 ///MarginTransferDetails
30035 ///
30036 /// <details><summary>JSON schema</summary>
30037 ///
30038 /// ```json
30039 ///{
30040 /// "type": "object",
30041 /// "required": [
30042 /// "rows",
30043 /// "total"
30044 /// ],
30045 /// "properties": {
30046 /// "rows": {
30047 /// "type": "array",
30048 /// "items": {
30049 /// "type": "object",
30050 /// "required": [
30051 /// "amount",
30052 /// "asset",
30053 /// "status",
30054 /// "timestamp",
30055 /// "transFrom",
30056 /// "transTo",
30057 /// "txId"
30058 /// ],
30059 /// "properties": {
30060 /// "amount": {
30061 /// "examples": [
30062 /// "0.10000000"
30063 /// ],
30064 /// "type": "string"
30065 /// },
30066 /// "asset": {
30067 /// "examples": [
30068 /// "BNB"
30069 /// ],
30070 /// "type": "string"
30071 /// },
30072 /// "status": {
30073 /// "examples": [
30074 /// "CONFIRMED"
30075 /// ],
30076 /// "type": "string"
30077 /// },
30078 /// "timestamp": {
30079 /// "examples": [
30080 /// 1566898617000
30081 /// ],
30082 /// "type": "integer",
30083 /// "format": "int64"
30084 /// },
30085 /// "transFrom": {
30086 /// "examples": [
30087 /// "SPOT"
30088 /// ],
30089 /// "type": "string"
30090 /// },
30091 /// "transTo": {
30092 /// "examples": [
30093 /// "ISOLATED_MARGIN"
30094 /// ],
30095 /// "type": "string"
30096 /// },
30097 /// "txId": {
30098 /// "examples": [
30099 /// 5240372201
30100 /// ],
30101 /// "type": "integer",
30102 /// "format": "int64"
30103 /// },
30104 /// "type": {
30105 /// "examples": [
30106 /// "ROLL_IN"
30107 /// ],
30108 /// "type": "string"
30109 /// }
30110 /// }
30111 /// }
30112 /// },
30113 /// "total": {
30114 /// "examples": [
30115 /// 1
30116 /// ],
30117 /// "type": "integer",
30118 /// "format": "int32"
30119 /// }
30120 /// }
30121 ///}
30122 /// ```
30123 /// </details>
30124 #[derive(Clone, Debug, Deserialize, Serialize)]
30125 pub struct MarginTransferDetails {
30126 pub rows: Vec<MarginTransferDetailsRowsItem>,
30127 pub total: i32,
30128 }
30129 impl From<&MarginTransferDetails> for MarginTransferDetails {
30130 fn from(value: &MarginTransferDetails) -> Self {
30131 value.clone()
30132 }
30133 }
30134 ///MarginTransferDetailsRowsItem
30135 ///
30136 /// <details><summary>JSON schema</summary>
30137 ///
30138 /// ```json
30139 ///{
30140 /// "type": "object",
30141 /// "required": [
30142 /// "amount",
30143 /// "asset",
30144 /// "status",
30145 /// "timestamp",
30146 /// "transFrom",
30147 /// "transTo",
30148 /// "txId"
30149 /// ],
30150 /// "properties": {
30151 /// "amount": {
30152 /// "examples": [
30153 /// "0.10000000"
30154 /// ],
30155 /// "type": "string"
30156 /// },
30157 /// "asset": {
30158 /// "examples": [
30159 /// "BNB"
30160 /// ],
30161 /// "type": "string"
30162 /// },
30163 /// "status": {
30164 /// "examples": [
30165 /// "CONFIRMED"
30166 /// ],
30167 /// "type": "string"
30168 /// },
30169 /// "timestamp": {
30170 /// "examples": [
30171 /// 1566898617000
30172 /// ],
30173 /// "type": "integer",
30174 /// "format": "int64"
30175 /// },
30176 /// "transFrom": {
30177 /// "examples": [
30178 /// "SPOT"
30179 /// ],
30180 /// "type": "string"
30181 /// },
30182 /// "transTo": {
30183 /// "examples": [
30184 /// "ISOLATED_MARGIN"
30185 /// ],
30186 /// "type": "string"
30187 /// },
30188 /// "txId": {
30189 /// "examples": [
30190 /// 5240372201
30191 /// ],
30192 /// "type": "integer",
30193 /// "format": "int64"
30194 /// },
30195 /// "type": {
30196 /// "examples": [
30197 /// "ROLL_IN"
30198 /// ],
30199 /// "type": "string"
30200 /// }
30201 /// }
30202 ///}
30203 /// ```
30204 /// </details>
30205 #[derive(Clone, Debug, Deserialize, Serialize)]
30206 pub struct MarginTransferDetailsRowsItem {
30207 pub amount: String,
30208 pub asset: String,
30209 pub status: String,
30210 pub timestamp: i64,
30211 #[serde(rename = "transFrom")]
30212 pub trans_from: String,
30213 #[serde(rename = "transTo")]
30214 pub trans_to: String,
30215 #[serde(rename = "txId")]
30216 pub tx_id: i64,
30217 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
30218 pub type_: Option<String>,
30219 }
30220 impl From<&MarginTransferDetailsRowsItem> for MarginTransferDetailsRowsItem {
30221 fn from(value: &MarginTransferDetailsRowsItem) -> Self {
30222 value.clone()
30223 }
30224 }
30225 ///MiningHashTransferConfigCancelResponse
30226 ///
30227 /// <details><summary>JSON schema</summary>
30228 ///
30229 /// ```json
30230 ///{
30231 /// "type": "object",
30232 /// "required": [
30233 /// "code",
30234 /// "data",
30235 /// "msg"
30236 /// ],
30237 /// "properties": {
30238 /// "code": {
30239 /// "examples": [
30240 /// 0
30241 /// ],
30242 /// "type": "integer",
30243 /// "format": "int64"
30244 /// },
30245 /// "data": {
30246 /// "type": "boolean"
30247 /// },
30248 /// "msg": {
30249 /// "examples": [
30250 /// ""
30251 /// ],
30252 /// "type": "string"
30253 /// }
30254 /// }
30255 ///}
30256 /// ```
30257 /// </details>
30258 #[derive(Clone, Debug, Deserialize, Serialize)]
30259 pub struct MiningHashTransferConfigCancelResponse {
30260 pub code: i64,
30261 pub data: bool,
30262 pub msg: String,
30263 }
30264 impl From<&MiningHashTransferConfigCancelResponse>
30265 for MiningHashTransferConfigCancelResponse {
30266 fn from(value: &MiningHashTransferConfigCancelResponse) -> Self {
30267 value.clone()
30268 }
30269 }
30270 ///MiningHashTransferConfigDetailsListResponse
30271 ///
30272 /// <details><summary>JSON schema</summary>
30273 ///
30274 /// ```json
30275 ///{
30276 /// "type": "object",
30277 /// "required": [
30278 /// "code",
30279 /// "data",
30280 /// "msg"
30281 /// ],
30282 /// "properties": {
30283 /// "code": {
30284 /// "examples": [
30285 /// 0
30286 /// ],
30287 /// "type": "integer",
30288 /// "format": "int64"
30289 /// },
30290 /// "data": {
30291 /// "type": "object",
30292 /// "required": [
30293 /// "configDetails",
30294 /// "pageSize",
30295 /// "totalNum"
30296 /// ],
30297 /// "properties": {
30298 /// "configDetails": {
30299 /// "type": "array",
30300 /// "items": {
30301 /// "type": "object",
30302 /// "required": [
30303 /// "algoName",
30304 /// "configId",
30305 /// "endDay",
30306 /// "hashRate",
30307 /// "poolUsername",
30308 /// "startDay",
30309 /// "status",
30310 /// "toPoolUsername"
30311 /// ],
30312 /// "properties": {
30313 /// "algoName": {
30314 /// "description": "Transfer algorithm",
30315 /// "examples": [
30316 /// "Ethash"
30317 /// ],
30318 /// "type": "string"
30319 /// },
30320 /// "configId": {
30321 /// "description": "Mining ID",
30322 /// "examples": [
30323 /// 168
30324 /// ],
30325 /// "type": "integer",
30326 /// "format": "int64"
30327 /// },
30328 /// "endDay": {
30329 /// "description": "End date",
30330 /// "examples": [
30331 /// 20210405
30332 /// ],
30333 /// "type": "integer",
30334 /// "format": "int64"
30335 /// },
30336 /// "hashRate": {
30337 /// "description": "Transferred Hashrate quantity",
30338 /// "examples": [
30339 /// 5000000
30340 /// ],
30341 /// "type": "integer",
30342 /// "format": "int64"
30343 /// },
30344 /// "poolUsername": {
30345 /// "description": "Transfer out of subaccount",
30346 /// "examples": [
30347 /// "123"
30348 /// ],
30349 /// "type": "string"
30350 /// },
30351 /// "startDay": {
30352 /// "description": "Start date",
30353 /// "examples": [
30354 /// 20201210
30355 /// ],
30356 /// "type": "integer",
30357 /// "format": "int64"
30358 /// },
30359 /// "status": {
30360 /// "description": "0 Processing, 1:Cancelled, 2:Terminated ",
30361 /// "examples": [
30362 /// 1
30363 /// ],
30364 /// "type": "integer",
30365 /// "format": "int32"
30366 /// },
30367 /// "toPoolUsername": {
30368 /// "description": "Transfer into subaccount",
30369 /// "examples": [
30370 /// "user1"
30371 /// ],
30372 /// "type": "string"
30373 /// }
30374 /// }
30375 /// }
30376 /// },
30377 /// "pageSize": {
30378 /// "examples": [
30379 /// 200
30380 /// ],
30381 /// "type": "integer",
30382 /// "format": "int64"
30383 /// },
30384 /// "totalNum": {
30385 /// "examples": [
30386 /// 21
30387 /// ],
30388 /// "type": "integer",
30389 /// "format": "int64"
30390 /// }
30391 /// }
30392 /// },
30393 /// "msg": {
30394 /// "examples": [
30395 /// ""
30396 /// ],
30397 /// "type": "string"
30398 /// }
30399 /// }
30400 ///}
30401 /// ```
30402 /// </details>
30403 #[derive(Clone, Debug, Deserialize, Serialize)]
30404 pub struct MiningHashTransferConfigDetailsListResponse {
30405 pub code: i64,
30406 pub data: MiningHashTransferConfigDetailsListResponseData,
30407 pub msg: String,
30408 }
30409 impl From<&MiningHashTransferConfigDetailsListResponse>
30410 for MiningHashTransferConfigDetailsListResponse {
30411 fn from(value: &MiningHashTransferConfigDetailsListResponse) -> Self {
30412 value.clone()
30413 }
30414 }
30415 ///MiningHashTransferConfigDetailsListResponseData
30416 ///
30417 /// <details><summary>JSON schema</summary>
30418 ///
30419 /// ```json
30420 ///{
30421 /// "type": "object",
30422 /// "required": [
30423 /// "configDetails",
30424 /// "pageSize",
30425 /// "totalNum"
30426 /// ],
30427 /// "properties": {
30428 /// "configDetails": {
30429 /// "type": "array",
30430 /// "items": {
30431 /// "type": "object",
30432 /// "required": [
30433 /// "algoName",
30434 /// "configId",
30435 /// "endDay",
30436 /// "hashRate",
30437 /// "poolUsername",
30438 /// "startDay",
30439 /// "status",
30440 /// "toPoolUsername"
30441 /// ],
30442 /// "properties": {
30443 /// "algoName": {
30444 /// "description": "Transfer algorithm",
30445 /// "examples": [
30446 /// "Ethash"
30447 /// ],
30448 /// "type": "string"
30449 /// },
30450 /// "configId": {
30451 /// "description": "Mining ID",
30452 /// "examples": [
30453 /// 168
30454 /// ],
30455 /// "type": "integer",
30456 /// "format": "int64"
30457 /// },
30458 /// "endDay": {
30459 /// "description": "End date",
30460 /// "examples": [
30461 /// 20210405
30462 /// ],
30463 /// "type": "integer",
30464 /// "format": "int64"
30465 /// },
30466 /// "hashRate": {
30467 /// "description": "Transferred Hashrate quantity",
30468 /// "examples": [
30469 /// 5000000
30470 /// ],
30471 /// "type": "integer",
30472 /// "format": "int64"
30473 /// },
30474 /// "poolUsername": {
30475 /// "description": "Transfer out of subaccount",
30476 /// "examples": [
30477 /// "123"
30478 /// ],
30479 /// "type": "string"
30480 /// },
30481 /// "startDay": {
30482 /// "description": "Start date",
30483 /// "examples": [
30484 /// 20201210
30485 /// ],
30486 /// "type": "integer",
30487 /// "format": "int64"
30488 /// },
30489 /// "status": {
30490 /// "description": "0 Processing, 1:Cancelled, 2:Terminated ",
30491 /// "examples": [
30492 /// 1
30493 /// ],
30494 /// "type": "integer",
30495 /// "format": "int32"
30496 /// },
30497 /// "toPoolUsername": {
30498 /// "description": "Transfer into subaccount",
30499 /// "examples": [
30500 /// "user1"
30501 /// ],
30502 /// "type": "string"
30503 /// }
30504 /// }
30505 /// }
30506 /// },
30507 /// "pageSize": {
30508 /// "examples": [
30509 /// 200
30510 /// ],
30511 /// "type": "integer",
30512 /// "format": "int64"
30513 /// },
30514 /// "totalNum": {
30515 /// "examples": [
30516 /// 21
30517 /// ],
30518 /// "type": "integer",
30519 /// "format": "int64"
30520 /// }
30521 /// }
30522 ///}
30523 /// ```
30524 /// </details>
30525 #[derive(Clone, Debug, Deserialize, Serialize)]
30526 pub struct MiningHashTransferConfigDetailsListResponseData {
30527 #[serde(rename = "configDetails")]
30528 pub config_details: Vec<
30529 MiningHashTransferConfigDetailsListResponseDataConfigDetailsItem,
30530 >,
30531 #[serde(rename = "pageSize")]
30532 pub page_size: i64,
30533 #[serde(rename = "totalNum")]
30534 pub total_num: i64,
30535 }
30536 impl From<&MiningHashTransferConfigDetailsListResponseData>
30537 for MiningHashTransferConfigDetailsListResponseData {
30538 fn from(value: &MiningHashTransferConfigDetailsListResponseData) -> Self {
30539 value.clone()
30540 }
30541 }
30542 ///MiningHashTransferConfigDetailsListResponseDataConfigDetailsItem
30543 ///
30544 /// <details><summary>JSON schema</summary>
30545 ///
30546 /// ```json
30547 ///{
30548 /// "type": "object",
30549 /// "required": [
30550 /// "algoName",
30551 /// "configId",
30552 /// "endDay",
30553 /// "hashRate",
30554 /// "poolUsername",
30555 /// "startDay",
30556 /// "status",
30557 /// "toPoolUsername"
30558 /// ],
30559 /// "properties": {
30560 /// "algoName": {
30561 /// "description": "Transfer algorithm",
30562 /// "examples": [
30563 /// "Ethash"
30564 /// ],
30565 /// "type": "string"
30566 /// },
30567 /// "configId": {
30568 /// "description": "Mining ID",
30569 /// "examples": [
30570 /// 168
30571 /// ],
30572 /// "type": "integer",
30573 /// "format": "int64"
30574 /// },
30575 /// "endDay": {
30576 /// "description": "End date",
30577 /// "examples": [
30578 /// 20210405
30579 /// ],
30580 /// "type": "integer",
30581 /// "format": "int64"
30582 /// },
30583 /// "hashRate": {
30584 /// "description": "Transferred Hashrate quantity",
30585 /// "examples": [
30586 /// 5000000
30587 /// ],
30588 /// "type": "integer",
30589 /// "format": "int64"
30590 /// },
30591 /// "poolUsername": {
30592 /// "description": "Transfer out of subaccount",
30593 /// "examples": [
30594 /// "123"
30595 /// ],
30596 /// "type": "string"
30597 /// },
30598 /// "startDay": {
30599 /// "description": "Start date",
30600 /// "examples": [
30601 /// 20201210
30602 /// ],
30603 /// "type": "integer",
30604 /// "format": "int64"
30605 /// },
30606 /// "status": {
30607 /// "description": "0 Processing, 1:Cancelled, 2:Terminated ",
30608 /// "examples": [
30609 /// 1
30610 /// ],
30611 /// "type": "integer",
30612 /// "format": "int32"
30613 /// },
30614 /// "toPoolUsername": {
30615 /// "description": "Transfer into subaccount",
30616 /// "examples": [
30617 /// "user1"
30618 /// ],
30619 /// "type": "string"
30620 /// }
30621 /// }
30622 ///}
30623 /// ```
30624 /// </details>
30625 #[derive(Clone, Debug, Deserialize, Serialize)]
30626 pub struct MiningHashTransferConfigDetailsListResponseDataConfigDetailsItem {
30627 ///Transfer algorithm
30628 #[serde(rename = "algoName")]
30629 pub algo_name: String,
30630 ///Mining ID
30631 #[serde(rename = "configId")]
30632 pub config_id: i64,
30633 ///End date
30634 #[serde(rename = "endDay")]
30635 pub end_day: i64,
30636 ///Transferred Hashrate quantity
30637 #[serde(rename = "hashRate")]
30638 pub hash_rate: i64,
30639 ///Transfer out of subaccount
30640 #[serde(rename = "poolUsername")]
30641 pub pool_username: String,
30642 ///Start date
30643 #[serde(rename = "startDay")]
30644 pub start_day: i64,
30645 ///0 Processing, 1:Cancelled, 2:Terminated
30646 pub status: i32,
30647 ///Transfer into subaccount
30648 #[serde(rename = "toPoolUsername")]
30649 pub to_pool_username: String,
30650 }
30651 impl From<&MiningHashTransferConfigDetailsListResponseDataConfigDetailsItem>
30652 for MiningHashTransferConfigDetailsListResponseDataConfigDetailsItem {
30653 fn from(
30654 value: &MiningHashTransferConfigDetailsListResponseDataConfigDetailsItem,
30655 ) -> Self {
30656 value.clone()
30657 }
30658 }
30659 ///MiningHashTransferConfigResponse
30660 ///
30661 /// <details><summary>JSON schema</summary>
30662 ///
30663 /// ```json
30664 ///{
30665 /// "type": "object",
30666 /// "required": [
30667 /// "code",
30668 /// "data",
30669 /// "msg"
30670 /// ],
30671 /// "properties": {
30672 /// "code": {
30673 /// "examples": [
30674 /// 0
30675 /// ],
30676 /// "type": "integer",
30677 /// "format": "int64"
30678 /// },
30679 /// "data": {
30680 /// "description": "Mining Account",
30681 /// "examples": [
30682 /// 171
30683 /// ],
30684 /// "type": "integer",
30685 /// "format": "int64"
30686 /// },
30687 /// "msg": {
30688 /// "examples": [
30689 /// ""
30690 /// ],
30691 /// "type": "string"
30692 /// }
30693 /// }
30694 ///}
30695 /// ```
30696 /// </details>
30697 #[derive(Clone, Debug, Deserialize, Serialize)]
30698 pub struct MiningHashTransferConfigResponse {
30699 pub code: i64,
30700 ///Mining Account
30701 pub data: i64,
30702 pub msg: String,
30703 }
30704 impl From<&MiningHashTransferConfigResponse> for MiningHashTransferConfigResponse {
30705 fn from(value: &MiningHashTransferConfigResponse) -> Self {
30706 value.clone()
30707 }
30708 }
30709 ///MiningHashTransferProfitDetailsResponse
30710 ///
30711 /// <details><summary>JSON schema</summary>
30712 ///
30713 /// ```json
30714 ///{
30715 /// "type": "object",
30716 /// "required": [
30717 /// "code",
30718 /// "data",
30719 /// "msg"
30720 /// ],
30721 /// "properties": {
30722 /// "code": {
30723 /// "examples": [
30724 /// 0
30725 /// ],
30726 /// "type": "integer",
30727 /// "format": "int64"
30728 /// },
30729 /// "data": {
30730 /// "type": "object",
30731 /// "required": [
30732 /// "pageSize",
30733 /// "profitTransferDetails",
30734 /// "totalNum"
30735 /// ],
30736 /// "properties": {
30737 /// "pageSize": {
30738 /// "examples": [
30739 /// 200
30740 /// ],
30741 /// "type": "integer",
30742 /// "format": "int64"
30743 /// },
30744 /// "profitTransferDetails": {
30745 /// "type": "array",
30746 /// "items": {
30747 /// "type": "object",
30748 /// "required": [
30749 /// "algoName",
30750 /// "amount",
30751 /// "coinName",
30752 /// "day",
30753 /// "hashRate",
30754 /// "poolUsername",
30755 /// "toPoolUsername"
30756 /// ],
30757 /// "properties": {
30758 /// "algoName": {
30759 /// "description": "Transfer algorithm",
30760 /// "examples": [
30761 /// "sha256"
30762 /// ],
30763 /// "type": "string"
30764 /// },
30765 /// "amount": {
30766 /// "description": "Transfer income",
30767 /// "examples": [
30768 /// 0.2256872
30769 /// ],
30770 /// "type": "number",
30771 /// "format": "double"
30772 /// },
30773 /// "coinName": {
30774 /// "examples": [
30775 /// "BTC"
30776 /// ],
30777 /// "type": "string"
30778 /// },
30779 /// "day": {
30780 /// "description": "Transfer date",
30781 /// "examples": [
30782 /// 20201213
30783 /// ],
30784 /// "type": "integer",
30785 /// "format": "int64"
30786 /// },
30787 /// "hashRate": {
30788 /// "description": "Transferred Hashrate quantity",
30789 /// "examples": [
30790 /// 200000000000
30791 /// ],
30792 /// "type": "integer",
30793 /// "format": "int64"
30794 /// },
30795 /// "poolUsername": {
30796 /// "description": "Transfer out of sub-account",
30797 /// "examples": [
30798 /// "test4001"
30799 /// ],
30800 /// "type": "string"
30801 /// },
30802 /// "toPoolUsername": {
30803 /// "description": "Transfer into subaccount",
30804 /// "examples": [
30805 /// "pop"
30806 /// ],
30807 /// "type": "string"
30808 /// }
30809 /// }
30810 /// }
30811 /// },
30812 /// "totalNum": {
30813 /// "examples": [
30814 /// 8
30815 /// ],
30816 /// "type": "integer",
30817 /// "format": "int64"
30818 /// }
30819 /// }
30820 /// },
30821 /// "msg": {
30822 /// "examples": [
30823 /// ""
30824 /// ],
30825 /// "type": "string"
30826 /// }
30827 /// }
30828 ///}
30829 /// ```
30830 /// </details>
30831 #[derive(Clone, Debug, Deserialize, Serialize)]
30832 pub struct MiningHashTransferProfitDetailsResponse {
30833 pub code: i64,
30834 pub data: MiningHashTransferProfitDetailsResponseData,
30835 pub msg: String,
30836 }
30837 impl From<&MiningHashTransferProfitDetailsResponse>
30838 for MiningHashTransferProfitDetailsResponse {
30839 fn from(value: &MiningHashTransferProfitDetailsResponse) -> Self {
30840 value.clone()
30841 }
30842 }
30843 ///MiningHashTransferProfitDetailsResponseData
30844 ///
30845 /// <details><summary>JSON schema</summary>
30846 ///
30847 /// ```json
30848 ///{
30849 /// "type": "object",
30850 /// "required": [
30851 /// "pageSize",
30852 /// "profitTransferDetails",
30853 /// "totalNum"
30854 /// ],
30855 /// "properties": {
30856 /// "pageSize": {
30857 /// "examples": [
30858 /// 200
30859 /// ],
30860 /// "type": "integer",
30861 /// "format": "int64"
30862 /// },
30863 /// "profitTransferDetails": {
30864 /// "type": "array",
30865 /// "items": {
30866 /// "type": "object",
30867 /// "required": [
30868 /// "algoName",
30869 /// "amount",
30870 /// "coinName",
30871 /// "day",
30872 /// "hashRate",
30873 /// "poolUsername",
30874 /// "toPoolUsername"
30875 /// ],
30876 /// "properties": {
30877 /// "algoName": {
30878 /// "description": "Transfer algorithm",
30879 /// "examples": [
30880 /// "sha256"
30881 /// ],
30882 /// "type": "string"
30883 /// },
30884 /// "amount": {
30885 /// "description": "Transfer income",
30886 /// "examples": [
30887 /// 0.2256872
30888 /// ],
30889 /// "type": "number",
30890 /// "format": "double"
30891 /// },
30892 /// "coinName": {
30893 /// "examples": [
30894 /// "BTC"
30895 /// ],
30896 /// "type": "string"
30897 /// },
30898 /// "day": {
30899 /// "description": "Transfer date",
30900 /// "examples": [
30901 /// 20201213
30902 /// ],
30903 /// "type": "integer",
30904 /// "format": "int64"
30905 /// },
30906 /// "hashRate": {
30907 /// "description": "Transferred Hashrate quantity",
30908 /// "examples": [
30909 /// 200000000000
30910 /// ],
30911 /// "type": "integer",
30912 /// "format": "int64"
30913 /// },
30914 /// "poolUsername": {
30915 /// "description": "Transfer out of sub-account",
30916 /// "examples": [
30917 /// "test4001"
30918 /// ],
30919 /// "type": "string"
30920 /// },
30921 /// "toPoolUsername": {
30922 /// "description": "Transfer into subaccount",
30923 /// "examples": [
30924 /// "pop"
30925 /// ],
30926 /// "type": "string"
30927 /// }
30928 /// }
30929 /// }
30930 /// },
30931 /// "totalNum": {
30932 /// "examples": [
30933 /// 8
30934 /// ],
30935 /// "type": "integer",
30936 /// "format": "int64"
30937 /// }
30938 /// }
30939 ///}
30940 /// ```
30941 /// </details>
30942 #[derive(Clone, Debug, Deserialize, Serialize)]
30943 pub struct MiningHashTransferProfitDetailsResponseData {
30944 #[serde(rename = "pageSize")]
30945 pub page_size: i64,
30946 #[serde(rename = "profitTransferDetails")]
30947 pub profit_transfer_details: Vec<
30948 MiningHashTransferProfitDetailsResponseDataProfitTransferDetailsItem,
30949 >,
30950 #[serde(rename = "totalNum")]
30951 pub total_num: i64,
30952 }
30953 impl From<&MiningHashTransferProfitDetailsResponseData>
30954 for MiningHashTransferProfitDetailsResponseData {
30955 fn from(value: &MiningHashTransferProfitDetailsResponseData) -> Self {
30956 value.clone()
30957 }
30958 }
30959 ///MiningHashTransferProfitDetailsResponseDataProfitTransferDetailsItem
30960 ///
30961 /// <details><summary>JSON schema</summary>
30962 ///
30963 /// ```json
30964 ///{
30965 /// "type": "object",
30966 /// "required": [
30967 /// "algoName",
30968 /// "amount",
30969 /// "coinName",
30970 /// "day",
30971 /// "hashRate",
30972 /// "poolUsername",
30973 /// "toPoolUsername"
30974 /// ],
30975 /// "properties": {
30976 /// "algoName": {
30977 /// "description": "Transfer algorithm",
30978 /// "examples": [
30979 /// "sha256"
30980 /// ],
30981 /// "type": "string"
30982 /// },
30983 /// "amount": {
30984 /// "description": "Transfer income",
30985 /// "examples": [
30986 /// 0.2256872
30987 /// ],
30988 /// "type": "number",
30989 /// "format": "double"
30990 /// },
30991 /// "coinName": {
30992 /// "examples": [
30993 /// "BTC"
30994 /// ],
30995 /// "type": "string"
30996 /// },
30997 /// "day": {
30998 /// "description": "Transfer date",
30999 /// "examples": [
31000 /// 20201213
31001 /// ],
31002 /// "type": "integer",
31003 /// "format": "int64"
31004 /// },
31005 /// "hashRate": {
31006 /// "description": "Transferred Hashrate quantity",
31007 /// "examples": [
31008 /// 200000000000
31009 /// ],
31010 /// "type": "integer",
31011 /// "format": "int64"
31012 /// },
31013 /// "poolUsername": {
31014 /// "description": "Transfer out of sub-account",
31015 /// "examples": [
31016 /// "test4001"
31017 /// ],
31018 /// "type": "string"
31019 /// },
31020 /// "toPoolUsername": {
31021 /// "description": "Transfer into subaccount",
31022 /// "examples": [
31023 /// "pop"
31024 /// ],
31025 /// "type": "string"
31026 /// }
31027 /// }
31028 ///}
31029 /// ```
31030 /// </details>
31031 #[derive(Clone, Debug, Deserialize, Serialize)]
31032 pub struct MiningHashTransferProfitDetailsResponseDataProfitTransferDetailsItem {
31033 ///Transfer algorithm
31034 #[serde(rename = "algoName")]
31035 pub algo_name: String,
31036 pub amount: f64,
31037 #[serde(rename = "coinName")]
31038 pub coin_name: String,
31039 ///Transfer date
31040 pub day: i64,
31041 ///Transferred Hashrate quantity
31042 #[serde(rename = "hashRate")]
31043 pub hash_rate: i64,
31044 ///Transfer out of sub-account
31045 #[serde(rename = "poolUsername")]
31046 pub pool_username: String,
31047 ///Transfer into subaccount
31048 #[serde(rename = "toPoolUsername")]
31049 pub to_pool_username: String,
31050 }
31051 impl From<&MiningHashTransferProfitDetailsResponseDataProfitTransferDetailsItem>
31052 for MiningHashTransferProfitDetailsResponseDataProfitTransferDetailsItem {
31053 fn from(
31054 value: &MiningHashTransferProfitDetailsResponseDataProfitTransferDetailsItem,
31055 ) -> Self {
31056 value.clone()
31057 }
31058 }
31059 ///MiningPaymentListResponse
31060 ///
31061 /// <details><summary>JSON schema</summary>
31062 ///
31063 /// ```json
31064 ///{
31065 /// "type": "object",
31066 /// "required": [
31067 /// "code",
31068 /// "data",
31069 /// "msg"
31070 /// ],
31071 /// "properties": {
31072 /// "code": {
31073 /// "examples": [
31074 /// 0
31075 /// ],
31076 /// "type": "integer",
31077 /// "format": "int64"
31078 /// },
31079 /// "data": {
31080 /// "type": "object",
31081 /// "required": [
31082 /// "accountProfits",
31083 /// "pageSize",
31084 /// "totalNum"
31085 /// ],
31086 /// "properties": {
31087 /// "accountProfits": {
31088 /// "type": "array",
31089 /// "items": {
31090 /// "type": "object",
31091 /// "required": [
31092 /// "coinName",
31093 /// "dayHashRate",
31094 /// "hashTransfer",
31095 /// "profitAmount",
31096 /// "status",
31097 /// "time",
31098 /// "transferAmount",
31099 /// "type"
31100 /// ],
31101 /// "properties": {
31102 /// "coinName": {
31103 /// "description": "Coin Type",
31104 /// "examples": [
31105 /// "BTC"
31106 /// ],
31107 /// "type": "string"
31108 /// },
31109 /// "dayHashRate": {
31110 /// "description": "Daily Hashrate",
31111 /// "examples": [
31112 /// 129129903378244
31113 /// ],
31114 /// "type": "integer",
31115 /// "format": "int64"
31116 /// },
31117 /// "hashTransfer": {
31118 /// "description": "Transferred Hashrate",
31119 /// "type": "integer",
31120 /// "format": "nullable"
31121 /// },
31122 /// "profitAmount": {
31123 /// "description": "Earnings Amount",
31124 /// "examples": [
31125 /// 8.6083060304
31126 /// ],
31127 /// "type": "number",
31128 /// "format": "double"
31129 /// },
31130 /// "status": {
31131 /// "description": "Status:0:Unpaid, 1:Paying 2:Paid",
31132 /// "examples": [
31133 /// 2
31134 /// ],
31135 /// "type": "integer",
31136 /// "format": "int32"
31137 /// },
31138 /// "time": {
31139 /// "description": "Mining date",
31140 /// "examples": [
31141 /// 1586188800000
31142 /// ],
31143 /// "type": "integer",
31144 /// "format": "int64"
31145 /// },
31146 /// "transferAmount": {
31147 /// "description": "Transferred Income",
31148 /// "type": "number",
31149 /// "format": "nullable"
31150 /// },
31151 /// "type": {
31152 /// "description": "0:Mining Wallet,5:Mining Address,7:Pool Savings,8:Transferred,31:Income Transfer ,32:Hashrate Resale-Mining Wallet 33:Hashrate Resale-Pool Savings",
31153 /// "examples": [
31154 /// 31
31155 /// ],
31156 /// "type": "integer",
31157 /// "format": "int64"
31158 /// }
31159 /// }
31160 /// }
31161 /// },
31162 /// "pageSize": {
31163 /// "description": "Rows per page",
31164 /// "examples": [
31165 /// 20
31166 /// ],
31167 /// "type": "integer",
31168 /// "format": "int64"
31169 /// },
31170 /// "totalNum": {
31171 /// "description": "Total Rows",
31172 /// "examples": [
31173 /// 3
31174 /// ],
31175 /// "type": "integer",
31176 /// "format": "int64"
31177 /// }
31178 /// }
31179 /// },
31180 /// "msg": {
31181 /// "examples": [
31182 /// ""
31183 /// ],
31184 /// "type": "string"
31185 /// }
31186 /// }
31187 ///}
31188 /// ```
31189 /// </details>
31190 #[derive(Clone, Debug, Deserialize, Serialize)]
31191 pub struct MiningPaymentListResponse {
31192 pub code: i64,
31193 pub data: MiningPaymentListResponseData,
31194 pub msg: String,
31195 }
31196 impl From<&MiningPaymentListResponse> for MiningPaymentListResponse {
31197 fn from(value: &MiningPaymentListResponse) -> Self {
31198 value.clone()
31199 }
31200 }
31201 ///MiningPaymentListResponseData
31202 ///
31203 /// <details><summary>JSON schema</summary>
31204 ///
31205 /// ```json
31206 ///{
31207 /// "type": "object",
31208 /// "required": [
31209 /// "accountProfits",
31210 /// "pageSize",
31211 /// "totalNum"
31212 /// ],
31213 /// "properties": {
31214 /// "accountProfits": {
31215 /// "type": "array",
31216 /// "items": {
31217 /// "type": "object",
31218 /// "required": [
31219 /// "coinName",
31220 /// "dayHashRate",
31221 /// "hashTransfer",
31222 /// "profitAmount",
31223 /// "status",
31224 /// "time",
31225 /// "transferAmount",
31226 /// "type"
31227 /// ],
31228 /// "properties": {
31229 /// "coinName": {
31230 /// "description": "Coin Type",
31231 /// "examples": [
31232 /// "BTC"
31233 /// ],
31234 /// "type": "string"
31235 /// },
31236 /// "dayHashRate": {
31237 /// "description": "Daily Hashrate",
31238 /// "examples": [
31239 /// 129129903378244
31240 /// ],
31241 /// "type": "integer",
31242 /// "format": "int64"
31243 /// },
31244 /// "hashTransfer": {
31245 /// "description": "Transferred Hashrate",
31246 /// "type": "integer",
31247 /// "format": "nullable"
31248 /// },
31249 /// "profitAmount": {
31250 /// "description": "Earnings Amount",
31251 /// "examples": [
31252 /// 8.6083060304
31253 /// ],
31254 /// "type": "number",
31255 /// "format": "double"
31256 /// },
31257 /// "status": {
31258 /// "description": "Status:0:Unpaid, 1:Paying 2:Paid",
31259 /// "examples": [
31260 /// 2
31261 /// ],
31262 /// "type": "integer",
31263 /// "format": "int32"
31264 /// },
31265 /// "time": {
31266 /// "description": "Mining date",
31267 /// "examples": [
31268 /// 1586188800000
31269 /// ],
31270 /// "type": "integer",
31271 /// "format": "int64"
31272 /// },
31273 /// "transferAmount": {
31274 /// "description": "Transferred Income",
31275 /// "type": "number",
31276 /// "format": "nullable"
31277 /// },
31278 /// "type": {
31279 /// "description": "0:Mining Wallet,5:Mining Address,7:Pool Savings,8:Transferred,31:Income Transfer ,32:Hashrate Resale-Mining Wallet 33:Hashrate Resale-Pool Savings",
31280 /// "examples": [
31281 /// 31
31282 /// ],
31283 /// "type": "integer",
31284 /// "format": "int64"
31285 /// }
31286 /// }
31287 /// }
31288 /// },
31289 /// "pageSize": {
31290 /// "description": "Rows per page",
31291 /// "examples": [
31292 /// 20
31293 /// ],
31294 /// "type": "integer",
31295 /// "format": "int64"
31296 /// },
31297 /// "totalNum": {
31298 /// "description": "Total Rows",
31299 /// "examples": [
31300 /// 3
31301 /// ],
31302 /// "type": "integer",
31303 /// "format": "int64"
31304 /// }
31305 /// }
31306 ///}
31307 /// ```
31308 /// </details>
31309 #[derive(Clone, Debug, Deserialize, Serialize)]
31310 pub struct MiningPaymentListResponseData {
31311 #[serde(rename = "accountProfits")]
31312 pub account_profits: Vec<MiningPaymentListResponseDataAccountProfitsItem>,
31313 ///Rows per page
31314 #[serde(rename = "pageSize")]
31315 pub page_size: i64,
31316 ///Total Rows
31317 #[serde(rename = "totalNum")]
31318 pub total_num: i64,
31319 }
31320 impl From<&MiningPaymentListResponseData> for MiningPaymentListResponseData {
31321 fn from(value: &MiningPaymentListResponseData) -> Self {
31322 value.clone()
31323 }
31324 }
31325 ///MiningPaymentListResponseDataAccountProfitsItem
31326 ///
31327 /// <details><summary>JSON schema</summary>
31328 ///
31329 /// ```json
31330 ///{
31331 /// "type": "object",
31332 /// "required": [
31333 /// "coinName",
31334 /// "dayHashRate",
31335 /// "hashTransfer",
31336 /// "profitAmount",
31337 /// "status",
31338 /// "time",
31339 /// "transferAmount",
31340 /// "type"
31341 /// ],
31342 /// "properties": {
31343 /// "coinName": {
31344 /// "description": "Coin Type",
31345 /// "examples": [
31346 /// "BTC"
31347 /// ],
31348 /// "type": "string"
31349 /// },
31350 /// "dayHashRate": {
31351 /// "description": "Daily Hashrate",
31352 /// "examples": [
31353 /// 129129903378244
31354 /// ],
31355 /// "type": "integer",
31356 /// "format": "int64"
31357 /// },
31358 /// "hashTransfer": {
31359 /// "description": "Transferred Hashrate",
31360 /// "type": "integer",
31361 /// "format": "nullable"
31362 /// },
31363 /// "profitAmount": {
31364 /// "description": "Earnings Amount",
31365 /// "examples": [
31366 /// 8.6083060304
31367 /// ],
31368 /// "type": "number",
31369 /// "format": "double"
31370 /// },
31371 /// "status": {
31372 /// "description": "Status:0:Unpaid, 1:Paying 2:Paid",
31373 /// "examples": [
31374 /// 2
31375 /// ],
31376 /// "type": "integer",
31377 /// "format": "int32"
31378 /// },
31379 /// "time": {
31380 /// "description": "Mining date",
31381 /// "examples": [
31382 /// 1586188800000
31383 /// ],
31384 /// "type": "integer",
31385 /// "format": "int64"
31386 /// },
31387 /// "transferAmount": {
31388 /// "description": "Transferred Income",
31389 /// "type": "number",
31390 /// "format": "nullable"
31391 /// },
31392 /// "type": {
31393 /// "description": "0:Mining Wallet,5:Mining Address,7:Pool Savings,8:Transferred,31:Income Transfer ,32:Hashrate Resale-Mining Wallet 33:Hashrate Resale-Pool Savings",
31394 /// "examples": [
31395 /// 31
31396 /// ],
31397 /// "type": "integer",
31398 /// "format": "int64"
31399 /// }
31400 /// }
31401 ///}
31402 /// ```
31403 /// </details>
31404 #[derive(Clone, Debug, Deserialize, Serialize)]
31405 pub struct MiningPaymentListResponseDataAccountProfitsItem {
31406 ///Coin Type
31407 #[serde(rename = "coinName")]
31408 pub coin_name: String,
31409 ///Daily Hashrate
31410 #[serde(rename = "dayHashRate")]
31411 pub day_hash_rate: i64,
31412 ///Transferred Hashrate
31413 #[serde(rename = "hashTransfer")]
31414 pub hash_transfer: i64,
31415 #[serde(rename = "profitAmount")]
31416 pub profit_amount: f64,
31417 ///Status:0:Unpaid, 1:Paying 2:Paid
31418 pub status: i32,
31419 ///Mining date
31420 pub time: i64,
31421 #[serde(rename = "transferAmount")]
31422 pub transfer_amount: f64,
31423 ///0:Mining Wallet,5:Mining Address,7:Pool Savings,8:Transferred,31:Income Transfer ,32:Hashrate Resale-Mining Wallet 33:Hashrate Resale-Pool Savings
31424 #[serde(rename = "type")]
31425 pub type_: i64,
31426 }
31427 impl From<&MiningPaymentListResponseDataAccountProfitsItem>
31428 for MiningPaymentListResponseDataAccountProfitsItem {
31429 fn from(value: &MiningPaymentListResponseDataAccountProfitsItem) -> Self {
31430 value.clone()
31431 }
31432 }
31433 ///MiningPaymentOtherResponse
31434 ///
31435 /// <details><summary>JSON schema</summary>
31436 ///
31437 /// ```json
31438 ///{
31439 /// "type": "object",
31440 /// "required": [
31441 /// "code",
31442 /// "data",
31443 /// "msg"
31444 /// ],
31445 /// "properties": {
31446 /// "code": {
31447 /// "examples": [
31448 /// 0
31449 /// ],
31450 /// "type": "integer",
31451 /// "format": "int64"
31452 /// },
31453 /// "data": {
31454 /// "type": "object",
31455 /// "required": [
31456 /// "otherProfits",
31457 /// "pageSize",
31458 /// "totalNum"
31459 /// ],
31460 /// "properties": {
31461 /// "otherProfits": {
31462 /// "type": "array",
31463 /// "items": {
31464 /// "type": "object",
31465 /// "required": [
31466 /// "coinName",
31467 /// "profitAmount",
31468 /// "status",
31469 /// "time",
31470 /// "type"
31471 /// ],
31472 /// "properties": {
31473 /// "coinName": {
31474 /// "description": "Coin Name",
31475 /// "examples": [
31476 /// "BTC"
31477 /// ],
31478 /// "type": "string"
31479 /// },
31480 /// "profitAmount": {
31481 /// "examples": [
31482 /// 0.0011859
31483 /// ],
31484 /// "type": "number",
31485 /// "format": "double"
31486 /// },
31487 /// "status": {
31488 /// "description": "0:Unpaid, 1:Paying 2:Paid",
31489 /// "examples": [
31490 /// 2
31491 /// ],
31492 /// "type": "integer",
31493 /// "format": "int32"
31494 /// },
31495 /// "time": {
31496 /// "description": "Mining date",
31497 /// "examples": [
31498 /// 1607443200000
31499 /// ],
31500 /// "type": "integer",
31501 /// "format": "int64"
31502 /// },
31503 /// "type": {
31504 /// "description": "1: Merged Mining, 2: Activity Bonus, 3:Rebate 4:Smart Pool 6:Income Transfer 7:Pool Savings",
31505 /// "examples": [
31506 /// 4
31507 /// ],
31508 /// "type": "integer",
31509 /// "format": "int32"
31510 /// }
31511 /// }
31512 /// }
31513 /// },
31514 /// "pageSize": {
31515 /// "description": "Rows per page",
31516 /// "examples": [
31517 /// 20
31518 /// ],
31519 /// "type": "integer",
31520 /// "format": "int64"
31521 /// },
31522 /// "totalNum": {
31523 /// "description": "Total Rows",
31524 /// "examples": [
31525 /// 3
31526 /// ],
31527 /// "type": "integer",
31528 /// "format": "int64"
31529 /// }
31530 /// }
31531 /// },
31532 /// "msg": {
31533 /// "examples": [
31534 /// ""
31535 /// ],
31536 /// "type": "string"
31537 /// }
31538 /// }
31539 ///}
31540 /// ```
31541 /// </details>
31542 #[derive(Clone, Debug, Deserialize, Serialize)]
31543 pub struct MiningPaymentOtherResponse {
31544 pub code: i64,
31545 pub data: MiningPaymentOtherResponseData,
31546 pub msg: String,
31547 }
31548 impl From<&MiningPaymentOtherResponse> for MiningPaymentOtherResponse {
31549 fn from(value: &MiningPaymentOtherResponse) -> Self {
31550 value.clone()
31551 }
31552 }
31553 ///MiningPaymentOtherResponseData
31554 ///
31555 /// <details><summary>JSON schema</summary>
31556 ///
31557 /// ```json
31558 ///{
31559 /// "type": "object",
31560 /// "required": [
31561 /// "otherProfits",
31562 /// "pageSize",
31563 /// "totalNum"
31564 /// ],
31565 /// "properties": {
31566 /// "otherProfits": {
31567 /// "type": "array",
31568 /// "items": {
31569 /// "type": "object",
31570 /// "required": [
31571 /// "coinName",
31572 /// "profitAmount",
31573 /// "status",
31574 /// "time",
31575 /// "type"
31576 /// ],
31577 /// "properties": {
31578 /// "coinName": {
31579 /// "description": "Coin Name",
31580 /// "examples": [
31581 /// "BTC"
31582 /// ],
31583 /// "type": "string"
31584 /// },
31585 /// "profitAmount": {
31586 /// "examples": [
31587 /// 0.0011859
31588 /// ],
31589 /// "type": "number",
31590 /// "format": "double"
31591 /// },
31592 /// "status": {
31593 /// "description": "0:Unpaid, 1:Paying 2:Paid",
31594 /// "examples": [
31595 /// 2
31596 /// ],
31597 /// "type": "integer",
31598 /// "format": "int32"
31599 /// },
31600 /// "time": {
31601 /// "description": "Mining date",
31602 /// "examples": [
31603 /// 1607443200000
31604 /// ],
31605 /// "type": "integer",
31606 /// "format": "int64"
31607 /// },
31608 /// "type": {
31609 /// "description": "1: Merged Mining, 2: Activity Bonus, 3:Rebate 4:Smart Pool 6:Income Transfer 7:Pool Savings",
31610 /// "examples": [
31611 /// 4
31612 /// ],
31613 /// "type": "integer",
31614 /// "format": "int32"
31615 /// }
31616 /// }
31617 /// }
31618 /// },
31619 /// "pageSize": {
31620 /// "description": "Rows per page",
31621 /// "examples": [
31622 /// 20
31623 /// ],
31624 /// "type": "integer",
31625 /// "format": "int64"
31626 /// },
31627 /// "totalNum": {
31628 /// "description": "Total Rows",
31629 /// "examples": [
31630 /// 3
31631 /// ],
31632 /// "type": "integer",
31633 /// "format": "int64"
31634 /// }
31635 /// }
31636 ///}
31637 /// ```
31638 /// </details>
31639 #[derive(Clone, Debug, Deserialize, Serialize)]
31640 pub struct MiningPaymentOtherResponseData {
31641 #[serde(rename = "otherProfits")]
31642 pub other_profits: Vec<MiningPaymentOtherResponseDataOtherProfitsItem>,
31643 ///Rows per page
31644 #[serde(rename = "pageSize")]
31645 pub page_size: i64,
31646 ///Total Rows
31647 #[serde(rename = "totalNum")]
31648 pub total_num: i64,
31649 }
31650 impl From<&MiningPaymentOtherResponseData> for MiningPaymentOtherResponseData {
31651 fn from(value: &MiningPaymentOtherResponseData) -> Self {
31652 value.clone()
31653 }
31654 }
31655 ///MiningPaymentOtherResponseDataOtherProfitsItem
31656 ///
31657 /// <details><summary>JSON schema</summary>
31658 ///
31659 /// ```json
31660 ///{
31661 /// "type": "object",
31662 /// "required": [
31663 /// "coinName",
31664 /// "profitAmount",
31665 /// "status",
31666 /// "time",
31667 /// "type"
31668 /// ],
31669 /// "properties": {
31670 /// "coinName": {
31671 /// "description": "Coin Name",
31672 /// "examples": [
31673 /// "BTC"
31674 /// ],
31675 /// "type": "string"
31676 /// },
31677 /// "profitAmount": {
31678 /// "examples": [
31679 /// 0.0011859
31680 /// ],
31681 /// "type": "number",
31682 /// "format": "double"
31683 /// },
31684 /// "status": {
31685 /// "description": "0:Unpaid, 1:Paying 2:Paid",
31686 /// "examples": [
31687 /// 2
31688 /// ],
31689 /// "type": "integer",
31690 /// "format": "int32"
31691 /// },
31692 /// "time": {
31693 /// "description": "Mining date",
31694 /// "examples": [
31695 /// 1607443200000
31696 /// ],
31697 /// "type": "integer",
31698 /// "format": "int64"
31699 /// },
31700 /// "type": {
31701 /// "description": "1: Merged Mining, 2: Activity Bonus, 3:Rebate 4:Smart Pool 6:Income Transfer 7:Pool Savings",
31702 /// "examples": [
31703 /// 4
31704 /// ],
31705 /// "type": "integer",
31706 /// "format": "int32"
31707 /// }
31708 /// }
31709 ///}
31710 /// ```
31711 /// </details>
31712 #[derive(Clone, Debug, Deserialize, Serialize)]
31713 pub struct MiningPaymentOtherResponseDataOtherProfitsItem {
31714 ///Coin Name
31715 #[serde(rename = "coinName")]
31716 pub coin_name: String,
31717 #[serde(rename = "profitAmount")]
31718 pub profit_amount: f64,
31719 ///0:Unpaid, 1:Paying 2:Paid
31720 pub status: i32,
31721 ///Mining date
31722 pub time: i64,
31723 ///1: Merged Mining, 2: Activity Bonus, 3:Rebate 4:Smart Pool 6:Income Transfer 7:Pool Savings
31724 #[serde(rename = "type")]
31725 pub type_: i32,
31726 }
31727 impl From<&MiningPaymentOtherResponseDataOtherProfitsItem>
31728 for MiningPaymentOtherResponseDataOtherProfitsItem {
31729 fn from(value: &MiningPaymentOtherResponseDataOtherProfitsItem) -> Self {
31730 value.clone()
31731 }
31732 }
31733 ///MiningPaymentUidResponse
31734 ///
31735 /// <details><summary>JSON schema</summary>
31736 ///
31737 /// ```json
31738 ///{
31739 /// "type": "object",
31740 /// "required": [
31741 /// "code",
31742 /// "data",
31743 /// "msg"
31744 /// ],
31745 /// "properties": {
31746 /// "code": {
31747 /// "examples": [
31748 /// 0
31749 /// ],
31750 /// "type": "integer",
31751 /// "format": "int32"
31752 /// },
31753 /// "data": {
31754 /// "type": "object",
31755 /// "required": [
31756 /// "accountProfits",
31757 /// "pageSize",
31758 /// "totalNum"
31759 /// ],
31760 /// "properties": {
31761 /// "accountProfits": {
31762 /// "type": "array",
31763 /// "items": {
31764 /// "type": "object",
31765 /// "required": [
31766 /// "amount",
31767 /// "coinName",
31768 /// "puid",
31769 /// "subName",
31770 /// "time",
31771 /// "type"
31772 /// ],
31773 /// "properties": {
31774 /// "amount": {
31775 /// "examples": [
31776 /// 0.09186957
31777 /// ],
31778 /// "type": "number"
31779 /// },
31780 /// "coinName": {
31781 /// "examples": [
31782 /// "BTC"
31783 /// ],
31784 /// "type": "string"
31785 /// },
31786 /// "puid": {
31787 /// "description": "puid",
31788 /// "examples": [
31789 /// 59985472
31790 /// ],
31791 /// "type": "integer",
31792 /// "format": "int32"
31793 /// },
31794 /// "subName": {
31795 /// "description": "Mining account",
31796 /// "examples": [
31797 /// "vdvaghani"
31798 /// ],
31799 /// "type": "string"
31800 /// },
31801 /// "time": {
31802 /// "examples": [
31803 /// 1607443200000
31804 /// ],
31805 /// "type": "integer",
31806 /// "format": "int64"
31807 /// },
31808 /// "type": {
31809 /// "description": "0:Referral 1:Refund 2:Rebate",
31810 /// "examples": [
31811 /// 2
31812 /// ],
31813 /// "type": "integer",
31814 /// "format": "int32"
31815 /// }
31816 /// }
31817 /// }
31818 /// },
31819 /// "pageSize": {
31820 /// "examples": [
31821 /// 20
31822 /// ],
31823 /// "type": "integer",
31824 /// "format": "int32"
31825 /// },
31826 /// "totalNum": {
31827 /// "examples": [
31828 /// 3
31829 /// ],
31830 /// "type": "integer",
31831 /// "format": "int32"
31832 /// }
31833 /// }
31834 /// },
31835 /// "msg": {
31836 /// "examples": [
31837 /// ""
31838 /// ],
31839 /// "type": "string"
31840 /// }
31841 /// }
31842 ///}
31843 /// ```
31844 /// </details>
31845 #[derive(Clone, Debug, Deserialize, Serialize)]
31846 pub struct MiningPaymentUidResponse {
31847 pub code: i32,
31848 pub data: MiningPaymentUidResponseData,
31849 pub msg: String,
31850 }
31851 impl From<&MiningPaymentUidResponse> for MiningPaymentUidResponse {
31852 fn from(value: &MiningPaymentUidResponse) -> Self {
31853 value.clone()
31854 }
31855 }
31856 ///MiningPaymentUidResponseData
31857 ///
31858 /// <details><summary>JSON schema</summary>
31859 ///
31860 /// ```json
31861 ///{
31862 /// "type": "object",
31863 /// "required": [
31864 /// "accountProfits",
31865 /// "pageSize",
31866 /// "totalNum"
31867 /// ],
31868 /// "properties": {
31869 /// "accountProfits": {
31870 /// "type": "array",
31871 /// "items": {
31872 /// "type": "object",
31873 /// "required": [
31874 /// "amount",
31875 /// "coinName",
31876 /// "puid",
31877 /// "subName",
31878 /// "time",
31879 /// "type"
31880 /// ],
31881 /// "properties": {
31882 /// "amount": {
31883 /// "examples": [
31884 /// 0.09186957
31885 /// ],
31886 /// "type": "number"
31887 /// },
31888 /// "coinName": {
31889 /// "examples": [
31890 /// "BTC"
31891 /// ],
31892 /// "type": "string"
31893 /// },
31894 /// "puid": {
31895 /// "description": "puid",
31896 /// "examples": [
31897 /// 59985472
31898 /// ],
31899 /// "type": "integer",
31900 /// "format": "int32"
31901 /// },
31902 /// "subName": {
31903 /// "description": "Mining account",
31904 /// "examples": [
31905 /// "vdvaghani"
31906 /// ],
31907 /// "type": "string"
31908 /// },
31909 /// "time": {
31910 /// "examples": [
31911 /// 1607443200000
31912 /// ],
31913 /// "type": "integer",
31914 /// "format": "int64"
31915 /// },
31916 /// "type": {
31917 /// "description": "0:Referral 1:Refund 2:Rebate",
31918 /// "examples": [
31919 /// 2
31920 /// ],
31921 /// "type": "integer",
31922 /// "format": "int32"
31923 /// }
31924 /// }
31925 /// }
31926 /// },
31927 /// "pageSize": {
31928 /// "examples": [
31929 /// 20
31930 /// ],
31931 /// "type": "integer",
31932 /// "format": "int32"
31933 /// },
31934 /// "totalNum": {
31935 /// "examples": [
31936 /// 3
31937 /// ],
31938 /// "type": "integer",
31939 /// "format": "int32"
31940 /// }
31941 /// }
31942 ///}
31943 /// ```
31944 /// </details>
31945 #[derive(Clone, Debug, Deserialize, Serialize)]
31946 pub struct MiningPaymentUidResponseData {
31947 #[serde(rename = "accountProfits")]
31948 pub account_profits: Vec<MiningPaymentUidResponseDataAccountProfitsItem>,
31949 #[serde(rename = "pageSize")]
31950 pub page_size: i32,
31951 #[serde(rename = "totalNum")]
31952 pub total_num: i32,
31953 }
31954 impl From<&MiningPaymentUidResponseData> for MiningPaymentUidResponseData {
31955 fn from(value: &MiningPaymentUidResponseData) -> Self {
31956 value.clone()
31957 }
31958 }
31959 ///MiningPaymentUidResponseDataAccountProfitsItem
31960 ///
31961 /// <details><summary>JSON schema</summary>
31962 ///
31963 /// ```json
31964 ///{
31965 /// "type": "object",
31966 /// "required": [
31967 /// "amount",
31968 /// "coinName",
31969 /// "puid",
31970 /// "subName",
31971 /// "time",
31972 /// "type"
31973 /// ],
31974 /// "properties": {
31975 /// "amount": {
31976 /// "examples": [
31977 /// 0.09186957
31978 /// ],
31979 /// "type": "number"
31980 /// },
31981 /// "coinName": {
31982 /// "examples": [
31983 /// "BTC"
31984 /// ],
31985 /// "type": "string"
31986 /// },
31987 /// "puid": {
31988 /// "description": "puid",
31989 /// "examples": [
31990 /// 59985472
31991 /// ],
31992 /// "type": "integer",
31993 /// "format": "int32"
31994 /// },
31995 /// "subName": {
31996 /// "description": "Mining account",
31997 /// "examples": [
31998 /// "vdvaghani"
31999 /// ],
32000 /// "type": "string"
32001 /// },
32002 /// "time": {
32003 /// "examples": [
32004 /// 1607443200000
32005 /// ],
32006 /// "type": "integer",
32007 /// "format": "int64"
32008 /// },
32009 /// "type": {
32010 /// "description": "0:Referral 1:Refund 2:Rebate",
32011 /// "examples": [
32012 /// 2
32013 /// ],
32014 /// "type": "integer",
32015 /// "format": "int32"
32016 /// }
32017 /// }
32018 ///}
32019 /// ```
32020 /// </details>
32021 #[derive(Clone, Debug, Deserialize, Serialize)]
32022 pub struct MiningPaymentUidResponseDataAccountProfitsItem {
32023 pub amount: f64,
32024 #[serde(rename = "coinName")]
32025 pub coin_name: String,
32026 ///puid
32027 pub puid: i32,
32028 ///Mining account
32029 #[serde(rename = "subName")]
32030 pub sub_name: String,
32031 pub time: i64,
32032 ///0:Referral 1:Refund 2:Rebate
32033 #[serde(rename = "type")]
32034 pub type_: i32,
32035 }
32036 impl From<&MiningPaymentUidResponseDataAccountProfitsItem>
32037 for MiningPaymentUidResponseDataAccountProfitsItem {
32038 fn from(value: &MiningPaymentUidResponseDataAccountProfitsItem) -> Self {
32039 value.clone()
32040 }
32041 }
32042 ///MiningPubAlgoListResponse
32043 ///
32044 /// <details><summary>JSON schema</summary>
32045 ///
32046 /// ```json
32047 ///{
32048 /// "type": "object",
32049 /// "required": [
32050 /// "code",
32051 /// "data",
32052 /// "msg"
32053 /// ],
32054 /// "properties": {
32055 /// "code": {
32056 /// "examples": [
32057 /// 0
32058 /// ],
32059 /// "type": "integer",
32060 /// "format": "int64"
32061 /// },
32062 /// "data": {
32063 /// "type": "array",
32064 /// "items": {
32065 /// "type": "object",
32066 /// "required": [
32067 /// "algoId",
32068 /// "algoName",
32069 /// "poolIndex",
32070 /// "unit"
32071 /// ],
32072 /// "properties": {
32073 /// "algoId": {
32074 /// "examples": [
32075 /// 1
32076 /// ],
32077 /// "type": "integer",
32078 /// "format": "int64"
32079 /// },
32080 /// "algoName": {
32081 /// "examples": [
32082 /// "sha256"
32083 /// ],
32084 /// "type": "string"
32085 /// },
32086 /// "poolIndex": {
32087 /// "examples": [
32088 /// 0
32089 /// ],
32090 /// "type": "integer",
32091 /// "format": "int64"
32092 /// },
32093 /// "unit": {
32094 /// "examples": [
32095 /// "h/s"
32096 /// ],
32097 /// "type": "string"
32098 /// }
32099 /// }
32100 /// }
32101 /// },
32102 /// "msg": {
32103 /// "examples": [
32104 /// ""
32105 /// ],
32106 /// "type": "string"
32107 /// }
32108 /// }
32109 ///}
32110 /// ```
32111 /// </details>
32112 #[derive(Clone, Debug, Deserialize, Serialize)]
32113 pub struct MiningPubAlgoListResponse {
32114 pub code: i64,
32115 pub data: Vec<MiningPubAlgoListResponseDataItem>,
32116 pub msg: String,
32117 }
32118 impl From<&MiningPubAlgoListResponse> for MiningPubAlgoListResponse {
32119 fn from(value: &MiningPubAlgoListResponse) -> Self {
32120 value.clone()
32121 }
32122 }
32123 ///MiningPubAlgoListResponseDataItem
32124 ///
32125 /// <details><summary>JSON schema</summary>
32126 ///
32127 /// ```json
32128 ///{
32129 /// "type": "object",
32130 /// "required": [
32131 /// "algoId",
32132 /// "algoName",
32133 /// "poolIndex",
32134 /// "unit"
32135 /// ],
32136 /// "properties": {
32137 /// "algoId": {
32138 /// "examples": [
32139 /// 1
32140 /// ],
32141 /// "type": "integer",
32142 /// "format": "int64"
32143 /// },
32144 /// "algoName": {
32145 /// "examples": [
32146 /// "sha256"
32147 /// ],
32148 /// "type": "string"
32149 /// },
32150 /// "poolIndex": {
32151 /// "examples": [
32152 /// 0
32153 /// ],
32154 /// "type": "integer",
32155 /// "format": "int64"
32156 /// },
32157 /// "unit": {
32158 /// "examples": [
32159 /// "h/s"
32160 /// ],
32161 /// "type": "string"
32162 /// }
32163 /// }
32164 ///}
32165 /// ```
32166 /// </details>
32167 #[derive(Clone, Debug, Deserialize, Serialize)]
32168 pub struct MiningPubAlgoListResponseDataItem {
32169 #[serde(rename = "algoId")]
32170 pub algo_id: i64,
32171 #[serde(rename = "algoName")]
32172 pub algo_name: String,
32173 #[serde(rename = "poolIndex")]
32174 pub pool_index: i64,
32175 pub unit: String,
32176 }
32177 impl From<&MiningPubAlgoListResponseDataItem> for MiningPubAlgoListResponseDataItem {
32178 fn from(value: &MiningPubAlgoListResponseDataItem) -> Self {
32179 value.clone()
32180 }
32181 }
32182 ///MiningPubCoinListResponse
32183 ///
32184 /// <details><summary>JSON schema</summary>
32185 ///
32186 /// ```json
32187 ///{
32188 /// "type": "object",
32189 /// "required": [
32190 /// "code",
32191 /// "data",
32192 /// "msg"
32193 /// ],
32194 /// "properties": {
32195 /// "code": {
32196 /// "examples": [
32197 /// 0
32198 /// ],
32199 /// "type": "integer",
32200 /// "format": "int64"
32201 /// },
32202 /// "data": {
32203 /// "type": "array",
32204 /// "items": {
32205 /// "type": "object",
32206 /// "required": [
32207 /// "algoId",
32208 /// "algoName",
32209 /// "coinId",
32210 /// "coinName",
32211 /// "poolIndex"
32212 /// ],
32213 /// "properties": {
32214 /// "algoId": {
32215 /// "examples": [
32216 /// 1
32217 /// ],
32218 /// "type": "integer",
32219 /// "format": "int64"
32220 /// },
32221 /// "algoName": {
32222 /// "examples": [
32223 /// "sha256"
32224 /// ],
32225 /// "type": "string"
32226 /// },
32227 /// "coinId": {
32228 /// "examples": [
32229 /// 1
32230 /// ],
32231 /// "type": "integer",
32232 /// "format": "int64"
32233 /// },
32234 /// "coinName": {
32235 /// "examples": [
32236 /// "BTC"
32237 /// ],
32238 /// "type": "string"
32239 /// },
32240 /// "poolIndex": {
32241 /// "examples": [
32242 /// 0
32243 /// ],
32244 /// "type": "integer",
32245 /// "format": "int64"
32246 /// }
32247 /// }
32248 /// }
32249 /// },
32250 /// "msg": {
32251 /// "examples": [
32252 /// ""
32253 /// ],
32254 /// "type": "string"
32255 /// }
32256 /// }
32257 ///}
32258 /// ```
32259 /// </details>
32260 #[derive(Clone, Debug, Deserialize, Serialize)]
32261 pub struct MiningPubCoinListResponse {
32262 pub code: i64,
32263 pub data: Vec<MiningPubCoinListResponseDataItem>,
32264 pub msg: String,
32265 }
32266 impl From<&MiningPubCoinListResponse> for MiningPubCoinListResponse {
32267 fn from(value: &MiningPubCoinListResponse) -> Self {
32268 value.clone()
32269 }
32270 }
32271 ///MiningPubCoinListResponseDataItem
32272 ///
32273 /// <details><summary>JSON schema</summary>
32274 ///
32275 /// ```json
32276 ///{
32277 /// "type": "object",
32278 /// "required": [
32279 /// "algoId",
32280 /// "algoName",
32281 /// "coinId",
32282 /// "coinName",
32283 /// "poolIndex"
32284 /// ],
32285 /// "properties": {
32286 /// "algoId": {
32287 /// "examples": [
32288 /// 1
32289 /// ],
32290 /// "type": "integer",
32291 /// "format": "int64"
32292 /// },
32293 /// "algoName": {
32294 /// "examples": [
32295 /// "sha256"
32296 /// ],
32297 /// "type": "string"
32298 /// },
32299 /// "coinId": {
32300 /// "examples": [
32301 /// 1
32302 /// ],
32303 /// "type": "integer",
32304 /// "format": "int64"
32305 /// },
32306 /// "coinName": {
32307 /// "examples": [
32308 /// "BTC"
32309 /// ],
32310 /// "type": "string"
32311 /// },
32312 /// "poolIndex": {
32313 /// "examples": [
32314 /// 0
32315 /// ],
32316 /// "type": "integer",
32317 /// "format": "int64"
32318 /// }
32319 /// }
32320 ///}
32321 /// ```
32322 /// </details>
32323 #[derive(Clone, Debug, Deserialize, Serialize)]
32324 pub struct MiningPubCoinListResponseDataItem {
32325 #[serde(rename = "algoId")]
32326 pub algo_id: i64,
32327 #[serde(rename = "algoName")]
32328 pub algo_name: String,
32329 #[serde(rename = "coinId")]
32330 pub coin_id: i64,
32331 #[serde(rename = "coinName")]
32332 pub coin_name: String,
32333 #[serde(rename = "poolIndex")]
32334 pub pool_index: i64,
32335 }
32336 impl From<&MiningPubCoinListResponseDataItem> for MiningPubCoinListResponseDataItem {
32337 fn from(value: &MiningPubCoinListResponseDataItem) -> Self {
32338 value.clone()
32339 }
32340 }
32341 ///MiningStatisticsUserListResponse
32342 ///
32343 /// <details><summary>JSON schema</summary>
32344 ///
32345 /// ```json
32346 ///{
32347 /// "type": "object",
32348 /// "required": [
32349 /// "code",
32350 /// "data",
32351 /// "msg"
32352 /// ],
32353 /// "properties": {
32354 /// "code": {
32355 /// "examples": [
32356 /// 0
32357 /// ],
32358 /// "type": "integer",
32359 /// "format": "int64"
32360 /// },
32361 /// "data": {
32362 /// "type": "array",
32363 /// "items": {
32364 /// "type": "object",
32365 /// "required": [
32366 /// "list",
32367 /// "type",
32368 /// "userName"
32369 /// ],
32370 /// "properties": {
32371 /// "list": {
32372 /// "type": "array",
32373 /// "items": {
32374 /// "type": "object",
32375 /// "required": [
32376 /// "hashrate",
32377 /// "reject",
32378 /// "time"
32379 /// ],
32380 /// "properties": {
32381 /// "hashrate": {
32382 /// "examples": [
32383 /// "0.00000000"
32384 /// ],
32385 /// "type": "string"
32386 /// },
32387 /// "reject": {
32388 /// "examples": [
32389 /// "0.00000000"
32390 /// ],
32391 /// "type": "string"
32392 /// },
32393 /// "time": {
32394 /// "examples": [
32395 /// 1585267200000
32396 /// ],
32397 /// "type": "integer",
32398 /// "format": "int64"
32399 /// }
32400 /// }
32401 /// }
32402 /// },
32403 /// "type": {
32404 /// "examples": [
32405 /// "H_hashrate"
32406 /// ],
32407 /// "type": "string"
32408 /// },
32409 /// "userName": {
32410 /// "examples": [
32411 /// "test"
32412 /// ],
32413 /// "type": "string"
32414 /// }
32415 /// }
32416 /// }
32417 /// },
32418 /// "msg": {
32419 /// "examples": [
32420 /// ""
32421 /// ],
32422 /// "type": "string"
32423 /// }
32424 /// }
32425 ///}
32426 /// ```
32427 /// </details>
32428 #[derive(Clone, Debug, Deserialize, Serialize)]
32429 pub struct MiningStatisticsUserListResponse {
32430 pub code: i64,
32431 pub data: Vec<MiningStatisticsUserListResponseDataItem>,
32432 pub msg: String,
32433 }
32434 impl From<&MiningStatisticsUserListResponse> for MiningStatisticsUserListResponse {
32435 fn from(value: &MiningStatisticsUserListResponse) -> Self {
32436 value.clone()
32437 }
32438 }
32439 ///MiningStatisticsUserListResponseDataItem
32440 ///
32441 /// <details><summary>JSON schema</summary>
32442 ///
32443 /// ```json
32444 ///{
32445 /// "type": "object",
32446 /// "required": [
32447 /// "list",
32448 /// "type",
32449 /// "userName"
32450 /// ],
32451 /// "properties": {
32452 /// "list": {
32453 /// "type": "array",
32454 /// "items": {
32455 /// "type": "object",
32456 /// "required": [
32457 /// "hashrate",
32458 /// "reject",
32459 /// "time"
32460 /// ],
32461 /// "properties": {
32462 /// "hashrate": {
32463 /// "examples": [
32464 /// "0.00000000"
32465 /// ],
32466 /// "type": "string"
32467 /// },
32468 /// "reject": {
32469 /// "examples": [
32470 /// "0.00000000"
32471 /// ],
32472 /// "type": "string"
32473 /// },
32474 /// "time": {
32475 /// "examples": [
32476 /// 1585267200000
32477 /// ],
32478 /// "type": "integer",
32479 /// "format": "int64"
32480 /// }
32481 /// }
32482 /// }
32483 /// },
32484 /// "type": {
32485 /// "examples": [
32486 /// "H_hashrate"
32487 /// ],
32488 /// "type": "string"
32489 /// },
32490 /// "userName": {
32491 /// "examples": [
32492 /// "test"
32493 /// ],
32494 /// "type": "string"
32495 /// }
32496 /// }
32497 ///}
32498 /// ```
32499 /// </details>
32500 #[derive(Clone, Debug, Deserialize, Serialize)]
32501 pub struct MiningStatisticsUserListResponseDataItem {
32502 pub list: Vec<MiningStatisticsUserListResponseDataItemListItem>,
32503 #[serde(rename = "type")]
32504 pub type_: String,
32505 #[serde(rename = "userName")]
32506 pub user_name: String,
32507 }
32508 impl From<&MiningStatisticsUserListResponseDataItem>
32509 for MiningStatisticsUserListResponseDataItem {
32510 fn from(value: &MiningStatisticsUserListResponseDataItem) -> Self {
32511 value.clone()
32512 }
32513 }
32514 ///MiningStatisticsUserListResponseDataItemListItem
32515 ///
32516 /// <details><summary>JSON schema</summary>
32517 ///
32518 /// ```json
32519 ///{
32520 /// "type": "object",
32521 /// "required": [
32522 /// "hashrate",
32523 /// "reject",
32524 /// "time"
32525 /// ],
32526 /// "properties": {
32527 /// "hashrate": {
32528 /// "examples": [
32529 /// "0.00000000"
32530 /// ],
32531 /// "type": "string"
32532 /// },
32533 /// "reject": {
32534 /// "examples": [
32535 /// "0.00000000"
32536 /// ],
32537 /// "type": "string"
32538 /// },
32539 /// "time": {
32540 /// "examples": [
32541 /// 1585267200000
32542 /// ],
32543 /// "type": "integer",
32544 /// "format": "int64"
32545 /// }
32546 /// }
32547 ///}
32548 /// ```
32549 /// </details>
32550 #[derive(Clone, Debug, Deserialize, Serialize)]
32551 pub struct MiningStatisticsUserListResponseDataItemListItem {
32552 pub hashrate: String,
32553 pub reject: String,
32554 pub time: i64,
32555 }
32556 impl From<&MiningStatisticsUserListResponseDataItemListItem>
32557 for MiningStatisticsUserListResponseDataItemListItem {
32558 fn from(value: &MiningStatisticsUserListResponseDataItemListItem) -> Self {
32559 value.clone()
32560 }
32561 }
32562 ///MiningStatisticsUserStatusResponse
32563 ///
32564 /// <details><summary>JSON schema</summary>
32565 ///
32566 /// ```json
32567 ///{
32568 /// "type": "object",
32569 /// "required": [
32570 /// "code",
32571 /// "data",
32572 /// "msg"
32573 /// ],
32574 /// "properties": {
32575 /// "code": {
32576 /// "examples": [
32577 /// 0
32578 /// ],
32579 /// "type": "integer",
32580 /// "format": "int64"
32581 /// },
32582 /// "data": {
32583 /// "type": "object",
32584 /// "required": [
32585 /// "algo",
32586 /// "dayHashRate",
32587 /// "fifteenMinHashRate",
32588 /// "invalidNum",
32589 /// "profitToday",
32590 /// "profitYesterday",
32591 /// "unit",
32592 /// "userName",
32593 /// "validNum"
32594 /// ],
32595 /// "properties": {
32596 /// "algo": {
32597 /// "examples": [
32598 /// "sha256"
32599 /// ],
32600 /// "type": "string"
32601 /// },
32602 /// "dayHashRate": {
32603 /// "examples": [
32604 /// "214289268068874127.65000000"
32605 /// ],
32606 /// "type": "string"
32607 /// },
32608 /// "fifteenMinHashRate": {
32609 /// "examples": [
32610 /// "457835490067496409.00000000"
32611 /// ],
32612 /// "type": "string"
32613 /// },
32614 /// "invalidNum": {
32615 /// "examples": [
32616 /// 17562
32617 /// ],
32618 /// "type": "integer",
32619 /// "format": "int64"
32620 /// },
32621 /// "profitToday": {
32622 /// "type": "object",
32623 /// "required": [
32624 /// "BCH",
32625 /// "BSV",
32626 /// "BTC"
32627 /// ],
32628 /// "properties": {
32629 /// "BCH": {
32630 /// "examples": [
32631 /// "106.61586001"
32632 /// ],
32633 /// "type": "string"
32634 /// },
32635 /// "BSV": {
32636 /// "examples": [
32637 /// "56.17055953"
32638 /// ],
32639 /// "type": "string"
32640 /// },
32641 /// "BTC": {
32642 /// "examples": [
32643 /// "0.00314332"
32644 /// ],
32645 /// "type": "string"
32646 /// }
32647 /// }
32648 /// },
32649 /// "profitYesterday": {
32650 /// "type": "object",
32651 /// "required": [
32652 /// "BCH",
32653 /// "BSV",
32654 /// "BTC"
32655 /// ],
32656 /// "properties": {
32657 /// "BCH": {
32658 /// "examples": [
32659 /// "106.61586001"
32660 /// ],
32661 /// "type": "string"
32662 /// },
32663 /// "BSV": {
32664 /// "examples": [
32665 /// "56.17055953"
32666 /// ],
32667 /// "type": "string"
32668 /// },
32669 /// "BTC": {
32670 /// "examples": [
32671 /// "0.00314332"
32672 /// ],
32673 /// "type": "string"
32674 /// }
32675 /// }
32676 /// },
32677 /// "unit": {
32678 /// "examples": [
32679 /// "h/s"
32680 /// ],
32681 /// "type": "string"
32682 /// },
32683 /// "userName": {
32684 /// "examples": [
32685 /// "test"
32686 /// ],
32687 /// "type": "string"
32688 /// },
32689 /// "validNum": {
32690 /// "examples": [
32691 /// 0
32692 /// ],
32693 /// "type": "integer",
32694 /// "format": "int64"
32695 /// }
32696 /// }
32697 /// },
32698 /// "msg": {
32699 /// "examples": [
32700 /// ""
32701 /// ],
32702 /// "type": "string"
32703 /// }
32704 /// }
32705 ///}
32706 /// ```
32707 /// </details>
32708 #[derive(Clone, Debug, Deserialize, Serialize)]
32709 pub struct MiningStatisticsUserStatusResponse {
32710 pub code: i64,
32711 pub data: MiningStatisticsUserStatusResponseData,
32712 pub msg: String,
32713 }
32714 impl From<&MiningStatisticsUserStatusResponse>
32715 for MiningStatisticsUserStatusResponse {
32716 fn from(value: &MiningStatisticsUserStatusResponse) -> Self {
32717 value.clone()
32718 }
32719 }
32720 ///MiningStatisticsUserStatusResponseData
32721 ///
32722 /// <details><summary>JSON schema</summary>
32723 ///
32724 /// ```json
32725 ///{
32726 /// "type": "object",
32727 /// "required": [
32728 /// "algo",
32729 /// "dayHashRate",
32730 /// "fifteenMinHashRate",
32731 /// "invalidNum",
32732 /// "profitToday",
32733 /// "profitYesterday",
32734 /// "unit",
32735 /// "userName",
32736 /// "validNum"
32737 /// ],
32738 /// "properties": {
32739 /// "algo": {
32740 /// "examples": [
32741 /// "sha256"
32742 /// ],
32743 /// "type": "string"
32744 /// },
32745 /// "dayHashRate": {
32746 /// "examples": [
32747 /// "214289268068874127.65000000"
32748 /// ],
32749 /// "type": "string"
32750 /// },
32751 /// "fifteenMinHashRate": {
32752 /// "examples": [
32753 /// "457835490067496409.00000000"
32754 /// ],
32755 /// "type": "string"
32756 /// },
32757 /// "invalidNum": {
32758 /// "examples": [
32759 /// 17562
32760 /// ],
32761 /// "type": "integer",
32762 /// "format": "int64"
32763 /// },
32764 /// "profitToday": {
32765 /// "type": "object",
32766 /// "required": [
32767 /// "BCH",
32768 /// "BSV",
32769 /// "BTC"
32770 /// ],
32771 /// "properties": {
32772 /// "BCH": {
32773 /// "examples": [
32774 /// "106.61586001"
32775 /// ],
32776 /// "type": "string"
32777 /// },
32778 /// "BSV": {
32779 /// "examples": [
32780 /// "56.17055953"
32781 /// ],
32782 /// "type": "string"
32783 /// },
32784 /// "BTC": {
32785 /// "examples": [
32786 /// "0.00314332"
32787 /// ],
32788 /// "type": "string"
32789 /// }
32790 /// }
32791 /// },
32792 /// "profitYesterday": {
32793 /// "type": "object",
32794 /// "required": [
32795 /// "BCH",
32796 /// "BSV",
32797 /// "BTC"
32798 /// ],
32799 /// "properties": {
32800 /// "BCH": {
32801 /// "examples": [
32802 /// "106.61586001"
32803 /// ],
32804 /// "type": "string"
32805 /// },
32806 /// "BSV": {
32807 /// "examples": [
32808 /// "56.17055953"
32809 /// ],
32810 /// "type": "string"
32811 /// },
32812 /// "BTC": {
32813 /// "examples": [
32814 /// "0.00314332"
32815 /// ],
32816 /// "type": "string"
32817 /// }
32818 /// }
32819 /// },
32820 /// "unit": {
32821 /// "examples": [
32822 /// "h/s"
32823 /// ],
32824 /// "type": "string"
32825 /// },
32826 /// "userName": {
32827 /// "examples": [
32828 /// "test"
32829 /// ],
32830 /// "type": "string"
32831 /// },
32832 /// "validNum": {
32833 /// "examples": [
32834 /// 0
32835 /// ],
32836 /// "type": "integer",
32837 /// "format": "int64"
32838 /// }
32839 /// }
32840 ///}
32841 /// ```
32842 /// </details>
32843 #[derive(Clone, Debug, Deserialize, Serialize)]
32844 pub struct MiningStatisticsUserStatusResponseData {
32845 pub algo: String,
32846 #[serde(rename = "dayHashRate")]
32847 pub day_hash_rate: String,
32848 #[serde(rename = "fifteenMinHashRate")]
32849 pub fifteen_min_hash_rate: String,
32850 #[serde(rename = "invalidNum")]
32851 pub invalid_num: i64,
32852 #[serde(rename = "profitToday")]
32853 pub profit_today: MiningStatisticsUserStatusResponseDataProfitToday,
32854 #[serde(rename = "profitYesterday")]
32855 pub profit_yesterday: MiningStatisticsUserStatusResponseDataProfitYesterday,
32856 pub unit: String,
32857 #[serde(rename = "userName")]
32858 pub user_name: String,
32859 #[serde(rename = "validNum")]
32860 pub valid_num: i64,
32861 }
32862 impl From<&MiningStatisticsUserStatusResponseData>
32863 for MiningStatisticsUserStatusResponseData {
32864 fn from(value: &MiningStatisticsUserStatusResponseData) -> Self {
32865 value.clone()
32866 }
32867 }
32868 ///MiningStatisticsUserStatusResponseDataProfitToday
32869 ///
32870 /// <details><summary>JSON schema</summary>
32871 ///
32872 /// ```json
32873 ///{
32874 /// "type": "object",
32875 /// "required": [
32876 /// "BCH",
32877 /// "BSV",
32878 /// "BTC"
32879 /// ],
32880 /// "properties": {
32881 /// "BCH": {
32882 /// "examples": [
32883 /// "106.61586001"
32884 /// ],
32885 /// "type": "string"
32886 /// },
32887 /// "BSV": {
32888 /// "examples": [
32889 /// "56.17055953"
32890 /// ],
32891 /// "type": "string"
32892 /// },
32893 /// "BTC": {
32894 /// "examples": [
32895 /// "0.00314332"
32896 /// ],
32897 /// "type": "string"
32898 /// }
32899 /// }
32900 ///}
32901 /// ```
32902 /// </details>
32903 #[derive(Clone, Debug, Deserialize, Serialize)]
32904 pub struct MiningStatisticsUserStatusResponseDataProfitToday {
32905 #[serde(rename = "BCH")]
32906 pub bch: String,
32907 #[serde(rename = "BSV")]
32908 pub bsv: String,
32909 #[serde(rename = "BTC")]
32910 pub btc: String,
32911 }
32912 impl From<&MiningStatisticsUserStatusResponseDataProfitToday>
32913 for MiningStatisticsUserStatusResponseDataProfitToday {
32914 fn from(value: &MiningStatisticsUserStatusResponseDataProfitToday) -> Self {
32915 value.clone()
32916 }
32917 }
32918 ///MiningStatisticsUserStatusResponseDataProfitYesterday
32919 ///
32920 /// <details><summary>JSON schema</summary>
32921 ///
32922 /// ```json
32923 ///{
32924 /// "type": "object",
32925 /// "required": [
32926 /// "BCH",
32927 /// "BSV",
32928 /// "BTC"
32929 /// ],
32930 /// "properties": {
32931 /// "BCH": {
32932 /// "examples": [
32933 /// "106.61586001"
32934 /// ],
32935 /// "type": "string"
32936 /// },
32937 /// "BSV": {
32938 /// "examples": [
32939 /// "56.17055953"
32940 /// ],
32941 /// "type": "string"
32942 /// },
32943 /// "BTC": {
32944 /// "examples": [
32945 /// "0.00314332"
32946 /// ],
32947 /// "type": "string"
32948 /// }
32949 /// }
32950 ///}
32951 /// ```
32952 /// </details>
32953 #[derive(Clone, Debug, Deserialize, Serialize)]
32954 pub struct MiningStatisticsUserStatusResponseDataProfitYesterday {
32955 #[serde(rename = "BCH")]
32956 pub bch: String,
32957 #[serde(rename = "BSV")]
32958 pub bsv: String,
32959 #[serde(rename = "BTC")]
32960 pub btc: String,
32961 }
32962 impl From<&MiningStatisticsUserStatusResponseDataProfitYesterday>
32963 for MiningStatisticsUserStatusResponseDataProfitYesterday {
32964 fn from(value: &MiningStatisticsUserStatusResponseDataProfitYesterday) -> Self {
32965 value.clone()
32966 }
32967 }
32968 ///MiningWorkerDetailResponse
32969 ///
32970 /// <details><summary>JSON schema</summary>
32971 ///
32972 /// ```json
32973 ///{
32974 /// "type": "object",
32975 /// "required": [
32976 /// "code",
32977 /// "data",
32978 /// "msg"
32979 /// ],
32980 /// "properties": {
32981 /// "code": {
32982 /// "examples": [
32983 /// 0
32984 /// ],
32985 /// "type": "integer",
32986 /// "format": "int64"
32987 /// },
32988 /// "data": {
32989 /// "type": "array",
32990 /// "items": {
32991 /// "type": "object",
32992 /// "required": [
32993 /// "hashrateDatas",
32994 /// "type",
32995 /// "workerName"
32996 /// ],
32997 /// "properties": {
32998 /// "hashrateDatas": {
32999 /// "type": "array",
33000 /// "items": {
33001 /// "type": "object",
33002 /// "required": [
33003 /// "hashrate",
33004 /// "reject",
33005 /// "time"
33006 /// ],
33007 /// "properties": {
33008 /// "hashrate": {
33009 /// "examples": [
33010 /// "0"
33011 /// ],
33012 /// "type": "string"
33013 /// },
33014 /// "reject": {
33015 /// "description": "Rejection Rate",
33016 /// "examples": [
33017 /// 0
33018 /// ],
33019 /// "type": "integer",
33020 /// "format": "int64"
33021 /// },
33022 /// "time": {
33023 /// "examples": [
33024 /// 1587902400000
33025 /// ],
33026 /// "type": "integer",
33027 /// "format": "int64"
33028 /// }
33029 /// }
33030 /// }
33031 /// },
33032 /// "type": {
33033 /// "description": "Type of hourly hashrate",
33034 /// "examples": [
33035 /// "H_hashrate"
33036 /// ],
33037 /// "type": "string"
33038 /// },
33039 /// "workerName": {
33040 /// "description": "Mining Account name",
33041 /// "examples": [
33042 /// "bhdc1.16A10404B"
33043 /// ],
33044 /// "type": "string"
33045 /// }
33046 /// }
33047 /// }
33048 /// },
33049 /// "msg": {
33050 /// "examples": [
33051 /// ""
33052 /// ],
33053 /// "type": "string"
33054 /// }
33055 /// }
33056 ///}
33057 /// ```
33058 /// </details>
33059 #[derive(Clone, Debug, Deserialize, Serialize)]
33060 pub struct MiningWorkerDetailResponse {
33061 pub code: i64,
33062 pub data: Vec<MiningWorkerDetailResponseDataItem>,
33063 pub msg: String,
33064 }
33065 impl From<&MiningWorkerDetailResponse> for MiningWorkerDetailResponse {
33066 fn from(value: &MiningWorkerDetailResponse) -> Self {
33067 value.clone()
33068 }
33069 }
33070 ///MiningWorkerDetailResponseDataItem
33071 ///
33072 /// <details><summary>JSON schema</summary>
33073 ///
33074 /// ```json
33075 ///{
33076 /// "type": "object",
33077 /// "required": [
33078 /// "hashrateDatas",
33079 /// "type",
33080 /// "workerName"
33081 /// ],
33082 /// "properties": {
33083 /// "hashrateDatas": {
33084 /// "type": "array",
33085 /// "items": {
33086 /// "type": "object",
33087 /// "required": [
33088 /// "hashrate",
33089 /// "reject",
33090 /// "time"
33091 /// ],
33092 /// "properties": {
33093 /// "hashrate": {
33094 /// "examples": [
33095 /// "0"
33096 /// ],
33097 /// "type": "string"
33098 /// },
33099 /// "reject": {
33100 /// "description": "Rejection Rate",
33101 /// "examples": [
33102 /// 0
33103 /// ],
33104 /// "type": "integer",
33105 /// "format": "int64"
33106 /// },
33107 /// "time": {
33108 /// "examples": [
33109 /// 1587902400000
33110 /// ],
33111 /// "type": "integer",
33112 /// "format": "int64"
33113 /// }
33114 /// }
33115 /// }
33116 /// },
33117 /// "type": {
33118 /// "description": "Type of hourly hashrate",
33119 /// "examples": [
33120 /// "H_hashrate"
33121 /// ],
33122 /// "type": "string"
33123 /// },
33124 /// "workerName": {
33125 /// "description": "Mining Account name",
33126 /// "examples": [
33127 /// "bhdc1.16A10404B"
33128 /// ],
33129 /// "type": "string"
33130 /// }
33131 /// }
33132 ///}
33133 /// ```
33134 /// </details>
33135 #[derive(Clone, Debug, Deserialize, Serialize)]
33136 pub struct MiningWorkerDetailResponseDataItem {
33137 #[serde(rename = "hashrateDatas")]
33138 pub hashrate_datas: Vec<MiningWorkerDetailResponseDataItemHashrateDatasItem>,
33139 ///Type of hourly hashrate
33140 #[serde(rename = "type")]
33141 pub type_: String,
33142 ///Mining Account name
33143 #[serde(rename = "workerName")]
33144 pub worker_name: String,
33145 }
33146 impl From<&MiningWorkerDetailResponseDataItem>
33147 for MiningWorkerDetailResponseDataItem {
33148 fn from(value: &MiningWorkerDetailResponseDataItem) -> Self {
33149 value.clone()
33150 }
33151 }
33152 ///MiningWorkerDetailResponseDataItemHashrateDatasItem
33153 ///
33154 /// <details><summary>JSON schema</summary>
33155 ///
33156 /// ```json
33157 ///{
33158 /// "type": "object",
33159 /// "required": [
33160 /// "hashrate",
33161 /// "reject",
33162 /// "time"
33163 /// ],
33164 /// "properties": {
33165 /// "hashrate": {
33166 /// "examples": [
33167 /// "0"
33168 /// ],
33169 /// "type": "string"
33170 /// },
33171 /// "reject": {
33172 /// "description": "Rejection Rate",
33173 /// "examples": [
33174 /// 0
33175 /// ],
33176 /// "type": "integer",
33177 /// "format": "int64"
33178 /// },
33179 /// "time": {
33180 /// "examples": [
33181 /// 1587902400000
33182 /// ],
33183 /// "type": "integer",
33184 /// "format": "int64"
33185 /// }
33186 /// }
33187 ///}
33188 /// ```
33189 /// </details>
33190 #[derive(Clone, Debug, Deserialize, Serialize)]
33191 pub struct MiningWorkerDetailResponseDataItemHashrateDatasItem {
33192 pub hashrate: String,
33193 ///Rejection Rate
33194 pub reject: i64,
33195 pub time: i64,
33196 }
33197 impl From<&MiningWorkerDetailResponseDataItemHashrateDatasItem>
33198 for MiningWorkerDetailResponseDataItemHashrateDatasItem {
33199 fn from(value: &MiningWorkerDetailResponseDataItemHashrateDatasItem) -> Self {
33200 value.clone()
33201 }
33202 }
33203 ///MiningWorkerListResponse
33204 ///
33205 /// <details><summary>JSON schema</summary>
33206 ///
33207 /// ```json
33208 ///{
33209 /// "type": "object",
33210 /// "required": [
33211 /// "code",
33212 /// "data",
33213 /// "msg"
33214 /// ],
33215 /// "properties": {
33216 /// "code": {
33217 /// "examples": [
33218 /// 0
33219 /// ],
33220 /// "type": "integer",
33221 /// "format": "int64"
33222 /// },
33223 /// "data": {
33224 /// "type": "object",
33225 /// "required": [
33226 /// "pageSize",
33227 /// "totalNum",
33228 /// "workerDatas"
33229 /// ],
33230 /// "properties": {
33231 /// "pageSize": {
33232 /// "examples": [
33233 /// 20
33234 /// ],
33235 /// "type": "integer",
33236 /// "format": "int64"
33237 /// },
33238 /// "totalNum": {
33239 /// "examples": [
33240 /// 18530
33241 /// ],
33242 /// "type": "integer",
33243 /// "format": "int64"
33244 /// },
33245 /// "workerDatas": {
33246 /// "type": "array",
33247 /// "items": {
33248 /// "type": "object",
33249 /// "required": [
33250 /// "dayHashRate",
33251 /// "hashRate",
33252 /// "lastShareTime",
33253 /// "rejectRate",
33254 /// "status",
33255 /// "workerId",
33256 /// "workerName"
33257 /// ],
33258 /// "properties": {
33259 /// "dayHashRate": {
33260 /// "description": "24H Hashrate",
33261 /// "examples": [
33262 /// 0
33263 /// ],
33264 /// "type": "integer",
33265 /// "format": "int64"
33266 /// },
33267 /// "hashRate": {
33268 /// "description": "Real-time rate",
33269 /// "examples": [
33270 /// 0
33271 /// ],
33272 /// "type": "integer",
33273 /// "format": "int64"
33274 /// },
33275 /// "lastShareTime": {
33276 /// "description": "Last submission time",
33277 /// "examples": [
33278 /// 1587712919000
33279 /// ],
33280 /// "type": "integer",
33281 /// "format": "int64"
33282 /// },
33283 /// "rejectRate": {
33284 /// "description": "Real-time Rejection Rate",
33285 /// "examples": [
33286 /// 0
33287 /// ],
33288 /// "type": "integer",
33289 /// "format": "int64"
33290 /// },
33291 /// "status": {
33292 /// "description": "Status:1 valid, 2 invalid, 3 no longer valid",
33293 /// "examples": [
33294 /// 3
33295 /// ],
33296 /// "type": "integer",
33297 /// "format": "int64"
33298 /// },
33299 /// "workerId": {
33300 /// "examples": [
33301 /// "1420554439452400131"
33302 /// ],
33303 /// "type": "string"
33304 /// },
33305 /// "workerName": {
33306 /// "examples": [
33307 /// "2X73"
33308 /// ],
33309 /// "type": "string"
33310 /// }
33311 /// }
33312 /// }
33313 /// }
33314 /// }
33315 /// },
33316 /// "msg": {
33317 /// "examples": [
33318 /// ""
33319 /// ],
33320 /// "type": "string"
33321 /// }
33322 /// }
33323 ///}
33324 /// ```
33325 /// </details>
33326 #[derive(Clone, Debug, Deserialize, Serialize)]
33327 pub struct MiningWorkerListResponse {
33328 pub code: i64,
33329 pub data: MiningWorkerListResponseData,
33330 pub msg: String,
33331 }
33332 impl From<&MiningWorkerListResponse> for MiningWorkerListResponse {
33333 fn from(value: &MiningWorkerListResponse) -> Self {
33334 value.clone()
33335 }
33336 }
33337 ///MiningWorkerListResponseData
33338 ///
33339 /// <details><summary>JSON schema</summary>
33340 ///
33341 /// ```json
33342 ///{
33343 /// "type": "object",
33344 /// "required": [
33345 /// "pageSize",
33346 /// "totalNum",
33347 /// "workerDatas"
33348 /// ],
33349 /// "properties": {
33350 /// "pageSize": {
33351 /// "examples": [
33352 /// 20
33353 /// ],
33354 /// "type": "integer",
33355 /// "format": "int64"
33356 /// },
33357 /// "totalNum": {
33358 /// "examples": [
33359 /// 18530
33360 /// ],
33361 /// "type": "integer",
33362 /// "format": "int64"
33363 /// },
33364 /// "workerDatas": {
33365 /// "type": "array",
33366 /// "items": {
33367 /// "type": "object",
33368 /// "required": [
33369 /// "dayHashRate",
33370 /// "hashRate",
33371 /// "lastShareTime",
33372 /// "rejectRate",
33373 /// "status",
33374 /// "workerId",
33375 /// "workerName"
33376 /// ],
33377 /// "properties": {
33378 /// "dayHashRate": {
33379 /// "description": "24H Hashrate",
33380 /// "examples": [
33381 /// 0
33382 /// ],
33383 /// "type": "integer",
33384 /// "format": "int64"
33385 /// },
33386 /// "hashRate": {
33387 /// "description": "Real-time rate",
33388 /// "examples": [
33389 /// 0
33390 /// ],
33391 /// "type": "integer",
33392 /// "format": "int64"
33393 /// },
33394 /// "lastShareTime": {
33395 /// "description": "Last submission time",
33396 /// "examples": [
33397 /// 1587712919000
33398 /// ],
33399 /// "type": "integer",
33400 /// "format": "int64"
33401 /// },
33402 /// "rejectRate": {
33403 /// "description": "Real-time Rejection Rate",
33404 /// "examples": [
33405 /// 0
33406 /// ],
33407 /// "type": "integer",
33408 /// "format": "int64"
33409 /// },
33410 /// "status": {
33411 /// "description": "Status:1 valid, 2 invalid, 3 no longer valid",
33412 /// "examples": [
33413 /// 3
33414 /// ],
33415 /// "type": "integer",
33416 /// "format": "int64"
33417 /// },
33418 /// "workerId": {
33419 /// "examples": [
33420 /// "1420554439452400131"
33421 /// ],
33422 /// "type": "string"
33423 /// },
33424 /// "workerName": {
33425 /// "examples": [
33426 /// "2X73"
33427 /// ],
33428 /// "type": "string"
33429 /// }
33430 /// }
33431 /// }
33432 /// }
33433 /// }
33434 ///}
33435 /// ```
33436 /// </details>
33437 #[derive(Clone, Debug, Deserialize, Serialize)]
33438 pub struct MiningWorkerListResponseData {
33439 #[serde(rename = "pageSize")]
33440 pub page_size: i64,
33441 #[serde(rename = "totalNum")]
33442 pub total_num: i64,
33443 #[serde(rename = "workerDatas")]
33444 pub worker_datas: Vec<MiningWorkerListResponseDataWorkerDatasItem>,
33445 }
33446 impl From<&MiningWorkerListResponseData> for MiningWorkerListResponseData {
33447 fn from(value: &MiningWorkerListResponseData) -> Self {
33448 value.clone()
33449 }
33450 }
33451 ///MiningWorkerListResponseDataWorkerDatasItem
33452 ///
33453 /// <details><summary>JSON schema</summary>
33454 ///
33455 /// ```json
33456 ///{
33457 /// "type": "object",
33458 /// "required": [
33459 /// "dayHashRate",
33460 /// "hashRate",
33461 /// "lastShareTime",
33462 /// "rejectRate",
33463 /// "status",
33464 /// "workerId",
33465 /// "workerName"
33466 /// ],
33467 /// "properties": {
33468 /// "dayHashRate": {
33469 /// "description": "24H Hashrate",
33470 /// "examples": [
33471 /// 0
33472 /// ],
33473 /// "type": "integer",
33474 /// "format": "int64"
33475 /// },
33476 /// "hashRate": {
33477 /// "description": "Real-time rate",
33478 /// "examples": [
33479 /// 0
33480 /// ],
33481 /// "type": "integer",
33482 /// "format": "int64"
33483 /// },
33484 /// "lastShareTime": {
33485 /// "description": "Last submission time",
33486 /// "examples": [
33487 /// 1587712919000
33488 /// ],
33489 /// "type": "integer",
33490 /// "format": "int64"
33491 /// },
33492 /// "rejectRate": {
33493 /// "description": "Real-time Rejection Rate",
33494 /// "examples": [
33495 /// 0
33496 /// ],
33497 /// "type": "integer",
33498 /// "format": "int64"
33499 /// },
33500 /// "status": {
33501 /// "description": "Status:1 valid, 2 invalid, 3 no longer valid",
33502 /// "examples": [
33503 /// 3
33504 /// ],
33505 /// "type": "integer",
33506 /// "format": "int64"
33507 /// },
33508 /// "workerId": {
33509 /// "examples": [
33510 /// "1420554439452400131"
33511 /// ],
33512 /// "type": "string"
33513 /// },
33514 /// "workerName": {
33515 /// "examples": [
33516 /// "2X73"
33517 /// ],
33518 /// "type": "string"
33519 /// }
33520 /// }
33521 ///}
33522 /// ```
33523 /// </details>
33524 #[derive(Clone, Debug, Deserialize, Serialize)]
33525 pub struct MiningWorkerListResponseDataWorkerDatasItem {
33526 ///24H Hashrate
33527 #[serde(rename = "dayHashRate")]
33528 pub day_hash_rate: i64,
33529 ///Real-time rate
33530 #[serde(rename = "hashRate")]
33531 pub hash_rate: i64,
33532 ///Last submission time
33533 #[serde(rename = "lastShareTime")]
33534 pub last_share_time: i64,
33535 ///Real-time Rejection Rate
33536 #[serde(rename = "rejectRate")]
33537 pub reject_rate: i64,
33538 ///Status:1 valid, 2 invalid, 3 no longer valid
33539 pub status: i64,
33540 #[serde(rename = "workerId")]
33541 pub worker_id: String,
33542 #[serde(rename = "workerName")]
33543 pub worker_name: String,
33544 }
33545 impl From<&MiningWorkerListResponseDataWorkerDatasItem>
33546 for MiningWorkerListResponseDataWorkerDatasItem {
33547 fn from(value: &MiningWorkerListResponseDataWorkerDatasItem) -> Self {
33548 value.clone()
33549 }
33550 }
33551 ///MyAllocationsResponseItem
33552 ///
33553 /// <details><summary>JSON schema</summary>
33554 ///
33555 /// ```json
33556 ///{
33557 /// "type": "object",
33558 /// "required": [
33559 /// "allocationId",
33560 /// "allocationType",
33561 /// "commission",
33562 /// "commissionAsset",
33563 /// "isAllocator",
33564 /// "isBuyer",
33565 /// "isMaker",
33566 /// "orderId",
33567 /// "orderListId",
33568 /// "price",
33569 /// "qty",
33570 /// "quoteQty",
33571 /// "symbol",
33572 /// "time"
33573 /// ],
33574 /// "properties": {
33575 /// "allocationId": {
33576 /// "examples": [
33577 /// 0
33578 /// ],
33579 /// "type": "integer",
33580 /// "format": "int64"
33581 /// },
33582 /// "allocationType": {
33583 /// "examples": [
33584 /// "SOR"
33585 /// ],
33586 /// "type": "string"
33587 /// },
33588 /// "commission": {
33589 /// "examples": [
33590 /// "0.00000000"
33591 /// ],
33592 /// "type": "string"
33593 /// },
33594 /// "commissionAsset": {
33595 /// "examples": [
33596 /// "BTC"
33597 /// ],
33598 /// "type": "string"
33599 /// },
33600 /// "isAllocator": {
33601 /// "examples": [
33602 /// false
33603 /// ],
33604 /// "type": "boolean"
33605 /// },
33606 /// "isBuyer": {
33607 /// "examples": [
33608 /// true
33609 /// ],
33610 /// "type": "boolean"
33611 /// },
33612 /// "isMaker": {
33613 /// "examples": [
33614 /// false
33615 /// ],
33616 /// "type": "boolean"
33617 /// },
33618 /// "orderId": {
33619 /// "examples": [
33620 /// 1
33621 /// ],
33622 /// "type": "integer",
33623 /// "format": "int64"
33624 /// },
33625 /// "orderListId": {
33626 /// "examples": [
33627 /// -1
33628 /// ],
33629 /// "type": "integer",
33630 /// "format": "int64"
33631 /// },
33632 /// "price": {
33633 /// "examples": [
33634 /// "1.00000000"
33635 /// ],
33636 /// "type": "string"
33637 /// },
33638 /// "qty": {
33639 /// "examples": [
33640 /// "5.00000000"
33641 /// ],
33642 /// "type": "string"
33643 /// },
33644 /// "quoteQty": {
33645 /// "examples": [
33646 /// "5.00000000"
33647 /// ],
33648 /// "type": "string"
33649 /// },
33650 /// "symbol": {
33651 /// "examples": [
33652 /// "BTCUSDT"
33653 /// ],
33654 /// "type": "string"
33655 /// },
33656 /// "time": {
33657 /// "examples": [
33658 /// 1687506878118
33659 /// ],
33660 /// "type": "integer",
33661 /// "format": "int64"
33662 /// }
33663 /// }
33664 ///}
33665 /// ```
33666 /// </details>
33667 #[derive(Clone, Debug, Deserialize, Serialize)]
33668 pub struct MyAllocationsResponseItem {
33669 #[serde(rename = "allocationId")]
33670 pub allocation_id: i64,
33671 #[serde(rename = "allocationType")]
33672 pub allocation_type: String,
33673 pub commission: String,
33674 #[serde(rename = "commissionAsset")]
33675 pub commission_asset: String,
33676 #[serde(rename = "isAllocator")]
33677 pub is_allocator: bool,
33678 #[serde(rename = "isBuyer")]
33679 pub is_buyer: bool,
33680 #[serde(rename = "isMaker")]
33681 pub is_maker: bool,
33682 #[serde(rename = "orderId")]
33683 pub order_id: i64,
33684 #[serde(rename = "orderListId")]
33685 pub order_list_id: i64,
33686 pub price: String,
33687 pub qty: String,
33688 #[serde(rename = "quoteQty")]
33689 pub quote_qty: String,
33690 pub symbol: String,
33691 pub time: i64,
33692 }
33693 impl From<&MyAllocationsResponseItem> for MyAllocationsResponseItem {
33694 fn from(value: &MyAllocationsResponseItem) -> Self {
33695 value.clone()
33696 }
33697 }
33698 ///MyPreventedMatchesResponseItem
33699 ///
33700 /// <details><summary>JSON schema</summary>
33701 ///
33702 /// ```json
33703 ///{
33704 /// "type": "object",
33705 /// "required": [
33706 /// "makerOrderId",
33707 /// "makerPreventedQuantity",
33708 /// "preventedMatchId",
33709 /// "price",
33710 /// "selfTradePreventionMode",
33711 /// "symbol",
33712 /// "takerOrderId",
33713 /// "tradeGroupId",
33714 /// "transactTime"
33715 /// ],
33716 /// "properties": {
33717 /// "makerOrderId": {
33718 /// "examples": [
33719 /// 3
33720 /// ],
33721 /// "type": "integer",
33722 /// "format": "int64"
33723 /// },
33724 /// "makerPreventedQuantity": {
33725 /// "examples": [
33726 /// "1.300000"
33727 /// ],
33728 /// "type": "string"
33729 /// },
33730 /// "preventedMatchId": {
33731 /// "examples": [
33732 /// 1
33733 /// ],
33734 /// "type": "integer",
33735 /// "format": "int64"
33736 /// },
33737 /// "price": {
33738 /// "examples": [
33739 /// "1.100000"
33740 /// ],
33741 /// "type": "string"
33742 /// },
33743 /// "selfTradePreventionMode": {
33744 /// "examples": [
33745 /// "EXPIRE_MAKER"
33746 /// ],
33747 /// "type": "string"
33748 /// },
33749 /// "symbol": {
33750 /// "examples": [
33751 /// "BTCUSDT"
33752 /// ],
33753 /// "type": "string"
33754 /// },
33755 /// "takerOrderId": {
33756 /// "examples": [
33757 /// 5
33758 /// ],
33759 /// "type": "integer",
33760 /// "format": "int64"
33761 /// },
33762 /// "tradeGroupId": {
33763 /// "examples": [
33764 /// 1
33765 /// ],
33766 /// "type": "integer",
33767 /// "format": "int64"
33768 /// },
33769 /// "transactTime": {
33770 /// "examples": [
33771 /// 1669101687094
33772 /// ],
33773 /// "type": "integer",
33774 /// "format": "int64"
33775 /// }
33776 /// }
33777 ///}
33778 /// ```
33779 /// </details>
33780 #[derive(Clone, Debug, Deserialize, Serialize)]
33781 pub struct MyPreventedMatchesResponseItem {
33782 #[serde(rename = "makerOrderId")]
33783 pub maker_order_id: i64,
33784 #[serde(rename = "makerPreventedQuantity")]
33785 pub maker_prevented_quantity: String,
33786 #[serde(rename = "preventedMatchId")]
33787 pub prevented_match_id: i64,
33788 pub price: String,
33789 #[serde(rename = "selfTradePreventionMode")]
33790 pub self_trade_prevention_mode: String,
33791 pub symbol: String,
33792 #[serde(rename = "takerOrderId")]
33793 pub taker_order_id: i64,
33794 #[serde(rename = "tradeGroupId")]
33795 pub trade_group_id: i64,
33796 #[serde(rename = "transactTime")]
33797 pub transact_time: i64,
33798 }
33799 impl From<&MyPreventedMatchesResponseItem> for MyPreventedMatchesResponseItem {
33800 fn from(value: &MyPreventedMatchesResponseItem) -> Self {
33801 value.clone()
33802 }
33803 }
33804 ///MyTrade
33805 ///
33806 /// <details><summary>JSON schema</summary>
33807 ///
33808 /// ```json
33809 ///{
33810 /// "type": "object",
33811 /// "required": [
33812 /// "commission",
33813 /// "commissionAsset",
33814 /// "id",
33815 /// "isBestMatch",
33816 /// "isBuyer",
33817 /// "isMaker",
33818 /// "orderId",
33819 /// "orderListId",
33820 /// "price",
33821 /// "qty",
33822 /// "quoteQty",
33823 /// "symbol",
33824 /// "time"
33825 /// ],
33826 /// "properties": {
33827 /// "commission": {
33828 /// "examples": [
33829 /// "10.10000000"
33830 /// ],
33831 /// "type": "string"
33832 /// },
33833 /// "commissionAsset": {
33834 /// "examples": [
33835 /// "BNB"
33836 /// ],
33837 /// "type": "string"
33838 /// },
33839 /// "id": {
33840 /// "description": "Trade id",
33841 /// "examples": [
33842 /// 28457
33843 /// ],
33844 /// "type": "integer",
33845 /// "format": "int64"
33846 /// },
33847 /// "isBestMatch": {
33848 /// "type": "boolean"
33849 /// },
33850 /// "isBuyer": {
33851 /// "examples": [
33852 /// false
33853 /// ],
33854 /// "type": "boolean"
33855 /// },
33856 /// "isMaker": {
33857 /// "examples": [
33858 /// false
33859 /// ],
33860 /// "type": "boolean"
33861 /// },
33862 /// "orderId": {
33863 /// "examples": [
33864 /// 100234
33865 /// ],
33866 /// "type": "integer",
33867 /// "format": "int64"
33868 /// },
33869 /// "orderListId": {
33870 /// "examples": [
33871 /// -1
33872 /// ],
33873 /// "type": "integer",
33874 /// "format": "int64"
33875 /// },
33876 /// "price": {
33877 /// "description": "Price",
33878 /// "examples": [
33879 /// "4.00000100"
33880 /// ],
33881 /// "type": "string"
33882 /// },
33883 /// "qty": {
33884 /// "description": "Amount of base asset",
33885 /// "examples": [
33886 /// "12.00000000"
33887 /// ],
33888 /// "type": "string"
33889 /// },
33890 /// "quoteQty": {
33891 /// "description": "Amount of quote asset",
33892 /// "examples": [
33893 /// "48.000012"
33894 /// ],
33895 /// "type": "string"
33896 /// },
33897 /// "symbol": {
33898 /// "examples": [
33899 /// "BNBBTC"
33900 /// ],
33901 /// "type": "string"
33902 /// },
33903 /// "time": {
33904 /// "description": "Trade timestamp",
33905 /// "examples": [
33906 /// 1499865549590
33907 /// ],
33908 /// "type": "integer",
33909 /// "format": "int64"
33910 /// }
33911 /// }
33912 ///}
33913 /// ```
33914 /// </details>
33915 #[derive(Clone, Debug, Deserialize, Serialize)]
33916 pub struct MyTrade {
33917 pub commission: String,
33918 #[serde(rename = "commissionAsset")]
33919 pub commission_asset: String,
33920 ///Trade id
33921 pub id: i64,
33922 #[serde(rename = "isBestMatch")]
33923 pub is_best_match: bool,
33924 #[serde(rename = "isBuyer")]
33925 pub is_buyer: bool,
33926 #[serde(rename = "isMaker")]
33927 pub is_maker: bool,
33928 #[serde(rename = "orderId")]
33929 pub order_id: i64,
33930 #[serde(rename = "orderListId")]
33931 pub order_list_id: i64,
33932 ///Price
33933 pub price: String,
33934 ///Amount of base asset
33935 pub qty: String,
33936 ///Amount of quote asset
33937 #[serde(rename = "quoteQty")]
33938 pub quote_qty: String,
33939 pub symbol: String,
33940 ///Trade timestamp
33941 pub time: i64,
33942 }
33943 impl From<&MyTrade> for MyTrade {
33944 fn from(value: &MyTrade) -> Self {
33945 value.clone()
33946 }
33947 }
33948 ///NftHistoryDepositResponse
33949 ///
33950 /// <details><summary>JSON schema</summary>
33951 ///
33952 /// ```json
33953 ///{
33954 /// "type": "object",
33955 /// "required": [
33956 /// "list",
33957 /// "total"
33958 /// ],
33959 /// "properties": {
33960 /// "list": {
33961 /// "type": "array",
33962 /// "items": {
33963 /// "type": "object",
33964 /// "required": [
33965 /// "contractAdrress",
33966 /// "network",
33967 /// "timestamp",
33968 /// "tokenId",
33969 /// "txID"
33970 /// ],
33971 /// "properties": {
33972 /// "contractAdrress": {
33973 /// "examples": [
33974 /// "0xe507c961ee127d4439977a61af39c34eafee0dc6"
33975 /// ],
33976 /// "type": "string"
33977 /// },
33978 /// "network": {
33979 /// "examples": [
33980 /// "ETH"
33981 /// ],
33982 /// "type": "string"
33983 /// },
33984 /// "timestamp": {
33985 /// "examples": [
33986 /// 1629986047000
33987 /// ],
33988 /// "type": "integer",
33989 /// "format": "int64"
33990 /// },
33991 /// "tokenId": {
33992 /// "examples": [
33993 /// "10014"
33994 /// ],
33995 /// "type": "string"
33996 /// },
33997 /// "txID": {
33998 /// "type": [
33999 /// "integer",
34000 /// "null"
34001 /// ]
34002 /// }
34003 /// }
34004 /// }
34005 /// },
34006 /// "total": {
34007 /// "examples": [
34008 /// 1
34009 /// ],
34010 /// "type": "integer",
34011 /// "format": "int32"
34012 /// }
34013 /// }
34014 ///}
34015 /// ```
34016 /// </details>
34017 #[derive(Clone, Debug, Deserialize, Serialize)]
34018 pub struct NftHistoryDepositResponse {
34019 pub list: Vec<NftHistoryDepositResponseListItem>,
34020 pub total: i32,
34021 }
34022 impl From<&NftHistoryDepositResponse> for NftHistoryDepositResponse {
34023 fn from(value: &NftHistoryDepositResponse) -> Self {
34024 value.clone()
34025 }
34026 }
34027 ///NftHistoryDepositResponseListItem
34028 ///
34029 /// <details><summary>JSON schema</summary>
34030 ///
34031 /// ```json
34032 ///{
34033 /// "type": "object",
34034 /// "required": [
34035 /// "contractAdrress",
34036 /// "network",
34037 /// "timestamp",
34038 /// "tokenId",
34039 /// "txID"
34040 /// ],
34041 /// "properties": {
34042 /// "contractAdrress": {
34043 /// "examples": [
34044 /// "0xe507c961ee127d4439977a61af39c34eafee0dc6"
34045 /// ],
34046 /// "type": "string"
34047 /// },
34048 /// "network": {
34049 /// "examples": [
34050 /// "ETH"
34051 /// ],
34052 /// "type": "string"
34053 /// },
34054 /// "timestamp": {
34055 /// "examples": [
34056 /// 1629986047000
34057 /// ],
34058 /// "type": "integer",
34059 /// "format": "int64"
34060 /// },
34061 /// "tokenId": {
34062 /// "examples": [
34063 /// "10014"
34064 /// ],
34065 /// "type": "string"
34066 /// },
34067 /// "txID": {
34068 /// "type": [
34069 /// "integer",
34070 /// "null"
34071 /// ]
34072 /// }
34073 /// }
34074 ///}
34075 /// ```
34076 /// </details>
34077 #[derive(Clone, Debug, Deserialize, Serialize)]
34078 pub struct NftHistoryDepositResponseListItem {
34079 #[serde(rename = "contractAdrress")]
34080 pub contract_adrress: String,
34081 pub network: String,
34082 pub timestamp: i64,
34083 #[serde(rename = "tokenId")]
34084 pub token_id: String,
34085 #[serde(rename = "txID")]
34086 pub tx_id: Option<i64>,
34087 }
34088 impl From<&NftHistoryDepositResponseListItem> for NftHistoryDepositResponseListItem {
34089 fn from(value: &NftHistoryDepositResponseListItem) -> Self {
34090 value.clone()
34091 }
34092 }
34093 ///NftHistoryTransactionsResponse
34094 ///
34095 /// <details><summary>JSON schema</summary>
34096 ///
34097 /// ```json
34098 ///{
34099 /// "type": "object",
34100 /// "required": [
34101 /// "list",
34102 /// "total"
34103 /// ],
34104 /// "properties": {
34105 /// "list": {
34106 /// "type": "array",
34107 /// "items": {
34108 /// "type": "object",
34109 /// "required": [
34110 /// "orderNo",
34111 /// "tokens",
34112 /// "tradeAmount",
34113 /// "tradeCurrency",
34114 /// "tradeTime"
34115 /// ],
34116 /// "properties": {
34117 /// "orderNo": {
34118 /// "description": "0: purchase order, 1: sell order, 2: royalty income, 3: primary market order, 4: mint fee",
34119 /// "examples": [
34120 /// "1_470502070600699904"
34121 /// ],
34122 /// "type": "string"
34123 /// },
34124 /// "tokens": {
34125 /// "type": "array",
34126 /// "items": {
34127 /// "type": "object",
34128 /// "required": [
34129 /// "contractAddress",
34130 /// "network",
34131 /// "tokenId"
34132 /// ],
34133 /// "properties": {
34134 /// "contractAddress": {
34135 /// "examples": [
34136 /// "MYSTERY_BOX0000087"
34137 /// ],
34138 /// "type": "string"
34139 /// },
34140 /// "network": {
34141 /// "examples": [
34142 /// "BSC"
34143 /// ],
34144 /// "type": "string"
34145 /// },
34146 /// "tokenId": {
34147 /// "examples": [
34148 /// "216000000496"
34149 /// ],
34150 /// "type": "string"
34151 /// }
34152 /// }
34153 /// }
34154 /// },
34155 /// "tradeAmount": {
34156 /// "examples": [
34157 /// "19.60000000"
34158 /// ],
34159 /// "type": "string"
34160 /// },
34161 /// "tradeCurrency": {
34162 /// "examples": [
34163 /// "BNB"
34164 /// ],
34165 /// "type": "string"
34166 /// },
34167 /// "tradeTime": {
34168 /// "examples": [
34169 /// 1626941236000
34170 /// ],
34171 /// "type": "integer",
34172 /// "format": "int64"
34173 /// }
34174 /// }
34175 /// }
34176 /// },
34177 /// "total": {
34178 /// "examples": [
34179 /// 1
34180 /// ],
34181 /// "type": "integer",
34182 /// "format": "int32"
34183 /// }
34184 /// }
34185 ///}
34186 /// ```
34187 /// </details>
34188 #[derive(Clone, Debug, Deserialize, Serialize)]
34189 pub struct NftHistoryTransactionsResponse {
34190 pub list: Vec<NftHistoryTransactionsResponseListItem>,
34191 pub total: i32,
34192 }
34193 impl From<&NftHistoryTransactionsResponse> for NftHistoryTransactionsResponse {
34194 fn from(value: &NftHistoryTransactionsResponse) -> Self {
34195 value.clone()
34196 }
34197 }
34198 ///NftHistoryTransactionsResponseListItem
34199 ///
34200 /// <details><summary>JSON schema</summary>
34201 ///
34202 /// ```json
34203 ///{
34204 /// "type": "object",
34205 /// "required": [
34206 /// "orderNo",
34207 /// "tokens",
34208 /// "tradeAmount",
34209 /// "tradeCurrency",
34210 /// "tradeTime"
34211 /// ],
34212 /// "properties": {
34213 /// "orderNo": {
34214 /// "description": "0: purchase order, 1: sell order, 2: royalty income, 3: primary market order, 4: mint fee",
34215 /// "examples": [
34216 /// "1_470502070600699904"
34217 /// ],
34218 /// "type": "string"
34219 /// },
34220 /// "tokens": {
34221 /// "type": "array",
34222 /// "items": {
34223 /// "type": "object",
34224 /// "required": [
34225 /// "contractAddress",
34226 /// "network",
34227 /// "tokenId"
34228 /// ],
34229 /// "properties": {
34230 /// "contractAddress": {
34231 /// "examples": [
34232 /// "MYSTERY_BOX0000087"
34233 /// ],
34234 /// "type": "string"
34235 /// },
34236 /// "network": {
34237 /// "examples": [
34238 /// "BSC"
34239 /// ],
34240 /// "type": "string"
34241 /// },
34242 /// "tokenId": {
34243 /// "examples": [
34244 /// "216000000496"
34245 /// ],
34246 /// "type": "string"
34247 /// }
34248 /// }
34249 /// }
34250 /// },
34251 /// "tradeAmount": {
34252 /// "examples": [
34253 /// "19.60000000"
34254 /// ],
34255 /// "type": "string"
34256 /// },
34257 /// "tradeCurrency": {
34258 /// "examples": [
34259 /// "BNB"
34260 /// ],
34261 /// "type": "string"
34262 /// },
34263 /// "tradeTime": {
34264 /// "examples": [
34265 /// 1626941236000
34266 /// ],
34267 /// "type": "integer",
34268 /// "format": "int64"
34269 /// }
34270 /// }
34271 ///}
34272 /// ```
34273 /// </details>
34274 #[derive(Clone, Debug, Deserialize, Serialize)]
34275 pub struct NftHistoryTransactionsResponseListItem {
34276 ///0: purchase order, 1: sell order, 2: royalty income, 3: primary market order, 4: mint fee
34277 #[serde(rename = "orderNo")]
34278 pub order_no: String,
34279 pub tokens: Vec<NftHistoryTransactionsResponseListItemTokensItem>,
34280 #[serde(rename = "tradeAmount")]
34281 pub trade_amount: String,
34282 #[serde(rename = "tradeCurrency")]
34283 pub trade_currency: String,
34284 #[serde(rename = "tradeTime")]
34285 pub trade_time: i64,
34286 }
34287 impl From<&NftHistoryTransactionsResponseListItem>
34288 for NftHistoryTransactionsResponseListItem {
34289 fn from(value: &NftHistoryTransactionsResponseListItem) -> Self {
34290 value.clone()
34291 }
34292 }
34293 ///NftHistoryTransactionsResponseListItemTokensItem
34294 ///
34295 /// <details><summary>JSON schema</summary>
34296 ///
34297 /// ```json
34298 ///{
34299 /// "type": "object",
34300 /// "required": [
34301 /// "contractAddress",
34302 /// "network",
34303 /// "tokenId"
34304 /// ],
34305 /// "properties": {
34306 /// "contractAddress": {
34307 /// "examples": [
34308 /// "MYSTERY_BOX0000087"
34309 /// ],
34310 /// "type": "string"
34311 /// },
34312 /// "network": {
34313 /// "examples": [
34314 /// "BSC"
34315 /// ],
34316 /// "type": "string"
34317 /// },
34318 /// "tokenId": {
34319 /// "examples": [
34320 /// "216000000496"
34321 /// ],
34322 /// "type": "string"
34323 /// }
34324 /// }
34325 ///}
34326 /// ```
34327 /// </details>
34328 #[derive(Clone, Debug, Deserialize, Serialize)]
34329 pub struct NftHistoryTransactionsResponseListItemTokensItem {
34330 #[serde(rename = "contractAddress")]
34331 pub contract_address: String,
34332 pub network: String,
34333 #[serde(rename = "tokenId")]
34334 pub token_id: String,
34335 }
34336 impl From<&NftHistoryTransactionsResponseListItemTokensItem>
34337 for NftHistoryTransactionsResponseListItemTokensItem {
34338 fn from(value: &NftHistoryTransactionsResponseListItemTokensItem) -> Self {
34339 value.clone()
34340 }
34341 }
34342 ///NftHistoryWithdrawResponse
34343 ///
34344 /// <details><summary>JSON schema</summary>
34345 ///
34346 /// ```json
34347 ///{
34348 /// "type": "object",
34349 /// "required": [
34350 /// "list",
34351 /// "total"
34352 /// ],
34353 /// "properties": {
34354 /// "list": {
34355 /// "type": "array",
34356 /// "items": {
34357 /// "type": "object",
34358 /// "required": [
34359 /// "contractAdrress",
34360 /// "fee",
34361 /// "feeAsset",
34362 /// "network",
34363 /// "timestamp",
34364 /// "tokenId",
34365 /// "txID"
34366 /// ],
34367 /// "properties": {
34368 /// "contractAdrress": {
34369 /// "examples": [
34370 /// "0xe507c961ee127d4439977a61af39c34eafee0dc6"
34371 /// ],
34372 /// "type": "string"
34373 /// },
34374 /// "fee": {
34375 /// "examples": [
34376 /// 0.1
34377 /// ],
34378 /// "type": "number"
34379 /// },
34380 /// "feeAsset": {
34381 /// "examples": [
34382 /// "ETH"
34383 /// ],
34384 /// "type": "string"
34385 /// },
34386 /// "network": {
34387 /// "examples": [
34388 /// "ETH"
34389 /// ],
34390 /// "type": "string"
34391 /// },
34392 /// "timestamp": {
34393 /// "examples": [
34394 /// 1633674433000
34395 /// ],
34396 /// "type": "integer",
34397 /// "format": "int64"
34398 /// },
34399 /// "tokenId": {
34400 /// "examples": [
34401 /// "1000001247"
34402 /// ],
34403 /// "type": "string"
34404 /// },
34405 /// "txID": {
34406 /// "examples": [
34407 /// "0x2be5eed31d787fdb4880bc631c8e76bdfb6150e137f5cf1732e0416ea206f57f"
34408 /// ],
34409 /// "type": "string"
34410 /// }
34411 /// }
34412 /// }
34413 /// },
34414 /// "total": {
34415 /// "examples": [
34416 /// 178
34417 /// ],
34418 /// "type": "integer",
34419 /// "format": "int32"
34420 /// }
34421 /// }
34422 ///}
34423 /// ```
34424 /// </details>
34425 #[derive(Clone, Debug, Deserialize, Serialize)]
34426 pub struct NftHistoryWithdrawResponse {
34427 pub list: Vec<NftHistoryWithdrawResponseListItem>,
34428 pub total: i32,
34429 }
34430 impl From<&NftHistoryWithdrawResponse> for NftHistoryWithdrawResponse {
34431 fn from(value: &NftHistoryWithdrawResponse) -> Self {
34432 value.clone()
34433 }
34434 }
34435 ///NftHistoryWithdrawResponseListItem
34436 ///
34437 /// <details><summary>JSON schema</summary>
34438 ///
34439 /// ```json
34440 ///{
34441 /// "type": "object",
34442 /// "required": [
34443 /// "contractAdrress",
34444 /// "fee",
34445 /// "feeAsset",
34446 /// "network",
34447 /// "timestamp",
34448 /// "tokenId",
34449 /// "txID"
34450 /// ],
34451 /// "properties": {
34452 /// "contractAdrress": {
34453 /// "examples": [
34454 /// "0xe507c961ee127d4439977a61af39c34eafee0dc6"
34455 /// ],
34456 /// "type": "string"
34457 /// },
34458 /// "fee": {
34459 /// "examples": [
34460 /// 0.1
34461 /// ],
34462 /// "type": "number"
34463 /// },
34464 /// "feeAsset": {
34465 /// "examples": [
34466 /// "ETH"
34467 /// ],
34468 /// "type": "string"
34469 /// },
34470 /// "network": {
34471 /// "examples": [
34472 /// "ETH"
34473 /// ],
34474 /// "type": "string"
34475 /// },
34476 /// "timestamp": {
34477 /// "examples": [
34478 /// 1633674433000
34479 /// ],
34480 /// "type": "integer",
34481 /// "format": "int64"
34482 /// },
34483 /// "tokenId": {
34484 /// "examples": [
34485 /// "1000001247"
34486 /// ],
34487 /// "type": "string"
34488 /// },
34489 /// "txID": {
34490 /// "examples": [
34491 /// "0x2be5eed31d787fdb4880bc631c8e76bdfb6150e137f5cf1732e0416ea206f57f"
34492 /// ],
34493 /// "type": "string"
34494 /// }
34495 /// }
34496 ///}
34497 /// ```
34498 /// </details>
34499 #[derive(Clone, Debug, Deserialize, Serialize)]
34500 pub struct NftHistoryWithdrawResponseListItem {
34501 #[serde(rename = "contractAdrress")]
34502 pub contract_adrress: String,
34503 pub fee: f64,
34504 #[serde(rename = "feeAsset")]
34505 pub fee_asset: String,
34506 pub network: String,
34507 pub timestamp: i64,
34508 #[serde(rename = "tokenId")]
34509 pub token_id: String,
34510 #[serde(rename = "txID")]
34511 pub tx_id: String,
34512 }
34513 impl From<&NftHistoryWithdrawResponseListItem>
34514 for NftHistoryWithdrawResponseListItem {
34515 fn from(value: &NftHistoryWithdrawResponseListItem) -> Self {
34516 value.clone()
34517 }
34518 }
34519 ///NftUserGetAssetResponse
34520 ///
34521 /// <details><summary>JSON schema</summary>
34522 ///
34523 /// ```json
34524 ///{
34525 /// "type": "object",
34526 /// "required": [
34527 /// "list",
34528 /// "total"
34529 /// ],
34530 /// "properties": {
34531 /// "list": {
34532 /// "type": "array",
34533 /// "items": {
34534 /// "type": "object",
34535 /// "required": [
34536 /// "contractAddress",
34537 /// "network",
34538 /// "tokenId"
34539 /// ],
34540 /// "properties": {
34541 /// "contractAddress": {
34542 /// "examples": [
34543 /// "REGULAR11234567891779"
34544 /// ],
34545 /// "type": "string"
34546 /// },
34547 /// "network": {
34548 /// "examples": [
34549 /// "BSC"
34550 /// ],
34551 /// "type": "string"
34552 /// },
34553 /// "tokenId": {
34554 /// "examples": [
34555 /// "100900000017"
34556 /// ],
34557 /// "type": "string"
34558 /// }
34559 /// }
34560 /// }
34561 /// },
34562 /// "total": {
34563 /// "examples": [
34564 /// 347
34565 /// ],
34566 /// "type": "integer",
34567 /// "format": "int32"
34568 /// }
34569 /// }
34570 ///}
34571 /// ```
34572 /// </details>
34573 #[derive(Clone, Debug, Deserialize, Serialize)]
34574 pub struct NftUserGetAssetResponse {
34575 pub list: Vec<NftUserGetAssetResponseListItem>,
34576 pub total: i32,
34577 }
34578 impl From<&NftUserGetAssetResponse> for NftUserGetAssetResponse {
34579 fn from(value: &NftUserGetAssetResponse) -> Self {
34580 value.clone()
34581 }
34582 }
34583 ///NftUserGetAssetResponseListItem
34584 ///
34585 /// <details><summary>JSON schema</summary>
34586 ///
34587 /// ```json
34588 ///{
34589 /// "type": "object",
34590 /// "required": [
34591 /// "contractAddress",
34592 /// "network",
34593 /// "tokenId"
34594 /// ],
34595 /// "properties": {
34596 /// "contractAddress": {
34597 /// "examples": [
34598 /// "REGULAR11234567891779"
34599 /// ],
34600 /// "type": "string"
34601 /// },
34602 /// "network": {
34603 /// "examples": [
34604 /// "BSC"
34605 /// ],
34606 /// "type": "string"
34607 /// },
34608 /// "tokenId": {
34609 /// "examples": [
34610 /// "100900000017"
34611 /// ],
34612 /// "type": "string"
34613 /// }
34614 /// }
34615 ///}
34616 /// ```
34617 /// </details>
34618 #[derive(Clone, Debug, Deserialize, Serialize)]
34619 pub struct NftUserGetAssetResponseListItem {
34620 #[serde(rename = "contractAddress")]
34621 pub contract_address: String,
34622 pub network: String,
34623 #[serde(rename = "tokenId")]
34624 pub token_id: String,
34625 }
34626 impl From<&NftUserGetAssetResponseListItem> for NftUserGetAssetResponseListItem {
34627 fn from(value: &NftUserGetAssetResponseListItem) -> Self {
34628 value.clone()
34629 }
34630 }
34631 ///OcoOrder
34632 ///
34633 /// <details><summary>JSON schema</summary>
34634 ///
34635 /// ```json
34636 ///{
34637 /// "type": "object",
34638 /// "required": [
34639 /// "contingencyType",
34640 /// "listClientOrderId",
34641 /// "listOrderStatus",
34642 /// "listStatusType",
34643 /// "orderListId",
34644 /// "orderReports",
34645 /// "orders",
34646 /// "symbol",
34647 /// "transactionTime"
34648 /// ],
34649 /// "properties": {
34650 /// "contingencyType": {
34651 /// "examples": [
34652 /// "OCO"
34653 /// ],
34654 /// "type": "string"
34655 /// },
34656 /// "listClientOrderId": {
34657 /// "examples": [
34658 /// "C3wyj4WVEktd7u9aVBRXcN"
34659 /// ],
34660 /// "type": "string"
34661 /// },
34662 /// "listOrderStatus": {
34663 /// "examples": [
34664 /// "ALL_DONE"
34665 /// ],
34666 /// "type": "string"
34667 /// },
34668 /// "listStatusType": {
34669 /// "examples": [
34670 /// "ALL_DONE"
34671 /// ],
34672 /// "type": "string"
34673 /// },
34674 /// "orderListId": {
34675 /// "examples": [
34676 /// 1929
34677 /// ],
34678 /// "type": "integer",
34679 /// "format": "int64"
34680 /// },
34681 /// "orderReports": {
34682 /// "examples": [
34683 /// [
34684 /// {
34685 /// "clientOrderId": "unfWT8ig8i0uj6lPuYLez6",
34686 /// "cummulativeQuoteQty": "0.00000000",
34687 /// "executedQty": "0.00000000",
34688 /// "orderId": 2,
34689 /// "orderListId": 0,
34690 /// "origClientOrderId": "pO9ufTiFGg3nw2fOdgeOXa",
34691 /// "origQty": "10.00000000",
34692 /// "price": "1.00000000",
34693 /// "side": "SELL",
34694 /// "status": "CANCELED",
34695 /// "stopPrice": "1.00000000",
34696 /// "symbol": "BNBBTC",
34697 /// "timeInForce": "GTC",
34698 /// "transactTime": 1688005070874,
34699 /// "type": "STOP_LOSS_LIMIT"
34700 /// },
34701 /// {
34702 /// "clientOrderId": "unfWT8ig8i0uj6lPuYLez6",
34703 /// "cummulativeQuoteQty": "0.00000000",
34704 /// "executedQty": "0.00000000",
34705 /// "orderId": 3,
34706 /// "orderListId": 0,
34707 /// "origClientOrderId": "TXOvglzXuaubXAaENpaRCB",
34708 /// "origQty": "10.00000000",
34709 /// "price": "3.00000000",
34710 /// "selfTradePreventionMode": "NONE",
34711 /// "side": "SELL",
34712 /// "status": "CANCELED",
34713 /// "symbol": "BNBBTC",
34714 /// "timeInForce": "GTC",
34715 /// "transactTime": 1688005070874,
34716 /// "type": "LIMIT_MAKER"
34717 /// }
34718 /// ]
34719 /// ],
34720 /// "type": "array",
34721 /// "items": {
34722 /// "type": "object",
34723 /// "required": [
34724 /// "clientOrderId",
34725 /// "cummulativeQuoteQty",
34726 /// "executedQty",
34727 /// "orderId",
34728 /// "orderListId",
34729 /// "origClientOrderId",
34730 /// "origQty",
34731 /// "price",
34732 /// "selfTradePreventionMode",
34733 /// "side",
34734 /// "status",
34735 /// "stopPrice",
34736 /// "symbol",
34737 /// "timeInForce",
34738 /// "transactTime",
34739 /// "type"
34740 /// ],
34741 /// "properties": {
34742 /// "clientOrderId": {
34743 /// "type": "string"
34744 /// },
34745 /// "cummulativeQuoteQty": {
34746 /// "type": "string"
34747 /// },
34748 /// "executedQty": {
34749 /// "type": "string"
34750 /// },
34751 /// "orderId": {
34752 /// "type": "integer",
34753 /// "format": "int64"
34754 /// },
34755 /// "orderListId": {
34756 /// "type": "integer",
34757 /// "format": "int64"
34758 /// },
34759 /// "origClientOrderId": {
34760 /// "type": "string"
34761 /// },
34762 /// "origQty": {
34763 /// "type": "string"
34764 /// },
34765 /// "price": {
34766 /// "type": "string"
34767 /// },
34768 /// "selfTradePreventionMode": {
34769 /// "type": "string"
34770 /// },
34771 /// "side": {
34772 /// "type": "string"
34773 /// },
34774 /// "status": {
34775 /// "type": "string"
34776 /// },
34777 /// "stopPrice": {
34778 /// "type": "string"
34779 /// },
34780 /// "symbol": {
34781 /// "type": "string"
34782 /// },
34783 /// "timeInForce": {
34784 /// "type": "string"
34785 /// },
34786 /// "transactTime": {
34787 /// "type": "integer",
34788 /// "format": "int64"
34789 /// },
34790 /// "type": {
34791 /// "type": "string"
34792 /// }
34793 /// }
34794 /// }
34795 /// },
34796 /// "orders": {
34797 /// "examples": [
34798 /// [
34799 /// {
34800 /// "clientOrderId": "pO9ufTiFGg3nw2fOdgeOXa",
34801 /// "orderId": 2,
34802 /// "symbol": "BNBBTC"
34803 /// },
34804 /// {
34805 /// "clientOrderId": "TXOvglzXuaubXAaENpaRCB",
34806 /// "orderId": 3,
34807 /// "symbol": "BNBBTC"
34808 /// }
34809 /// ]
34810 /// ],
34811 /// "type": "array",
34812 /// "items": {
34813 /// "type": "object",
34814 /// "required": [
34815 /// "clientOrderId",
34816 /// "orderId",
34817 /// "symbol"
34818 /// ],
34819 /// "properties": {
34820 /// "clientOrderId": {
34821 /// "type": "string"
34822 /// },
34823 /// "orderId": {
34824 /// "type": "integer",
34825 /// "format": "int64"
34826 /// },
34827 /// "symbol": {
34828 /// "type": "string"
34829 /// }
34830 /// }
34831 /// }
34832 /// },
34833 /// "symbol": {
34834 /// "examples": [
34835 /// "BNBBTC"
34836 /// ],
34837 /// "type": "string"
34838 /// },
34839 /// "transactionTime": {
34840 /// "examples": [
34841 /// 1574040868128
34842 /// ],
34843 /// "type": "integer",
34844 /// "format": "int64"
34845 /// }
34846 /// }
34847 ///}
34848 /// ```
34849 /// </details>
34850 #[derive(Clone, Debug, Deserialize, Serialize)]
34851 pub struct OcoOrder {
34852 #[serde(rename = "contingencyType")]
34853 pub contingency_type: String,
34854 #[serde(rename = "listClientOrderId")]
34855 pub list_client_order_id: String,
34856 #[serde(rename = "listOrderStatus")]
34857 pub list_order_status: String,
34858 #[serde(rename = "listStatusType")]
34859 pub list_status_type: String,
34860 #[serde(rename = "orderListId")]
34861 pub order_list_id: i64,
34862 #[serde(rename = "orderReports")]
34863 pub order_reports: Vec<OcoOrderOrderReportsItem>,
34864 pub orders: Vec<OcoOrderOrdersItem>,
34865 pub symbol: String,
34866 #[serde(rename = "transactionTime")]
34867 pub transaction_time: i64,
34868 }
34869 impl From<&OcoOrder> for OcoOrder {
34870 fn from(value: &OcoOrder) -> Self {
34871 value.clone()
34872 }
34873 }
34874 ///OcoOrderOrderReportsItem
34875 ///
34876 /// <details><summary>JSON schema</summary>
34877 ///
34878 /// ```json
34879 ///{
34880 /// "type": "object",
34881 /// "required": [
34882 /// "clientOrderId",
34883 /// "cummulativeQuoteQty",
34884 /// "executedQty",
34885 /// "orderId",
34886 /// "orderListId",
34887 /// "origClientOrderId",
34888 /// "origQty",
34889 /// "price",
34890 /// "selfTradePreventionMode",
34891 /// "side",
34892 /// "status",
34893 /// "stopPrice",
34894 /// "symbol",
34895 /// "timeInForce",
34896 /// "transactTime",
34897 /// "type"
34898 /// ],
34899 /// "properties": {
34900 /// "clientOrderId": {
34901 /// "type": "string"
34902 /// },
34903 /// "cummulativeQuoteQty": {
34904 /// "type": "string"
34905 /// },
34906 /// "executedQty": {
34907 /// "type": "string"
34908 /// },
34909 /// "orderId": {
34910 /// "type": "integer",
34911 /// "format": "int64"
34912 /// },
34913 /// "orderListId": {
34914 /// "type": "integer",
34915 /// "format": "int64"
34916 /// },
34917 /// "origClientOrderId": {
34918 /// "type": "string"
34919 /// },
34920 /// "origQty": {
34921 /// "type": "string"
34922 /// },
34923 /// "price": {
34924 /// "type": "string"
34925 /// },
34926 /// "selfTradePreventionMode": {
34927 /// "type": "string"
34928 /// },
34929 /// "side": {
34930 /// "type": "string"
34931 /// },
34932 /// "status": {
34933 /// "type": "string"
34934 /// },
34935 /// "stopPrice": {
34936 /// "type": "string"
34937 /// },
34938 /// "symbol": {
34939 /// "type": "string"
34940 /// },
34941 /// "timeInForce": {
34942 /// "type": "string"
34943 /// },
34944 /// "transactTime": {
34945 /// "type": "integer",
34946 /// "format": "int64"
34947 /// },
34948 /// "type": {
34949 /// "type": "string"
34950 /// }
34951 /// }
34952 ///}
34953 /// ```
34954 /// </details>
34955 #[derive(Clone, Debug, Deserialize, Serialize)]
34956 pub struct OcoOrderOrderReportsItem {
34957 #[serde(rename = "clientOrderId")]
34958 pub client_order_id: String,
34959 #[serde(rename = "cummulativeQuoteQty")]
34960 pub cummulative_quote_qty: String,
34961 #[serde(rename = "executedQty")]
34962 pub executed_qty: String,
34963 #[serde(rename = "orderId")]
34964 pub order_id: i64,
34965 #[serde(rename = "orderListId")]
34966 pub order_list_id: i64,
34967 #[serde(rename = "origClientOrderId")]
34968 pub orig_client_order_id: String,
34969 #[serde(rename = "origQty")]
34970 pub orig_qty: String,
34971 pub price: String,
34972 #[serde(rename = "selfTradePreventionMode")]
34973 pub self_trade_prevention_mode: String,
34974 pub side: String,
34975 pub status: String,
34976 #[serde(rename = "stopPrice")]
34977 pub stop_price: String,
34978 pub symbol: String,
34979 #[serde(rename = "timeInForce")]
34980 pub time_in_force: String,
34981 #[serde(rename = "transactTime")]
34982 pub transact_time: i64,
34983 #[serde(rename = "type")]
34984 pub type_: String,
34985 }
34986 impl From<&OcoOrderOrderReportsItem> for OcoOrderOrderReportsItem {
34987 fn from(value: &OcoOrderOrderReportsItem) -> Self {
34988 value.clone()
34989 }
34990 }
34991 ///OcoOrderOrdersItem
34992 ///
34993 /// <details><summary>JSON schema</summary>
34994 ///
34995 /// ```json
34996 ///{
34997 /// "type": "object",
34998 /// "required": [
34999 /// "clientOrderId",
35000 /// "orderId",
35001 /// "symbol"
35002 /// ],
35003 /// "properties": {
35004 /// "clientOrderId": {
35005 /// "type": "string"
35006 /// },
35007 /// "orderId": {
35008 /// "type": "integer",
35009 /// "format": "int64"
35010 /// },
35011 /// "symbol": {
35012 /// "type": "string"
35013 /// }
35014 /// }
35015 ///}
35016 /// ```
35017 /// </details>
35018 #[derive(Clone, Debug, Deserialize, Serialize)]
35019 pub struct OcoOrderOrdersItem {
35020 #[serde(rename = "clientOrderId")]
35021 pub client_order_id: String,
35022 #[serde(rename = "orderId")]
35023 pub order_id: i64,
35024 pub symbol: String,
35025 }
35026 impl From<&OcoOrderOrdersItem> for OcoOrderOrdersItem {
35027 fn from(value: &OcoOrderOrdersItem) -> Self {
35028 value.clone()
35029 }
35030 }
35031 ///OpenOrderListResponseItem
35032 ///
35033 /// <details><summary>JSON schema</summary>
35034 ///
35035 /// ```json
35036 ///{
35037 /// "type": "object",
35038 /// "required": [
35039 /// "contingencyType",
35040 /// "listClientOrderId",
35041 /// "listOrderStatus",
35042 /// "listStatusType",
35043 /// "orderListId",
35044 /// "orders",
35045 /// "symbol",
35046 /// "transactionTime"
35047 /// ],
35048 /// "properties": {
35049 /// "contingencyType": {
35050 /// "examples": [
35051 /// "OCO"
35052 /// ],
35053 /// "type": "string"
35054 /// },
35055 /// "listClientOrderId": {
35056 /// "examples": [
35057 /// "wuB13fmulKj3YjdqWEcsnp"
35058 /// ],
35059 /// "type": "string"
35060 /// },
35061 /// "listOrderStatus": {
35062 /// "examples": [
35063 /// "EXECUTING"
35064 /// ],
35065 /// "type": "string"
35066 /// },
35067 /// "listStatusType": {
35068 /// "examples": [
35069 /// "EXEC_STARTED"
35070 /// ],
35071 /// "type": "string"
35072 /// },
35073 /// "orderListId": {
35074 /// "examples": [
35075 /// 31
35076 /// ],
35077 /// "type": "integer",
35078 /// "format": "int64"
35079 /// },
35080 /// "orders": {
35081 /// "type": "array",
35082 /// "items": {
35083 /// "examples": [
35084 /// [
35085 /// {
35086 /// "clientOrderId": "r3EH2N76dHfLoSZWIUw1bT",
35087 /// "orderId": 4,
35088 /// "symbol": "LTCBTC"
35089 /// },
35090 /// {
35091 /// "clientOrderId": "Cv1SnyPD3qhqpbjpYEHbd2",
35092 /// "orderId": 5,
35093 /// "symbol": "LTCBTC"
35094 /// }
35095 /// ]
35096 /// ],
35097 /// "type": "object",
35098 /// "required": [
35099 /// "clientOrderId",
35100 /// "orderId",
35101 /// "symbol"
35102 /// ],
35103 /// "properties": {
35104 /// "clientOrderId": {
35105 /// "type": "string"
35106 /// },
35107 /// "orderId": {
35108 /// "type": "integer",
35109 /// "format": "int64"
35110 /// },
35111 /// "symbol": {
35112 /// "type": "string"
35113 /// }
35114 /// }
35115 /// }
35116 /// },
35117 /// "symbol": {
35118 /// "examples": [
35119 /// "LTCBTC"
35120 /// ],
35121 /// "type": "string"
35122 /// },
35123 /// "transactionTime": {
35124 /// "examples": [
35125 /// 1565246080644
35126 /// ],
35127 /// "type": "integer",
35128 /// "format": "int64"
35129 /// }
35130 /// }
35131 ///}
35132 /// ```
35133 /// </details>
35134 #[derive(Clone, Debug, Deserialize, Serialize)]
35135 pub struct OpenOrderListResponseItem {
35136 #[serde(rename = "contingencyType")]
35137 pub contingency_type: String,
35138 #[serde(rename = "listClientOrderId")]
35139 pub list_client_order_id: String,
35140 #[serde(rename = "listOrderStatus")]
35141 pub list_order_status: String,
35142 #[serde(rename = "listStatusType")]
35143 pub list_status_type: String,
35144 #[serde(rename = "orderListId")]
35145 pub order_list_id: i64,
35146 pub orders: Vec<OpenOrderListResponseItemOrdersItem>,
35147 pub symbol: String,
35148 #[serde(rename = "transactionTime")]
35149 pub transaction_time: i64,
35150 }
35151 impl From<&OpenOrderListResponseItem> for OpenOrderListResponseItem {
35152 fn from(value: &OpenOrderListResponseItem) -> Self {
35153 value.clone()
35154 }
35155 }
35156 ///OpenOrderListResponseItemOrdersItem
35157 ///
35158 /// <details><summary>JSON schema</summary>
35159 ///
35160 /// ```json
35161 ///{
35162 /// "examples": [
35163 /// [
35164 /// {
35165 /// "clientOrderId": "r3EH2N76dHfLoSZWIUw1bT",
35166 /// "orderId": 4,
35167 /// "symbol": "LTCBTC"
35168 /// },
35169 /// {
35170 /// "clientOrderId": "Cv1SnyPD3qhqpbjpYEHbd2",
35171 /// "orderId": 5,
35172 /// "symbol": "LTCBTC"
35173 /// }
35174 /// ]
35175 /// ],
35176 /// "type": "object",
35177 /// "required": [
35178 /// "clientOrderId",
35179 /// "orderId",
35180 /// "symbol"
35181 /// ],
35182 /// "properties": {
35183 /// "clientOrderId": {
35184 /// "type": "string"
35185 /// },
35186 /// "orderId": {
35187 /// "type": "integer",
35188 /// "format": "int64"
35189 /// },
35190 /// "symbol": {
35191 /// "type": "string"
35192 /// }
35193 /// }
35194 ///}
35195 /// ```
35196 /// </details>
35197 #[derive(Clone, Debug, Deserialize, Serialize)]
35198 pub struct OpenOrderListResponseItemOrdersItem {
35199 #[serde(rename = "clientOrderId")]
35200 pub client_order_id: String,
35201 #[serde(rename = "orderId")]
35202 pub order_id: i64,
35203 pub symbol: String,
35204 }
35205 impl From<&OpenOrderListResponseItemOrdersItem>
35206 for OpenOrderListResponseItemOrdersItem {
35207 fn from(value: &OpenOrderListResponseItemOrdersItem) -> Self {
35208 value.clone()
35209 }
35210 }
35211 ///Order
35212 ///
35213 /// <details><summary>JSON schema</summary>
35214 ///
35215 /// ```json
35216 ///{
35217 /// "type": "object",
35218 /// "required": [
35219 /// "clientOrderId",
35220 /// "cummulativeQuoteQty",
35221 /// "executedQty",
35222 /// "orderId",
35223 /// "orderListId",
35224 /// "origClientOrderId",
35225 /// "origQty",
35226 /// "price",
35227 /// "selfTradePreventionMode",
35228 /// "side",
35229 /// "status",
35230 /// "symbol",
35231 /// "timeInForce",
35232 /// "transactTime",
35233 /// "type"
35234 /// ],
35235 /// "properties": {
35236 /// "clientOrderId": {
35237 /// "examples": [
35238 /// "6gCrw2kRUAF9CvJDGP16IP"
35239 /// ],
35240 /// "type": "string"
35241 /// },
35242 /// "cummulativeQuoteQty": {
35243 /// "examples": [
35244 /// "10.00000000"
35245 /// ],
35246 /// "type": "string"
35247 /// },
35248 /// "executedQty": {
35249 /// "examples": [
35250 /// "10.00000000"
35251 /// ],
35252 /// "type": "string"
35253 /// },
35254 /// "orderId": {
35255 /// "examples": [
35256 /// 28
35257 /// ],
35258 /// "type": "integer",
35259 /// "format": "int64"
35260 /// },
35261 /// "orderListId": {
35262 /// "description": "Unless OCO, value will be -1",
35263 /// "examples": [
35264 /// -1
35265 /// ],
35266 /// "type": "integer",
35267 /// "format": "int64"
35268 /// },
35269 /// "origClientOrderId": {
35270 /// "examples": [
35271 /// "msXkySR3u5uYwpvRMFsi3u"
35272 /// ],
35273 /// "type": "string"
35274 /// },
35275 /// "origQty": {
35276 /// "examples": [
35277 /// "10.00000000"
35278 /// ],
35279 /// "type": "string"
35280 /// },
35281 /// "price": {
35282 /// "examples": [
35283 /// "1.00000000"
35284 /// ],
35285 /// "type": "string"
35286 /// },
35287 /// "selfTradePreventionMode": {
35288 /// "examples": [
35289 /// "NONE"
35290 /// ],
35291 /// "type": "string"
35292 /// },
35293 /// "side": {
35294 /// "examples": [
35295 /// "SELL"
35296 /// ],
35297 /// "type": "string"
35298 /// },
35299 /// "status": {
35300 /// "examples": [
35301 /// "FILLED"
35302 /// ],
35303 /// "type": "string"
35304 /// },
35305 /// "symbol": {
35306 /// "examples": [
35307 /// "BNBBTC"
35308 /// ],
35309 /// "type": "string"
35310 /// },
35311 /// "timeInForce": {
35312 /// "examples": [
35313 /// "GTC"
35314 /// ],
35315 /// "type": "string"
35316 /// },
35317 /// "transactTime": {
35318 /// "examples": [
35319 /// 1507725176595
35320 /// ],
35321 /// "type": "integer",
35322 /// "format": "int64"
35323 /// },
35324 /// "type": {
35325 /// "examples": [
35326 /// "LIMIT"
35327 /// ],
35328 /// "type": "string"
35329 /// }
35330 /// }
35331 ///}
35332 /// ```
35333 /// </details>
35334 #[derive(Clone, Debug, Deserialize, Serialize)]
35335 pub struct Order {
35336 #[serde(rename = "clientOrderId")]
35337 pub client_order_id: String,
35338 #[serde(rename = "cummulativeQuoteQty")]
35339 pub cummulative_quote_qty: String,
35340 #[serde(rename = "executedQty")]
35341 pub executed_qty: String,
35342 #[serde(rename = "orderId")]
35343 pub order_id: i64,
35344 ///Unless OCO, value will be -1
35345 #[serde(rename = "orderListId")]
35346 pub order_list_id: i64,
35347 #[serde(rename = "origClientOrderId")]
35348 pub orig_client_order_id: String,
35349 #[serde(rename = "origQty")]
35350 pub orig_qty: String,
35351 pub price: String,
35352 #[serde(rename = "selfTradePreventionMode")]
35353 pub self_trade_prevention_mode: String,
35354 pub side: String,
35355 pub status: String,
35356 pub symbol: String,
35357 #[serde(rename = "timeInForce")]
35358 pub time_in_force: String,
35359 #[serde(rename = "transactTime")]
35360 pub transact_time: i64,
35361 #[serde(rename = "type")]
35362 pub type_: String,
35363 }
35364 impl From<&Order> for Order {
35365 fn from(value: &Order) -> Self {
35366 value.clone()
35367 }
35368 }
35369 ///OrderDetails
35370 ///
35371 /// <details><summary>JSON schema</summary>
35372 ///
35373 /// ```json
35374 ///{
35375 /// "type": "object",
35376 /// "required": [
35377 /// "clientOrderId",
35378 /// "cummulativeQuoteQty",
35379 /// "executedQty",
35380 /// "icebergQty",
35381 /// "isWorking",
35382 /// "orderId",
35383 /// "orderListId",
35384 /// "origQty",
35385 /// "origQuoteOrderQty",
35386 /// "price",
35387 /// "selfTradePreventionMode",
35388 /// "side",
35389 /// "status",
35390 /// "stopPrice",
35391 /// "symbol",
35392 /// "time",
35393 /// "timeInForce",
35394 /// "type",
35395 /// "updateTime",
35396 /// "workingTime"
35397 /// ],
35398 /// "properties": {
35399 /// "clientOrderId": {
35400 /// "examples": [
35401 /// "myOrder1"
35402 /// ],
35403 /// "type": "string"
35404 /// },
35405 /// "cummulativeQuoteQty": {
35406 /// "examples": [
35407 /// "0.0"
35408 /// ],
35409 /// "type": "string"
35410 /// },
35411 /// "executedQty": {
35412 /// "examples": [
35413 /// "0.0"
35414 /// ],
35415 /// "type": "string"
35416 /// },
35417 /// "icebergQty": {
35418 /// "examples": [
35419 /// "0.0"
35420 /// ],
35421 /// "type": "string"
35422 /// },
35423 /// "isWorking": {
35424 /// "type": "boolean"
35425 /// },
35426 /// "orderId": {
35427 /// "examples": [
35428 /// 1
35429 /// ],
35430 /// "type": "integer",
35431 /// "format": "int64"
35432 /// },
35433 /// "orderListId": {
35434 /// "description": "Unless OCO, value will be -1",
35435 /// "examples": [
35436 /// -1
35437 /// ],
35438 /// "type": "integer",
35439 /// "format": "int64"
35440 /// },
35441 /// "origQty": {
35442 /// "examples": [
35443 /// "1.0"
35444 /// ],
35445 /// "type": "string"
35446 /// },
35447 /// "origQuoteOrderQty": {
35448 /// "examples": [
35449 /// "0.00000000"
35450 /// ],
35451 /// "type": "string"
35452 /// },
35453 /// "preventedMatchId": {
35454 /// "examples": [
35455 /// 0
35456 /// ],
35457 /// "type": "integer"
35458 /// },
35459 /// "preventedQuantity": {
35460 /// "examples": [
35461 /// "1.200000"
35462 /// ],
35463 /// "type": "string"
35464 /// },
35465 /// "price": {
35466 /// "examples": [
35467 /// "0.1"
35468 /// ],
35469 /// "type": "string"
35470 /// },
35471 /// "selfTradePreventionMode": {
35472 /// "examples": [
35473 /// "NONE"
35474 /// ],
35475 /// "type": "string"
35476 /// },
35477 /// "side": {
35478 /// "examples": [
35479 /// "BUY"
35480 /// ],
35481 /// "type": "string"
35482 /// },
35483 /// "status": {
35484 /// "examples": [
35485 /// "NEW"
35486 /// ],
35487 /// "type": "string"
35488 /// },
35489 /// "stopPrice": {
35490 /// "examples": [
35491 /// "0.0"
35492 /// ],
35493 /// "type": "string"
35494 /// },
35495 /// "symbol": {
35496 /// "examples": [
35497 /// "LTCBTC"
35498 /// ],
35499 /// "type": "string"
35500 /// },
35501 /// "time": {
35502 /// "examples": [
35503 /// 1499827319559
35504 /// ],
35505 /// "type": "integer",
35506 /// "format": "int64"
35507 /// },
35508 /// "timeInForce": {
35509 /// "examples": [
35510 /// "GTC"
35511 /// ],
35512 /// "type": "string"
35513 /// },
35514 /// "type": {
35515 /// "examples": [
35516 /// "LIMIT"
35517 /// ],
35518 /// "type": "string"
35519 /// },
35520 /// "updateTime": {
35521 /// "examples": [
35522 /// 1499827319559
35523 /// ],
35524 /// "type": "integer",
35525 /// "format": "int64"
35526 /// },
35527 /// "workingTime": {
35528 /// "examples": [
35529 /// 1499827319559
35530 /// ],
35531 /// "type": "integer",
35532 /// "format": "int64"
35533 /// }
35534 /// }
35535 ///}
35536 /// ```
35537 /// </details>
35538 #[derive(Clone, Debug, Deserialize, Serialize)]
35539 pub struct OrderDetails {
35540 #[serde(rename = "clientOrderId")]
35541 pub client_order_id: String,
35542 #[serde(rename = "cummulativeQuoteQty")]
35543 pub cummulative_quote_qty: String,
35544 #[serde(rename = "executedQty")]
35545 pub executed_qty: String,
35546 #[serde(rename = "icebergQty")]
35547 pub iceberg_qty: String,
35548 #[serde(rename = "isWorking")]
35549 pub is_working: bool,
35550 #[serde(rename = "orderId")]
35551 pub order_id: i64,
35552 ///Unless OCO, value will be -1
35553 #[serde(rename = "orderListId")]
35554 pub order_list_id: i64,
35555 #[serde(rename = "origQty")]
35556 pub orig_qty: String,
35557 #[serde(rename = "origQuoteOrderQty")]
35558 pub orig_quote_order_qty: String,
35559 #[serde(
35560 rename = "preventedMatchId",
35561 default,
35562 skip_serializing_if = "Option::is_none"
35563 )]
35564 pub prevented_match_id: Option<i64>,
35565 #[serde(
35566 rename = "preventedQuantity",
35567 default,
35568 skip_serializing_if = "Option::is_none"
35569 )]
35570 pub prevented_quantity: Option<String>,
35571 pub price: String,
35572 #[serde(rename = "selfTradePreventionMode")]
35573 pub self_trade_prevention_mode: String,
35574 pub side: String,
35575 pub status: String,
35576 #[serde(rename = "stopPrice")]
35577 pub stop_price: String,
35578 pub symbol: String,
35579 pub time: i64,
35580 #[serde(rename = "timeInForce")]
35581 pub time_in_force: String,
35582 #[serde(rename = "type")]
35583 pub type_: String,
35584 #[serde(rename = "updateTime")]
35585 pub update_time: i64,
35586 #[serde(rename = "workingTime")]
35587 pub working_time: i64,
35588 }
35589 impl From<&OrderDetails> for OrderDetails {
35590 fn from(value: &OrderDetails) -> Self {
35591 value.clone()
35592 }
35593 }
35594 ///OrderListResponse
35595 ///
35596 /// <details><summary>JSON schema</summary>
35597 ///
35598 /// ```json
35599 ///{
35600 /// "type": "object",
35601 /// "required": [
35602 /// "contingencyType",
35603 /// "listClientOrderId",
35604 /// "listOrderStatus",
35605 /// "listStatusType",
35606 /// "orderListId",
35607 /// "orders",
35608 /// "symbol",
35609 /// "transactionTime"
35610 /// ],
35611 /// "properties": {
35612 /// "contingencyType": {
35613 /// "examples": [
35614 /// "OCO"
35615 /// ],
35616 /// "type": "string"
35617 /// },
35618 /// "listClientOrderId": {
35619 /// "examples": [
35620 /// "h2USkA5YQpaXHPIrkd96xE"
35621 /// ],
35622 /// "type": "string"
35623 /// },
35624 /// "listOrderStatus": {
35625 /// "examples": [
35626 /// "EXECUTING"
35627 /// ],
35628 /// "type": "string"
35629 /// },
35630 /// "listStatusType": {
35631 /// "examples": [
35632 /// "EXEC_STARTED"
35633 /// ],
35634 /// "type": "string"
35635 /// },
35636 /// "orderListId": {
35637 /// "examples": [
35638 /// 27
35639 /// ],
35640 /// "type": "integer",
35641 /// "format": "int64"
35642 /// },
35643 /// "orders": {
35644 /// "type": "array",
35645 /// "items": {
35646 /// "examples": [
35647 /// [
35648 /// {
35649 /// "clientOrderId": "qD1gy3kc3Gx0rihm9Y3xwS",
35650 /// "orderId": 4,
35651 /// "symbol": "LTCBTC"
35652 /// },
35653 /// {
35654 /// "clientOrderId": "ARzZ9I00CPM8i3NhmU9Ega",
35655 /// "orderId": 5,
35656 /// "symbol": "LTCBTC"
35657 /// }
35658 /// ]
35659 /// ],
35660 /// "type": "object",
35661 /// "required": [
35662 /// "clientOrderId",
35663 /// "orderId",
35664 /// "symbol"
35665 /// ],
35666 /// "properties": {
35667 /// "clientOrderId": {
35668 /// "type": "string"
35669 /// },
35670 /// "orderId": {
35671 /// "type": "integer",
35672 /// "format": "int64"
35673 /// },
35674 /// "symbol": {
35675 /// "type": "string"
35676 /// }
35677 /// }
35678 /// }
35679 /// },
35680 /// "symbol": {
35681 /// "examples": [
35682 /// "LTCBTC"
35683 /// ],
35684 /// "type": "string"
35685 /// },
35686 /// "transactionTime": {
35687 /// "examples": [
35688 /// 1565245656253
35689 /// ],
35690 /// "type": "integer",
35691 /// "format": "int64"
35692 /// }
35693 /// }
35694 ///}
35695 /// ```
35696 /// </details>
35697 #[derive(Clone, Debug, Deserialize, Serialize)]
35698 pub struct OrderListResponse {
35699 #[serde(rename = "contingencyType")]
35700 pub contingency_type: String,
35701 #[serde(rename = "listClientOrderId")]
35702 pub list_client_order_id: String,
35703 #[serde(rename = "listOrderStatus")]
35704 pub list_order_status: String,
35705 #[serde(rename = "listStatusType")]
35706 pub list_status_type: String,
35707 #[serde(rename = "orderListId")]
35708 pub order_list_id: i64,
35709 pub orders: Vec<OrderListResponseOrdersItem>,
35710 pub symbol: String,
35711 #[serde(rename = "transactionTime")]
35712 pub transaction_time: i64,
35713 }
35714 impl From<&OrderListResponse> for OrderListResponse {
35715 fn from(value: &OrderListResponse) -> Self {
35716 value.clone()
35717 }
35718 }
35719 ///OrderListResponseOrdersItem
35720 ///
35721 /// <details><summary>JSON schema</summary>
35722 ///
35723 /// ```json
35724 ///{
35725 /// "examples": [
35726 /// [
35727 /// {
35728 /// "clientOrderId": "qD1gy3kc3Gx0rihm9Y3xwS",
35729 /// "orderId": 4,
35730 /// "symbol": "LTCBTC"
35731 /// },
35732 /// {
35733 /// "clientOrderId": "ARzZ9I00CPM8i3NhmU9Ega",
35734 /// "orderId": 5,
35735 /// "symbol": "LTCBTC"
35736 /// }
35737 /// ]
35738 /// ],
35739 /// "type": "object",
35740 /// "required": [
35741 /// "clientOrderId",
35742 /// "orderId",
35743 /// "symbol"
35744 /// ],
35745 /// "properties": {
35746 /// "clientOrderId": {
35747 /// "type": "string"
35748 /// },
35749 /// "orderId": {
35750 /// "type": "integer",
35751 /// "format": "int64"
35752 /// },
35753 /// "symbol": {
35754 /// "type": "string"
35755 /// }
35756 /// }
35757 ///}
35758 /// ```
35759 /// </details>
35760 #[derive(Clone, Debug, Deserialize, Serialize)]
35761 pub struct OrderListResponseOrdersItem {
35762 #[serde(rename = "clientOrderId")]
35763 pub client_order_id: String,
35764 #[serde(rename = "orderId")]
35765 pub order_id: i64,
35766 pub symbol: String,
35767 }
35768 impl From<&OrderListResponseOrdersItem> for OrderListResponseOrdersItem {
35769 fn from(value: &OrderListResponseOrdersItem) -> Self {
35770 value.clone()
35771 }
35772 }
35773 ///OrderResponseAck
35774 ///
35775 /// <details><summary>JSON schema</summary>
35776 ///
35777 /// ```json
35778 ///{
35779 /// "type": "object",
35780 /// "required": [
35781 /// "clientOrderId",
35782 /// "orderId",
35783 /// "orderListId",
35784 /// "symbol",
35785 /// "transactTime"
35786 /// ],
35787 /// "properties": {
35788 /// "clientOrderId": {
35789 /// "examples": [
35790 /// "6gCrw2kRUAF9CvJDGP16IP"
35791 /// ],
35792 /// "type": "string"
35793 /// },
35794 /// "orderId": {
35795 /// "examples": [
35796 /// 28
35797 /// ],
35798 /// "type": "integer",
35799 /// "format": "int64"
35800 /// },
35801 /// "orderListId": {
35802 /// "examples": [
35803 /// -1
35804 /// ],
35805 /// "type": "integer",
35806 /// "format": "int64"
35807 /// },
35808 /// "symbol": {
35809 /// "examples": [
35810 /// "BTCUSDT"
35811 /// ],
35812 /// "type": "string"
35813 /// },
35814 /// "transactTime": {
35815 /// "examples": [
35816 /// 1507725176595
35817 /// ],
35818 /// "type": "integer",
35819 /// "format": "int64"
35820 /// }
35821 /// }
35822 ///}
35823 /// ```
35824 /// </details>
35825 #[derive(Clone, Debug, Deserialize, Serialize)]
35826 pub struct OrderResponseAck {
35827 #[serde(rename = "clientOrderId")]
35828 pub client_order_id: String,
35829 #[serde(rename = "orderId")]
35830 pub order_id: i64,
35831 #[serde(rename = "orderListId")]
35832 pub order_list_id: i64,
35833 pub symbol: String,
35834 #[serde(rename = "transactTime")]
35835 pub transact_time: i64,
35836 }
35837 impl From<&OrderResponseAck> for OrderResponseAck {
35838 fn from(value: &OrderResponseAck) -> Self {
35839 value.clone()
35840 }
35841 }
35842 ///OrderResponseFull
35843 ///
35844 /// <details><summary>JSON schema</summary>
35845 ///
35846 /// ```json
35847 ///{
35848 /// "type": "object",
35849 /// "required": [
35850 /// "clientOrderId",
35851 /// "cummulativeQuoteQty",
35852 /// "executedQty",
35853 /// "fills",
35854 /// "orderId",
35855 /// "orderListId",
35856 /// "origQty",
35857 /// "price",
35858 /// "selfTradePreventionMode",
35859 /// "side",
35860 /// "status",
35861 /// "symbol",
35862 /// "timeInForce",
35863 /// "transactTime",
35864 /// "type",
35865 /// "workingTime"
35866 /// ],
35867 /// "properties": {
35868 /// "clientOrderId": {
35869 /// "examples": [
35870 /// "6gCrw2kRUAF9CvJDGP16IP"
35871 /// ],
35872 /// "type": "string"
35873 /// },
35874 /// "cummulativeQuoteQty": {
35875 /// "examples": [
35876 /// "10.00000000"
35877 /// ],
35878 /// "type": "string"
35879 /// },
35880 /// "executedQty": {
35881 /// "examples": [
35882 /// "10.00000000"
35883 /// ],
35884 /// "type": "string"
35885 /// },
35886 /// "fills": {
35887 /// "type": "array",
35888 /// "items": {
35889 /// "type": "object",
35890 /// "required": [
35891 /// "commission",
35892 /// "commissionAsset",
35893 /// "price",
35894 /// "qty"
35895 /// ],
35896 /// "properties": {
35897 /// "commission": {
35898 /// "examples": [
35899 /// "4.00000000"
35900 /// ],
35901 /// "type": "string"
35902 /// },
35903 /// "commissionAsset": {
35904 /// "examples": [
35905 /// "USDT"
35906 /// ],
35907 /// "type": "string"
35908 /// },
35909 /// "price": {
35910 /// "examples": [
35911 /// "4000.00000000"
35912 /// ],
35913 /// "type": "string"
35914 /// },
35915 /// "qty": {
35916 /// "examples": [
35917 /// "1.00000000"
35918 /// ],
35919 /// "type": "string"
35920 /// }
35921 /// }
35922 /// }
35923 /// },
35924 /// "orderId": {
35925 /// "examples": [
35926 /// 28
35927 /// ],
35928 /// "type": "integer",
35929 /// "format": "int64"
35930 /// },
35931 /// "orderListId": {
35932 /// "examples": [
35933 /// -1
35934 /// ],
35935 /// "type": "integer",
35936 /// "format": "int64"
35937 /// },
35938 /// "origQty": {
35939 /// "examples": [
35940 /// "10.00000000"
35941 /// ],
35942 /// "type": "string"
35943 /// },
35944 /// "price": {
35945 /// "examples": [
35946 /// "0.00000000"
35947 /// ],
35948 /// "type": "string"
35949 /// },
35950 /// "selfTradePreventionMode": {
35951 /// "examples": [
35952 /// "NONE"
35953 /// ],
35954 /// "type": "string"
35955 /// },
35956 /// "side": {
35957 /// "examples": [
35958 /// "SELL"
35959 /// ],
35960 /// "type": "string"
35961 /// },
35962 /// "status": {
35963 /// "examples": [
35964 /// "FILLED"
35965 /// ],
35966 /// "type": "string"
35967 /// },
35968 /// "strategyId": {
35969 /// "examples": [
35970 /// 1
35971 /// ],
35972 /// "type": "integer",
35973 /// "format": "int64"
35974 /// },
35975 /// "strategyType": {
35976 /// "examples": [
35977 /// 1000000
35978 /// ],
35979 /// "type": "integer",
35980 /// "format": "int64"
35981 /// },
35982 /// "symbol": {
35983 /// "examples": [
35984 /// "BTCUSDT"
35985 /// ],
35986 /// "type": "string"
35987 /// },
35988 /// "timeInForce": {
35989 /// "examples": [
35990 /// "GTC"
35991 /// ],
35992 /// "type": "string"
35993 /// },
35994 /// "transactTime": {
35995 /// "examples": [
35996 /// 1507725176595
35997 /// ],
35998 /// "type": "integer",
35999 /// "format": "int64"
36000 /// },
36001 /// "type": {
36002 /// "examples": [
36003 /// "MARKET"
36004 /// ],
36005 /// "type": "string"
36006 /// },
36007 /// "workingTime": {
36008 /// "examples": [
36009 /// 1507725176595
36010 /// ],
36011 /// "type": "integer",
36012 /// "format": "int64"
36013 /// }
36014 /// }
36015 ///}
36016 /// ```
36017 /// </details>
36018 #[derive(Clone, Debug, Deserialize, Serialize)]
36019 pub struct OrderResponseFull {
36020 #[serde(rename = "clientOrderId")]
36021 pub client_order_id: String,
36022 #[serde(rename = "cummulativeQuoteQty")]
36023 pub cummulative_quote_qty: String,
36024 #[serde(rename = "executedQty")]
36025 pub executed_qty: String,
36026 pub fills: Vec<OrderResponseFullFillsItem>,
36027 #[serde(rename = "orderId")]
36028 pub order_id: i64,
36029 #[serde(rename = "orderListId")]
36030 pub order_list_id: i64,
36031 #[serde(rename = "origQty")]
36032 pub orig_qty: String,
36033 pub price: String,
36034 #[serde(rename = "selfTradePreventionMode")]
36035 pub self_trade_prevention_mode: String,
36036 pub side: String,
36037 pub status: String,
36038 #[serde(rename = "strategyId", default, skip_serializing_if = "Option::is_none")]
36039 pub strategy_id: Option<i64>,
36040 #[serde(
36041 rename = "strategyType",
36042 default,
36043 skip_serializing_if = "Option::is_none"
36044 )]
36045 pub strategy_type: Option<i64>,
36046 pub symbol: String,
36047 #[serde(rename = "timeInForce")]
36048 pub time_in_force: String,
36049 #[serde(rename = "transactTime")]
36050 pub transact_time: i64,
36051 #[serde(rename = "type")]
36052 pub type_: String,
36053 #[serde(rename = "workingTime")]
36054 pub working_time: i64,
36055 }
36056 impl From<&OrderResponseFull> for OrderResponseFull {
36057 fn from(value: &OrderResponseFull) -> Self {
36058 value.clone()
36059 }
36060 }
36061 ///OrderResponseFullFillsItem
36062 ///
36063 /// <details><summary>JSON schema</summary>
36064 ///
36065 /// ```json
36066 ///{
36067 /// "type": "object",
36068 /// "required": [
36069 /// "commission",
36070 /// "commissionAsset",
36071 /// "price",
36072 /// "qty"
36073 /// ],
36074 /// "properties": {
36075 /// "commission": {
36076 /// "examples": [
36077 /// "4.00000000"
36078 /// ],
36079 /// "type": "string"
36080 /// },
36081 /// "commissionAsset": {
36082 /// "examples": [
36083 /// "USDT"
36084 /// ],
36085 /// "type": "string"
36086 /// },
36087 /// "price": {
36088 /// "examples": [
36089 /// "4000.00000000"
36090 /// ],
36091 /// "type": "string"
36092 /// },
36093 /// "qty": {
36094 /// "examples": [
36095 /// "1.00000000"
36096 /// ],
36097 /// "type": "string"
36098 /// }
36099 /// }
36100 ///}
36101 /// ```
36102 /// </details>
36103 #[derive(Clone, Debug, Deserialize, Serialize)]
36104 pub struct OrderResponseFullFillsItem {
36105 pub commission: String,
36106 #[serde(rename = "commissionAsset")]
36107 pub commission_asset: String,
36108 pub price: String,
36109 pub qty: String,
36110 }
36111 impl From<&OrderResponseFullFillsItem> for OrderResponseFullFillsItem {
36112 fn from(value: &OrderResponseFullFillsItem) -> Self {
36113 value.clone()
36114 }
36115 }
36116 ///OrderResponseResult
36117 ///
36118 /// <details><summary>JSON schema</summary>
36119 ///
36120 /// ```json
36121 ///{
36122 /// "type": "object",
36123 /// "required": [
36124 /// "clientOrderId",
36125 /// "cummulativeQuoteQty",
36126 /// "executedQty",
36127 /// "orderId",
36128 /// "orderListId",
36129 /// "origQty",
36130 /// "price",
36131 /// "selfTradePreventionMode",
36132 /// "side",
36133 /// "status",
36134 /// "symbol",
36135 /// "timeInForce",
36136 /// "transactTime",
36137 /// "type",
36138 /// "workingTime"
36139 /// ],
36140 /// "properties": {
36141 /// "clientOrderId": {
36142 /// "examples": [
36143 /// "6gCrw2kRUAF9CvJDGP16IP"
36144 /// ],
36145 /// "type": "string"
36146 /// },
36147 /// "cummulativeQuoteQty": {
36148 /// "examples": [
36149 /// "10.00000000"
36150 /// ],
36151 /// "type": "string"
36152 /// },
36153 /// "executedQty": {
36154 /// "examples": [
36155 /// "10.00000000"
36156 /// ],
36157 /// "type": "string"
36158 /// },
36159 /// "orderId": {
36160 /// "examples": [
36161 /// 28
36162 /// ],
36163 /// "type": "integer",
36164 /// "format": "int64"
36165 /// },
36166 /// "orderListId": {
36167 /// "examples": [
36168 /// -1
36169 /// ],
36170 /// "type": "integer",
36171 /// "format": "int64"
36172 /// },
36173 /// "origQty": {
36174 /// "examples": [
36175 /// "10.00000000"
36176 /// ],
36177 /// "type": "string"
36178 /// },
36179 /// "price": {
36180 /// "examples": [
36181 /// "0.00000000"
36182 /// ],
36183 /// "type": "string"
36184 /// },
36185 /// "selfTradePreventionMode": {
36186 /// "examples": [
36187 /// "NONE"
36188 /// ],
36189 /// "type": "string"
36190 /// },
36191 /// "side": {
36192 /// "examples": [
36193 /// "SELL"
36194 /// ],
36195 /// "type": "string"
36196 /// },
36197 /// "status": {
36198 /// "examples": [
36199 /// "FILLED"
36200 /// ],
36201 /// "type": "string"
36202 /// },
36203 /// "strategyId": {
36204 /// "examples": [
36205 /// 1
36206 /// ],
36207 /// "type": "integer",
36208 /// "format": "int64"
36209 /// },
36210 /// "strategyType": {
36211 /// "examples": [
36212 /// 1000000
36213 /// ],
36214 /// "type": "integer",
36215 /// "format": "int64"
36216 /// },
36217 /// "symbol": {
36218 /// "examples": [
36219 /// "BTCUSDT"
36220 /// ],
36221 /// "type": "string"
36222 /// },
36223 /// "timeInForce": {
36224 /// "examples": [
36225 /// "GTC"
36226 /// ],
36227 /// "type": "string"
36228 /// },
36229 /// "transactTime": {
36230 /// "examples": [
36231 /// 1507725176595
36232 /// ],
36233 /// "type": "integer",
36234 /// "format": "int64"
36235 /// },
36236 /// "type": {
36237 /// "examples": [
36238 /// "MARKET"
36239 /// ],
36240 /// "type": "string"
36241 /// },
36242 /// "workingTime": {
36243 /// "examples": [
36244 /// 1507725176595
36245 /// ],
36246 /// "type": "integer",
36247 /// "format": "int64"
36248 /// }
36249 /// }
36250 ///}
36251 /// ```
36252 /// </details>
36253 #[derive(Clone, Debug, Deserialize, Serialize)]
36254 pub struct OrderResponseResult {
36255 #[serde(rename = "clientOrderId")]
36256 pub client_order_id: String,
36257 #[serde(rename = "cummulativeQuoteQty")]
36258 pub cummulative_quote_qty: String,
36259 #[serde(rename = "executedQty")]
36260 pub executed_qty: String,
36261 #[serde(rename = "orderId")]
36262 pub order_id: i64,
36263 #[serde(rename = "orderListId")]
36264 pub order_list_id: i64,
36265 #[serde(rename = "origQty")]
36266 pub orig_qty: String,
36267 pub price: String,
36268 #[serde(rename = "selfTradePreventionMode")]
36269 pub self_trade_prevention_mode: String,
36270 pub side: String,
36271 pub status: String,
36272 #[serde(rename = "strategyId", default, skip_serializing_if = "Option::is_none")]
36273 pub strategy_id: Option<i64>,
36274 #[serde(
36275 rename = "strategyType",
36276 default,
36277 skip_serializing_if = "Option::is_none"
36278 )]
36279 pub strategy_type: Option<i64>,
36280 pub symbol: String,
36281 #[serde(rename = "timeInForce")]
36282 pub time_in_force: String,
36283 #[serde(rename = "transactTime")]
36284 pub transact_time: i64,
36285 #[serde(rename = "type")]
36286 pub type_: String,
36287 #[serde(rename = "workingTime")]
36288 pub working_time: i64,
36289 }
36290 impl From<&OrderResponseResult> for OrderResponseResult {
36291 fn from(value: &OrderResponseResult) -> Self {
36292 value.clone()
36293 }
36294 }
36295 ///OrderTestNewOrderRespType
36296 ///
36297 /// <details><summary>JSON schema</summary>
36298 ///
36299 /// ```json
36300 ///{
36301 /// "type": "string",
36302 /// "enum": [
36303 /// "ACK",
36304 /// "RESULT",
36305 /// "FULL"
36306 /// ]
36307 ///}
36308 /// ```
36309 /// </details>
36310 #[derive(
36311 Clone,
36312 Copy,
36313 Debug,
36314 Deserialize,
36315 Eq,
36316 Hash,
36317 Ord,
36318 PartialEq,
36319 PartialOrd,
36320 Serialize
36321 )]
36322 pub enum OrderTestNewOrderRespType {
36323 #[serde(rename = "ACK")]
36324 Ack,
36325 #[serde(rename = "RESULT")]
36326 Result,
36327 #[serde(rename = "FULL")]
36328 Full,
36329 }
36330 impl From<&OrderTestNewOrderRespType> for OrderTestNewOrderRespType {
36331 fn from(value: &OrderTestNewOrderRespType) -> Self {
36332 value.clone()
36333 }
36334 }
36335 impl ToString for OrderTestNewOrderRespType {
36336 fn to_string(&self) -> String {
36337 match *self {
36338 Self::Ack => "ACK".to_string(),
36339 Self::Result => "RESULT".to_string(),
36340 Self::Full => "FULL".to_string(),
36341 }
36342 }
36343 }
36344 impl std::str::FromStr for OrderTestNewOrderRespType {
36345 type Err = self::error::ConversionError;
36346 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
36347 match value {
36348 "ACK" => Ok(Self::Ack),
36349 "RESULT" => Ok(Self::Result),
36350 "FULL" => Ok(Self::Full),
36351 _ => Err("invalid value".into()),
36352 }
36353 }
36354 }
36355 impl std::convert::TryFrom<&str> for OrderTestNewOrderRespType {
36356 type Error = self::error::ConversionError;
36357 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
36358 value.parse()
36359 }
36360 }
36361 impl std::convert::TryFrom<&String> for OrderTestNewOrderRespType {
36362 type Error = self::error::ConversionError;
36363 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
36364 value.parse()
36365 }
36366 }
36367 impl std::convert::TryFrom<String> for OrderTestNewOrderRespType {
36368 type Error = self::error::ConversionError;
36369 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
36370 value.parse()
36371 }
36372 }
36373 ///OrderTestSide
36374 ///
36375 /// <details><summary>JSON schema</summary>
36376 ///
36377 /// ```json
36378 ///{
36379 /// "examples": [
36380 /// "SELL"
36381 /// ],
36382 /// "type": "string",
36383 /// "enum": [
36384 /// "SELL",
36385 /// "BUY"
36386 /// ]
36387 ///}
36388 /// ```
36389 /// </details>
36390 #[derive(
36391 Clone,
36392 Copy,
36393 Debug,
36394 Deserialize,
36395 Eq,
36396 Hash,
36397 Ord,
36398 PartialEq,
36399 PartialOrd,
36400 Serialize
36401 )]
36402 pub enum OrderTestSide {
36403 #[serde(rename = "SELL")]
36404 Sell,
36405 #[serde(rename = "BUY")]
36406 Buy,
36407 }
36408 impl From<&OrderTestSide> for OrderTestSide {
36409 fn from(value: &OrderTestSide) -> Self {
36410 value.clone()
36411 }
36412 }
36413 impl ToString for OrderTestSide {
36414 fn to_string(&self) -> String {
36415 match *self {
36416 Self::Sell => "SELL".to_string(),
36417 Self::Buy => "BUY".to_string(),
36418 }
36419 }
36420 }
36421 impl std::str::FromStr for OrderTestSide {
36422 type Err = self::error::ConversionError;
36423 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
36424 match value {
36425 "SELL" => Ok(Self::Sell),
36426 "BUY" => Ok(Self::Buy),
36427 _ => Err("invalid value".into()),
36428 }
36429 }
36430 }
36431 impl std::convert::TryFrom<&str> for OrderTestSide {
36432 type Error = self::error::ConversionError;
36433 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
36434 value.parse()
36435 }
36436 }
36437 impl std::convert::TryFrom<&String> for OrderTestSide {
36438 type Error = self::error::ConversionError;
36439 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
36440 value.parse()
36441 }
36442 }
36443 impl std::convert::TryFrom<String> for OrderTestSide {
36444 type Error = self::error::ConversionError;
36445 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
36446 value.parse()
36447 }
36448 }
36449 ///OrderTestTimeInForce
36450 ///
36451 /// <details><summary>JSON schema</summary>
36452 ///
36453 /// ```json
36454 ///{
36455 /// "examples": [
36456 /// "GTC"
36457 /// ],
36458 /// "type": "string",
36459 /// "enum": [
36460 /// "GTC",
36461 /// "IOC",
36462 /// "FOK"
36463 /// ]
36464 ///}
36465 /// ```
36466 /// </details>
36467 #[derive(
36468 Clone,
36469 Copy,
36470 Debug,
36471 Deserialize,
36472 Eq,
36473 Hash,
36474 Ord,
36475 PartialEq,
36476 PartialOrd,
36477 Serialize
36478 )]
36479 pub enum OrderTestTimeInForce {
36480 #[serde(rename = "GTC")]
36481 Gtc,
36482 #[serde(rename = "IOC")]
36483 Ioc,
36484 #[serde(rename = "FOK")]
36485 Fok,
36486 }
36487 impl From<&OrderTestTimeInForce> for OrderTestTimeInForce {
36488 fn from(value: &OrderTestTimeInForce) -> Self {
36489 value.clone()
36490 }
36491 }
36492 impl ToString for OrderTestTimeInForce {
36493 fn to_string(&self) -> String {
36494 match *self {
36495 Self::Gtc => "GTC".to_string(),
36496 Self::Ioc => "IOC".to_string(),
36497 Self::Fok => "FOK".to_string(),
36498 }
36499 }
36500 }
36501 impl std::str::FromStr for OrderTestTimeInForce {
36502 type Err = self::error::ConversionError;
36503 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
36504 match value {
36505 "GTC" => Ok(Self::Gtc),
36506 "IOC" => Ok(Self::Ioc),
36507 "FOK" => Ok(Self::Fok),
36508 _ => Err("invalid value".into()),
36509 }
36510 }
36511 }
36512 impl std::convert::TryFrom<&str> for OrderTestTimeInForce {
36513 type Error = self::error::ConversionError;
36514 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
36515 value.parse()
36516 }
36517 }
36518 impl std::convert::TryFrom<&String> for OrderTestTimeInForce {
36519 type Error = self::error::ConversionError;
36520 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
36521 value.parse()
36522 }
36523 }
36524 impl std::convert::TryFrom<String> for OrderTestTimeInForce {
36525 type Error = self::error::ConversionError;
36526 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
36527 value.parse()
36528 }
36529 }
36530 ///OrderTestType
36531 ///
36532 /// <details><summary>JSON schema</summary>
36533 ///
36534 /// ```json
36535 ///{
36536 /// "examples": [
36537 /// "LIMIT"
36538 /// ],
36539 /// "type": "string",
36540 /// "enum": [
36541 /// "LIMIT",
36542 /// "MARKET",
36543 /// "STOP_LOSS",
36544 /// "STOP_LOSS_LIMIT",
36545 /// "TAKE_PROFIT",
36546 /// "TAKE_PROFIT_LIMIT",
36547 /// "LIMIT_MAKER"
36548 /// ]
36549 ///}
36550 /// ```
36551 /// </details>
36552 #[derive(
36553 Clone,
36554 Copy,
36555 Debug,
36556 Deserialize,
36557 Eq,
36558 Hash,
36559 Ord,
36560 PartialEq,
36561 PartialOrd,
36562 Serialize
36563 )]
36564 pub enum OrderTestType {
36565 #[serde(rename = "LIMIT")]
36566 Limit,
36567 #[serde(rename = "MARKET")]
36568 Market,
36569 #[serde(rename = "STOP_LOSS")]
36570 StopLoss,
36571 #[serde(rename = "STOP_LOSS_LIMIT")]
36572 StopLossLimit,
36573 #[serde(rename = "TAKE_PROFIT")]
36574 TakeProfit,
36575 #[serde(rename = "TAKE_PROFIT_LIMIT")]
36576 TakeProfitLimit,
36577 #[serde(rename = "LIMIT_MAKER")]
36578 LimitMaker,
36579 }
36580 impl From<&OrderTestType> for OrderTestType {
36581 fn from(value: &OrderTestType) -> Self {
36582 value.clone()
36583 }
36584 }
36585 impl ToString for OrderTestType {
36586 fn to_string(&self) -> String {
36587 match *self {
36588 Self::Limit => "LIMIT".to_string(),
36589 Self::Market => "MARKET".to_string(),
36590 Self::StopLoss => "STOP_LOSS".to_string(),
36591 Self::StopLossLimit => "STOP_LOSS_LIMIT".to_string(),
36592 Self::TakeProfit => "TAKE_PROFIT".to_string(),
36593 Self::TakeProfitLimit => "TAKE_PROFIT_LIMIT".to_string(),
36594 Self::LimitMaker => "LIMIT_MAKER".to_string(),
36595 }
36596 }
36597 }
36598 impl std::str::FromStr for OrderTestType {
36599 type Err = self::error::ConversionError;
36600 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
36601 match value {
36602 "LIMIT" => Ok(Self::Limit),
36603 "MARKET" => Ok(Self::Market),
36604 "STOP_LOSS" => Ok(Self::StopLoss),
36605 "STOP_LOSS_LIMIT" => Ok(Self::StopLossLimit),
36606 "TAKE_PROFIT" => Ok(Self::TakeProfit),
36607 "TAKE_PROFIT_LIMIT" => Ok(Self::TakeProfitLimit),
36608 "LIMIT_MAKER" => Ok(Self::LimitMaker),
36609 _ => Err("invalid value".into()),
36610 }
36611 }
36612 }
36613 impl std::convert::TryFrom<&str> for OrderTestType {
36614 type Error = self::error::ConversionError;
36615 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
36616 value.parse()
36617 }
36618 }
36619 impl std::convert::TryFrom<&String> for OrderTestType {
36620 type Error = self::error::ConversionError;
36621 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
36622 value.parse()
36623 }
36624 }
36625 impl std::convert::TryFrom<String> for OrderTestType {
36626 type Error = self::error::ConversionError;
36627 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
36628 value.parse()
36629 }
36630 }
36631 ///PayTransactionsResponse
36632 ///
36633 /// <details><summary>JSON schema</summary>
36634 ///
36635 /// ```json
36636 ///{
36637 /// "type": "object",
36638 /// "required": [
36639 /// "code",
36640 /// "data",
36641 /// "message",
36642 /// "success"
36643 /// ],
36644 /// "properties": {
36645 /// "code": {
36646 /// "examples": [
36647 /// "000000"
36648 /// ],
36649 /// "type": "string"
36650 /// },
36651 /// "data": {
36652 /// "type": "array",
36653 /// "items": {
36654 /// "type": "object",
36655 /// "required": [
36656 /// "amount",
36657 /// "currency",
36658 /// "fundsDetail",
36659 /// "orderType",
36660 /// "payerInfo",
36661 /// "receiverInfo",
36662 /// "transactionId",
36663 /// "transactionTime",
36664 /// "walletType",
36665 /// "walletTypes"
36666 /// ],
36667 /// "properties": {
36668 /// "amount": {
36669 /// "description": "order amount(up to 8 decimal places), positive is income, negative is expenditure",
36670 /// "examples": [
36671 /// "23.72469206"
36672 /// ],
36673 /// "type": "string"
36674 /// },
36675 /// "currency": {
36676 /// "examples": [
36677 /// "BNB"
36678 /// ],
36679 /// "type": "string"
36680 /// },
36681 /// "fundsDetail": {
36682 /// "type": "array",
36683 /// "items": {
36684 /// "examples": [
36685 /// [
36686 /// {
36687 /// "amount": "1.2",
36688 /// "currency": "USDT"
36689 /// },
36690 /// {
36691 /// "amount": "0.0001",
36692 /// "currency": "ETH"
36693 /// }
36694 /// ]
36695 /// ],
36696 /// "type": "object",
36697 /// "required": [
36698 /// "amount",
36699 /// "currency"
36700 /// ],
36701 /// "properties": {
36702 /// "amount": {
36703 /// "type": "string"
36704 /// },
36705 /// "currency": {
36706 /// "type": "string"
36707 /// }
36708 /// }
36709 /// }
36710 /// },
36711 /// "orderType": {
36712 /// "description": "Enum:PAY(C2B Merchant Acquiring Payment), PAY_REFUND(C2B Merchant Acquiring Payment,refund), C2C(C2C Transfer Payment),CRYPTO_BOX(Crypto box), CRYPTO_BOX_RF(Crypto Box, refund), C2C_HOLDING(Transfer to new Binance user), C2C_HOLDING_RF(Transfer to new Binance user,refund), PAYOUT(B2C Disbursement Payment)",
36713 /// "examples": [
36714 /// "C2C"
36715 /// ],
36716 /// "type": "string"
36717 /// },
36718 /// "payerInfo": {
36719 /// "type": "object",
36720 /// "required": [
36721 /// "accountId",
36722 /// "binanceId",
36723 /// "name",
36724 /// "type"
36725 /// ],
36726 /// "properties": {
36727 /// "accountId": {
36728 /// "examples": [
36729 /// "67736251"
36730 /// ],
36731 /// "type": "string"
36732 /// },
36733 /// "binanceId": {
36734 /// "examples": [
36735 /// "12345678"
36736 /// ],
36737 /// "type": "string"
36738 /// },
36739 /// "name": {
36740 /// "examples": [
36741 /// "Jack"
36742 /// ],
36743 /// "type": "string"
36744 /// },
36745 /// "type": {
36746 /// "examples": [
36747 /// "USER"
36748 /// ],
36749 /// "type": "string"
36750 /// }
36751 /// }
36752 /// },
36753 /// "receiverInfo": {
36754 /// "type": "object",
36755 /// "required": [
36756 /// "accountId",
36757 /// "binanceId",
36758 /// "countryCode",
36759 /// "email",
36760 /// "mobileCode",
36761 /// "name",
36762 /// "phoneNumber",
36763 /// "type"
36764 /// ],
36765 /// "properties": {
36766 /// "accountId": {
36767 /// "examples": [
36768 /// "21326891"
36769 /// ],
36770 /// "type": "string"
36771 /// },
36772 /// "binanceId": {
36773 /// "examples": [
36774 /// "34355667"
36775 /// ],
36776 /// "type": "string"
36777 /// },
36778 /// "countryCode": {
36779 /// "examples": [
36780 /// "1"
36781 /// ],
36782 /// "type": "string"
36783 /// },
36784 /// "email": {
36785 /// "examples": [
36786 /// "alan@test.com"
36787 /// ],
36788 /// "type": "string"
36789 /// },
36790 /// "extend": {
36791 /// "type": "array",
36792 /// "items": {
36793 /// "type": "object",
36794 /// "required": [
36795 /// "cardNumber",
36796 /// "digitalWalletId",
36797 /// "institutionName"
36798 /// ],
36799 /// "properties": {
36800 /// "cardNumber": {
36801 /// "type": "string"
36802 /// },
36803 /// "digitalWalletId": {
36804 /// "type": "string"
36805 /// },
36806 /// "institutionName": {
36807 /// "type": "string"
36808 /// }
36809 /// }
36810 /// }
36811 /// },
36812 /// "mobileCode": {
36813 /// "examples": [
36814 /// "US"
36815 /// ],
36816 /// "type": "string"
36817 /// },
36818 /// "name": {
36819 /// "examples": [
36820 /// "Alan"
36821 /// ],
36822 /// "type": "string"
36823 /// },
36824 /// "phoneNumber": {
36825 /// "examples": [
36826 /// "8057651210"
36827 /// ],
36828 /// "type": "string"
36829 /// },
36830 /// "type": {
36831 /// "examples": [
36832 /// "MERCHANT"
36833 /// ],
36834 /// "type": "string"
36835 /// }
36836 /// }
36837 /// },
36838 /// "transactionId": {
36839 /// "examples": [
36840 /// "M_P_71505104267788288"
36841 /// ],
36842 /// "type": "string"
36843 /// },
36844 /// "transactionTime": {
36845 /// "examples": [
36846 /// 1610090460133
36847 /// ],
36848 /// "type": "integer",
36849 /// "format": "int64"
36850 /// },
36851 /// "walletType": {
36852 /// "examples": [
36853 /// 1
36854 /// ],
36855 /// "type": "integer"
36856 /// },
36857 /// "walletTypes": {
36858 /// "type": "array",
36859 /// "items": {
36860 /// "type": "integer"
36861 /// }
36862 /// }
36863 /// }
36864 /// }
36865 /// },
36866 /// "message": {
36867 /// "examples": [
36868 /// "success"
36869 /// ],
36870 /// "type": "string"
36871 /// },
36872 /// "success": {
36873 /// "type": "boolean"
36874 /// }
36875 /// }
36876 ///}
36877 /// ```
36878 /// </details>
36879 #[derive(Clone, Debug, Deserialize, Serialize)]
36880 pub struct PayTransactionsResponse {
36881 pub code: String,
36882 pub data: Vec<PayTransactionsResponseDataItem>,
36883 pub message: String,
36884 pub success: bool,
36885 }
36886 impl From<&PayTransactionsResponse> for PayTransactionsResponse {
36887 fn from(value: &PayTransactionsResponse) -> Self {
36888 value.clone()
36889 }
36890 }
36891 ///PayTransactionsResponseDataItem
36892 ///
36893 /// <details><summary>JSON schema</summary>
36894 ///
36895 /// ```json
36896 ///{
36897 /// "type": "object",
36898 /// "required": [
36899 /// "amount",
36900 /// "currency",
36901 /// "fundsDetail",
36902 /// "orderType",
36903 /// "payerInfo",
36904 /// "receiverInfo",
36905 /// "transactionId",
36906 /// "transactionTime",
36907 /// "walletType",
36908 /// "walletTypes"
36909 /// ],
36910 /// "properties": {
36911 /// "amount": {
36912 /// "description": "order amount(up to 8 decimal places), positive is income, negative is expenditure",
36913 /// "examples": [
36914 /// "23.72469206"
36915 /// ],
36916 /// "type": "string"
36917 /// },
36918 /// "currency": {
36919 /// "examples": [
36920 /// "BNB"
36921 /// ],
36922 /// "type": "string"
36923 /// },
36924 /// "fundsDetail": {
36925 /// "type": "array",
36926 /// "items": {
36927 /// "examples": [
36928 /// [
36929 /// {
36930 /// "amount": "1.2",
36931 /// "currency": "USDT"
36932 /// },
36933 /// {
36934 /// "amount": "0.0001",
36935 /// "currency": "ETH"
36936 /// }
36937 /// ]
36938 /// ],
36939 /// "type": "object",
36940 /// "required": [
36941 /// "amount",
36942 /// "currency"
36943 /// ],
36944 /// "properties": {
36945 /// "amount": {
36946 /// "type": "string"
36947 /// },
36948 /// "currency": {
36949 /// "type": "string"
36950 /// }
36951 /// }
36952 /// }
36953 /// },
36954 /// "orderType": {
36955 /// "description": "Enum:PAY(C2B Merchant Acquiring Payment), PAY_REFUND(C2B Merchant Acquiring Payment,refund), C2C(C2C Transfer Payment),CRYPTO_BOX(Crypto box), CRYPTO_BOX_RF(Crypto Box, refund), C2C_HOLDING(Transfer to new Binance user), C2C_HOLDING_RF(Transfer to new Binance user,refund), PAYOUT(B2C Disbursement Payment)",
36956 /// "examples": [
36957 /// "C2C"
36958 /// ],
36959 /// "type": "string"
36960 /// },
36961 /// "payerInfo": {
36962 /// "type": "object",
36963 /// "required": [
36964 /// "accountId",
36965 /// "binanceId",
36966 /// "name",
36967 /// "type"
36968 /// ],
36969 /// "properties": {
36970 /// "accountId": {
36971 /// "examples": [
36972 /// "67736251"
36973 /// ],
36974 /// "type": "string"
36975 /// },
36976 /// "binanceId": {
36977 /// "examples": [
36978 /// "12345678"
36979 /// ],
36980 /// "type": "string"
36981 /// },
36982 /// "name": {
36983 /// "examples": [
36984 /// "Jack"
36985 /// ],
36986 /// "type": "string"
36987 /// },
36988 /// "type": {
36989 /// "examples": [
36990 /// "USER"
36991 /// ],
36992 /// "type": "string"
36993 /// }
36994 /// }
36995 /// },
36996 /// "receiverInfo": {
36997 /// "type": "object",
36998 /// "required": [
36999 /// "accountId",
37000 /// "binanceId",
37001 /// "countryCode",
37002 /// "email",
37003 /// "mobileCode",
37004 /// "name",
37005 /// "phoneNumber",
37006 /// "type"
37007 /// ],
37008 /// "properties": {
37009 /// "accountId": {
37010 /// "examples": [
37011 /// "21326891"
37012 /// ],
37013 /// "type": "string"
37014 /// },
37015 /// "binanceId": {
37016 /// "examples": [
37017 /// "34355667"
37018 /// ],
37019 /// "type": "string"
37020 /// },
37021 /// "countryCode": {
37022 /// "examples": [
37023 /// "1"
37024 /// ],
37025 /// "type": "string"
37026 /// },
37027 /// "email": {
37028 /// "examples": [
37029 /// "alan@test.com"
37030 /// ],
37031 /// "type": "string"
37032 /// },
37033 /// "extend": {
37034 /// "type": "array",
37035 /// "items": {
37036 /// "type": "object",
37037 /// "required": [
37038 /// "cardNumber",
37039 /// "digitalWalletId",
37040 /// "institutionName"
37041 /// ],
37042 /// "properties": {
37043 /// "cardNumber": {
37044 /// "type": "string"
37045 /// },
37046 /// "digitalWalletId": {
37047 /// "type": "string"
37048 /// },
37049 /// "institutionName": {
37050 /// "type": "string"
37051 /// }
37052 /// }
37053 /// }
37054 /// },
37055 /// "mobileCode": {
37056 /// "examples": [
37057 /// "US"
37058 /// ],
37059 /// "type": "string"
37060 /// },
37061 /// "name": {
37062 /// "examples": [
37063 /// "Alan"
37064 /// ],
37065 /// "type": "string"
37066 /// },
37067 /// "phoneNumber": {
37068 /// "examples": [
37069 /// "8057651210"
37070 /// ],
37071 /// "type": "string"
37072 /// },
37073 /// "type": {
37074 /// "examples": [
37075 /// "MERCHANT"
37076 /// ],
37077 /// "type": "string"
37078 /// }
37079 /// }
37080 /// },
37081 /// "transactionId": {
37082 /// "examples": [
37083 /// "M_P_71505104267788288"
37084 /// ],
37085 /// "type": "string"
37086 /// },
37087 /// "transactionTime": {
37088 /// "examples": [
37089 /// 1610090460133
37090 /// ],
37091 /// "type": "integer",
37092 /// "format": "int64"
37093 /// },
37094 /// "walletType": {
37095 /// "examples": [
37096 /// 1
37097 /// ],
37098 /// "type": "integer"
37099 /// },
37100 /// "walletTypes": {
37101 /// "type": "array",
37102 /// "items": {
37103 /// "type": "integer"
37104 /// }
37105 /// }
37106 /// }
37107 ///}
37108 /// ```
37109 /// </details>
37110 #[derive(Clone, Debug, Deserialize, Serialize)]
37111 pub struct PayTransactionsResponseDataItem {
37112 ///order amount(up to 8 decimal places), positive is income, negative is expenditure
37113 pub amount: String,
37114 pub currency: String,
37115 #[serde(rename = "fundsDetail")]
37116 pub funds_detail: Vec<PayTransactionsResponseDataItemFundsDetailItem>,
37117 ///Enum:PAY(C2B Merchant Acquiring Payment), PAY_REFUND(C2B Merchant Acquiring Payment,refund), C2C(C2C Transfer Payment),CRYPTO_BOX(Crypto box), CRYPTO_BOX_RF(Crypto Box, refund), C2C_HOLDING(Transfer to new Binance user), C2C_HOLDING_RF(Transfer to new Binance user,refund), PAYOUT(B2C Disbursement Payment)
37118 #[serde(rename = "orderType")]
37119 pub order_type: String,
37120 #[serde(rename = "payerInfo")]
37121 pub payer_info: PayTransactionsResponseDataItemPayerInfo,
37122 #[serde(rename = "receiverInfo")]
37123 pub receiver_info: PayTransactionsResponseDataItemReceiverInfo,
37124 #[serde(rename = "transactionId")]
37125 pub transaction_id: String,
37126 #[serde(rename = "transactionTime")]
37127 pub transaction_time: i64,
37128 #[serde(rename = "walletType")]
37129 pub wallet_type: i64,
37130 #[serde(rename = "walletTypes")]
37131 pub wallet_types: Vec<i64>,
37132 }
37133 impl From<&PayTransactionsResponseDataItem> for PayTransactionsResponseDataItem {
37134 fn from(value: &PayTransactionsResponseDataItem) -> Self {
37135 value.clone()
37136 }
37137 }
37138 ///PayTransactionsResponseDataItemFundsDetailItem
37139 ///
37140 /// <details><summary>JSON schema</summary>
37141 ///
37142 /// ```json
37143 ///{
37144 /// "examples": [
37145 /// [
37146 /// {
37147 /// "amount": "1.2",
37148 /// "currency": "USDT"
37149 /// },
37150 /// {
37151 /// "amount": "0.0001",
37152 /// "currency": "ETH"
37153 /// }
37154 /// ]
37155 /// ],
37156 /// "type": "object",
37157 /// "required": [
37158 /// "amount",
37159 /// "currency"
37160 /// ],
37161 /// "properties": {
37162 /// "amount": {
37163 /// "type": "string"
37164 /// },
37165 /// "currency": {
37166 /// "type": "string"
37167 /// }
37168 /// }
37169 ///}
37170 /// ```
37171 /// </details>
37172 #[derive(Clone, Debug, Deserialize, Serialize)]
37173 pub struct PayTransactionsResponseDataItemFundsDetailItem {
37174 pub amount: String,
37175 pub currency: String,
37176 }
37177 impl From<&PayTransactionsResponseDataItemFundsDetailItem>
37178 for PayTransactionsResponseDataItemFundsDetailItem {
37179 fn from(value: &PayTransactionsResponseDataItemFundsDetailItem) -> Self {
37180 value.clone()
37181 }
37182 }
37183 ///PayTransactionsResponseDataItemPayerInfo
37184 ///
37185 /// <details><summary>JSON schema</summary>
37186 ///
37187 /// ```json
37188 ///{
37189 /// "type": "object",
37190 /// "required": [
37191 /// "accountId",
37192 /// "binanceId",
37193 /// "name",
37194 /// "type"
37195 /// ],
37196 /// "properties": {
37197 /// "accountId": {
37198 /// "examples": [
37199 /// "67736251"
37200 /// ],
37201 /// "type": "string"
37202 /// },
37203 /// "binanceId": {
37204 /// "examples": [
37205 /// "12345678"
37206 /// ],
37207 /// "type": "string"
37208 /// },
37209 /// "name": {
37210 /// "examples": [
37211 /// "Jack"
37212 /// ],
37213 /// "type": "string"
37214 /// },
37215 /// "type": {
37216 /// "examples": [
37217 /// "USER"
37218 /// ],
37219 /// "type": "string"
37220 /// }
37221 /// }
37222 ///}
37223 /// ```
37224 /// </details>
37225 #[derive(Clone, Debug, Deserialize, Serialize)]
37226 pub struct PayTransactionsResponseDataItemPayerInfo {
37227 #[serde(rename = "accountId")]
37228 pub account_id: String,
37229 #[serde(rename = "binanceId")]
37230 pub binance_id: String,
37231 pub name: String,
37232 #[serde(rename = "type")]
37233 pub type_: String,
37234 }
37235 impl From<&PayTransactionsResponseDataItemPayerInfo>
37236 for PayTransactionsResponseDataItemPayerInfo {
37237 fn from(value: &PayTransactionsResponseDataItemPayerInfo) -> Self {
37238 value.clone()
37239 }
37240 }
37241 ///PayTransactionsResponseDataItemReceiverInfo
37242 ///
37243 /// <details><summary>JSON schema</summary>
37244 ///
37245 /// ```json
37246 ///{
37247 /// "type": "object",
37248 /// "required": [
37249 /// "accountId",
37250 /// "binanceId",
37251 /// "countryCode",
37252 /// "email",
37253 /// "mobileCode",
37254 /// "name",
37255 /// "phoneNumber",
37256 /// "type"
37257 /// ],
37258 /// "properties": {
37259 /// "accountId": {
37260 /// "examples": [
37261 /// "21326891"
37262 /// ],
37263 /// "type": "string"
37264 /// },
37265 /// "binanceId": {
37266 /// "examples": [
37267 /// "34355667"
37268 /// ],
37269 /// "type": "string"
37270 /// },
37271 /// "countryCode": {
37272 /// "examples": [
37273 /// "1"
37274 /// ],
37275 /// "type": "string"
37276 /// },
37277 /// "email": {
37278 /// "examples": [
37279 /// "alan@test.com"
37280 /// ],
37281 /// "type": "string"
37282 /// },
37283 /// "extend": {
37284 /// "type": "array",
37285 /// "items": {
37286 /// "type": "object",
37287 /// "required": [
37288 /// "cardNumber",
37289 /// "digitalWalletId",
37290 /// "institutionName"
37291 /// ],
37292 /// "properties": {
37293 /// "cardNumber": {
37294 /// "type": "string"
37295 /// },
37296 /// "digitalWalletId": {
37297 /// "type": "string"
37298 /// },
37299 /// "institutionName": {
37300 /// "type": "string"
37301 /// }
37302 /// }
37303 /// }
37304 /// },
37305 /// "mobileCode": {
37306 /// "examples": [
37307 /// "US"
37308 /// ],
37309 /// "type": "string"
37310 /// },
37311 /// "name": {
37312 /// "examples": [
37313 /// "Alan"
37314 /// ],
37315 /// "type": "string"
37316 /// },
37317 /// "phoneNumber": {
37318 /// "examples": [
37319 /// "8057651210"
37320 /// ],
37321 /// "type": "string"
37322 /// },
37323 /// "type": {
37324 /// "examples": [
37325 /// "MERCHANT"
37326 /// ],
37327 /// "type": "string"
37328 /// }
37329 /// }
37330 ///}
37331 /// ```
37332 /// </details>
37333 #[derive(Clone, Debug, Deserialize, Serialize)]
37334 pub struct PayTransactionsResponseDataItemReceiverInfo {
37335 #[serde(rename = "accountId")]
37336 pub account_id: String,
37337 #[serde(rename = "binanceId")]
37338 pub binance_id: String,
37339 #[serde(rename = "countryCode")]
37340 pub country_code: String,
37341 pub email: String,
37342 #[serde(default, skip_serializing_if = "Vec::is_empty")]
37343 pub extend: Vec<PayTransactionsResponseDataItemReceiverInfoExtendItem>,
37344 #[serde(rename = "mobileCode")]
37345 pub mobile_code: String,
37346 pub name: String,
37347 #[serde(rename = "phoneNumber")]
37348 pub phone_number: String,
37349 #[serde(rename = "type")]
37350 pub type_: String,
37351 }
37352 impl From<&PayTransactionsResponseDataItemReceiverInfo>
37353 for PayTransactionsResponseDataItemReceiverInfo {
37354 fn from(value: &PayTransactionsResponseDataItemReceiverInfo) -> Self {
37355 value.clone()
37356 }
37357 }
37358 ///PayTransactionsResponseDataItemReceiverInfoExtendItem
37359 ///
37360 /// <details><summary>JSON schema</summary>
37361 ///
37362 /// ```json
37363 ///{
37364 /// "type": "object",
37365 /// "required": [
37366 /// "cardNumber",
37367 /// "digitalWalletId",
37368 /// "institutionName"
37369 /// ],
37370 /// "properties": {
37371 /// "cardNumber": {
37372 /// "type": "string"
37373 /// },
37374 /// "digitalWalletId": {
37375 /// "type": "string"
37376 /// },
37377 /// "institutionName": {
37378 /// "type": "string"
37379 /// }
37380 /// }
37381 ///}
37382 /// ```
37383 /// </details>
37384 #[derive(Clone, Debug, Deserialize, Serialize)]
37385 pub struct PayTransactionsResponseDataItemReceiverInfoExtendItem {
37386 #[serde(rename = "cardNumber")]
37387 pub card_number: String,
37388 #[serde(rename = "digitalWalletId")]
37389 pub digital_wallet_id: String,
37390 #[serde(rename = "institutionName")]
37391 pub institution_name: String,
37392 }
37393 impl From<&PayTransactionsResponseDataItemReceiverInfoExtendItem>
37394 for PayTransactionsResponseDataItemReceiverInfoExtendItem {
37395 fn from(value: &PayTransactionsResponseDataItemReceiverInfoExtendItem) -> Self {
37396 value.clone()
37397 }
37398 }
37399 ///PlaceNewOrderNewOrderRespType
37400 ///
37401 /// <details><summary>JSON schema</summary>
37402 ///
37403 /// ```json
37404 ///{
37405 /// "type": "string",
37406 /// "enum": [
37407 /// "ACK",
37408 /// "RESULT",
37409 /// "FULL"
37410 /// ]
37411 ///}
37412 /// ```
37413 /// </details>
37414 #[derive(
37415 Clone,
37416 Copy,
37417 Debug,
37418 Deserialize,
37419 Eq,
37420 Hash,
37421 Ord,
37422 PartialEq,
37423 PartialOrd,
37424 Serialize
37425 )]
37426 pub enum PlaceNewOrderNewOrderRespType {
37427 #[serde(rename = "ACK")]
37428 Ack,
37429 #[serde(rename = "RESULT")]
37430 Result,
37431 #[serde(rename = "FULL")]
37432 Full,
37433 }
37434 impl From<&PlaceNewOrderNewOrderRespType> for PlaceNewOrderNewOrderRespType {
37435 fn from(value: &PlaceNewOrderNewOrderRespType) -> Self {
37436 value.clone()
37437 }
37438 }
37439 impl ToString for PlaceNewOrderNewOrderRespType {
37440 fn to_string(&self) -> String {
37441 match *self {
37442 Self::Ack => "ACK".to_string(),
37443 Self::Result => "RESULT".to_string(),
37444 Self::Full => "FULL".to_string(),
37445 }
37446 }
37447 }
37448 impl std::str::FromStr for PlaceNewOrderNewOrderRespType {
37449 type Err = self::error::ConversionError;
37450 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
37451 match value {
37452 "ACK" => Ok(Self::Ack),
37453 "RESULT" => Ok(Self::Result),
37454 "FULL" => Ok(Self::Full),
37455 _ => Err("invalid value".into()),
37456 }
37457 }
37458 }
37459 impl std::convert::TryFrom<&str> for PlaceNewOrderNewOrderRespType {
37460 type Error = self::error::ConversionError;
37461 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
37462 value.parse()
37463 }
37464 }
37465 impl std::convert::TryFrom<&String> for PlaceNewOrderNewOrderRespType {
37466 type Error = self::error::ConversionError;
37467 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
37468 value.parse()
37469 }
37470 }
37471 impl std::convert::TryFrom<String> for PlaceNewOrderNewOrderRespType {
37472 type Error = self::error::ConversionError;
37473 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
37474 value.parse()
37475 }
37476 }
37477 ///PlaceNewOrderResponse
37478 ///
37479 /// <details><summary>JSON schema</summary>
37480 ///
37481 /// ```json
37482 ///{
37483 /// "oneOf": [
37484 /// {
37485 /// "$ref": "#/components/schemas/orderResponseAck"
37486 /// },
37487 /// {
37488 /// "$ref": "#/components/schemas/orderResponseResult"
37489 /// },
37490 /// {
37491 /// "$ref": "#/components/schemas/orderResponseFull"
37492 /// }
37493 /// ]
37494 ///}
37495 /// ```
37496 /// </details>
37497 #[derive(Clone, Debug, Deserialize, Serialize)]
37498 #[serde(untagged)]
37499 pub enum PlaceNewOrderResponse {
37500 Ack(OrderResponseAck),
37501 Result(OrderResponseResult),
37502 Full(OrderResponseFull),
37503 }
37504 impl From<&PlaceNewOrderResponse> for PlaceNewOrderResponse {
37505 fn from(value: &PlaceNewOrderResponse) -> Self {
37506 value.clone()
37507 }
37508 }
37509 impl From<OrderResponseAck> for PlaceNewOrderResponse {
37510 fn from(value: OrderResponseAck) -> Self {
37511 Self::Ack(value)
37512 }
37513 }
37514 impl From<OrderResponseResult> for PlaceNewOrderResponse {
37515 fn from(value: OrderResponseResult) -> Self {
37516 Self::Result(value)
37517 }
37518 }
37519 impl From<OrderResponseFull> for PlaceNewOrderResponse {
37520 fn from(value: OrderResponseFull) -> Self {
37521 Self::Full(value)
37522 }
37523 }
37524 ///PlaceNewOrderSelfTradePreventionMode
37525 ///
37526 /// <details><summary>JSON schema</summary>
37527 ///
37528 /// ```json
37529 ///{
37530 /// "examples": [
37531 /// "EXPIRE_TAKER"
37532 /// ],
37533 /// "type": "string",
37534 /// "enum": [
37535 /// "EXPIRE_TAKER",
37536 /// "EXPIRE_MAKER",
37537 /// "EXPIRE_BOTH",
37538 /// "NONE"
37539 /// ]
37540 ///}
37541 /// ```
37542 /// </details>
37543 #[derive(
37544 Clone,
37545 Copy,
37546 Debug,
37547 Deserialize,
37548 Eq,
37549 Hash,
37550 Ord,
37551 PartialEq,
37552 PartialOrd,
37553 Serialize
37554 )]
37555 pub enum PlaceNewOrderSelfTradePreventionMode {
37556 #[serde(rename = "EXPIRE_TAKER")]
37557 ExpireTaker,
37558 #[serde(rename = "EXPIRE_MAKER")]
37559 ExpireMaker,
37560 #[serde(rename = "EXPIRE_BOTH")]
37561 ExpireBoth,
37562 #[serde(rename = "NONE")]
37563 None,
37564 }
37565 impl From<&PlaceNewOrderSelfTradePreventionMode>
37566 for PlaceNewOrderSelfTradePreventionMode {
37567 fn from(value: &PlaceNewOrderSelfTradePreventionMode) -> Self {
37568 value.clone()
37569 }
37570 }
37571 impl ToString for PlaceNewOrderSelfTradePreventionMode {
37572 fn to_string(&self) -> String {
37573 match *self {
37574 Self::ExpireTaker => "EXPIRE_TAKER".to_string(),
37575 Self::ExpireMaker => "EXPIRE_MAKER".to_string(),
37576 Self::ExpireBoth => "EXPIRE_BOTH".to_string(),
37577 Self::None => "NONE".to_string(),
37578 }
37579 }
37580 }
37581 impl std::str::FromStr for PlaceNewOrderSelfTradePreventionMode {
37582 type Err = self::error::ConversionError;
37583 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
37584 match value {
37585 "EXPIRE_TAKER" => Ok(Self::ExpireTaker),
37586 "EXPIRE_MAKER" => Ok(Self::ExpireMaker),
37587 "EXPIRE_BOTH" => Ok(Self::ExpireBoth),
37588 "NONE" => Ok(Self::None),
37589 _ => Err("invalid value".into()),
37590 }
37591 }
37592 }
37593 impl std::convert::TryFrom<&str> for PlaceNewOrderSelfTradePreventionMode {
37594 type Error = self::error::ConversionError;
37595 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
37596 value.parse()
37597 }
37598 }
37599 impl std::convert::TryFrom<&String> for PlaceNewOrderSelfTradePreventionMode {
37600 type Error = self::error::ConversionError;
37601 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
37602 value.parse()
37603 }
37604 }
37605 impl std::convert::TryFrom<String> for PlaceNewOrderSelfTradePreventionMode {
37606 type Error = self::error::ConversionError;
37607 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
37608 value.parse()
37609 }
37610 }
37611 ///PlaceNewOrderSide
37612 ///
37613 /// <details><summary>JSON schema</summary>
37614 ///
37615 /// ```json
37616 ///{
37617 /// "examples": [
37618 /// "SELL"
37619 /// ],
37620 /// "type": "string",
37621 /// "enum": [
37622 /// "SELL",
37623 /// "BUY"
37624 /// ]
37625 ///}
37626 /// ```
37627 /// </details>
37628 #[derive(
37629 Clone,
37630 Copy,
37631 Debug,
37632 Deserialize,
37633 Eq,
37634 Hash,
37635 Ord,
37636 PartialEq,
37637 PartialOrd,
37638 Serialize
37639 )]
37640 pub enum PlaceNewOrderSide {
37641 #[serde(rename = "SELL")]
37642 Sell,
37643 #[serde(rename = "BUY")]
37644 Buy,
37645 }
37646 impl From<&PlaceNewOrderSide> for PlaceNewOrderSide {
37647 fn from(value: &PlaceNewOrderSide) -> Self {
37648 value.clone()
37649 }
37650 }
37651 impl ToString for PlaceNewOrderSide {
37652 fn to_string(&self) -> String {
37653 match *self {
37654 Self::Sell => "SELL".to_string(),
37655 Self::Buy => "BUY".to_string(),
37656 }
37657 }
37658 }
37659 impl std::str::FromStr for PlaceNewOrderSide {
37660 type Err = self::error::ConversionError;
37661 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
37662 match value {
37663 "SELL" => Ok(Self::Sell),
37664 "BUY" => Ok(Self::Buy),
37665 _ => Err("invalid value".into()),
37666 }
37667 }
37668 }
37669 impl std::convert::TryFrom<&str> for PlaceNewOrderSide {
37670 type Error = self::error::ConversionError;
37671 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
37672 value.parse()
37673 }
37674 }
37675 impl std::convert::TryFrom<&String> for PlaceNewOrderSide {
37676 type Error = self::error::ConversionError;
37677 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
37678 value.parse()
37679 }
37680 }
37681 impl std::convert::TryFrom<String> for PlaceNewOrderSide {
37682 type Error = self::error::ConversionError;
37683 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
37684 value.parse()
37685 }
37686 }
37687 ///PlaceNewOrderTimeInForce
37688 ///
37689 /// <details><summary>JSON schema</summary>
37690 ///
37691 /// ```json
37692 ///{
37693 /// "examples": [
37694 /// "GTC"
37695 /// ],
37696 /// "type": "string",
37697 /// "enum": [
37698 /// "GTC",
37699 /// "IOC",
37700 /// "FOK"
37701 /// ]
37702 ///}
37703 /// ```
37704 /// </details>
37705 #[derive(
37706 Clone,
37707 Copy,
37708 Debug,
37709 Deserialize,
37710 Eq,
37711 Hash,
37712 Ord,
37713 PartialEq,
37714 PartialOrd,
37715 Serialize
37716 )]
37717 pub enum PlaceNewOrderTimeInForce {
37718 #[serde(rename = "GTC")]
37719 Gtc,
37720 #[serde(rename = "IOC")]
37721 Ioc,
37722 #[serde(rename = "FOK")]
37723 Fok,
37724 }
37725 impl From<&PlaceNewOrderTimeInForce> for PlaceNewOrderTimeInForce {
37726 fn from(value: &PlaceNewOrderTimeInForce) -> Self {
37727 value.clone()
37728 }
37729 }
37730 impl ToString for PlaceNewOrderTimeInForce {
37731 fn to_string(&self) -> String {
37732 match *self {
37733 Self::Gtc => "GTC".to_string(),
37734 Self::Ioc => "IOC".to_string(),
37735 Self::Fok => "FOK".to_string(),
37736 }
37737 }
37738 }
37739 impl std::str::FromStr for PlaceNewOrderTimeInForce {
37740 type Err = self::error::ConversionError;
37741 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
37742 match value {
37743 "GTC" => Ok(Self::Gtc),
37744 "IOC" => Ok(Self::Ioc),
37745 "FOK" => Ok(Self::Fok),
37746 _ => Err("invalid value".into()),
37747 }
37748 }
37749 }
37750 impl std::convert::TryFrom<&str> for PlaceNewOrderTimeInForce {
37751 type Error = self::error::ConversionError;
37752 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
37753 value.parse()
37754 }
37755 }
37756 impl std::convert::TryFrom<&String> for PlaceNewOrderTimeInForce {
37757 type Error = self::error::ConversionError;
37758 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
37759 value.parse()
37760 }
37761 }
37762 impl std::convert::TryFrom<String> for PlaceNewOrderTimeInForce {
37763 type Error = self::error::ConversionError;
37764 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
37765 value.parse()
37766 }
37767 }
37768 ///PlaceNewOrderType
37769 ///
37770 /// <details><summary>JSON schema</summary>
37771 ///
37772 /// ```json
37773 ///{
37774 /// "examples": [
37775 /// "LIMIT"
37776 /// ],
37777 /// "type": "string",
37778 /// "enum": [
37779 /// "LIMIT",
37780 /// "MARKET",
37781 /// "STOP_LOSS",
37782 /// "STOP_LOSS_LIMIT",
37783 /// "TAKE_PROFIT",
37784 /// "TAKE_PROFIT_LIMIT",
37785 /// "LIMIT_MAKER"
37786 /// ]
37787 ///}
37788 /// ```
37789 /// </details>
37790 #[derive(
37791 Clone,
37792 Copy,
37793 Debug,
37794 Deserialize,
37795 Eq,
37796 Hash,
37797 Ord,
37798 PartialEq,
37799 PartialOrd,
37800 Serialize
37801 )]
37802 pub enum PlaceNewOrderType {
37803 #[serde(rename = "LIMIT")]
37804 Limit,
37805 #[serde(rename = "MARKET")]
37806 Market,
37807 #[serde(rename = "STOP_LOSS")]
37808 StopLoss,
37809 #[serde(rename = "STOP_LOSS_LIMIT")]
37810 StopLossLimit,
37811 #[serde(rename = "TAKE_PROFIT")]
37812 TakeProfit,
37813 #[serde(rename = "TAKE_PROFIT_LIMIT")]
37814 TakeProfitLimit,
37815 #[serde(rename = "LIMIT_MAKER")]
37816 LimitMaker,
37817 }
37818 impl From<&PlaceNewOrderType> for PlaceNewOrderType {
37819 fn from(value: &PlaceNewOrderType) -> Self {
37820 value.clone()
37821 }
37822 }
37823 impl ToString for PlaceNewOrderType {
37824 fn to_string(&self) -> String {
37825 match *self {
37826 Self::Limit => "LIMIT".to_string(),
37827 Self::Market => "MARKET".to_string(),
37828 Self::StopLoss => "STOP_LOSS".to_string(),
37829 Self::StopLossLimit => "STOP_LOSS_LIMIT".to_string(),
37830 Self::TakeProfit => "TAKE_PROFIT".to_string(),
37831 Self::TakeProfitLimit => "TAKE_PROFIT_LIMIT".to_string(),
37832 Self::LimitMaker => "LIMIT_MAKER".to_string(),
37833 }
37834 }
37835 }
37836 impl std::str::FromStr for PlaceNewOrderType {
37837 type Err = self::error::ConversionError;
37838 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
37839 match value {
37840 "LIMIT" => Ok(Self::Limit),
37841 "MARKET" => Ok(Self::Market),
37842 "STOP_LOSS" => Ok(Self::StopLoss),
37843 "STOP_LOSS_LIMIT" => Ok(Self::StopLossLimit),
37844 "TAKE_PROFIT" => Ok(Self::TakeProfit),
37845 "TAKE_PROFIT_LIMIT" => Ok(Self::TakeProfitLimit),
37846 "LIMIT_MAKER" => Ok(Self::LimitMaker),
37847 _ => Err("invalid value".into()),
37848 }
37849 }
37850 }
37851 impl std::convert::TryFrom<&str> for PlaceNewOrderType {
37852 type Error = self::error::ConversionError;
37853 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
37854 value.parse()
37855 }
37856 }
37857 impl std::convert::TryFrom<&String> for PlaceNewOrderType {
37858 type Error = self::error::ConversionError;
37859 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
37860 value.parse()
37861 }
37862 }
37863 impl std::convert::TryFrom<String> for PlaceNewOrderType {
37864 type Error = self::error::ConversionError;
37865 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
37866 value.parse()
37867 }
37868 }
37869 ///PlaceOrderOcoNewOrderRespType
37870 ///
37871 /// <details><summary>JSON schema</summary>
37872 ///
37873 /// ```json
37874 ///{
37875 /// "type": "string",
37876 /// "enum": [
37877 /// "ACK",
37878 /// "RESULT",
37879 /// "FULL"
37880 /// ]
37881 ///}
37882 /// ```
37883 /// </details>
37884 #[derive(
37885 Clone,
37886 Copy,
37887 Debug,
37888 Deserialize,
37889 Eq,
37890 Hash,
37891 Ord,
37892 PartialEq,
37893 PartialOrd,
37894 Serialize
37895 )]
37896 pub enum PlaceOrderOcoNewOrderRespType {
37897 #[serde(rename = "ACK")]
37898 Ack,
37899 #[serde(rename = "RESULT")]
37900 Result,
37901 #[serde(rename = "FULL")]
37902 Full,
37903 }
37904 impl From<&PlaceOrderOcoNewOrderRespType> for PlaceOrderOcoNewOrderRespType {
37905 fn from(value: &PlaceOrderOcoNewOrderRespType) -> Self {
37906 value.clone()
37907 }
37908 }
37909 impl ToString for PlaceOrderOcoNewOrderRespType {
37910 fn to_string(&self) -> String {
37911 match *self {
37912 Self::Ack => "ACK".to_string(),
37913 Self::Result => "RESULT".to_string(),
37914 Self::Full => "FULL".to_string(),
37915 }
37916 }
37917 }
37918 impl std::str::FromStr for PlaceOrderOcoNewOrderRespType {
37919 type Err = self::error::ConversionError;
37920 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
37921 match value {
37922 "ACK" => Ok(Self::Ack),
37923 "RESULT" => Ok(Self::Result),
37924 "FULL" => Ok(Self::Full),
37925 _ => Err("invalid value".into()),
37926 }
37927 }
37928 }
37929 impl std::convert::TryFrom<&str> for PlaceOrderOcoNewOrderRespType {
37930 type Error = self::error::ConversionError;
37931 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
37932 value.parse()
37933 }
37934 }
37935 impl std::convert::TryFrom<&String> for PlaceOrderOcoNewOrderRespType {
37936 type Error = self::error::ConversionError;
37937 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
37938 value.parse()
37939 }
37940 }
37941 impl std::convert::TryFrom<String> for PlaceOrderOcoNewOrderRespType {
37942 type Error = self::error::ConversionError;
37943 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
37944 value.parse()
37945 }
37946 }
37947 ///PlaceOrderOcoResponse
37948 ///
37949 /// <details><summary>JSON schema</summary>
37950 ///
37951 /// ```json
37952 ///{
37953 /// "type": "object",
37954 /// "required": [
37955 /// "contingencyType",
37956 /// "listClientOrderId",
37957 /// "listOrderStatus",
37958 /// "listStatusType",
37959 /// "orderListId",
37960 /// "orderReports",
37961 /// "orders",
37962 /// "symbol",
37963 /// "transactionTime"
37964 /// ],
37965 /// "properties": {
37966 /// "contingencyType": {
37967 /// "examples": [
37968 /// "OCO"
37969 /// ],
37970 /// "type": "string"
37971 /// },
37972 /// "listClientOrderId": {
37973 /// "examples": [
37974 /// "JYVpp3F0f5CAG15DhtrqLp"
37975 /// ],
37976 /// "type": "string"
37977 /// },
37978 /// "listOrderStatus": {
37979 /// "examples": [
37980 /// "EXECUTING"
37981 /// ],
37982 /// "type": "string"
37983 /// },
37984 /// "listStatusType": {
37985 /// "examples": [
37986 /// "EXEC_STARTED"
37987 /// ],
37988 /// "type": "string"
37989 /// },
37990 /// "orderListId": {
37991 /// "examples": [
37992 /// 0
37993 /// ],
37994 /// "type": "integer",
37995 /// "format": "int64"
37996 /// },
37997 /// "orderReports": {
37998 /// "examples": [
37999 /// [
38000 /// {
38001 /// "clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos",
38002 /// "cummulativeQuoteQty": "0.000000",
38003 /// "executedQty": "0.000000",
38004 /// "orderId": 2,
38005 /// "orderListId": 0,
38006 /// "origQty": "0.624363",
38007 /// "price": "0.000000",
38008 /// "selfTradePreventionMode": "NONE",
38009 /// "side": "BUY",
38010 /// "status": "NEW",
38011 /// "stopPrice": "0.960664",
38012 /// "symbol": "LTCBTC",
38013 /// "timeInForce": "GTC",
38014 /// "transactTime": 1563417480525,
38015 /// "type": "STOP_LOSS",
38016 /// "workingTime": -1
38017 /// },
38018 /// {
38019 /// "clientOrderId": "xTXKaGYd4bluPVp78IVRvl",
38020 /// "cummulativeQuoteQty": "0.000000",
38021 /// "executedQty": "0.000000",
38022 /// "orderId": 3,
38023 /// "orderListId": 0,
38024 /// "origQty": "0.624363",
38025 /// "price": "0.036435",
38026 /// "selfTradePreventionMode": "NONE",
38027 /// "side": "BUY",
38028 /// "status": "NEW",
38029 /// "symbol": "LTCBTC",
38030 /// "timeInForce": "GTC",
38031 /// "transactTime": 1563417480525,
38032 /// "type": "LIMIT_MAKER",
38033 /// "workingTime": 1563417480525
38034 /// }
38035 /// ]
38036 /// ],
38037 /// "type": "array",
38038 /// "items": {
38039 /// "type": "object",
38040 /// "required": [
38041 /// "clientOrderId",
38042 /// "cummulativeQuoteQty",
38043 /// "executedQty",
38044 /// "orderId",
38045 /// "orderListId",
38046 /// "origQty",
38047 /// "price",
38048 /// "selfTradePreventionMode",
38049 /// "side",
38050 /// "status",
38051 /// "stopPrice",
38052 /// "symbol",
38053 /// "timeInForce",
38054 /// "transactTime",
38055 /// "type",
38056 /// "workingTime"
38057 /// ],
38058 /// "properties": {
38059 /// "clientOrderId": {
38060 /// "type": "string"
38061 /// },
38062 /// "cummulativeQuoteQty": {
38063 /// "type": "string"
38064 /// },
38065 /// "executedQty": {
38066 /// "type": "string"
38067 /// },
38068 /// "orderId": {
38069 /// "type": "integer",
38070 /// "format": "int64"
38071 /// },
38072 /// "orderListId": {
38073 /// "type": "integer",
38074 /// "format": "int64"
38075 /// },
38076 /// "origQty": {
38077 /// "type": "string"
38078 /// },
38079 /// "price": {
38080 /// "type": "string"
38081 /// },
38082 /// "selfTradePreventionMode": {
38083 /// "type": "string"
38084 /// },
38085 /// "side": {
38086 /// "type": "string"
38087 /// },
38088 /// "status": {
38089 /// "type": "string"
38090 /// },
38091 /// "stopPrice": {
38092 /// "type": "string"
38093 /// },
38094 /// "symbol": {
38095 /// "type": "string"
38096 /// },
38097 /// "timeInForce": {
38098 /// "type": "string"
38099 /// },
38100 /// "transactTime": {
38101 /// "type": "integer",
38102 /// "format": "int64"
38103 /// },
38104 /// "type": {
38105 /// "type": "string"
38106 /// },
38107 /// "workingTime": {
38108 /// "type": "string"
38109 /// }
38110 /// }
38111 /// }
38112 /// },
38113 /// "orders": {
38114 /// "type": "array",
38115 /// "items": {
38116 /// "examples": [
38117 /// [
38118 /// {
38119 /// "clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos",
38120 /// "orderId": 2,
38121 /// "symbol": "LTCBTC"
38122 /// },
38123 /// {
38124 /// "clientOrderId": "xTXKaGYd4bluPVp78IVRvl",
38125 /// "orderId": 3,
38126 /// "symbol": "LTCBTC"
38127 /// }
38128 /// ]
38129 /// ],
38130 /// "type": "object",
38131 /// "required": [
38132 /// "clientOrderId",
38133 /// "orderId",
38134 /// "symbol"
38135 /// ],
38136 /// "properties": {
38137 /// "clientOrderId": {
38138 /// "type": "string"
38139 /// },
38140 /// "orderId": {
38141 /// "type": "integer",
38142 /// "format": "int64"
38143 /// },
38144 /// "symbol": {
38145 /// "type": "string"
38146 /// }
38147 /// }
38148 /// }
38149 /// },
38150 /// "symbol": {
38151 /// "examples": [
38152 /// "LTCBTC"
38153 /// ],
38154 /// "type": "string"
38155 /// },
38156 /// "transactionTime": {
38157 /// "examples": [
38158 /// 1563417480525
38159 /// ],
38160 /// "type": "integer",
38161 /// "format": "int64"
38162 /// }
38163 /// }
38164 ///}
38165 /// ```
38166 /// </details>
38167 #[derive(Clone, Debug, Deserialize, Serialize)]
38168 pub struct PlaceOrderOcoResponse {
38169 #[serde(rename = "contingencyType")]
38170 pub contingency_type: String,
38171 #[serde(rename = "listClientOrderId")]
38172 pub list_client_order_id: String,
38173 #[serde(rename = "listOrderStatus")]
38174 pub list_order_status: String,
38175 #[serde(rename = "listStatusType")]
38176 pub list_status_type: String,
38177 #[serde(rename = "orderListId")]
38178 pub order_list_id: i64,
38179 #[serde(rename = "orderReports")]
38180 pub order_reports: Vec<PlaceOrderOcoResponseOrderReportsItem>,
38181 pub orders: Vec<PlaceOrderOcoResponseOrdersItem>,
38182 pub symbol: String,
38183 #[serde(rename = "transactionTime")]
38184 pub transaction_time: i64,
38185 }
38186 impl From<&PlaceOrderOcoResponse> for PlaceOrderOcoResponse {
38187 fn from(value: &PlaceOrderOcoResponse) -> Self {
38188 value.clone()
38189 }
38190 }
38191 ///PlaceOrderOcoResponseOrderReportsItem
38192 ///
38193 /// <details><summary>JSON schema</summary>
38194 ///
38195 /// ```json
38196 ///{
38197 /// "type": "object",
38198 /// "required": [
38199 /// "clientOrderId",
38200 /// "cummulativeQuoteQty",
38201 /// "executedQty",
38202 /// "orderId",
38203 /// "orderListId",
38204 /// "origQty",
38205 /// "price",
38206 /// "selfTradePreventionMode",
38207 /// "side",
38208 /// "status",
38209 /// "stopPrice",
38210 /// "symbol",
38211 /// "timeInForce",
38212 /// "transactTime",
38213 /// "type",
38214 /// "workingTime"
38215 /// ],
38216 /// "properties": {
38217 /// "clientOrderId": {
38218 /// "type": "string"
38219 /// },
38220 /// "cummulativeQuoteQty": {
38221 /// "type": "string"
38222 /// },
38223 /// "executedQty": {
38224 /// "type": "string"
38225 /// },
38226 /// "orderId": {
38227 /// "type": "integer",
38228 /// "format": "int64"
38229 /// },
38230 /// "orderListId": {
38231 /// "type": "integer",
38232 /// "format": "int64"
38233 /// },
38234 /// "origQty": {
38235 /// "type": "string"
38236 /// },
38237 /// "price": {
38238 /// "type": "string"
38239 /// },
38240 /// "selfTradePreventionMode": {
38241 /// "type": "string"
38242 /// },
38243 /// "side": {
38244 /// "type": "string"
38245 /// },
38246 /// "status": {
38247 /// "type": "string"
38248 /// },
38249 /// "stopPrice": {
38250 /// "type": "string"
38251 /// },
38252 /// "symbol": {
38253 /// "type": "string"
38254 /// },
38255 /// "timeInForce": {
38256 /// "type": "string"
38257 /// },
38258 /// "transactTime": {
38259 /// "type": "integer",
38260 /// "format": "int64"
38261 /// },
38262 /// "type": {
38263 /// "type": "string"
38264 /// },
38265 /// "workingTime": {
38266 /// "type": "string"
38267 /// }
38268 /// }
38269 ///}
38270 /// ```
38271 /// </details>
38272 #[derive(Clone, Debug, Deserialize, Serialize)]
38273 pub struct PlaceOrderOcoResponseOrderReportsItem {
38274 #[serde(rename = "clientOrderId")]
38275 pub client_order_id: String,
38276 #[serde(rename = "cummulativeQuoteQty")]
38277 pub cummulative_quote_qty: String,
38278 #[serde(rename = "executedQty")]
38279 pub executed_qty: String,
38280 #[serde(rename = "orderId")]
38281 pub order_id: i64,
38282 #[serde(rename = "orderListId")]
38283 pub order_list_id: i64,
38284 #[serde(rename = "origQty")]
38285 pub orig_qty: String,
38286 pub price: String,
38287 #[serde(rename = "selfTradePreventionMode")]
38288 pub self_trade_prevention_mode: String,
38289 pub side: String,
38290 pub status: String,
38291 #[serde(rename = "stopPrice")]
38292 pub stop_price: String,
38293 pub symbol: String,
38294 #[serde(rename = "timeInForce")]
38295 pub time_in_force: String,
38296 #[serde(rename = "transactTime")]
38297 pub transact_time: i64,
38298 #[serde(rename = "type")]
38299 pub type_: String,
38300 #[serde(rename = "workingTime")]
38301 pub working_time: String,
38302 }
38303 impl From<&PlaceOrderOcoResponseOrderReportsItem>
38304 for PlaceOrderOcoResponseOrderReportsItem {
38305 fn from(value: &PlaceOrderOcoResponseOrderReportsItem) -> Self {
38306 value.clone()
38307 }
38308 }
38309 ///PlaceOrderOcoResponseOrdersItem
38310 ///
38311 /// <details><summary>JSON schema</summary>
38312 ///
38313 /// ```json
38314 ///{
38315 /// "examples": [
38316 /// [
38317 /// {
38318 /// "clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos",
38319 /// "orderId": 2,
38320 /// "symbol": "LTCBTC"
38321 /// },
38322 /// {
38323 /// "clientOrderId": "xTXKaGYd4bluPVp78IVRvl",
38324 /// "orderId": 3,
38325 /// "symbol": "LTCBTC"
38326 /// }
38327 /// ]
38328 /// ],
38329 /// "type": "object",
38330 /// "required": [
38331 /// "clientOrderId",
38332 /// "orderId",
38333 /// "symbol"
38334 /// ],
38335 /// "properties": {
38336 /// "clientOrderId": {
38337 /// "type": "string"
38338 /// },
38339 /// "orderId": {
38340 /// "type": "integer",
38341 /// "format": "int64"
38342 /// },
38343 /// "symbol": {
38344 /// "type": "string"
38345 /// }
38346 /// }
38347 ///}
38348 /// ```
38349 /// </details>
38350 #[derive(Clone, Debug, Deserialize, Serialize)]
38351 pub struct PlaceOrderOcoResponseOrdersItem {
38352 #[serde(rename = "clientOrderId")]
38353 pub client_order_id: String,
38354 #[serde(rename = "orderId")]
38355 pub order_id: i64,
38356 pub symbol: String,
38357 }
38358 impl From<&PlaceOrderOcoResponseOrdersItem> for PlaceOrderOcoResponseOrdersItem {
38359 fn from(value: &PlaceOrderOcoResponseOrdersItem) -> Self {
38360 value.clone()
38361 }
38362 }
38363 ///PlaceOrderOcoSelfTradePreventionMode
38364 ///
38365 /// <details><summary>JSON schema</summary>
38366 ///
38367 /// ```json
38368 ///{
38369 /// "examples": [
38370 /// "EXPIRE_TAKER"
38371 /// ],
38372 /// "type": "string",
38373 /// "enum": [
38374 /// "EXPIRE_TAKER",
38375 /// "EXPIRE_MAKER",
38376 /// "EXPIRE_BOTH",
38377 /// "NONE"
38378 /// ]
38379 ///}
38380 /// ```
38381 /// </details>
38382 #[derive(
38383 Clone,
38384 Copy,
38385 Debug,
38386 Deserialize,
38387 Eq,
38388 Hash,
38389 Ord,
38390 PartialEq,
38391 PartialOrd,
38392 Serialize
38393 )]
38394 pub enum PlaceOrderOcoSelfTradePreventionMode {
38395 #[serde(rename = "EXPIRE_TAKER")]
38396 ExpireTaker,
38397 #[serde(rename = "EXPIRE_MAKER")]
38398 ExpireMaker,
38399 #[serde(rename = "EXPIRE_BOTH")]
38400 ExpireBoth,
38401 #[serde(rename = "NONE")]
38402 None,
38403 }
38404 impl From<&PlaceOrderOcoSelfTradePreventionMode>
38405 for PlaceOrderOcoSelfTradePreventionMode {
38406 fn from(value: &PlaceOrderOcoSelfTradePreventionMode) -> Self {
38407 value.clone()
38408 }
38409 }
38410 impl ToString for PlaceOrderOcoSelfTradePreventionMode {
38411 fn to_string(&self) -> String {
38412 match *self {
38413 Self::ExpireTaker => "EXPIRE_TAKER".to_string(),
38414 Self::ExpireMaker => "EXPIRE_MAKER".to_string(),
38415 Self::ExpireBoth => "EXPIRE_BOTH".to_string(),
38416 Self::None => "NONE".to_string(),
38417 }
38418 }
38419 }
38420 impl std::str::FromStr for PlaceOrderOcoSelfTradePreventionMode {
38421 type Err = self::error::ConversionError;
38422 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
38423 match value {
38424 "EXPIRE_TAKER" => Ok(Self::ExpireTaker),
38425 "EXPIRE_MAKER" => Ok(Self::ExpireMaker),
38426 "EXPIRE_BOTH" => Ok(Self::ExpireBoth),
38427 "NONE" => Ok(Self::None),
38428 _ => Err("invalid value".into()),
38429 }
38430 }
38431 }
38432 impl std::convert::TryFrom<&str> for PlaceOrderOcoSelfTradePreventionMode {
38433 type Error = self::error::ConversionError;
38434 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
38435 value.parse()
38436 }
38437 }
38438 impl std::convert::TryFrom<&String> for PlaceOrderOcoSelfTradePreventionMode {
38439 type Error = self::error::ConversionError;
38440 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
38441 value.parse()
38442 }
38443 }
38444 impl std::convert::TryFrom<String> for PlaceOrderOcoSelfTradePreventionMode {
38445 type Error = self::error::ConversionError;
38446 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
38447 value.parse()
38448 }
38449 }
38450 ///PlaceOrderOcoSide
38451 ///
38452 /// <details><summary>JSON schema</summary>
38453 ///
38454 /// ```json
38455 ///{
38456 /// "examples": [
38457 /// "SELL"
38458 /// ],
38459 /// "type": "string",
38460 /// "enum": [
38461 /// "SELL",
38462 /// "BUY"
38463 /// ]
38464 ///}
38465 /// ```
38466 /// </details>
38467 #[derive(
38468 Clone,
38469 Copy,
38470 Debug,
38471 Deserialize,
38472 Eq,
38473 Hash,
38474 Ord,
38475 PartialEq,
38476 PartialOrd,
38477 Serialize
38478 )]
38479 pub enum PlaceOrderOcoSide {
38480 #[serde(rename = "SELL")]
38481 Sell,
38482 #[serde(rename = "BUY")]
38483 Buy,
38484 }
38485 impl From<&PlaceOrderOcoSide> for PlaceOrderOcoSide {
38486 fn from(value: &PlaceOrderOcoSide) -> Self {
38487 value.clone()
38488 }
38489 }
38490 impl ToString for PlaceOrderOcoSide {
38491 fn to_string(&self) -> String {
38492 match *self {
38493 Self::Sell => "SELL".to_string(),
38494 Self::Buy => "BUY".to_string(),
38495 }
38496 }
38497 }
38498 impl std::str::FromStr for PlaceOrderOcoSide {
38499 type Err = self::error::ConversionError;
38500 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
38501 match value {
38502 "SELL" => Ok(Self::Sell),
38503 "BUY" => Ok(Self::Buy),
38504 _ => Err("invalid value".into()),
38505 }
38506 }
38507 }
38508 impl std::convert::TryFrom<&str> for PlaceOrderOcoSide {
38509 type Error = self::error::ConversionError;
38510 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
38511 value.parse()
38512 }
38513 }
38514 impl std::convert::TryFrom<&String> for PlaceOrderOcoSide {
38515 type Error = self::error::ConversionError;
38516 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
38517 value.parse()
38518 }
38519 }
38520 impl std::convert::TryFrom<String> for PlaceOrderOcoSide {
38521 type Error = self::error::ConversionError;
38522 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
38523 value.parse()
38524 }
38525 }
38526 ///PlaceOrderOcoStopLimitTimeInForce
38527 ///
38528 /// <details><summary>JSON schema</summary>
38529 ///
38530 /// ```json
38531 ///{
38532 /// "type": "string",
38533 /// "enum": [
38534 /// "GTC",
38535 /// "FOK",
38536 /// "IOC"
38537 /// ]
38538 ///}
38539 /// ```
38540 /// </details>
38541 #[derive(
38542 Clone,
38543 Copy,
38544 Debug,
38545 Deserialize,
38546 Eq,
38547 Hash,
38548 Ord,
38549 PartialEq,
38550 PartialOrd,
38551 Serialize
38552 )]
38553 pub enum PlaceOrderOcoStopLimitTimeInForce {
38554 #[serde(rename = "GTC")]
38555 Gtc,
38556 #[serde(rename = "FOK")]
38557 Fok,
38558 #[serde(rename = "IOC")]
38559 Ioc,
38560 }
38561 impl From<&PlaceOrderOcoStopLimitTimeInForce> for PlaceOrderOcoStopLimitTimeInForce {
38562 fn from(value: &PlaceOrderOcoStopLimitTimeInForce) -> Self {
38563 value.clone()
38564 }
38565 }
38566 impl ToString for PlaceOrderOcoStopLimitTimeInForce {
38567 fn to_string(&self) -> String {
38568 match *self {
38569 Self::Gtc => "GTC".to_string(),
38570 Self::Fok => "FOK".to_string(),
38571 Self::Ioc => "IOC".to_string(),
38572 }
38573 }
38574 }
38575 impl std::str::FromStr for PlaceOrderOcoStopLimitTimeInForce {
38576 type Err = self::error::ConversionError;
38577 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
38578 match value {
38579 "GTC" => Ok(Self::Gtc),
38580 "FOK" => Ok(Self::Fok),
38581 "IOC" => Ok(Self::Ioc),
38582 _ => Err("invalid value".into()),
38583 }
38584 }
38585 }
38586 impl std::convert::TryFrom<&str> for PlaceOrderOcoStopLimitTimeInForce {
38587 type Error = self::error::ConversionError;
38588 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
38589 value.parse()
38590 }
38591 }
38592 impl std::convert::TryFrom<&String> for PlaceOrderOcoStopLimitTimeInForce {
38593 type Error = self::error::ConversionError;
38594 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
38595 value.parse()
38596 }
38597 }
38598 impl std::convert::TryFrom<String> for PlaceOrderOcoStopLimitTimeInForce {
38599 type Error = self::error::ConversionError;
38600 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
38601 value.parse()
38602 }
38603 }
38604 ///PortfolioAccountResponse
38605 ///
38606 /// <details><summary>JSON schema</summary>
38607 ///
38608 /// ```json
38609 ///{
38610 /// "type": "object",
38611 /// "required": [
38612 /// "accountEquity",
38613 /// "accountMaintMargin",
38614 /// "accountStatus",
38615 /// "accountType",
38616 /// "actualEquity",
38617 /// "uniMMR"
38618 /// ],
38619 /// "properties": {
38620 /// "accountEquity": {
38621 /// "description": "Account equity, unit is USD",
38622 /// "examples": [
38623 /// "122607.35137903"
38624 /// ],
38625 /// "type": "string"
38626 /// },
38627 /// "accountMaintMargin": {
38628 /// "description": "Classic Portfolio margin account maintenance margin, unit is USD",
38629 /// "examples": [
38630 /// "23.72469206"
38631 /// ],
38632 /// "type": "string"
38633 /// },
38634 /// "accountStatus": {
38635 /// "description": "Classic Portfolio margin account status:\"NORMAL\", \"MARGIN_CALL\", \"SUPPLY_MARGIN\", \"REDUCE_ONLY\", \"ACTIVE_LIQUIDATION\", \"FORCE_LIQUIDATION\", \"BANKRUPTED\"",
38636 /// "examples": [
38637 /// "NORMAL"
38638 /// ],
38639 /// "type": "string"
38640 /// },
38641 /// "accountType": {
38642 /// "description": "PM_1 for classic PM, PM_2 for PM",
38643 /// "examples": [
38644 /// "PM_1"
38645 /// ],
38646 /// "type": "string"
38647 /// },
38648 /// "actualEquity": {
38649 /// "description": "Actual equity, unit is USD",
38650 /// "examples": [
38651 /// "142607.35137903"
38652 /// ],
38653 /// "type": "string"
38654 /// },
38655 /// "uniMMR": {
38656 /// "description": "Classic Portfolio margin account maintenance margin rate",
38657 /// "examples": [
38658 /// "1.87987800"
38659 /// ],
38660 /// "type": "string"
38661 /// }
38662 /// }
38663 ///}
38664 /// ```
38665 /// </details>
38666 #[derive(Clone, Debug, Deserialize, Serialize)]
38667 pub struct PortfolioAccountResponse {
38668 ///Account equity, unit is USD
38669 #[serde(rename = "accountEquity")]
38670 pub account_equity: String,
38671 ///Classic Portfolio margin account maintenance margin, unit is USD
38672 #[serde(rename = "accountMaintMargin")]
38673 pub account_maint_margin: String,
38674 ///Classic Portfolio margin account status:"NORMAL", "MARGIN_CALL", "SUPPLY_MARGIN", "REDUCE_ONLY", "ACTIVE_LIQUIDATION", "FORCE_LIQUIDATION", "BANKRUPTED"
38675 #[serde(rename = "accountStatus")]
38676 pub account_status: String,
38677 ///PM_1 for classic PM, PM_2 for PM
38678 #[serde(rename = "accountType")]
38679 pub account_type: String,
38680 ///Actual equity, unit is USD
38681 #[serde(rename = "actualEquity")]
38682 pub actual_equity: String,
38683 ///Classic Portfolio margin account maintenance margin rate
38684 #[serde(rename = "uniMMR")]
38685 pub uni_mmr: String,
38686 }
38687 impl From<&PortfolioAccountResponse> for PortfolioAccountResponse {
38688 fn from(value: &PortfolioAccountResponse) -> Self {
38689 value.clone()
38690 }
38691 }
38692 ///PortfolioAssetCollectionResponse
38693 ///
38694 /// <details><summary>JSON schema</summary>
38695 ///
38696 /// ```json
38697 ///{
38698 /// "type": "object",
38699 /// "required": [
38700 /// "msg"
38701 /// ],
38702 /// "properties": {
38703 /// "msg": {
38704 /// "examples": [
38705 /// "success"
38706 /// ],
38707 /// "type": "string"
38708 /// }
38709 /// }
38710 ///}
38711 /// ```
38712 /// </details>
38713 #[derive(Clone, Debug, Deserialize, Serialize)]
38714 pub struct PortfolioAssetCollectionResponse {
38715 pub msg: String,
38716 }
38717 impl From<&PortfolioAssetCollectionResponse> for PortfolioAssetCollectionResponse {
38718 fn from(value: &PortfolioAssetCollectionResponse) -> Self {
38719 value.clone()
38720 }
38721 }
38722 ///PortfolioAssetIndexPriceResponseItem
38723 ///
38724 /// <details><summary>JSON schema</summary>
38725 ///
38726 /// ```json
38727 ///{
38728 /// "type": "object",
38729 /// "required": [
38730 /// "asset",
38731 /// "assetIndexPrice",
38732 /// "time"
38733 /// ],
38734 /// "properties": {
38735 /// "asset": {
38736 /// "examples": [
38737 /// "USDT"
38738 /// ],
38739 /// "type": "string"
38740 /// },
38741 /// "assetIndexPrice": {
38742 /// "examples": [
38743 /// "28251.9136906"
38744 /// ],
38745 /// "type": "string"
38746 /// },
38747 /// "time": {
38748 /// "examples": [
38749 /// 1683518338121
38750 /// ],
38751 /// "type": "integer",
38752 /// "format": "int64"
38753 /// }
38754 /// }
38755 ///}
38756 /// ```
38757 /// </details>
38758 #[derive(Clone, Debug, Deserialize, Serialize)]
38759 pub struct PortfolioAssetIndexPriceResponseItem {
38760 pub asset: String,
38761 #[serde(rename = "assetIndexPrice")]
38762 pub asset_index_price: String,
38763 pub time: i64,
38764 }
38765 impl From<&PortfolioAssetIndexPriceResponseItem>
38766 for PortfolioAssetIndexPriceResponseItem {
38767 fn from(value: &PortfolioAssetIndexPriceResponseItem) -> Self {
38768 value.clone()
38769 }
38770 }
38771 ///PortfolioAutoCollectionResponse
38772 ///
38773 /// <details><summary>JSON schema</summary>
38774 ///
38775 /// ```json
38776 ///{
38777 /// "type": "object",
38778 /// "required": [
38779 /// "msg"
38780 /// ],
38781 /// "properties": {
38782 /// "msg": {
38783 /// "examples": [
38784 /// "success"
38785 /// ],
38786 /// "type": "string"
38787 /// }
38788 /// }
38789 ///}
38790 /// ```
38791 /// </details>
38792 #[derive(Clone, Debug, Deserialize, Serialize)]
38793 pub struct PortfolioAutoCollectionResponse {
38794 pub msg: String,
38795 }
38796 impl From<&PortfolioAutoCollectionResponse> for PortfolioAutoCollectionResponse {
38797 fn from(value: &PortfolioAutoCollectionResponse) -> Self {
38798 value.clone()
38799 }
38800 }
38801 ///PortfolioBnbTransferResponse
38802 ///
38803 /// <details><summary>JSON schema</summary>
38804 ///
38805 /// ```json
38806 ///{
38807 /// "type": "object",
38808 /// "required": [
38809 /// "tranId"
38810 /// ],
38811 /// "properties": {
38812 /// "tranId": {
38813 /// "examples": [
38814 /// 100000001
38815 /// ],
38816 /// "type": "integer",
38817 /// "format": "int64"
38818 /// }
38819 /// }
38820 ///}
38821 /// ```
38822 /// </details>
38823 #[derive(Clone, Debug, Deserialize, Serialize)]
38824 pub struct PortfolioBnbTransferResponse {
38825 #[serde(rename = "tranId")]
38826 pub tran_id: i64,
38827 }
38828 impl From<&PortfolioBnbTransferResponse> for PortfolioBnbTransferResponse {
38829 fn from(value: &PortfolioBnbTransferResponse) -> Self {
38830 value.clone()
38831 }
38832 }
38833 ///PortfolioBnbTransferTransferSide
38834 ///
38835 /// <details><summary>JSON schema</summary>
38836 ///
38837 /// ```json
38838 ///{
38839 /// "examples": [
38840 /// "TO_UM"
38841 /// ],
38842 /// "type": "string",
38843 /// "enum": [
38844 /// "TO_UM",
38845 /// "FROM_UM"
38846 /// ]
38847 ///}
38848 /// ```
38849 /// </details>
38850 #[derive(
38851 Clone,
38852 Copy,
38853 Debug,
38854 Deserialize,
38855 Eq,
38856 Hash,
38857 Ord,
38858 PartialEq,
38859 PartialOrd,
38860 Serialize
38861 )]
38862 pub enum PortfolioBnbTransferTransferSide {
38863 #[serde(rename = "TO_UM")]
38864 ToUm,
38865 #[serde(rename = "FROM_UM")]
38866 FromUm,
38867 }
38868 impl From<&PortfolioBnbTransferTransferSide> for PortfolioBnbTransferTransferSide {
38869 fn from(value: &PortfolioBnbTransferTransferSide) -> Self {
38870 value.clone()
38871 }
38872 }
38873 impl ToString for PortfolioBnbTransferTransferSide {
38874 fn to_string(&self) -> String {
38875 match *self {
38876 Self::ToUm => "TO_UM".to_string(),
38877 Self::FromUm => "FROM_UM".to_string(),
38878 }
38879 }
38880 }
38881 impl std::str::FromStr for PortfolioBnbTransferTransferSide {
38882 type Err = self::error::ConversionError;
38883 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
38884 match value {
38885 "TO_UM" => Ok(Self::ToUm),
38886 "FROM_UM" => Ok(Self::FromUm),
38887 _ => Err("invalid value".into()),
38888 }
38889 }
38890 }
38891 impl std::convert::TryFrom<&str> for PortfolioBnbTransferTransferSide {
38892 type Error = self::error::ConversionError;
38893 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
38894 value.parse()
38895 }
38896 }
38897 impl std::convert::TryFrom<&String> for PortfolioBnbTransferTransferSide {
38898 type Error = self::error::ConversionError;
38899 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
38900 value.parse()
38901 }
38902 }
38903 impl std::convert::TryFrom<String> for PortfolioBnbTransferTransferSide {
38904 type Error = self::error::ConversionError;
38905 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
38906 value.parse()
38907 }
38908 }
38909 ///PortfolioCollateralRateResponseItem
38910 ///
38911 /// <details><summary>JSON schema</summary>
38912 ///
38913 /// ```json
38914 ///{
38915 /// "type": "object",
38916 /// "required": [
38917 /// "asset",
38918 /// "collateralRate"
38919 /// ],
38920 /// "properties": {
38921 /// "asset": {
38922 /// "examples": [
38923 /// "USDC"
38924 /// ],
38925 /// "type": "string"
38926 /// },
38927 /// "collateralRate": {
38928 /// "examples": [
38929 /// "1.0000"
38930 /// ],
38931 /// "type": "string"
38932 /// }
38933 /// }
38934 ///}
38935 /// ```
38936 /// </details>
38937 #[derive(Clone, Debug, Deserialize, Serialize)]
38938 pub struct PortfolioCollateralRateResponseItem {
38939 pub asset: String,
38940 #[serde(rename = "collateralRate")]
38941 pub collateral_rate: String,
38942 }
38943 impl From<&PortfolioCollateralRateResponseItem>
38944 for PortfolioCollateralRateResponseItem {
38945 fn from(value: &PortfolioCollateralRateResponseItem) -> Self {
38946 value.clone()
38947 }
38948 }
38949 ///PortfolioInterestHistoryResponseItem
38950 ///
38951 /// <details><summary>JSON schema</summary>
38952 ///
38953 /// ```json
38954 ///{
38955 /// "type": "object",
38956 /// "required": [
38957 /// "asset",
38958 /// "interest",
38959 /// "interestAccruedTime",
38960 /// "interestRate",
38961 /// "principal"
38962 /// ],
38963 /// "properties": {
38964 /// "asset": {
38965 /// "examples": [
38966 /// "USDT"
38967 /// ],
38968 /// "type": "string"
38969 /// },
38970 /// "interest": {
38971 /// "examples": [
38972 /// "24.4440"
38973 /// ],
38974 /// "type": "string"
38975 /// },
38976 /// "interestAccruedTime": {
38977 /// "examples": [
38978 /// 1672801339253
38979 /// ],
38980 /// "type": "integer",
38981 /// "format": "int64"
38982 /// },
38983 /// "interestRate": {
38984 /// "examples": [
38985 /// "0.0001164"
38986 /// ],
38987 /// "type": "string"
38988 /// },
38989 /// "principal": {
38990 /// "examples": [
38991 /// "210000"
38992 /// ],
38993 /// "type": "string"
38994 /// }
38995 /// }
38996 ///}
38997 /// ```
38998 /// </details>
38999 #[derive(Clone, Debug, Deserialize, Serialize)]
39000 pub struct PortfolioInterestHistoryResponseItem {
39001 pub asset: String,
39002 pub interest: String,
39003 #[serde(rename = "interestAccruedTime")]
39004 pub interest_accrued_time: i64,
39005 #[serde(rename = "interestRate")]
39006 pub interest_rate: String,
39007 pub principal: String,
39008 }
39009 impl From<&PortfolioInterestHistoryResponseItem>
39010 for PortfolioInterestHistoryResponseItem {
39011 fn from(value: &PortfolioInterestHistoryResponseItem) -> Self {
39012 value.clone()
39013 }
39014 }
39015 ///PortfolioMarginAssetLeverageResponseItem
39016 ///
39017 /// <details><summary>JSON schema</summary>
39018 ///
39019 /// ```json
39020 ///{
39021 /// "type": "object",
39022 /// "properties": {
39023 /// "asset": {
39024 /// "examples": [
39025 /// "USDC"
39026 /// ],
39027 /// "type": "string"
39028 /// },
39029 /// "collateralRate": {
39030 /// "examples": [
39031 /// "1.0000"
39032 /// ],
39033 /// "type": "string"
39034 /// }
39035 /// }
39036 ///}
39037 /// ```
39038 /// </details>
39039 #[derive(Clone, Debug, Deserialize, Serialize)]
39040 pub struct PortfolioMarginAssetLeverageResponseItem {
39041 #[serde(default, skip_serializing_if = "Option::is_none")]
39042 pub asset: Option<String>,
39043 #[serde(
39044 rename = "collateralRate",
39045 default,
39046 skip_serializing_if = "Option::is_none"
39047 )]
39048 pub collateral_rate: Option<String>,
39049 }
39050 impl From<&PortfolioMarginAssetLeverageResponseItem>
39051 for PortfolioMarginAssetLeverageResponseItem {
39052 fn from(value: &PortfolioMarginAssetLeverageResponseItem) -> Self {
39053 value.clone()
39054 }
39055 }
39056 ///PortfolioPmLoanResponse
39057 ///
39058 /// <details><summary>JSON schema</summary>
39059 ///
39060 /// ```json
39061 ///{
39062 /// "type": "object",
39063 /// "required": [
39064 /// "amount",
39065 /// "asset"
39066 /// ],
39067 /// "properties": {
39068 /// "amount": {
39069 /// "examples": [
39070 /// "579.45"
39071 /// ],
39072 /// "type": "string"
39073 /// },
39074 /// "asset": {
39075 /// "examples": [
39076 /// "BUSD"
39077 /// ],
39078 /// "type": "string"
39079 /// }
39080 /// }
39081 ///}
39082 /// ```
39083 /// </details>
39084 #[derive(Clone, Debug, Deserialize, Serialize)]
39085 pub struct PortfolioPmLoanResponse {
39086 pub amount: String,
39087 pub asset: String,
39088 }
39089 impl From<&PortfolioPmLoanResponse> for PortfolioPmLoanResponse {
39090 fn from(value: &PortfolioPmLoanResponse) -> Self {
39091 value.clone()
39092 }
39093 }
39094 ///PortfolioRepayFuturesNegativeBalanceResponse
39095 ///
39096 /// <details><summary>JSON schema</summary>
39097 ///
39098 /// ```json
39099 ///{
39100 /// "type": "object",
39101 /// "required": [
39102 /// "msg"
39103 /// ],
39104 /// "properties": {
39105 /// "msg": {
39106 /// "examples": [
39107 /// "success"
39108 /// ],
39109 /// "type": "string"
39110 /// }
39111 /// }
39112 ///}
39113 /// ```
39114 /// </details>
39115 #[derive(Clone, Debug, Deserialize, Serialize)]
39116 pub struct PortfolioRepayFuturesNegativeBalanceResponse {
39117 pub msg: String,
39118 }
39119 impl From<&PortfolioRepayFuturesNegativeBalanceResponse>
39120 for PortfolioRepayFuturesNegativeBalanceResponse {
39121 fn from(value: &PortfolioRepayFuturesNegativeBalanceResponse) -> Self {
39122 value.clone()
39123 }
39124 }
39125 ///PortfolioRepayFuturesSwitchResponse
39126 ///
39127 /// <details><summary>JSON schema</summary>
39128 ///
39129 /// ```json
39130 ///{
39131 /// "type": "object",
39132 /// "required": [
39133 /// "msg"
39134 /// ],
39135 /// "properties": {
39136 /// "msg": {
39137 /// "examples": [
39138 /// "success"
39139 /// ],
39140 /// "type": "string"
39141 /// }
39142 /// }
39143 ///}
39144 /// ```
39145 /// </details>
39146 #[derive(Clone, Debug, Deserialize, Serialize)]
39147 pub struct PortfolioRepayFuturesSwitchResponse {
39148 pub msg: String,
39149 }
39150 impl From<&PortfolioRepayFuturesSwitchResponse>
39151 for PortfolioRepayFuturesSwitchResponse {
39152 fn from(value: &PortfolioRepayFuturesSwitchResponse) -> Self {
39153 value.clone()
39154 }
39155 }
39156 ///PortfolioRepayResponse
39157 ///
39158 /// <details><summary>JSON schema</summary>
39159 ///
39160 /// ```json
39161 ///{
39162 /// "type": "object",
39163 /// "required": [
39164 /// "tranId"
39165 /// ],
39166 /// "properties": {
39167 /// "tranId": {
39168 /// "examples": [
39169 /// 58203331886213500
39170 /// ],
39171 /// "type": "integer",
39172 /// "format": "int64"
39173 /// }
39174 /// }
39175 ///}
39176 /// ```
39177 /// </details>
39178 #[derive(Clone, Debug, Deserialize, Serialize)]
39179 pub struct PortfolioRepayResponse {
39180 #[serde(rename = "tranId")]
39181 pub tran_id: i64,
39182 }
39183 impl From<&PortfolioRepayResponse> for PortfolioRepayResponse {
39184 fn from(value: &PortfolioRepayResponse) -> Self {
39185 value.clone()
39186 }
39187 }
39188 ///PostMarginIsolatedAccountResponse
39189 ///
39190 /// <details><summary>JSON schema</summary>
39191 ///
39192 /// ```json
39193 ///{
39194 /// "type": "object",
39195 /// "required": [
39196 /// "success",
39197 /// "symbol"
39198 /// ],
39199 /// "properties": {
39200 /// "success": {
39201 /// "type": "boolean"
39202 /// },
39203 /// "symbol": {
39204 /// "examples": [
39205 /// "BTCUSDT"
39206 /// ],
39207 /// "type": "string"
39208 /// }
39209 /// }
39210 ///}
39211 /// ```
39212 /// </details>
39213 #[derive(Clone, Debug, Deserialize, Serialize)]
39214 pub struct PostMarginIsolatedAccountResponse {
39215 pub success: bool,
39216 pub symbol: String,
39217 }
39218 impl From<&PostMarginIsolatedAccountResponse> for PostMarginIsolatedAccountResponse {
39219 fn from(value: &PostMarginIsolatedAccountResponse) -> Self {
39220 value.clone()
39221 }
39222 }
39223 ///PostMarginIsolatedTransferTransFrom
39224 ///
39225 /// <details><summary>JSON schema</summary>
39226 ///
39227 /// ```json
39228 ///{
39229 /// "examples": [
39230 /// "SPOT"
39231 /// ],
39232 /// "type": "string",
39233 /// "enum": [
39234 /// "SPOT",
39235 /// "ISOLATED_MARGIN"
39236 /// ]
39237 ///}
39238 /// ```
39239 /// </details>
39240 #[derive(
39241 Clone,
39242 Copy,
39243 Debug,
39244 Deserialize,
39245 Eq,
39246 Hash,
39247 Ord,
39248 PartialEq,
39249 PartialOrd,
39250 Serialize
39251 )]
39252 pub enum PostMarginIsolatedTransferTransFrom {
39253 #[serde(rename = "SPOT")]
39254 Spot,
39255 #[serde(rename = "ISOLATED_MARGIN")]
39256 IsolatedMargin,
39257 }
39258 impl From<&PostMarginIsolatedTransferTransFrom>
39259 for PostMarginIsolatedTransferTransFrom {
39260 fn from(value: &PostMarginIsolatedTransferTransFrom) -> Self {
39261 value.clone()
39262 }
39263 }
39264 impl ToString for PostMarginIsolatedTransferTransFrom {
39265 fn to_string(&self) -> String {
39266 match *self {
39267 Self::Spot => "SPOT".to_string(),
39268 Self::IsolatedMargin => "ISOLATED_MARGIN".to_string(),
39269 }
39270 }
39271 }
39272 impl std::str::FromStr for PostMarginIsolatedTransferTransFrom {
39273 type Err = self::error::ConversionError;
39274 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
39275 match value {
39276 "SPOT" => Ok(Self::Spot),
39277 "ISOLATED_MARGIN" => Ok(Self::IsolatedMargin),
39278 _ => Err("invalid value".into()),
39279 }
39280 }
39281 }
39282 impl std::convert::TryFrom<&str> for PostMarginIsolatedTransferTransFrom {
39283 type Error = self::error::ConversionError;
39284 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
39285 value.parse()
39286 }
39287 }
39288 impl std::convert::TryFrom<&String> for PostMarginIsolatedTransferTransFrom {
39289 type Error = self::error::ConversionError;
39290 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
39291 value.parse()
39292 }
39293 }
39294 impl std::convert::TryFrom<String> for PostMarginIsolatedTransferTransFrom {
39295 type Error = self::error::ConversionError;
39296 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
39297 value.parse()
39298 }
39299 }
39300 ///PostMarginIsolatedTransferTransTo
39301 ///
39302 /// <details><summary>JSON schema</summary>
39303 ///
39304 /// ```json
39305 ///{
39306 /// "examples": [
39307 /// "ISOLATED_MARGIN"
39308 /// ],
39309 /// "type": "string",
39310 /// "enum": [
39311 /// "SPOT",
39312 /// "ISOLATED_MARGIN"
39313 /// ]
39314 ///}
39315 /// ```
39316 /// </details>
39317 #[derive(
39318 Clone,
39319 Copy,
39320 Debug,
39321 Deserialize,
39322 Eq,
39323 Hash,
39324 Ord,
39325 PartialEq,
39326 PartialOrd,
39327 Serialize
39328 )]
39329 pub enum PostMarginIsolatedTransferTransTo {
39330 #[serde(rename = "SPOT")]
39331 Spot,
39332 #[serde(rename = "ISOLATED_MARGIN")]
39333 IsolatedMargin,
39334 }
39335 impl From<&PostMarginIsolatedTransferTransTo> for PostMarginIsolatedTransferTransTo {
39336 fn from(value: &PostMarginIsolatedTransferTransTo) -> Self {
39337 value.clone()
39338 }
39339 }
39340 impl ToString for PostMarginIsolatedTransferTransTo {
39341 fn to_string(&self) -> String {
39342 match *self {
39343 Self::Spot => "SPOT".to_string(),
39344 Self::IsolatedMargin => "ISOLATED_MARGIN".to_string(),
39345 }
39346 }
39347 }
39348 impl std::str::FromStr for PostMarginIsolatedTransferTransTo {
39349 type Err = self::error::ConversionError;
39350 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
39351 match value {
39352 "SPOT" => Ok(Self::Spot),
39353 "ISOLATED_MARGIN" => Ok(Self::IsolatedMargin),
39354 _ => Err("invalid value".into()),
39355 }
39356 }
39357 }
39358 impl std::convert::TryFrom<&str> for PostMarginIsolatedTransferTransTo {
39359 type Error = self::error::ConversionError;
39360 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
39361 value.parse()
39362 }
39363 }
39364 impl std::convert::TryFrom<&String> for PostMarginIsolatedTransferTransTo {
39365 type Error = self::error::ConversionError;
39366 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
39367 value.parse()
39368 }
39369 }
39370 impl std::convert::TryFrom<String> for PostMarginIsolatedTransferTransTo {
39371 type Error = self::error::ConversionError;
39372 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
39373 value.parse()
39374 }
39375 }
39376 ///PostMarginOrderIsIsolated
39377 ///
39378 /// <details><summary>JSON schema</summary>
39379 ///
39380 /// ```json
39381 ///{
39382 /// "type": "string",
39383 /// "enum": [
39384 /// "TRUE",
39385 /// "FALSE"
39386 /// ]
39387 ///}
39388 /// ```
39389 /// </details>
39390 #[derive(
39391 Clone,
39392 Copy,
39393 Debug,
39394 Deserialize,
39395 Eq,
39396 Hash,
39397 Ord,
39398 PartialEq,
39399 PartialOrd,
39400 Serialize
39401 )]
39402 pub enum PostMarginOrderIsIsolated {
39403 #[serde(rename = "TRUE")]
39404 True,
39405 #[serde(rename = "FALSE")]
39406 False,
39407 }
39408 impl From<&PostMarginOrderIsIsolated> for PostMarginOrderIsIsolated {
39409 fn from(value: &PostMarginOrderIsIsolated) -> Self {
39410 value.clone()
39411 }
39412 }
39413 impl ToString for PostMarginOrderIsIsolated {
39414 fn to_string(&self) -> String {
39415 match *self {
39416 Self::True => "TRUE".to_string(),
39417 Self::False => "FALSE".to_string(),
39418 }
39419 }
39420 }
39421 impl std::str::FromStr for PostMarginOrderIsIsolated {
39422 type Err = self::error::ConversionError;
39423 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
39424 match value {
39425 "TRUE" => Ok(Self::True),
39426 "FALSE" => Ok(Self::False),
39427 _ => Err("invalid value".into()),
39428 }
39429 }
39430 }
39431 impl std::convert::TryFrom<&str> for PostMarginOrderIsIsolated {
39432 type Error = self::error::ConversionError;
39433 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
39434 value.parse()
39435 }
39436 }
39437 impl std::convert::TryFrom<&String> for PostMarginOrderIsIsolated {
39438 type Error = self::error::ConversionError;
39439 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
39440 value.parse()
39441 }
39442 }
39443 impl std::convert::TryFrom<String> for PostMarginOrderIsIsolated {
39444 type Error = self::error::ConversionError;
39445 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
39446 value.parse()
39447 }
39448 }
39449 ///PostMarginOrderNewOrderRespType
39450 ///
39451 /// <details><summary>JSON schema</summary>
39452 ///
39453 /// ```json
39454 ///{
39455 /// "type": "string",
39456 /// "enum": [
39457 /// "ACK",
39458 /// "RESULT",
39459 /// "FULL"
39460 /// ]
39461 ///}
39462 /// ```
39463 /// </details>
39464 #[derive(
39465 Clone,
39466 Copy,
39467 Debug,
39468 Deserialize,
39469 Eq,
39470 Hash,
39471 Ord,
39472 PartialEq,
39473 PartialOrd,
39474 Serialize
39475 )]
39476 pub enum PostMarginOrderNewOrderRespType {
39477 #[serde(rename = "ACK")]
39478 Ack,
39479 #[serde(rename = "RESULT")]
39480 Result,
39481 #[serde(rename = "FULL")]
39482 Full,
39483 }
39484 impl From<&PostMarginOrderNewOrderRespType> for PostMarginOrderNewOrderRespType {
39485 fn from(value: &PostMarginOrderNewOrderRespType) -> Self {
39486 value.clone()
39487 }
39488 }
39489 impl ToString for PostMarginOrderNewOrderRespType {
39490 fn to_string(&self) -> String {
39491 match *self {
39492 Self::Ack => "ACK".to_string(),
39493 Self::Result => "RESULT".to_string(),
39494 Self::Full => "FULL".to_string(),
39495 }
39496 }
39497 }
39498 impl std::str::FromStr for PostMarginOrderNewOrderRespType {
39499 type Err = self::error::ConversionError;
39500 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
39501 match value {
39502 "ACK" => Ok(Self::Ack),
39503 "RESULT" => Ok(Self::Result),
39504 "FULL" => Ok(Self::Full),
39505 _ => Err("invalid value".into()),
39506 }
39507 }
39508 }
39509 impl std::convert::TryFrom<&str> for PostMarginOrderNewOrderRespType {
39510 type Error = self::error::ConversionError;
39511 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
39512 value.parse()
39513 }
39514 }
39515 impl std::convert::TryFrom<&String> for PostMarginOrderNewOrderRespType {
39516 type Error = self::error::ConversionError;
39517 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
39518 value.parse()
39519 }
39520 }
39521 impl std::convert::TryFrom<String> for PostMarginOrderNewOrderRespType {
39522 type Error = self::error::ConversionError;
39523 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
39524 value.parse()
39525 }
39526 }
39527 ///PostMarginOrderResponse
39528 ///
39529 /// <details><summary>JSON schema</summary>
39530 ///
39531 /// ```json
39532 ///{
39533 /// "oneOf": [
39534 /// {
39535 /// "$ref": "#/components/schemas/marginOrderResponseAck"
39536 /// },
39537 /// {
39538 /// "$ref": "#/components/schemas/marginOrderResponseResult"
39539 /// },
39540 /// {
39541 /// "$ref": "#/components/schemas/marginOrderResponseFull"
39542 /// }
39543 /// ]
39544 ///}
39545 /// ```
39546 /// </details>
39547 #[derive(Clone, Debug, Deserialize, Serialize)]
39548 #[serde(untagged)]
39549 pub enum PostMarginOrderResponse {
39550 Ack(MarginOrderResponseAck),
39551 Result(MarginOrderResponseResult),
39552 Full(MarginOrderResponseFull),
39553 }
39554 impl From<&PostMarginOrderResponse> for PostMarginOrderResponse {
39555 fn from(value: &PostMarginOrderResponse) -> Self {
39556 value.clone()
39557 }
39558 }
39559 impl From<MarginOrderResponseAck> for PostMarginOrderResponse {
39560 fn from(value: MarginOrderResponseAck) -> Self {
39561 Self::Ack(value)
39562 }
39563 }
39564 impl From<MarginOrderResponseResult> for PostMarginOrderResponse {
39565 fn from(value: MarginOrderResponseResult) -> Self {
39566 Self::Result(value)
39567 }
39568 }
39569 impl From<MarginOrderResponseFull> for PostMarginOrderResponse {
39570 fn from(value: MarginOrderResponseFull) -> Self {
39571 Self::Full(value)
39572 }
39573 }
39574 ///PostMarginOrderSelfTradePreventionMode
39575 ///
39576 /// <details><summary>JSON schema</summary>
39577 ///
39578 /// ```json
39579 ///{
39580 /// "examples": [
39581 /// "EXPIRE_TAKER"
39582 /// ],
39583 /// "type": "string",
39584 /// "enum": [
39585 /// "EXPIRE_TAKER",
39586 /// "EXPIRE_MAKER",
39587 /// "EXPIRE_BOTH",
39588 /// "NONE"
39589 /// ]
39590 ///}
39591 /// ```
39592 /// </details>
39593 #[derive(
39594 Clone,
39595 Copy,
39596 Debug,
39597 Deserialize,
39598 Eq,
39599 Hash,
39600 Ord,
39601 PartialEq,
39602 PartialOrd,
39603 Serialize
39604 )]
39605 pub enum PostMarginOrderSelfTradePreventionMode {
39606 #[serde(rename = "EXPIRE_TAKER")]
39607 ExpireTaker,
39608 #[serde(rename = "EXPIRE_MAKER")]
39609 ExpireMaker,
39610 #[serde(rename = "EXPIRE_BOTH")]
39611 ExpireBoth,
39612 #[serde(rename = "NONE")]
39613 None,
39614 }
39615 impl From<&PostMarginOrderSelfTradePreventionMode>
39616 for PostMarginOrderSelfTradePreventionMode {
39617 fn from(value: &PostMarginOrderSelfTradePreventionMode) -> Self {
39618 value.clone()
39619 }
39620 }
39621 impl ToString for PostMarginOrderSelfTradePreventionMode {
39622 fn to_string(&self) -> String {
39623 match *self {
39624 Self::ExpireTaker => "EXPIRE_TAKER".to_string(),
39625 Self::ExpireMaker => "EXPIRE_MAKER".to_string(),
39626 Self::ExpireBoth => "EXPIRE_BOTH".to_string(),
39627 Self::None => "NONE".to_string(),
39628 }
39629 }
39630 }
39631 impl std::str::FromStr for PostMarginOrderSelfTradePreventionMode {
39632 type Err = self::error::ConversionError;
39633 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
39634 match value {
39635 "EXPIRE_TAKER" => Ok(Self::ExpireTaker),
39636 "EXPIRE_MAKER" => Ok(Self::ExpireMaker),
39637 "EXPIRE_BOTH" => Ok(Self::ExpireBoth),
39638 "NONE" => Ok(Self::None),
39639 _ => Err("invalid value".into()),
39640 }
39641 }
39642 }
39643 impl std::convert::TryFrom<&str> for PostMarginOrderSelfTradePreventionMode {
39644 type Error = self::error::ConversionError;
39645 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
39646 value.parse()
39647 }
39648 }
39649 impl std::convert::TryFrom<&String> for PostMarginOrderSelfTradePreventionMode {
39650 type Error = self::error::ConversionError;
39651 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
39652 value.parse()
39653 }
39654 }
39655 impl std::convert::TryFrom<String> for PostMarginOrderSelfTradePreventionMode {
39656 type Error = self::error::ConversionError;
39657 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
39658 value.parse()
39659 }
39660 }
39661 ///PostMarginOrderSide
39662 ///
39663 /// <details><summary>JSON schema</summary>
39664 ///
39665 /// ```json
39666 ///{
39667 /// "examples": [
39668 /// "SELL"
39669 /// ],
39670 /// "type": "string",
39671 /// "enum": [
39672 /// "SELL",
39673 /// "BUY"
39674 /// ]
39675 ///}
39676 /// ```
39677 /// </details>
39678 #[derive(
39679 Clone,
39680 Copy,
39681 Debug,
39682 Deserialize,
39683 Eq,
39684 Hash,
39685 Ord,
39686 PartialEq,
39687 PartialOrd,
39688 Serialize
39689 )]
39690 pub enum PostMarginOrderSide {
39691 #[serde(rename = "SELL")]
39692 Sell,
39693 #[serde(rename = "BUY")]
39694 Buy,
39695 }
39696 impl From<&PostMarginOrderSide> for PostMarginOrderSide {
39697 fn from(value: &PostMarginOrderSide) -> Self {
39698 value.clone()
39699 }
39700 }
39701 impl ToString for PostMarginOrderSide {
39702 fn to_string(&self) -> String {
39703 match *self {
39704 Self::Sell => "SELL".to_string(),
39705 Self::Buy => "BUY".to_string(),
39706 }
39707 }
39708 }
39709 impl std::str::FromStr for PostMarginOrderSide {
39710 type Err = self::error::ConversionError;
39711 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
39712 match value {
39713 "SELL" => Ok(Self::Sell),
39714 "BUY" => Ok(Self::Buy),
39715 _ => Err("invalid value".into()),
39716 }
39717 }
39718 }
39719 impl std::convert::TryFrom<&str> for PostMarginOrderSide {
39720 type Error = self::error::ConversionError;
39721 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
39722 value.parse()
39723 }
39724 }
39725 impl std::convert::TryFrom<&String> for PostMarginOrderSide {
39726 type Error = self::error::ConversionError;
39727 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
39728 value.parse()
39729 }
39730 }
39731 impl std::convert::TryFrom<String> for PostMarginOrderSide {
39732 type Error = self::error::ConversionError;
39733 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
39734 value.parse()
39735 }
39736 }
39737 ///PostMarginOrderSideEffectType
39738 ///
39739 /// <details><summary>JSON schema</summary>
39740 ///
39741 /// ```json
39742 ///{
39743 /// "type": "string",
39744 /// "enum": [
39745 /// "NO_SIDE_EFFECT",
39746 /// "MARGIN_BUY",
39747 /// "AUTO_REPAY"
39748 /// ]
39749 ///}
39750 /// ```
39751 /// </details>
39752 #[derive(
39753 Clone,
39754 Copy,
39755 Debug,
39756 Deserialize,
39757 Eq,
39758 Hash,
39759 Ord,
39760 PartialEq,
39761 PartialOrd,
39762 Serialize
39763 )]
39764 pub enum PostMarginOrderSideEffectType {
39765 #[serde(rename = "NO_SIDE_EFFECT")]
39766 NoSideEffect,
39767 #[serde(rename = "MARGIN_BUY")]
39768 MarginBuy,
39769 #[serde(rename = "AUTO_REPAY")]
39770 AutoRepay,
39771 }
39772 impl From<&PostMarginOrderSideEffectType> for PostMarginOrderSideEffectType {
39773 fn from(value: &PostMarginOrderSideEffectType) -> Self {
39774 value.clone()
39775 }
39776 }
39777 impl ToString for PostMarginOrderSideEffectType {
39778 fn to_string(&self) -> String {
39779 match *self {
39780 Self::NoSideEffect => "NO_SIDE_EFFECT".to_string(),
39781 Self::MarginBuy => "MARGIN_BUY".to_string(),
39782 Self::AutoRepay => "AUTO_REPAY".to_string(),
39783 }
39784 }
39785 }
39786 impl std::str::FromStr for PostMarginOrderSideEffectType {
39787 type Err = self::error::ConversionError;
39788 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
39789 match value {
39790 "NO_SIDE_EFFECT" => Ok(Self::NoSideEffect),
39791 "MARGIN_BUY" => Ok(Self::MarginBuy),
39792 "AUTO_REPAY" => Ok(Self::AutoRepay),
39793 _ => Err("invalid value".into()),
39794 }
39795 }
39796 }
39797 impl std::convert::TryFrom<&str> for PostMarginOrderSideEffectType {
39798 type Error = self::error::ConversionError;
39799 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
39800 value.parse()
39801 }
39802 }
39803 impl std::convert::TryFrom<&String> for PostMarginOrderSideEffectType {
39804 type Error = self::error::ConversionError;
39805 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
39806 value.parse()
39807 }
39808 }
39809 impl std::convert::TryFrom<String> for PostMarginOrderSideEffectType {
39810 type Error = self::error::ConversionError;
39811 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
39812 value.parse()
39813 }
39814 }
39815 ///PostMarginOrderTimeInForce
39816 ///
39817 /// <details><summary>JSON schema</summary>
39818 ///
39819 /// ```json
39820 ///{
39821 /// "examples": [
39822 /// "GTC"
39823 /// ],
39824 /// "type": "string",
39825 /// "enum": [
39826 /// "GTC",
39827 /// "IOC",
39828 /// "FOK"
39829 /// ]
39830 ///}
39831 /// ```
39832 /// </details>
39833 #[derive(
39834 Clone,
39835 Copy,
39836 Debug,
39837 Deserialize,
39838 Eq,
39839 Hash,
39840 Ord,
39841 PartialEq,
39842 PartialOrd,
39843 Serialize
39844 )]
39845 pub enum PostMarginOrderTimeInForce {
39846 #[serde(rename = "GTC")]
39847 Gtc,
39848 #[serde(rename = "IOC")]
39849 Ioc,
39850 #[serde(rename = "FOK")]
39851 Fok,
39852 }
39853 impl From<&PostMarginOrderTimeInForce> for PostMarginOrderTimeInForce {
39854 fn from(value: &PostMarginOrderTimeInForce) -> Self {
39855 value.clone()
39856 }
39857 }
39858 impl ToString for PostMarginOrderTimeInForce {
39859 fn to_string(&self) -> String {
39860 match *self {
39861 Self::Gtc => "GTC".to_string(),
39862 Self::Ioc => "IOC".to_string(),
39863 Self::Fok => "FOK".to_string(),
39864 }
39865 }
39866 }
39867 impl std::str::FromStr for PostMarginOrderTimeInForce {
39868 type Err = self::error::ConversionError;
39869 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
39870 match value {
39871 "GTC" => Ok(Self::Gtc),
39872 "IOC" => Ok(Self::Ioc),
39873 "FOK" => Ok(Self::Fok),
39874 _ => Err("invalid value".into()),
39875 }
39876 }
39877 }
39878 impl std::convert::TryFrom<&str> for PostMarginOrderTimeInForce {
39879 type Error = self::error::ConversionError;
39880 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
39881 value.parse()
39882 }
39883 }
39884 impl std::convert::TryFrom<&String> for PostMarginOrderTimeInForce {
39885 type Error = self::error::ConversionError;
39886 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
39887 value.parse()
39888 }
39889 }
39890 impl std::convert::TryFrom<String> for PostMarginOrderTimeInForce {
39891 type Error = self::error::ConversionError;
39892 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
39893 value.parse()
39894 }
39895 }
39896 ///PostMarginOrderType
39897 ///
39898 /// <details><summary>JSON schema</summary>
39899 ///
39900 /// ```json
39901 ///{
39902 /// "examples": [
39903 /// "LIMIT"
39904 /// ],
39905 /// "type": "string",
39906 /// "enum": [
39907 /// "LIMIT",
39908 /// "MARKET",
39909 /// "STOP_LOSS",
39910 /// "STOP_LOSS_LIMIT",
39911 /// "TAKE_PROFIT",
39912 /// "TAKE_PROFIT_LIMIT",
39913 /// "LIMIT_MAKER"
39914 /// ]
39915 ///}
39916 /// ```
39917 /// </details>
39918 #[derive(
39919 Clone,
39920 Copy,
39921 Debug,
39922 Deserialize,
39923 Eq,
39924 Hash,
39925 Ord,
39926 PartialEq,
39927 PartialOrd,
39928 Serialize
39929 )]
39930 pub enum PostMarginOrderType {
39931 #[serde(rename = "LIMIT")]
39932 Limit,
39933 #[serde(rename = "MARKET")]
39934 Market,
39935 #[serde(rename = "STOP_LOSS")]
39936 StopLoss,
39937 #[serde(rename = "STOP_LOSS_LIMIT")]
39938 StopLossLimit,
39939 #[serde(rename = "TAKE_PROFIT")]
39940 TakeProfit,
39941 #[serde(rename = "TAKE_PROFIT_LIMIT")]
39942 TakeProfitLimit,
39943 #[serde(rename = "LIMIT_MAKER")]
39944 LimitMaker,
39945 }
39946 impl From<&PostMarginOrderType> for PostMarginOrderType {
39947 fn from(value: &PostMarginOrderType) -> Self {
39948 value.clone()
39949 }
39950 }
39951 impl ToString for PostMarginOrderType {
39952 fn to_string(&self) -> String {
39953 match *self {
39954 Self::Limit => "LIMIT".to_string(),
39955 Self::Market => "MARKET".to_string(),
39956 Self::StopLoss => "STOP_LOSS".to_string(),
39957 Self::StopLossLimit => "STOP_LOSS_LIMIT".to_string(),
39958 Self::TakeProfit => "TAKE_PROFIT".to_string(),
39959 Self::TakeProfitLimit => "TAKE_PROFIT_LIMIT".to_string(),
39960 Self::LimitMaker => "LIMIT_MAKER".to_string(),
39961 }
39962 }
39963 }
39964 impl std::str::FromStr for PostMarginOrderType {
39965 type Err = self::error::ConversionError;
39966 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
39967 match value {
39968 "LIMIT" => Ok(Self::Limit),
39969 "MARKET" => Ok(Self::Market),
39970 "STOP_LOSS" => Ok(Self::StopLoss),
39971 "STOP_LOSS_LIMIT" => Ok(Self::StopLossLimit),
39972 "TAKE_PROFIT" => Ok(Self::TakeProfit),
39973 "TAKE_PROFIT_LIMIT" => Ok(Self::TakeProfitLimit),
39974 "LIMIT_MAKER" => Ok(Self::LimitMaker),
39975 _ => Err("invalid value".into()),
39976 }
39977 }
39978 }
39979 impl std::convert::TryFrom<&str> for PostMarginOrderType {
39980 type Error = self::error::ConversionError;
39981 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
39982 value.parse()
39983 }
39984 }
39985 impl std::convert::TryFrom<&String> for PostMarginOrderType {
39986 type Error = self::error::ConversionError;
39987 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
39988 value.parse()
39989 }
39990 }
39991 impl std::convert::TryFrom<String> for PostMarginOrderType {
39992 type Error = self::error::ConversionError;
39993 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
39994 value.parse()
39995 }
39996 }
39997 ///PostSubAccountFutureAssetTransferResponse
39998 ///
39999 /// <details><summary>JSON schema</summary>
40000 ///
40001 /// ```json
40002 ///{
40003 /// "type": "object",
40004 /// "required": [
40005 /// "success",
40006 /// "txnId"
40007 /// ],
40008 /// "properties": {
40009 /// "success": {
40010 /// "type": "boolean"
40011 /// },
40012 /// "txnId": {
40013 /// "examples": [
40014 /// "2934662589"
40015 /// ],
40016 /// "type": "string"
40017 /// }
40018 /// }
40019 ///}
40020 /// ```
40021 /// </details>
40022 #[derive(Clone, Debug, Deserialize, Serialize)]
40023 pub struct PostSubAccountFutureAssetTransferResponse {
40024 pub success: bool,
40025 #[serde(rename = "txnId")]
40026 pub txn_id: String,
40027 }
40028 impl From<&PostSubAccountFutureAssetTransferResponse>
40029 for PostSubAccountFutureAssetTransferResponse {
40030 fn from(value: &PostSubAccountFutureAssetTransferResponse) -> Self {
40031 value.clone()
40032 }
40033 }
40034 ///PostUserUniversalTransferResponse
40035 ///
40036 /// <details><summary>JSON schema</summary>
40037 ///
40038 /// ```json
40039 ///{
40040 /// "type": "object",
40041 /// "required": [
40042 /// "tranId"
40043 /// ],
40044 /// "properties": {
40045 /// "tranId": {
40046 /// "examples": [
40047 /// 13526853623
40048 /// ],
40049 /// "type": "integer",
40050 /// "format": "int64"
40051 /// }
40052 /// }
40053 ///}
40054 /// ```
40055 /// </details>
40056 #[derive(Clone, Debug, Deserialize, Serialize)]
40057 pub struct PostUserUniversalTransferResponse {
40058 #[serde(rename = "tranId")]
40059 pub tran_id: i64,
40060 }
40061 impl From<&PostUserUniversalTransferResponse> for PostUserUniversalTransferResponse {
40062 fn from(value: &PostUserUniversalTransferResponse) -> Self {
40063 value.clone()
40064 }
40065 }
40066 ///PostUserUniversalTransferType
40067 ///
40068 /// <details><summary>JSON schema</summary>
40069 ///
40070 /// ```json
40071 ///{
40072 /// "examples": [
40073 /// "MAIN_C2C"
40074 /// ],
40075 /// "type": "string",
40076 /// "enum": [
40077 /// "MAIN_C2C",
40078 /// "MAIN_UMFUTURE",
40079 /// "MAIN_CMFUTURE",
40080 /// "MAIN_MARGIN",
40081 /// "MAIN_MINING",
40082 /// "C2C_MAIN",
40083 /// "C2C_UMFUTURE",
40084 /// "C2C_MINING",
40085 /// "C2C_MARGIN",
40086 /// "UMFUTURE_MAIN",
40087 /// "UMFUTURE_C2C",
40088 /// "UMFUTURE_MARGIN",
40089 /// "CMFUTURE_MAIN",
40090 /// "CMFUTURE_MARGIN",
40091 /// "MARGIN_MAIN",
40092 /// "MARGIN_UMFUTURE",
40093 /// "MARGIN_CMFUTURE",
40094 /// "MARGIN_MINING",
40095 /// "MARGIN_C2C",
40096 /// "MINING_MAIN",
40097 /// "MINING_UMFUTURE",
40098 /// "MINING_C2C",
40099 /// "MINING_MARGIN",
40100 /// "MAIN_PAY",
40101 /// "PAY_MAIN",
40102 /// "ISOLATEDMARGIN_MARGIN",
40103 /// "MARGIN_ISOLATEDMARGIN",
40104 /// "ISOLATEDMARGIN_ISOLATEDMARGIN"
40105 /// ]
40106 ///}
40107 /// ```
40108 /// </details>
40109 #[derive(
40110 Clone,
40111 Copy,
40112 Debug,
40113 Deserialize,
40114 Eq,
40115 Hash,
40116 Ord,
40117 PartialEq,
40118 PartialOrd,
40119 Serialize
40120 )]
40121 pub enum PostUserUniversalTransferType {
40122 #[serde(rename = "MAIN_C2C")]
40123 MainC2c,
40124 #[serde(rename = "MAIN_UMFUTURE")]
40125 MainUmfuture,
40126 #[serde(rename = "MAIN_CMFUTURE")]
40127 MainCmfuture,
40128 #[serde(rename = "MAIN_MARGIN")]
40129 MainMargin,
40130 #[serde(rename = "MAIN_MINING")]
40131 MainMining,
40132 #[serde(rename = "C2C_MAIN")]
40133 C2cMain,
40134 #[serde(rename = "C2C_UMFUTURE")]
40135 C2cUmfuture,
40136 #[serde(rename = "C2C_MINING")]
40137 C2cMining,
40138 #[serde(rename = "C2C_MARGIN")]
40139 C2cMargin,
40140 #[serde(rename = "UMFUTURE_MAIN")]
40141 UmfutureMain,
40142 #[serde(rename = "UMFUTURE_C2C")]
40143 UmfutureC2c,
40144 #[serde(rename = "UMFUTURE_MARGIN")]
40145 UmfutureMargin,
40146 #[serde(rename = "CMFUTURE_MAIN")]
40147 CmfutureMain,
40148 #[serde(rename = "CMFUTURE_MARGIN")]
40149 CmfutureMargin,
40150 #[serde(rename = "MARGIN_MAIN")]
40151 MarginMain,
40152 #[serde(rename = "MARGIN_UMFUTURE")]
40153 MarginUmfuture,
40154 #[serde(rename = "MARGIN_CMFUTURE")]
40155 MarginCmfuture,
40156 #[serde(rename = "MARGIN_MINING")]
40157 MarginMining,
40158 #[serde(rename = "MARGIN_C2C")]
40159 MarginC2c,
40160 #[serde(rename = "MINING_MAIN")]
40161 MiningMain,
40162 #[serde(rename = "MINING_UMFUTURE")]
40163 MiningUmfuture,
40164 #[serde(rename = "MINING_C2C")]
40165 MiningC2c,
40166 #[serde(rename = "MINING_MARGIN")]
40167 MiningMargin,
40168 #[serde(rename = "MAIN_PAY")]
40169 MainPay,
40170 #[serde(rename = "PAY_MAIN")]
40171 PayMain,
40172 #[serde(rename = "ISOLATEDMARGIN_MARGIN")]
40173 IsolatedmarginMargin,
40174 #[serde(rename = "MARGIN_ISOLATEDMARGIN")]
40175 MarginIsolatedmargin,
40176 #[serde(rename = "ISOLATEDMARGIN_ISOLATEDMARGIN")]
40177 IsolatedmarginIsolatedmargin,
40178 }
40179 impl From<&PostUserUniversalTransferType> for PostUserUniversalTransferType {
40180 fn from(value: &PostUserUniversalTransferType) -> Self {
40181 value.clone()
40182 }
40183 }
40184 impl ToString for PostUserUniversalTransferType {
40185 fn to_string(&self) -> String {
40186 match *self {
40187 Self::MainC2c => "MAIN_C2C".to_string(),
40188 Self::MainUmfuture => "MAIN_UMFUTURE".to_string(),
40189 Self::MainCmfuture => "MAIN_CMFUTURE".to_string(),
40190 Self::MainMargin => "MAIN_MARGIN".to_string(),
40191 Self::MainMining => "MAIN_MINING".to_string(),
40192 Self::C2cMain => "C2C_MAIN".to_string(),
40193 Self::C2cUmfuture => "C2C_UMFUTURE".to_string(),
40194 Self::C2cMining => "C2C_MINING".to_string(),
40195 Self::C2cMargin => "C2C_MARGIN".to_string(),
40196 Self::UmfutureMain => "UMFUTURE_MAIN".to_string(),
40197 Self::UmfutureC2c => "UMFUTURE_C2C".to_string(),
40198 Self::UmfutureMargin => "UMFUTURE_MARGIN".to_string(),
40199 Self::CmfutureMain => "CMFUTURE_MAIN".to_string(),
40200 Self::CmfutureMargin => "CMFUTURE_MARGIN".to_string(),
40201 Self::MarginMain => "MARGIN_MAIN".to_string(),
40202 Self::MarginUmfuture => "MARGIN_UMFUTURE".to_string(),
40203 Self::MarginCmfuture => "MARGIN_CMFUTURE".to_string(),
40204 Self::MarginMining => "MARGIN_MINING".to_string(),
40205 Self::MarginC2c => "MARGIN_C2C".to_string(),
40206 Self::MiningMain => "MINING_MAIN".to_string(),
40207 Self::MiningUmfuture => "MINING_UMFUTURE".to_string(),
40208 Self::MiningC2c => "MINING_C2C".to_string(),
40209 Self::MiningMargin => "MINING_MARGIN".to_string(),
40210 Self::MainPay => "MAIN_PAY".to_string(),
40211 Self::PayMain => "PAY_MAIN".to_string(),
40212 Self::IsolatedmarginMargin => "ISOLATEDMARGIN_MARGIN".to_string(),
40213 Self::MarginIsolatedmargin => "MARGIN_ISOLATEDMARGIN".to_string(),
40214 Self::IsolatedmarginIsolatedmargin => {
40215 "ISOLATEDMARGIN_ISOLATEDMARGIN".to_string()
40216 }
40217 }
40218 }
40219 }
40220 impl std::str::FromStr for PostUserUniversalTransferType {
40221 type Err = self::error::ConversionError;
40222 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
40223 match value {
40224 "MAIN_C2C" => Ok(Self::MainC2c),
40225 "MAIN_UMFUTURE" => Ok(Self::MainUmfuture),
40226 "MAIN_CMFUTURE" => Ok(Self::MainCmfuture),
40227 "MAIN_MARGIN" => Ok(Self::MainMargin),
40228 "MAIN_MINING" => Ok(Self::MainMining),
40229 "C2C_MAIN" => Ok(Self::C2cMain),
40230 "C2C_UMFUTURE" => Ok(Self::C2cUmfuture),
40231 "C2C_MINING" => Ok(Self::C2cMining),
40232 "C2C_MARGIN" => Ok(Self::C2cMargin),
40233 "UMFUTURE_MAIN" => Ok(Self::UmfutureMain),
40234 "UMFUTURE_C2C" => Ok(Self::UmfutureC2c),
40235 "UMFUTURE_MARGIN" => Ok(Self::UmfutureMargin),
40236 "CMFUTURE_MAIN" => Ok(Self::CmfutureMain),
40237 "CMFUTURE_MARGIN" => Ok(Self::CmfutureMargin),
40238 "MARGIN_MAIN" => Ok(Self::MarginMain),
40239 "MARGIN_UMFUTURE" => Ok(Self::MarginUmfuture),
40240 "MARGIN_CMFUTURE" => Ok(Self::MarginCmfuture),
40241 "MARGIN_MINING" => Ok(Self::MarginMining),
40242 "MARGIN_C2C" => Ok(Self::MarginC2c),
40243 "MINING_MAIN" => Ok(Self::MiningMain),
40244 "MINING_UMFUTURE" => Ok(Self::MiningUmfuture),
40245 "MINING_C2C" => Ok(Self::MiningC2c),
40246 "MINING_MARGIN" => Ok(Self::MiningMargin),
40247 "MAIN_PAY" => Ok(Self::MainPay),
40248 "PAY_MAIN" => Ok(Self::PayMain),
40249 "ISOLATEDMARGIN_MARGIN" => Ok(Self::IsolatedmarginMargin),
40250 "MARGIN_ISOLATEDMARGIN" => Ok(Self::MarginIsolatedmargin),
40251 "ISOLATEDMARGIN_ISOLATEDMARGIN" => Ok(Self::IsolatedmarginIsolatedmargin),
40252 _ => Err("invalid value".into()),
40253 }
40254 }
40255 }
40256 impl std::convert::TryFrom<&str> for PostUserUniversalTransferType {
40257 type Error = self::error::ConversionError;
40258 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
40259 value.parse()
40260 }
40261 }
40262 impl std::convert::TryFrom<&String> for PostUserUniversalTransferType {
40263 type Error = self::error::ConversionError;
40264 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
40265 value.parse()
40266 }
40267 }
40268 impl std::convert::TryFrom<String> for PostUserUniversalTransferType {
40269 type Error = self::error::ConversionError;
40270 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
40271 value.parse()
40272 }
40273 }
40274 ///PriceTicker
40275 ///
40276 /// <details><summary>JSON schema</summary>
40277 ///
40278 /// ```json
40279 ///{
40280 /// "type": "object",
40281 /// "required": [
40282 /// "price",
40283 /// "symbol"
40284 /// ],
40285 /// "properties": {
40286 /// "price": {
40287 /// "examples": [
40288 /// "0.17160000"
40289 /// ],
40290 /// "type": "string"
40291 /// },
40292 /// "symbol": {
40293 /// "examples": [
40294 /// "BNBBTC"
40295 /// ],
40296 /// "type": "string"
40297 /// }
40298 /// }
40299 ///}
40300 /// ```
40301 /// </details>
40302 #[derive(Clone, Debug, Deserialize, Serialize)]
40303 pub struct PriceTicker {
40304 pub price: String,
40305 pub symbol: String,
40306 }
40307 impl From<&PriceTicker> for PriceTicker {
40308 fn from(value: &PriceTicker) -> Self {
40309 value.clone()
40310 }
40311 }
40312 ///PriceTickerList
40313 ///
40314 /// <details><summary>JSON schema</summary>
40315 ///
40316 /// ```json
40317 ///{
40318 /// "type": "array",
40319 /// "items": {
40320 /// "$ref": "#/components/schemas/priceTicker"
40321 /// }
40322 ///}
40323 /// ```
40324 /// </details>
40325 #[derive(Clone, Debug, Deserialize, Serialize)]
40326 pub struct PriceTickerList(pub Vec<PriceTicker>);
40327 impl std::ops::Deref for PriceTickerList {
40328 type Target = Vec<PriceTicker>;
40329 fn deref(&self) -> &Vec<PriceTicker> {
40330 &self.0
40331 }
40332 }
40333 impl From<PriceTickerList> for Vec<PriceTicker> {
40334 fn from(value: PriceTickerList) -> Self {
40335 value.0
40336 }
40337 }
40338 impl From<&PriceTickerList> for PriceTickerList {
40339 fn from(value: &PriceTickerList) -> Self {
40340 value.clone()
40341 }
40342 }
40343 impl From<Vec<PriceTicker>> for PriceTickerList {
40344 fn from(value: Vec<PriceTicker>) -> Self {
40345 Self(value)
40346 }
40347 }
40348 ///QueryMarginIsolatedTransferType
40349 ///
40350 /// <details><summary>JSON schema</summary>
40351 ///
40352 /// ```json
40353 ///{
40354 /// "type": "string",
40355 /// "enum": [
40356 /// "ROLL_IN",
40357 /// "ROLL_OUT"
40358 /// ]
40359 ///}
40360 /// ```
40361 /// </details>
40362 #[derive(
40363 Clone,
40364 Copy,
40365 Debug,
40366 Deserialize,
40367 Eq,
40368 Hash,
40369 Ord,
40370 PartialEq,
40371 PartialOrd,
40372 Serialize
40373 )]
40374 pub enum QueryMarginIsolatedTransferType {
40375 #[serde(rename = "ROLL_IN")]
40376 RollIn,
40377 #[serde(rename = "ROLL_OUT")]
40378 RollOut,
40379 }
40380 impl From<&QueryMarginIsolatedTransferType> for QueryMarginIsolatedTransferType {
40381 fn from(value: &QueryMarginIsolatedTransferType) -> Self {
40382 value.clone()
40383 }
40384 }
40385 impl ToString for QueryMarginIsolatedTransferType {
40386 fn to_string(&self) -> String {
40387 match *self {
40388 Self::RollIn => "ROLL_IN".to_string(),
40389 Self::RollOut => "ROLL_OUT".to_string(),
40390 }
40391 }
40392 }
40393 impl std::str::FromStr for QueryMarginIsolatedTransferType {
40394 type Err = self::error::ConversionError;
40395 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
40396 match value {
40397 "ROLL_IN" => Ok(Self::RollIn),
40398 "ROLL_OUT" => Ok(Self::RollOut),
40399 _ => Err("invalid value".into()),
40400 }
40401 }
40402 }
40403 impl std::convert::TryFrom<&str> for QueryMarginIsolatedTransferType {
40404 type Error = self::error::ConversionError;
40405 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
40406 value.parse()
40407 }
40408 }
40409 impl std::convert::TryFrom<&String> for QueryMarginIsolatedTransferType {
40410 type Error = self::error::ConversionError;
40411 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
40412 value.parse()
40413 }
40414 }
40415 impl std::convert::TryFrom<String> for QueryMarginIsolatedTransferType {
40416 type Error = self::error::ConversionError;
40417 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
40418 value.parse()
40419 }
40420 }
40421 ///QueryMarginLoanRecordResponse
40422 ///
40423 /// <details><summary>JSON schema</summary>
40424 ///
40425 /// ```json
40426 ///{
40427 /// "examples": [
40428 /// {
40429 /// "rows": [
40430 /// {
40431 /// "asset": "BNB",
40432 /// "isolatedSymbol": "BNBUSDT",
40433 /// "principal": "0.84624403",
40434 /// "status": "CONFIRMED",
40435 /// "timestamp": 1555056425000,
40436 /// "txId": 12807067523
40437 /// }
40438 /// ],
40439 /// "total": 1
40440 /// }
40441 /// ],
40442 /// "type": "object",
40443 /// "required": [
40444 /// "rows",
40445 /// "total"
40446 /// ],
40447 /// "properties": {
40448 /// "rows": {
40449 /// "type": "array",
40450 /// "items": {
40451 /// "type": "object",
40452 /// "required": [
40453 /// "asset",
40454 /// "isolatedSymbol",
40455 /// "principal",
40456 /// "status",
40457 /// "timestamp",
40458 /// "txId"
40459 /// ],
40460 /// "properties": {
40461 /// "asset": {
40462 /// "type": "string"
40463 /// },
40464 /// "isolatedSymbol": {
40465 /// "type": "string"
40466 /// },
40467 /// "principal": {
40468 /// "type": "string"
40469 /// },
40470 /// "status": {
40471 /// "type": "string"
40472 /// },
40473 /// "timestamp": {
40474 /// "type": "integer",
40475 /// "format": "int64"
40476 /// },
40477 /// "txId": {
40478 /// "type": "integer",
40479 /// "format": "int64"
40480 /// }
40481 /// }
40482 /// }
40483 /// },
40484 /// "total": {
40485 /// "type": "integer",
40486 /// "format": "int32"
40487 /// }
40488 /// }
40489 ///}
40490 /// ```
40491 /// </details>
40492 #[derive(Clone, Debug, Deserialize, Serialize)]
40493 pub struct QueryMarginLoanRecordResponse {
40494 pub rows: Vec<QueryMarginLoanRecordResponseRowsItem>,
40495 pub total: i32,
40496 }
40497 impl From<&QueryMarginLoanRecordResponse> for QueryMarginLoanRecordResponse {
40498 fn from(value: &QueryMarginLoanRecordResponse) -> Self {
40499 value.clone()
40500 }
40501 }
40502 ///QueryMarginLoanRecordResponseRowsItem
40503 ///
40504 /// <details><summary>JSON schema</summary>
40505 ///
40506 /// ```json
40507 ///{
40508 /// "type": "object",
40509 /// "required": [
40510 /// "asset",
40511 /// "isolatedSymbol",
40512 /// "principal",
40513 /// "status",
40514 /// "timestamp",
40515 /// "txId"
40516 /// ],
40517 /// "properties": {
40518 /// "asset": {
40519 /// "type": "string"
40520 /// },
40521 /// "isolatedSymbol": {
40522 /// "type": "string"
40523 /// },
40524 /// "principal": {
40525 /// "type": "string"
40526 /// },
40527 /// "status": {
40528 /// "type": "string"
40529 /// },
40530 /// "timestamp": {
40531 /// "type": "integer",
40532 /// "format": "int64"
40533 /// },
40534 /// "txId": {
40535 /// "type": "integer",
40536 /// "format": "int64"
40537 /// }
40538 /// }
40539 ///}
40540 /// ```
40541 /// </details>
40542 #[derive(Clone, Debug, Deserialize, Serialize)]
40543 pub struct QueryMarginLoanRecordResponseRowsItem {
40544 pub asset: String,
40545 #[serde(rename = "isolatedSymbol")]
40546 pub isolated_symbol: String,
40547 pub principal: String,
40548 pub status: String,
40549 pub timestamp: i64,
40550 #[serde(rename = "txId")]
40551 pub tx_id: i64,
40552 }
40553 impl From<&QueryMarginLoanRecordResponseRowsItem>
40554 for QueryMarginLoanRecordResponseRowsItem {
40555 fn from(value: &QueryMarginLoanRecordResponseRowsItem) -> Self {
40556 value.clone()
40557 }
40558 }
40559 ///QueryMarginRepayResponse
40560 ///
40561 /// <details><summary>JSON schema</summary>
40562 ///
40563 /// ```json
40564 ///{
40565 /// "type": "object",
40566 /// "required": [
40567 /// "rows",
40568 /// "total"
40569 /// ],
40570 /// "properties": {
40571 /// "rows": {
40572 /// "type": "array",
40573 /// "items": {
40574 /// "type": "object",
40575 /// "required": [
40576 /// "amount",
40577 /// "asset",
40578 /// "interest",
40579 /// "isolatedSymbol",
40580 /// "principal",
40581 /// "status",
40582 /// "timestamp",
40583 /// "txId"
40584 /// ],
40585 /// "properties": {
40586 /// "amount": {
40587 /// "description": "Total amount repaid",
40588 /// "examples": [
40589 /// "14.00000000"
40590 /// ],
40591 /// "type": "string"
40592 /// },
40593 /// "asset": {
40594 /// "examples": [
40595 /// "BNB"
40596 /// ],
40597 /// "type": "string"
40598 /// },
40599 /// "interest": {
40600 /// "description": "Interest repaid",
40601 /// "examples": [
40602 /// "0.01866667"
40603 /// ],
40604 /// "type": "string"
40605 /// },
40606 /// "isolatedSymbol": {
40607 /// "description": "Isolated symbol, will not be returned for crossed margin",
40608 /// "examples": [
40609 /// "BNBUSDT"
40610 /// ],
40611 /// "type": "string"
40612 /// },
40613 /// "principal": {
40614 /// "description": "Principal repaid",
40615 /// "examples": [
40616 /// "13.98133333"
40617 /// ],
40618 /// "type": "string"
40619 /// },
40620 /// "status": {
40621 /// "description": "One of PENDING (pending execution), CONFIRMED (successfully execution), FAILED (execution failed, nothing happened to your account)",
40622 /// "examples": [
40623 /// "CONFIRMED"
40624 /// ],
40625 /// "type": "string"
40626 /// },
40627 /// "timestamp": {
40628 /// "examples": [
40629 /// 1563438204000
40630 /// ],
40631 /// "type": "integer",
40632 /// "format": "int64"
40633 /// },
40634 /// "txId": {
40635 /// "examples": [
40636 /// 2970933056
40637 /// ],
40638 /// "type": "integer",
40639 /// "format": "int64"
40640 /// }
40641 /// }
40642 /// }
40643 /// },
40644 /// "total": {
40645 /// "examples": [
40646 /// 1
40647 /// ],
40648 /// "type": "integer",
40649 /// "format": "int32"
40650 /// }
40651 /// }
40652 ///}
40653 /// ```
40654 /// </details>
40655 #[derive(Clone, Debug, Deserialize, Serialize)]
40656 pub struct QueryMarginRepayResponse {
40657 pub rows: Vec<QueryMarginRepayResponseRowsItem>,
40658 pub total: i32,
40659 }
40660 impl From<&QueryMarginRepayResponse> for QueryMarginRepayResponse {
40661 fn from(value: &QueryMarginRepayResponse) -> Self {
40662 value.clone()
40663 }
40664 }
40665 ///QueryMarginRepayResponseRowsItem
40666 ///
40667 /// <details><summary>JSON schema</summary>
40668 ///
40669 /// ```json
40670 ///{
40671 /// "type": "object",
40672 /// "required": [
40673 /// "amount",
40674 /// "asset",
40675 /// "interest",
40676 /// "isolatedSymbol",
40677 /// "principal",
40678 /// "status",
40679 /// "timestamp",
40680 /// "txId"
40681 /// ],
40682 /// "properties": {
40683 /// "amount": {
40684 /// "description": "Total amount repaid",
40685 /// "examples": [
40686 /// "14.00000000"
40687 /// ],
40688 /// "type": "string"
40689 /// },
40690 /// "asset": {
40691 /// "examples": [
40692 /// "BNB"
40693 /// ],
40694 /// "type": "string"
40695 /// },
40696 /// "interest": {
40697 /// "description": "Interest repaid",
40698 /// "examples": [
40699 /// "0.01866667"
40700 /// ],
40701 /// "type": "string"
40702 /// },
40703 /// "isolatedSymbol": {
40704 /// "description": "Isolated symbol, will not be returned for crossed margin",
40705 /// "examples": [
40706 /// "BNBUSDT"
40707 /// ],
40708 /// "type": "string"
40709 /// },
40710 /// "principal": {
40711 /// "description": "Principal repaid",
40712 /// "examples": [
40713 /// "13.98133333"
40714 /// ],
40715 /// "type": "string"
40716 /// },
40717 /// "status": {
40718 /// "description": "One of PENDING (pending execution), CONFIRMED (successfully execution), FAILED (execution failed, nothing happened to your account)",
40719 /// "examples": [
40720 /// "CONFIRMED"
40721 /// ],
40722 /// "type": "string"
40723 /// },
40724 /// "timestamp": {
40725 /// "examples": [
40726 /// 1563438204000
40727 /// ],
40728 /// "type": "integer",
40729 /// "format": "int64"
40730 /// },
40731 /// "txId": {
40732 /// "examples": [
40733 /// 2970933056
40734 /// ],
40735 /// "type": "integer",
40736 /// "format": "int64"
40737 /// }
40738 /// }
40739 ///}
40740 /// ```
40741 /// </details>
40742 #[derive(Clone, Debug, Deserialize, Serialize)]
40743 pub struct QueryMarginRepayResponseRowsItem {
40744 ///Total amount repaid
40745 pub amount: String,
40746 pub asset: String,
40747 ///Interest repaid
40748 pub interest: String,
40749 ///Isolated symbol, will not be returned for crossed margin
40750 #[serde(rename = "isolatedSymbol")]
40751 pub isolated_symbol: String,
40752 ///Principal repaid
40753 pub principal: String,
40754 ///One of PENDING (pending execution), CONFIRMED (successfully execution), FAILED (execution failed, nothing happened to your account)
40755 pub status: String,
40756 pub timestamp: i64,
40757 #[serde(rename = "txId")]
40758 pub tx_id: i64,
40759 }
40760 impl From<&QueryMarginRepayResponseRowsItem> for QueryMarginRepayResponseRowsItem {
40761 fn from(value: &QueryMarginRepayResponseRowsItem) -> Self {
40762 value.clone()
40763 }
40764 }
40765 ///QuerySubAccountAssetsResponse
40766 ///
40767 /// <details><summary>JSON schema</summary>
40768 ///
40769 /// ```json
40770 ///{
40771 /// "type": "object",
40772 /// "required": [
40773 /// "balances"
40774 /// ],
40775 /// "properties": {
40776 /// "balances": {
40777 /// "type": "array",
40778 /// "items": {
40779 /// "type": "object",
40780 /// "required": [
40781 /// "asset",
40782 /// "free",
40783 /// "locked"
40784 /// ],
40785 /// "properties": {
40786 /// "asset": {
40787 /// "examples": [
40788 /// "BNB"
40789 /// ],
40790 /// "type": "string"
40791 /// },
40792 /// "free": {
40793 /// "examples": [
40794 /// "10000"
40795 /// ],
40796 /// "type": "string"
40797 /// },
40798 /// "locked": {
40799 /// "examples": [
40800 /// "0"
40801 /// ],
40802 /// "type": "string"
40803 /// }
40804 /// }
40805 /// }
40806 /// }
40807 /// }
40808 ///}
40809 /// ```
40810 /// </details>
40811 #[derive(Clone, Debug, Deserialize, Serialize)]
40812 pub struct QuerySubAccountAssetsResponse {
40813 pub balances: Vec<QuerySubAccountAssetsResponseBalancesItem>,
40814 }
40815 impl From<&QuerySubAccountAssetsResponse> for QuerySubAccountAssetsResponse {
40816 fn from(value: &QuerySubAccountAssetsResponse) -> Self {
40817 value.clone()
40818 }
40819 }
40820 ///QuerySubAccountAssetsResponseBalancesItem
40821 ///
40822 /// <details><summary>JSON schema</summary>
40823 ///
40824 /// ```json
40825 ///{
40826 /// "type": "object",
40827 /// "required": [
40828 /// "asset",
40829 /// "free",
40830 /// "locked"
40831 /// ],
40832 /// "properties": {
40833 /// "asset": {
40834 /// "examples": [
40835 /// "BNB"
40836 /// ],
40837 /// "type": "string"
40838 /// },
40839 /// "free": {
40840 /// "examples": [
40841 /// "10000"
40842 /// ],
40843 /// "type": "string"
40844 /// },
40845 /// "locked": {
40846 /// "examples": [
40847 /// "0"
40848 /// ],
40849 /// "type": "string"
40850 /// }
40851 /// }
40852 ///}
40853 /// ```
40854 /// </details>
40855 #[derive(Clone, Debug, Deserialize, Serialize)]
40856 pub struct QuerySubAccountAssetsResponseBalancesItem {
40857 pub asset: String,
40858 pub free: String,
40859 pub locked: String,
40860 }
40861 impl From<&QuerySubAccountAssetsResponseBalancesItem>
40862 for QuerySubAccountAssetsResponseBalancesItem {
40863 fn from(value: &QuerySubAccountAssetsResponseBalancesItem) -> Self {
40864 value.clone()
40865 }
40866 }
40867 ///QuerySubAccountFuturesAccountSummaryResponse
40868 ///
40869 /// <details><summary>JSON schema</summary>
40870 ///
40871 /// ```json
40872 ///{
40873 /// "oneOf": [
40874 /// {
40875 /// "$ref": "#/components/schemas/subAccountUSDTFuturesSummary"
40876 /// },
40877 /// {
40878 /// "$ref": "#/components/schemas/subAccountCOINFuturesSummary"
40879 /// }
40880 /// ]
40881 ///}
40882 /// ```
40883 /// </details>
40884 #[derive(Clone, Debug, Deserialize, Serialize)]
40885 #[serde(untagged)]
40886 pub enum QuerySubAccountFuturesAccountSummaryResponse {
40887 UsdtFuturesSummary(SubAccountUsdtFuturesSummary),
40888 CoinFuturesSummary(SubAccountCoinFuturesSummary),
40889 }
40890 impl From<&QuerySubAccountFuturesAccountSummaryResponse>
40891 for QuerySubAccountFuturesAccountSummaryResponse {
40892 fn from(value: &QuerySubAccountFuturesAccountSummaryResponse) -> Self {
40893 value.clone()
40894 }
40895 }
40896 impl From<SubAccountUsdtFuturesSummary>
40897 for QuerySubAccountFuturesAccountSummaryResponse {
40898 fn from(value: SubAccountUsdtFuturesSummary) -> Self {
40899 Self::UsdtFuturesSummary(value)
40900 }
40901 }
40902 impl From<SubAccountCoinFuturesSummary>
40903 for QuerySubAccountFuturesAccountSummaryResponse {
40904 fn from(value: SubAccountCoinFuturesSummary) -> Self {
40905 Self::CoinFuturesSummary(value)
40906 }
40907 }
40908 ///QuerySubAccountFuturesAccountV1Response
40909 ///
40910 /// <details><summary>JSON schema</summary>
40911 ///
40912 /// ```json
40913 ///{
40914 /// "type": "object",
40915 /// "required": [
40916 /// "asset",
40917 /// "assets",
40918 /// "canDeposit",
40919 /// "canTrade",
40920 /// "canWithdraw",
40921 /// "email",
40922 /// "feeTier",
40923 /// "maxWithdrawAmount",
40924 /// "totalInitialMargin",
40925 /// "totalMaintenanceMargin",
40926 /// "totalMarginBalance",
40927 /// "totalOpenOrderInitialMargin",
40928 /// "totalPositionInitialMargin",
40929 /// "totalUnrealizedProfit",
40930 /// "totalWalletBalance",
40931 /// "updateTime"
40932 /// ],
40933 /// "properties": {
40934 /// "asset": {
40935 /// "examples": [
40936 /// "USDT"
40937 /// ],
40938 /// "type": "string"
40939 /// },
40940 /// "assets": {
40941 /// "type": "array",
40942 /// "items": {
40943 /// "type": "object",
40944 /// "required": [
40945 /// "asset",
40946 /// "initialMargin",
40947 /// "maintenanceMargin",
40948 /// "marginBalance",
40949 /// "maxWithdrawAmount",
40950 /// "openOrderInitialMargin",
40951 /// "positionInitialMargin",
40952 /// "unrealizedProfit",
40953 /// "walletBalance"
40954 /// ],
40955 /// "properties": {
40956 /// "asset": {
40957 /// "examples": [
40958 /// "USDT"
40959 /// ],
40960 /// "type": "string"
40961 /// },
40962 /// "initialMargin": {
40963 /// "examples": [
40964 /// "0.00000000"
40965 /// ],
40966 /// "type": "string"
40967 /// },
40968 /// "maintenanceMargin": {
40969 /// "examples": [
40970 /// "0.00000000"
40971 /// ],
40972 /// "type": "string"
40973 /// },
40974 /// "marginBalance": {
40975 /// "examples": [
40976 /// "0.88308000"
40977 /// ],
40978 /// "type": "string"
40979 /// },
40980 /// "maxWithdrawAmount": {
40981 /// "examples": [
40982 /// "0.88308000"
40983 /// ],
40984 /// "type": "string"
40985 /// },
40986 /// "openOrderInitialMargin": {
40987 /// "examples": [
40988 /// "0.00000000"
40989 /// ],
40990 /// "type": "string"
40991 /// },
40992 /// "positionInitialMargin": {
40993 /// "examples": [
40994 /// "0.00000000"
40995 /// ],
40996 /// "type": "string"
40997 /// },
40998 /// "unrealizedProfit": {
40999 /// "examples": [
41000 /// "0.00000000"
41001 /// ],
41002 /// "type": "string"
41003 /// },
41004 /// "walletBalance": {
41005 /// "examples": [
41006 /// "0.88308000"
41007 /// ],
41008 /// "type": "string"
41009 /// }
41010 /// }
41011 /// }
41012 /// },
41013 /// "canDeposit": {
41014 /// "type": "boolean"
41015 /// },
41016 /// "canTrade": {
41017 /// "type": "boolean"
41018 /// },
41019 /// "canWithdraw": {
41020 /// "type": "boolean"
41021 /// },
41022 /// "email": {
41023 /// "examples": [
41024 /// "abc@test.com"
41025 /// ],
41026 /// "type": "string"
41027 /// },
41028 /// "feeTier": {
41029 /// "examples": [
41030 /// 2
41031 /// ],
41032 /// "type": "integer",
41033 /// "format": "int64"
41034 /// },
41035 /// "maxWithdrawAmount": {
41036 /// "examples": [
41037 /// "0.88308000"
41038 /// ],
41039 /// "type": "string"
41040 /// },
41041 /// "totalInitialMargin": {
41042 /// "examples": [
41043 /// "0.00000000"
41044 /// ],
41045 /// "type": "string"
41046 /// },
41047 /// "totalMaintenanceMargin": {
41048 /// "examples": [
41049 /// "0.00000000"
41050 /// ],
41051 /// "type": "string"
41052 /// },
41053 /// "totalMarginBalance": {
41054 /// "examples": [
41055 /// "0.88308000"
41056 /// ],
41057 /// "type": "string"
41058 /// },
41059 /// "totalOpenOrderInitialMargin": {
41060 /// "examples": [
41061 /// "0.00000000"
41062 /// ],
41063 /// "type": "string"
41064 /// },
41065 /// "totalPositionInitialMargin": {
41066 /// "examples": [
41067 /// "0.00000000"
41068 /// ],
41069 /// "type": "string"
41070 /// },
41071 /// "totalUnrealizedProfit": {
41072 /// "examples": [
41073 /// "0.00000000"
41074 /// ],
41075 /// "type": "string"
41076 /// },
41077 /// "totalWalletBalance": {
41078 /// "examples": [
41079 /// "0.88308000"
41080 /// ],
41081 /// "type": "string"
41082 /// },
41083 /// "updateTime": {
41084 /// "examples": [
41085 /// 1576756674610
41086 /// ],
41087 /// "type": "integer",
41088 /// "format": "int64"
41089 /// }
41090 /// }
41091 ///}
41092 /// ```
41093 /// </details>
41094 #[derive(Clone, Debug, Deserialize, Serialize)]
41095 pub struct QuerySubAccountFuturesAccountV1Response {
41096 pub asset: String,
41097 pub assets: Vec<QuerySubAccountFuturesAccountV1ResponseAssetsItem>,
41098 #[serde(rename = "canDeposit")]
41099 pub can_deposit: bool,
41100 #[serde(rename = "canTrade")]
41101 pub can_trade: bool,
41102 #[serde(rename = "canWithdraw")]
41103 pub can_withdraw: bool,
41104 pub email: String,
41105 #[serde(rename = "feeTier")]
41106 pub fee_tier: i64,
41107 #[serde(rename = "maxWithdrawAmount")]
41108 pub max_withdraw_amount: String,
41109 #[serde(rename = "totalInitialMargin")]
41110 pub total_initial_margin: String,
41111 #[serde(rename = "totalMaintenanceMargin")]
41112 pub total_maintenance_margin: String,
41113 #[serde(rename = "totalMarginBalance")]
41114 pub total_margin_balance: String,
41115 #[serde(rename = "totalOpenOrderInitialMargin")]
41116 pub total_open_order_initial_margin: String,
41117 #[serde(rename = "totalPositionInitialMargin")]
41118 pub total_position_initial_margin: String,
41119 #[serde(rename = "totalUnrealizedProfit")]
41120 pub total_unrealized_profit: String,
41121 #[serde(rename = "totalWalletBalance")]
41122 pub total_wallet_balance: String,
41123 #[serde(rename = "updateTime")]
41124 pub update_time: i64,
41125 }
41126 impl From<&QuerySubAccountFuturesAccountV1Response>
41127 for QuerySubAccountFuturesAccountV1Response {
41128 fn from(value: &QuerySubAccountFuturesAccountV1Response) -> Self {
41129 value.clone()
41130 }
41131 }
41132 ///QuerySubAccountFuturesAccountV1ResponseAssetsItem
41133 ///
41134 /// <details><summary>JSON schema</summary>
41135 ///
41136 /// ```json
41137 ///{
41138 /// "type": "object",
41139 /// "required": [
41140 /// "asset",
41141 /// "initialMargin",
41142 /// "maintenanceMargin",
41143 /// "marginBalance",
41144 /// "maxWithdrawAmount",
41145 /// "openOrderInitialMargin",
41146 /// "positionInitialMargin",
41147 /// "unrealizedProfit",
41148 /// "walletBalance"
41149 /// ],
41150 /// "properties": {
41151 /// "asset": {
41152 /// "examples": [
41153 /// "USDT"
41154 /// ],
41155 /// "type": "string"
41156 /// },
41157 /// "initialMargin": {
41158 /// "examples": [
41159 /// "0.00000000"
41160 /// ],
41161 /// "type": "string"
41162 /// },
41163 /// "maintenanceMargin": {
41164 /// "examples": [
41165 /// "0.00000000"
41166 /// ],
41167 /// "type": "string"
41168 /// },
41169 /// "marginBalance": {
41170 /// "examples": [
41171 /// "0.88308000"
41172 /// ],
41173 /// "type": "string"
41174 /// },
41175 /// "maxWithdrawAmount": {
41176 /// "examples": [
41177 /// "0.88308000"
41178 /// ],
41179 /// "type": "string"
41180 /// },
41181 /// "openOrderInitialMargin": {
41182 /// "examples": [
41183 /// "0.00000000"
41184 /// ],
41185 /// "type": "string"
41186 /// },
41187 /// "positionInitialMargin": {
41188 /// "examples": [
41189 /// "0.00000000"
41190 /// ],
41191 /// "type": "string"
41192 /// },
41193 /// "unrealizedProfit": {
41194 /// "examples": [
41195 /// "0.00000000"
41196 /// ],
41197 /// "type": "string"
41198 /// },
41199 /// "walletBalance": {
41200 /// "examples": [
41201 /// "0.88308000"
41202 /// ],
41203 /// "type": "string"
41204 /// }
41205 /// }
41206 ///}
41207 /// ```
41208 /// </details>
41209 #[derive(Clone, Debug, Deserialize, Serialize)]
41210 pub struct QuerySubAccountFuturesAccountV1ResponseAssetsItem {
41211 pub asset: String,
41212 #[serde(rename = "initialMargin")]
41213 pub initial_margin: String,
41214 #[serde(rename = "maintenanceMargin")]
41215 pub maintenance_margin: String,
41216 #[serde(rename = "marginBalance")]
41217 pub margin_balance: String,
41218 #[serde(rename = "maxWithdrawAmount")]
41219 pub max_withdraw_amount: String,
41220 #[serde(rename = "openOrderInitialMargin")]
41221 pub open_order_initial_margin: String,
41222 #[serde(rename = "positionInitialMargin")]
41223 pub position_initial_margin: String,
41224 #[serde(rename = "unrealizedProfit")]
41225 pub unrealized_profit: String,
41226 #[serde(rename = "walletBalance")]
41227 pub wallet_balance: String,
41228 }
41229 impl From<&QuerySubAccountFuturesAccountV1ResponseAssetsItem>
41230 for QuerySubAccountFuturesAccountV1ResponseAssetsItem {
41231 fn from(value: &QuerySubAccountFuturesAccountV1ResponseAssetsItem) -> Self {
41232 value.clone()
41233 }
41234 }
41235 ///QuerySubAccountFuturesAccountV2Response
41236 ///
41237 /// <details><summary>JSON schema</summary>
41238 ///
41239 /// ```json
41240 ///{
41241 /// "oneOf": [
41242 /// {
41243 /// "$ref": "#/components/schemas/subAccountUSDTFuturesDetails"
41244 /// },
41245 /// {
41246 /// "$ref": "#/components/schemas/subAccountCOINFuturesDetails"
41247 /// }
41248 /// ]
41249 ///}
41250 /// ```
41251 /// </details>
41252 #[derive(Clone, Debug, Deserialize, Serialize)]
41253 #[serde(untagged)]
41254 pub enum QuerySubAccountFuturesAccountV2Response {
41255 UsdtFuturesDetails(SubAccountUsdtFuturesDetails),
41256 CoinFuturesDetails(SubAccountCoinFuturesDetails),
41257 }
41258 impl From<&QuerySubAccountFuturesAccountV2Response>
41259 for QuerySubAccountFuturesAccountV2Response {
41260 fn from(value: &QuerySubAccountFuturesAccountV2Response) -> Self {
41261 value.clone()
41262 }
41263 }
41264 impl From<SubAccountUsdtFuturesDetails> for QuerySubAccountFuturesAccountV2Response {
41265 fn from(value: SubAccountUsdtFuturesDetails) -> Self {
41266 Self::UsdtFuturesDetails(value)
41267 }
41268 }
41269 impl From<SubAccountCoinFuturesDetails> for QuerySubAccountFuturesAccountV2Response {
41270 fn from(value: SubAccountCoinFuturesDetails) -> Self {
41271 Self::CoinFuturesDetails(value)
41272 }
41273 }
41274 ///QuerySubAccountFuturesPositionRiskResponse
41275 ///
41276 /// <details><summary>JSON schema</summary>
41277 ///
41278 /// ```json
41279 ///{
41280 /// "oneOf": [
41281 /// {
41282 /// "$ref": "#/components/schemas/subAccountUSDTFuturesPositionRisk"
41283 /// },
41284 /// {
41285 /// "$ref": "#/components/schemas/subAccountCOINFuturesPositionRisk"
41286 /// }
41287 /// ]
41288 ///}
41289 /// ```
41290 /// </details>
41291 #[derive(Clone, Debug, Deserialize, Serialize)]
41292 #[serde(untagged)]
41293 pub enum QuerySubAccountFuturesPositionRiskResponse {
41294 UsdtFuturesPositionRisk(SubAccountUsdtFuturesPositionRisk),
41295 CoinFuturesPositionRisk(SubAccountCoinFuturesPositionRisk),
41296 }
41297 impl From<&QuerySubAccountFuturesPositionRiskResponse>
41298 for QuerySubAccountFuturesPositionRiskResponse {
41299 fn from(value: &QuerySubAccountFuturesPositionRiskResponse) -> Self {
41300 value.clone()
41301 }
41302 }
41303 impl From<SubAccountUsdtFuturesPositionRisk>
41304 for QuerySubAccountFuturesPositionRiskResponse {
41305 fn from(value: SubAccountUsdtFuturesPositionRisk) -> Self {
41306 Self::UsdtFuturesPositionRisk(value)
41307 }
41308 }
41309 impl From<SubAccountCoinFuturesPositionRisk>
41310 for QuerySubAccountFuturesPositionRiskResponse {
41311 fn from(value: SubAccountCoinFuturesPositionRisk) -> Self {
41312 Self::CoinFuturesPositionRisk(value)
41313 }
41314 }
41315 ///QuerySubAccountSubAccountApiIpRestrictionResponse
41316 ///
41317 /// <details><summary>JSON schema</summary>
41318 ///
41319 /// ```json
41320 ///{
41321 /// "type": "object",
41322 /// "required": [
41323 /// "apiKey",
41324 /// "ipList",
41325 /// "ipRestrict",
41326 /// "updateTime"
41327 /// ],
41328 /// "properties": {
41329 /// "apiKey": {
41330 /// "examples": [
41331 /// "k5V49ldtn4tszj6W3hystegdfvmGbqDzjmkCtpTvC0G74WhK7yd4rfCTo4lShf"
41332 /// ],
41333 /// "type": "string"
41334 /// },
41335 /// "ipList": {
41336 /// "examples": [
41337 /// [
41338 /// "69.210.67.14",
41339 /// "8.34.21.10"
41340 /// ]
41341 /// ],
41342 /// "type": "array",
41343 /// "items": {
41344 /// "type": "string"
41345 /// }
41346 /// },
41347 /// "ipRestrict": {
41348 /// "examples": [
41349 /// "true"
41350 /// ],
41351 /// "type": "string"
41352 /// },
41353 /// "updateTime": {
41354 /// "examples": [
41355 /// 1636369557189
41356 /// ],
41357 /// "type": "integer",
41358 /// "format": "int64"
41359 /// }
41360 /// }
41361 ///}
41362 /// ```
41363 /// </details>
41364 #[derive(Clone, Debug, Deserialize, Serialize)]
41365 pub struct QuerySubAccountSubAccountApiIpRestrictionResponse {
41366 #[serde(rename = "apiKey")]
41367 pub api_key: String,
41368 #[serde(rename = "ipList")]
41369 pub ip_list: Vec<String>,
41370 #[serde(rename = "ipRestrict")]
41371 pub ip_restrict: String,
41372 #[serde(rename = "updateTime")]
41373 pub update_time: i64,
41374 }
41375 impl From<&QuerySubAccountSubAccountApiIpRestrictionResponse>
41376 for QuerySubAccountSubAccountApiIpRestrictionResponse {
41377 fn from(value: &QuerySubAccountSubAccountApiIpRestrictionResponse) -> Self {
41378 value.clone()
41379 }
41380 }
41381 ///RateLimitOrderResponseItem
41382 ///
41383 /// <details><summary>JSON schema</summary>
41384 ///
41385 /// ```json
41386 ///{
41387 /// "type": "object",
41388 /// "required": [
41389 /// "interval",
41390 /// "intervalNum",
41391 /// "limit",
41392 /// "rateLimitType"
41393 /// ],
41394 /// "properties": {
41395 /// "count": {
41396 /// "type": "integer",
41397 /// "format": "int32"
41398 /// },
41399 /// "interval": {
41400 /// "type": "string"
41401 /// },
41402 /// "intervalNum": {
41403 /// "type": "integer",
41404 /// "format": "int32"
41405 /// },
41406 /// "limit": {
41407 /// "type": "integer",
41408 /// "format": "int32"
41409 /// },
41410 /// "rateLimitType": {
41411 /// "type": "string"
41412 /// }
41413 /// }
41414 ///}
41415 /// ```
41416 /// </details>
41417 #[derive(Clone, Debug, Deserialize, Serialize)]
41418 pub struct RateLimitOrderResponseItem {
41419 #[serde(default, skip_serializing_if = "Option::is_none")]
41420 pub count: Option<i32>,
41421 pub interval: String,
41422 #[serde(rename = "intervalNum")]
41423 pub interval_num: i32,
41424 pub limit: i32,
41425 #[serde(rename = "rateLimitType")]
41426 pub rate_limit_type: String,
41427 }
41428 impl From<&RateLimitOrderResponseItem> for RateLimitOrderResponseItem {
41429 fn from(value: &RateLimitOrderResponseItem) -> Self {
41430 value.clone()
41431 }
41432 }
41433 ///RebateTaxQueryResponse
41434 ///
41435 /// <details><summary>JSON schema</summary>
41436 ///
41437 /// ```json
41438 ///{
41439 /// "type": "object",
41440 /// "required": [
41441 /// "code",
41442 /// "data",
41443 /// "status",
41444 /// "type"
41445 /// ],
41446 /// "properties": {
41447 /// "code": {
41448 /// "examples": [
41449 /// "000000000"
41450 /// ],
41451 /// "type": "string"
41452 /// },
41453 /// "data": {
41454 /// "type": "object",
41455 /// "required": [
41456 /// "data",
41457 /// "page",
41458 /// "totalPageNum",
41459 /// "totalRecords"
41460 /// ],
41461 /// "properties": {
41462 /// "data": {
41463 /// "type": "array",
41464 /// "items": {
41465 /// "type": "object",
41466 /// "required": [
41467 /// "amount",
41468 /// "asset",
41469 /// "type",
41470 /// "updateTime"
41471 /// ],
41472 /// "properties": {
41473 /// "amount": {
41474 /// "examples": [
41475 /// "0.0001126"
41476 /// ],
41477 /// "type": "string"
41478 /// },
41479 /// "asset": {
41480 /// "examples": [
41481 /// "USDT"
41482 /// ],
41483 /// "type": "string"
41484 /// },
41485 /// "type": {
41486 /// "description": "rebate type:1 is commission rebate,2 is referral kickback",
41487 /// "examples": [
41488 /// 1
41489 /// ],
41490 /// "type": "integer",
41491 /// "format": "int32"
41492 /// },
41493 /// "updateTime": {
41494 /// "examples": [
41495 /// 1637651320000
41496 /// ],
41497 /// "type": "integer",
41498 /// "format": "int64"
41499 /// }
41500 /// }
41501 /// }
41502 /// },
41503 /// "page": {
41504 /// "examples": [
41505 /// 1
41506 /// ],
41507 /// "type": "integer",
41508 /// "format": "int32"
41509 /// },
41510 /// "totalPageNum": {
41511 /// "examples": [
41512 /// 1
41513 /// ],
41514 /// "type": "integer",
41515 /// "format": "int32"
41516 /// },
41517 /// "totalRecords": {
41518 /// "examples": [
41519 /// 2
41520 /// ],
41521 /// "type": "integer",
41522 /// "format": "int32"
41523 /// }
41524 /// }
41525 /// },
41526 /// "status": {
41527 /// "examples": [
41528 /// "OK"
41529 /// ],
41530 /// "type": "string"
41531 /// },
41532 /// "type": {
41533 /// "examples": [
41534 /// "GENERAL"
41535 /// ],
41536 /// "type": "string"
41537 /// }
41538 /// }
41539 ///}
41540 /// ```
41541 /// </details>
41542 #[derive(Clone, Debug, Deserialize, Serialize)]
41543 pub struct RebateTaxQueryResponse {
41544 pub code: String,
41545 pub data: RebateTaxQueryResponseData,
41546 pub status: String,
41547 #[serde(rename = "type")]
41548 pub type_: String,
41549 }
41550 impl From<&RebateTaxQueryResponse> for RebateTaxQueryResponse {
41551 fn from(value: &RebateTaxQueryResponse) -> Self {
41552 value.clone()
41553 }
41554 }
41555 ///RebateTaxQueryResponseData
41556 ///
41557 /// <details><summary>JSON schema</summary>
41558 ///
41559 /// ```json
41560 ///{
41561 /// "type": "object",
41562 /// "required": [
41563 /// "data",
41564 /// "page",
41565 /// "totalPageNum",
41566 /// "totalRecords"
41567 /// ],
41568 /// "properties": {
41569 /// "data": {
41570 /// "type": "array",
41571 /// "items": {
41572 /// "type": "object",
41573 /// "required": [
41574 /// "amount",
41575 /// "asset",
41576 /// "type",
41577 /// "updateTime"
41578 /// ],
41579 /// "properties": {
41580 /// "amount": {
41581 /// "examples": [
41582 /// "0.0001126"
41583 /// ],
41584 /// "type": "string"
41585 /// },
41586 /// "asset": {
41587 /// "examples": [
41588 /// "USDT"
41589 /// ],
41590 /// "type": "string"
41591 /// },
41592 /// "type": {
41593 /// "description": "rebate type:1 is commission rebate,2 is referral kickback",
41594 /// "examples": [
41595 /// 1
41596 /// ],
41597 /// "type": "integer",
41598 /// "format": "int32"
41599 /// },
41600 /// "updateTime": {
41601 /// "examples": [
41602 /// 1637651320000
41603 /// ],
41604 /// "type": "integer",
41605 /// "format": "int64"
41606 /// }
41607 /// }
41608 /// }
41609 /// },
41610 /// "page": {
41611 /// "examples": [
41612 /// 1
41613 /// ],
41614 /// "type": "integer",
41615 /// "format": "int32"
41616 /// },
41617 /// "totalPageNum": {
41618 /// "examples": [
41619 /// 1
41620 /// ],
41621 /// "type": "integer",
41622 /// "format": "int32"
41623 /// },
41624 /// "totalRecords": {
41625 /// "examples": [
41626 /// 2
41627 /// ],
41628 /// "type": "integer",
41629 /// "format": "int32"
41630 /// }
41631 /// }
41632 ///}
41633 /// ```
41634 /// </details>
41635 #[derive(Clone, Debug, Deserialize, Serialize)]
41636 pub struct RebateTaxQueryResponseData {
41637 pub data: Vec<RebateTaxQueryResponseDataDataItem>,
41638 pub page: i32,
41639 #[serde(rename = "totalPageNum")]
41640 pub total_page_num: i32,
41641 #[serde(rename = "totalRecords")]
41642 pub total_records: i32,
41643 }
41644 impl From<&RebateTaxQueryResponseData> for RebateTaxQueryResponseData {
41645 fn from(value: &RebateTaxQueryResponseData) -> Self {
41646 value.clone()
41647 }
41648 }
41649 ///RebateTaxQueryResponseDataDataItem
41650 ///
41651 /// <details><summary>JSON schema</summary>
41652 ///
41653 /// ```json
41654 ///{
41655 /// "type": "object",
41656 /// "required": [
41657 /// "amount",
41658 /// "asset",
41659 /// "type",
41660 /// "updateTime"
41661 /// ],
41662 /// "properties": {
41663 /// "amount": {
41664 /// "examples": [
41665 /// "0.0001126"
41666 /// ],
41667 /// "type": "string"
41668 /// },
41669 /// "asset": {
41670 /// "examples": [
41671 /// "USDT"
41672 /// ],
41673 /// "type": "string"
41674 /// },
41675 /// "type": {
41676 /// "description": "rebate type:1 is commission rebate,2 is referral kickback",
41677 /// "examples": [
41678 /// 1
41679 /// ],
41680 /// "type": "integer",
41681 /// "format": "int32"
41682 /// },
41683 /// "updateTime": {
41684 /// "examples": [
41685 /// 1637651320000
41686 /// ],
41687 /// "type": "integer",
41688 /// "format": "int64"
41689 /// }
41690 /// }
41691 ///}
41692 /// ```
41693 /// </details>
41694 #[derive(Clone, Debug, Deserialize, Serialize)]
41695 pub struct RebateTaxQueryResponseDataDataItem {
41696 pub amount: String,
41697 pub asset: String,
41698 ///rebate type:1 is commission rebate,2 is referral kickback
41699 #[serde(rename = "type")]
41700 pub type_: i32,
41701 #[serde(rename = "updateTime")]
41702 pub update_time: i64,
41703 }
41704 impl From<&RebateTaxQueryResponseDataDataItem>
41705 for RebateTaxQueryResponseDataDataItem {
41706 fn from(value: &RebateTaxQueryResponseDataDataItem) -> Self {
41707 value.clone()
41708 }
41709 }
41710 ///RepaymentInfo
41711 ///
41712 /// <details><summary>JSON schema</summary>
41713 ///
41714 /// ```json
41715 ///{
41716 /// "type": "object",
41717 /// "required": [
41718 /// "collateralCoin",
41719 /// "currentLTV",
41720 /// "loanCoin",
41721 /// "remainingCollateral",
41722 /// "remainingInterest",
41723 /// "remainingPrincipal",
41724 /// "repayStatus"
41725 /// ],
41726 /// "properties": {
41727 /// "collateralCoin": {
41728 /// "examples": [
41729 /// "BNB"
41730 /// ],
41731 /// "type": "string"
41732 /// },
41733 /// "currentLTV": {
41734 /// "examples": [
41735 /// "0.25"
41736 /// ],
41737 /// "type": "string"
41738 /// },
41739 /// "loanCoin": {
41740 /// "examples": [
41741 /// "BUSD"
41742 /// ],
41743 /// "type": "string"
41744 /// },
41745 /// "remainingCollateral": {
41746 /// "examples": [
41747 /// "5.253"
41748 /// ],
41749 /// "type": "string"
41750 /// },
41751 /// "remainingInterest": {
41752 /// "examples": [
41753 /// "0"
41754 /// ],
41755 /// "type": "string"
41756 /// },
41757 /// "remainingPrincipal": {
41758 /// "examples": [
41759 /// "100.5"
41760 /// ],
41761 /// "type": "string"
41762 /// },
41763 /// "repayStatus": {
41764 /// "examples": [
41765 /// "Repaying"
41766 /// ],
41767 /// "type": "string"
41768 /// }
41769 /// }
41770 ///}
41771 /// ```
41772 /// </details>
41773 #[derive(Clone, Debug, Deserialize, Serialize)]
41774 pub struct RepaymentInfo {
41775 #[serde(rename = "collateralCoin")]
41776 pub collateral_coin: String,
41777 #[serde(rename = "currentLTV")]
41778 pub current_ltv: String,
41779 #[serde(rename = "loanCoin")]
41780 pub loan_coin: String,
41781 #[serde(rename = "remainingCollateral")]
41782 pub remaining_collateral: String,
41783 #[serde(rename = "remainingInterest")]
41784 pub remaining_interest: String,
41785 #[serde(rename = "remainingPrincipal")]
41786 pub remaining_principal: String,
41787 #[serde(rename = "repayStatus")]
41788 pub repay_status: String,
41789 }
41790 impl From<&RepaymentInfo> for RepaymentInfo {
41791 fn from(value: &RepaymentInfo) -> Self {
41792 value.clone()
41793 }
41794 }
41795 ///RepaymentInfo2
41796 ///
41797 /// <details><summary>JSON schema</summary>
41798 ///
41799 /// ```json
41800 ///{
41801 /// "type": "object",
41802 /// "required": [
41803 /// "collateralCoin",
41804 /// "loanCoin",
41805 /// "repayStatus"
41806 /// ],
41807 /// "properties": {
41808 /// "collateralCoin": {
41809 /// "examples": [
41810 /// "BNB"
41811 /// ],
41812 /// "type": "string"
41813 /// },
41814 /// "loanCoin": {
41815 /// "examples": [
41816 /// "BUSD"
41817 /// ],
41818 /// "type": "string"
41819 /// },
41820 /// "repayStatus": {
41821 /// "examples": [
41822 /// "Repaying"
41823 /// ],
41824 /// "type": "string"
41825 /// }
41826 /// }
41827 ///}
41828 /// ```
41829 /// </details>
41830 #[derive(Clone, Debug, Deserialize, Serialize)]
41831 pub struct RepaymentInfo2 {
41832 #[serde(rename = "collateralCoin")]
41833 pub collateral_coin: String,
41834 #[serde(rename = "loanCoin")]
41835 pub loan_coin: String,
41836 #[serde(rename = "repayStatus")]
41837 pub repay_status: String,
41838 }
41839 impl From<&RepaymentInfo2> for RepaymentInfo2 {
41840 fn from(value: &RepaymentInfo2) -> Self {
41841 value.clone()
41842 }
41843 }
41844 ///ReplaceOrderCancelRestrictions
41845 ///
41846 /// <details><summary>JSON schema</summary>
41847 ///
41848 /// ```json
41849 ///{
41850 /// "examples": [
41851 /// "ONLY_NEW"
41852 /// ],
41853 /// "type": "string",
41854 /// "enum": [
41855 /// "ONLY_NEW",
41856 /// "ONLY_PARTIALLY_FILLED"
41857 /// ]
41858 ///}
41859 /// ```
41860 /// </details>
41861 #[derive(
41862 Clone,
41863 Copy,
41864 Debug,
41865 Deserialize,
41866 Eq,
41867 Hash,
41868 Ord,
41869 PartialEq,
41870 PartialOrd,
41871 Serialize
41872 )]
41873 pub enum ReplaceOrderCancelRestrictions {
41874 #[serde(rename = "ONLY_NEW")]
41875 OnlyNew,
41876 #[serde(rename = "ONLY_PARTIALLY_FILLED")]
41877 OnlyPartiallyFilled,
41878 }
41879 impl From<&ReplaceOrderCancelRestrictions> for ReplaceOrderCancelRestrictions {
41880 fn from(value: &ReplaceOrderCancelRestrictions) -> Self {
41881 value.clone()
41882 }
41883 }
41884 impl ToString for ReplaceOrderCancelRestrictions {
41885 fn to_string(&self) -> String {
41886 match *self {
41887 Self::OnlyNew => "ONLY_NEW".to_string(),
41888 Self::OnlyPartiallyFilled => "ONLY_PARTIALLY_FILLED".to_string(),
41889 }
41890 }
41891 }
41892 impl std::str::FromStr for ReplaceOrderCancelRestrictions {
41893 type Err = self::error::ConversionError;
41894 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
41895 match value {
41896 "ONLY_NEW" => Ok(Self::OnlyNew),
41897 "ONLY_PARTIALLY_FILLED" => Ok(Self::OnlyPartiallyFilled),
41898 _ => Err("invalid value".into()),
41899 }
41900 }
41901 }
41902 impl std::convert::TryFrom<&str> for ReplaceOrderCancelRestrictions {
41903 type Error = self::error::ConversionError;
41904 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
41905 value.parse()
41906 }
41907 }
41908 impl std::convert::TryFrom<&String> for ReplaceOrderCancelRestrictions {
41909 type Error = self::error::ConversionError;
41910 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
41911 value.parse()
41912 }
41913 }
41914 impl std::convert::TryFrom<String> for ReplaceOrderCancelRestrictions {
41915 type Error = self::error::ConversionError;
41916 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
41917 value.parse()
41918 }
41919 }
41920 ///ReplaceOrderNewOrderRespType
41921 ///
41922 /// <details><summary>JSON schema</summary>
41923 ///
41924 /// ```json
41925 ///{
41926 /// "type": "string",
41927 /// "enum": [
41928 /// "ACK",
41929 /// "RESULT",
41930 /// "FULL"
41931 /// ]
41932 ///}
41933 /// ```
41934 /// </details>
41935 #[derive(
41936 Clone,
41937 Copy,
41938 Debug,
41939 Deserialize,
41940 Eq,
41941 Hash,
41942 Ord,
41943 PartialEq,
41944 PartialOrd,
41945 Serialize
41946 )]
41947 pub enum ReplaceOrderNewOrderRespType {
41948 #[serde(rename = "ACK")]
41949 Ack,
41950 #[serde(rename = "RESULT")]
41951 Result,
41952 #[serde(rename = "FULL")]
41953 Full,
41954 }
41955 impl From<&ReplaceOrderNewOrderRespType> for ReplaceOrderNewOrderRespType {
41956 fn from(value: &ReplaceOrderNewOrderRespType) -> Self {
41957 value.clone()
41958 }
41959 }
41960 impl ToString for ReplaceOrderNewOrderRespType {
41961 fn to_string(&self) -> String {
41962 match *self {
41963 Self::Ack => "ACK".to_string(),
41964 Self::Result => "RESULT".to_string(),
41965 Self::Full => "FULL".to_string(),
41966 }
41967 }
41968 }
41969 impl std::str::FromStr for ReplaceOrderNewOrderRespType {
41970 type Err = self::error::ConversionError;
41971 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
41972 match value {
41973 "ACK" => Ok(Self::Ack),
41974 "RESULT" => Ok(Self::Result),
41975 "FULL" => Ok(Self::Full),
41976 _ => Err("invalid value".into()),
41977 }
41978 }
41979 }
41980 impl std::convert::TryFrom<&str> for ReplaceOrderNewOrderRespType {
41981 type Error = self::error::ConversionError;
41982 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
41983 value.parse()
41984 }
41985 }
41986 impl std::convert::TryFrom<&String> for ReplaceOrderNewOrderRespType {
41987 type Error = self::error::ConversionError;
41988 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
41989 value.parse()
41990 }
41991 }
41992 impl std::convert::TryFrom<String> for ReplaceOrderNewOrderRespType {
41993 type Error = self::error::ConversionError;
41994 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
41995 value.parse()
41996 }
41997 }
41998 ///ReplaceOrderResponse
41999 ///
42000 /// <details><summary>JSON schema</summary>
42001 ///
42002 /// ```json
42003 ///{
42004 /// "type": "object",
42005 /// "required": [
42006 /// "cancelResponse",
42007 /// "cancelResult",
42008 /// "newOrderResponse",
42009 /// "newOrderResult"
42010 /// ],
42011 /// "properties": {
42012 /// "cancelResponse": {
42013 /// "type": "object",
42014 /// "required": [
42015 /// "clientOrderId",
42016 /// "cummulativeQuoteQty",
42017 /// "executedQty",
42018 /// "orderId",
42019 /// "orderListId",
42020 /// "origClientOrderId",
42021 /// "origQty",
42022 /// "price",
42023 /// "selfTradePreventionMode",
42024 /// "side",
42025 /// "status",
42026 /// "symbol",
42027 /// "timeInForce",
42028 /// "type"
42029 /// ],
42030 /// "properties": {
42031 /// "clientOrderId": {
42032 /// "examples": [
42033 /// "osxN3JXAtJvKvCqGeMWMVR"
42034 /// ],
42035 /// "type": "string"
42036 /// },
42037 /// "cummulativeQuoteQty": {
42038 /// "examples": [
42039 /// "0.00000000"
42040 /// ],
42041 /// "type": "string"
42042 /// },
42043 /// "executedQty": {
42044 /// "examples": [
42045 /// "0.00000000"
42046 /// ],
42047 /// "type": "string"
42048 /// },
42049 /// "orderId": {
42050 /// "examples": [
42051 /// 9
42052 /// ],
42053 /// "type": "integer",
42054 /// "format": "int64"
42055 /// },
42056 /// "orderListId": {
42057 /// "examples": [
42058 /// -1
42059 /// ],
42060 /// "type": "integer",
42061 /// "format": "int64"
42062 /// },
42063 /// "origClientOrderId": {
42064 /// "examples": [
42065 /// "DnLo3vTAQcjha43lAZhZ0y"
42066 /// ],
42067 /// "type": "string"
42068 /// },
42069 /// "origQty": {
42070 /// "examples": [
42071 /// "0.000100"
42072 /// ],
42073 /// "type": "string"
42074 /// },
42075 /// "price": {
42076 /// "examples": [
42077 /// "0.01000000"
42078 /// ],
42079 /// "type": "string"
42080 /// },
42081 /// "selfTradePreventionMode": {
42082 /// "examples": [
42083 /// "NONE"
42084 /// ],
42085 /// "type": "string"
42086 /// },
42087 /// "side": {
42088 /// "examples": [
42089 /// "SELL"
42090 /// ],
42091 /// "type": "string"
42092 /// },
42093 /// "status": {
42094 /// "examples": [
42095 /// "CANCELED"
42096 /// ],
42097 /// "type": "string"
42098 /// },
42099 /// "symbol": {
42100 /// "examples": [
42101 /// "BTCUSDT"
42102 /// ],
42103 /// "type": "string"
42104 /// },
42105 /// "timeInForce": {
42106 /// "examples": [
42107 /// "GTC"
42108 /// ],
42109 /// "type": "string"
42110 /// },
42111 /// "transactTime": {
42112 /// "examples": [
42113 /// 1507725176595
42114 /// ],
42115 /// "type": "integer",
42116 /// "format": "int64"
42117 /// },
42118 /// "type": {
42119 /// "examples": [
42120 /// "LIMIT"
42121 /// ],
42122 /// "type": "string"
42123 /// }
42124 /// }
42125 /// },
42126 /// "cancelResult": {
42127 /// "examples": [
42128 /// "SUCCESS"
42129 /// ],
42130 /// "type": "string"
42131 /// },
42132 /// "newOrderResponse": {
42133 /// "type": "object",
42134 /// "required": [
42135 /// "clientOrderId",
42136 /// "cummulativeQuoteQty",
42137 /// "executedQty",
42138 /// "fills",
42139 /// "orderId",
42140 /// "orderListId",
42141 /// "origQty",
42142 /// "price",
42143 /// "selfTradePreventionMode",
42144 /// "side",
42145 /// "status",
42146 /// "symbol",
42147 /// "timeInForce",
42148 /// "transactTime",
42149 /// "type",
42150 /// "workingTime"
42151 /// ],
42152 /// "properties": {
42153 /// "clientOrderId": {
42154 /// "examples": [
42155 /// "wOceeeOzNORyLiQfw7jd8S"
42156 /// ],
42157 /// "type": "string"
42158 /// },
42159 /// "cummulativeQuoteQty": {
42160 /// "examples": [
42161 /// "0.00000000"
42162 /// ],
42163 /// "type": "string"
42164 /// },
42165 /// "executedQty": {
42166 /// "examples": [
42167 /// "0.00000000"
42168 /// ],
42169 /// "type": "string"
42170 /// },
42171 /// "fills": {
42172 /// "type": "array",
42173 /// "items": {
42174 /// "type": "string"
42175 /// },
42176 /// "maxItems": 0
42177 /// },
42178 /// "orderId": {
42179 /// "examples": [
42180 /// 10
42181 /// ],
42182 /// "type": "integer",
42183 /// "format": "int64"
42184 /// },
42185 /// "orderListId": {
42186 /// "examples": [
42187 /// -1
42188 /// ],
42189 /// "type": "integer",
42190 /// "format": "int64"
42191 /// },
42192 /// "origQty": {
42193 /// "examples": [
42194 /// "0.040000"
42195 /// ],
42196 /// "type": "string"
42197 /// },
42198 /// "price": {
42199 /// "examples": [
42200 /// "0.02000000"
42201 /// ],
42202 /// "type": "string"
42203 /// },
42204 /// "selfTradePreventionMode": {
42205 /// "examples": [
42206 /// "NONE"
42207 /// ],
42208 /// "type": "string"
42209 /// },
42210 /// "side": {
42211 /// "examples": [
42212 /// "BUY"
42213 /// ],
42214 /// "type": "string"
42215 /// },
42216 /// "status": {
42217 /// "examples": [
42218 /// "NEW"
42219 /// ],
42220 /// "type": "string"
42221 /// },
42222 /// "symbol": {
42223 /// "examples": [
42224 /// "BTCUSDT"
42225 /// ],
42226 /// "type": "string"
42227 /// },
42228 /// "timeInForce": {
42229 /// "examples": [
42230 /// "GTC"
42231 /// ],
42232 /// "type": "string"
42233 /// },
42234 /// "transactTime": {
42235 /// "examples": [
42236 /// 1652928801803
42237 /// ],
42238 /// "type": "integer",
42239 /// "format": "int64"
42240 /// },
42241 /// "type": {
42242 /// "examples": [
42243 /// "LIMIT"
42244 /// ],
42245 /// "type": "string"
42246 /// },
42247 /// "workingTime": {
42248 /// "examples": [
42249 /// 1669277163808
42250 /// ],
42251 /// "type": "integer",
42252 /// "format": "int64"
42253 /// }
42254 /// }
42255 /// },
42256 /// "newOrderResult": {
42257 /// "examples": [
42258 /// "SUCCESS"
42259 /// ],
42260 /// "type": "string"
42261 /// }
42262 /// }
42263 ///}
42264 /// ```
42265 /// </details>
42266 #[derive(Clone, Debug, Deserialize, Serialize)]
42267 pub struct ReplaceOrderResponse {
42268 #[serde(rename = "cancelResponse")]
42269 pub cancel_response: ReplaceOrderResponseCancelResponse,
42270 #[serde(rename = "cancelResult")]
42271 pub cancel_result: String,
42272 #[serde(rename = "newOrderResponse")]
42273 pub new_order_response: ReplaceOrderResponseNewOrderResponse,
42274 #[serde(rename = "newOrderResult")]
42275 pub new_order_result: String,
42276 }
42277 impl From<&ReplaceOrderResponse> for ReplaceOrderResponse {
42278 fn from(value: &ReplaceOrderResponse) -> Self {
42279 value.clone()
42280 }
42281 }
42282 ///ReplaceOrderResponseCancelResponse
42283 ///
42284 /// <details><summary>JSON schema</summary>
42285 ///
42286 /// ```json
42287 ///{
42288 /// "type": "object",
42289 /// "required": [
42290 /// "clientOrderId",
42291 /// "cummulativeQuoteQty",
42292 /// "executedQty",
42293 /// "orderId",
42294 /// "orderListId",
42295 /// "origClientOrderId",
42296 /// "origQty",
42297 /// "price",
42298 /// "selfTradePreventionMode",
42299 /// "side",
42300 /// "status",
42301 /// "symbol",
42302 /// "timeInForce",
42303 /// "type"
42304 /// ],
42305 /// "properties": {
42306 /// "clientOrderId": {
42307 /// "examples": [
42308 /// "osxN3JXAtJvKvCqGeMWMVR"
42309 /// ],
42310 /// "type": "string"
42311 /// },
42312 /// "cummulativeQuoteQty": {
42313 /// "examples": [
42314 /// "0.00000000"
42315 /// ],
42316 /// "type": "string"
42317 /// },
42318 /// "executedQty": {
42319 /// "examples": [
42320 /// "0.00000000"
42321 /// ],
42322 /// "type": "string"
42323 /// },
42324 /// "orderId": {
42325 /// "examples": [
42326 /// 9
42327 /// ],
42328 /// "type": "integer",
42329 /// "format": "int64"
42330 /// },
42331 /// "orderListId": {
42332 /// "examples": [
42333 /// -1
42334 /// ],
42335 /// "type": "integer",
42336 /// "format": "int64"
42337 /// },
42338 /// "origClientOrderId": {
42339 /// "examples": [
42340 /// "DnLo3vTAQcjha43lAZhZ0y"
42341 /// ],
42342 /// "type": "string"
42343 /// },
42344 /// "origQty": {
42345 /// "examples": [
42346 /// "0.000100"
42347 /// ],
42348 /// "type": "string"
42349 /// },
42350 /// "price": {
42351 /// "examples": [
42352 /// "0.01000000"
42353 /// ],
42354 /// "type": "string"
42355 /// },
42356 /// "selfTradePreventionMode": {
42357 /// "examples": [
42358 /// "NONE"
42359 /// ],
42360 /// "type": "string"
42361 /// },
42362 /// "side": {
42363 /// "examples": [
42364 /// "SELL"
42365 /// ],
42366 /// "type": "string"
42367 /// },
42368 /// "status": {
42369 /// "examples": [
42370 /// "CANCELED"
42371 /// ],
42372 /// "type": "string"
42373 /// },
42374 /// "symbol": {
42375 /// "examples": [
42376 /// "BTCUSDT"
42377 /// ],
42378 /// "type": "string"
42379 /// },
42380 /// "timeInForce": {
42381 /// "examples": [
42382 /// "GTC"
42383 /// ],
42384 /// "type": "string"
42385 /// },
42386 /// "transactTime": {
42387 /// "examples": [
42388 /// 1507725176595
42389 /// ],
42390 /// "type": "integer",
42391 /// "format": "int64"
42392 /// },
42393 /// "type": {
42394 /// "examples": [
42395 /// "LIMIT"
42396 /// ],
42397 /// "type": "string"
42398 /// }
42399 /// }
42400 ///}
42401 /// ```
42402 /// </details>
42403 #[derive(Clone, Debug, Deserialize, Serialize)]
42404 pub struct ReplaceOrderResponseCancelResponse {
42405 #[serde(rename = "clientOrderId")]
42406 pub client_order_id: String,
42407 #[serde(rename = "cummulativeQuoteQty")]
42408 pub cummulative_quote_qty: String,
42409 #[serde(rename = "executedQty")]
42410 pub executed_qty: String,
42411 #[serde(rename = "orderId")]
42412 pub order_id: i64,
42413 #[serde(rename = "orderListId")]
42414 pub order_list_id: i64,
42415 #[serde(rename = "origClientOrderId")]
42416 pub orig_client_order_id: String,
42417 #[serde(rename = "origQty")]
42418 pub orig_qty: String,
42419 pub price: String,
42420 #[serde(rename = "selfTradePreventionMode")]
42421 pub self_trade_prevention_mode: String,
42422 pub side: String,
42423 pub status: String,
42424 pub symbol: String,
42425 #[serde(rename = "timeInForce")]
42426 pub time_in_force: String,
42427 #[serde(
42428 rename = "transactTime",
42429 default,
42430 skip_serializing_if = "Option::is_none"
42431 )]
42432 pub transact_time: Option<i64>,
42433 #[serde(rename = "type")]
42434 pub type_: String,
42435 }
42436 impl From<&ReplaceOrderResponseCancelResponse>
42437 for ReplaceOrderResponseCancelResponse {
42438 fn from(value: &ReplaceOrderResponseCancelResponse) -> Self {
42439 value.clone()
42440 }
42441 }
42442 ///ReplaceOrderResponseNewOrderResponse
42443 ///
42444 /// <details><summary>JSON schema</summary>
42445 ///
42446 /// ```json
42447 ///{
42448 /// "type": "object",
42449 /// "required": [
42450 /// "clientOrderId",
42451 /// "cummulativeQuoteQty",
42452 /// "executedQty",
42453 /// "fills",
42454 /// "orderId",
42455 /// "orderListId",
42456 /// "origQty",
42457 /// "price",
42458 /// "selfTradePreventionMode",
42459 /// "side",
42460 /// "status",
42461 /// "symbol",
42462 /// "timeInForce",
42463 /// "transactTime",
42464 /// "type",
42465 /// "workingTime"
42466 /// ],
42467 /// "properties": {
42468 /// "clientOrderId": {
42469 /// "examples": [
42470 /// "wOceeeOzNORyLiQfw7jd8S"
42471 /// ],
42472 /// "type": "string"
42473 /// },
42474 /// "cummulativeQuoteQty": {
42475 /// "examples": [
42476 /// "0.00000000"
42477 /// ],
42478 /// "type": "string"
42479 /// },
42480 /// "executedQty": {
42481 /// "examples": [
42482 /// "0.00000000"
42483 /// ],
42484 /// "type": "string"
42485 /// },
42486 /// "fills": {
42487 /// "type": "array",
42488 /// "items": {
42489 /// "type": "string"
42490 /// },
42491 /// "maxItems": 0
42492 /// },
42493 /// "orderId": {
42494 /// "examples": [
42495 /// 10
42496 /// ],
42497 /// "type": "integer",
42498 /// "format": "int64"
42499 /// },
42500 /// "orderListId": {
42501 /// "examples": [
42502 /// -1
42503 /// ],
42504 /// "type": "integer",
42505 /// "format": "int64"
42506 /// },
42507 /// "origQty": {
42508 /// "examples": [
42509 /// "0.040000"
42510 /// ],
42511 /// "type": "string"
42512 /// },
42513 /// "price": {
42514 /// "examples": [
42515 /// "0.02000000"
42516 /// ],
42517 /// "type": "string"
42518 /// },
42519 /// "selfTradePreventionMode": {
42520 /// "examples": [
42521 /// "NONE"
42522 /// ],
42523 /// "type": "string"
42524 /// },
42525 /// "side": {
42526 /// "examples": [
42527 /// "BUY"
42528 /// ],
42529 /// "type": "string"
42530 /// },
42531 /// "status": {
42532 /// "examples": [
42533 /// "NEW"
42534 /// ],
42535 /// "type": "string"
42536 /// },
42537 /// "symbol": {
42538 /// "examples": [
42539 /// "BTCUSDT"
42540 /// ],
42541 /// "type": "string"
42542 /// },
42543 /// "timeInForce": {
42544 /// "examples": [
42545 /// "GTC"
42546 /// ],
42547 /// "type": "string"
42548 /// },
42549 /// "transactTime": {
42550 /// "examples": [
42551 /// 1652928801803
42552 /// ],
42553 /// "type": "integer",
42554 /// "format": "int64"
42555 /// },
42556 /// "type": {
42557 /// "examples": [
42558 /// "LIMIT"
42559 /// ],
42560 /// "type": "string"
42561 /// },
42562 /// "workingTime": {
42563 /// "examples": [
42564 /// 1669277163808
42565 /// ],
42566 /// "type": "integer",
42567 /// "format": "int64"
42568 /// }
42569 /// }
42570 ///}
42571 /// ```
42572 /// </details>
42573 #[derive(Clone, Debug, Deserialize, Serialize)]
42574 pub struct ReplaceOrderResponseNewOrderResponse {
42575 #[serde(rename = "clientOrderId")]
42576 pub client_order_id: String,
42577 #[serde(rename = "cummulativeQuoteQty")]
42578 pub cummulative_quote_qty: String,
42579 #[serde(rename = "executedQty")]
42580 pub executed_qty: String,
42581 pub fills: Vec<String>,
42582 #[serde(rename = "orderId")]
42583 pub order_id: i64,
42584 #[serde(rename = "orderListId")]
42585 pub order_list_id: i64,
42586 #[serde(rename = "origQty")]
42587 pub orig_qty: String,
42588 pub price: String,
42589 #[serde(rename = "selfTradePreventionMode")]
42590 pub self_trade_prevention_mode: String,
42591 pub side: String,
42592 pub status: String,
42593 pub symbol: String,
42594 #[serde(rename = "timeInForce")]
42595 pub time_in_force: String,
42596 #[serde(rename = "transactTime")]
42597 pub transact_time: i64,
42598 #[serde(rename = "type")]
42599 pub type_: String,
42600 #[serde(rename = "workingTime")]
42601 pub working_time: i64,
42602 }
42603 impl From<&ReplaceOrderResponseNewOrderResponse>
42604 for ReplaceOrderResponseNewOrderResponse {
42605 fn from(value: &ReplaceOrderResponseNewOrderResponse) -> Self {
42606 value.clone()
42607 }
42608 }
42609 ///ReplaceOrderSelfTradePreventionMode
42610 ///
42611 /// <details><summary>JSON schema</summary>
42612 ///
42613 /// ```json
42614 ///{
42615 /// "examples": [
42616 /// "EXPIRE_TAKER"
42617 /// ],
42618 /// "type": "string",
42619 /// "enum": [
42620 /// "EXPIRE_TAKER",
42621 /// "EXPIRE_MAKER",
42622 /// "EXPIRE_BOTH",
42623 /// "NONE"
42624 /// ]
42625 ///}
42626 /// ```
42627 /// </details>
42628 #[derive(
42629 Clone,
42630 Copy,
42631 Debug,
42632 Deserialize,
42633 Eq,
42634 Hash,
42635 Ord,
42636 PartialEq,
42637 PartialOrd,
42638 Serialize
42639 )]
42640 pub enum ReplaceOrderSelfTradePreventionMode {
42641 #[serde(rename = "EXPIRE_TAKER")]
42642 ExpireTaker,
42643 #[serde(rename = "EXPIRE_MAKER")]
42644 ExpireMaker,
42645 #[serde(rename = "EXPIRE_BOTH")]
42646 ExpireBoth,
42647 #[serde(rename = "NONE")]
42648 None,
42649 }
42650 impl From<&ReplaceOrderSelfTradePreventionMode>
42651 for ReplaceOrderSelfTradePreventionMode {
42652 fn from(value: &ReplaceOrderSelfTradePreventionMode) -> Self {
42653 value.clone()
42654 }
42655 }
42656 impl ToString for ReplaceOrderSelfTradePreventionMode {
42657 fn to_string(&self) -> String {
42658 match *self {
42659 Self::ExpireTaker => "EXPIRE_TAKER".to_string(),
42660 Self::ExpireMaker => "EXPIRE_MAKER".to_string(),
42661 Self::ExpireBoth => "EXPIRE_BOTH".to_string(),
42662 Self::None => "NONE".to_string(),
42663 }
42664 }
42665 }
42666 impl std::str::FromStr for ReplaceOrderSelfTradePreventionMode {
42667 type Err = self::error::ConversionError;
42668 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
42669 match value {
42670 "EXPIRE_TAKER" => Ok(Self::ExpireTaker),
42671 "EXPIRE_MAKER" => Ok(Self::ExpireMaker),
42672 "EXPIRE_BOTH" => Ok(Self::ExpireBoth),
42673 "NONE" => Ok(Self::None),
42674 _ => Err("invalid value".into()),
42675 }
42676 }
42677 }
42678 impl std::convert::TryFrom<&str> for ReplaceOrderSelfTradePreventionMode {
42679 type Error = self::error::ConversionError;
42680 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
42681 value.parse()
42682 }
42683 }
42684 impl std::convert::TryFrom<&String> for ReplaceOrderSelfTradePreventionMode {
42685 type Error = self::error::ConversionError;
42686 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
42687 value.parse()
42688 }
42689 }
42690 impl std::convert::TryFrom<String> for ReplaceOrderSelfTradePreventionMode {
42691 type Error = self::error::ConversionError;
42692 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
42693 value.parse()
42694 }
42695 }
42696 ///ReplaceOrderSide
42697 ///
42698 /// <details><summary>JSON schema</summary>
42699 ///
42700 /// ```json
42701 ///{
42702 /// "examples": [
42703 /// "SELL"
42704 /// ],
42705 /// "type": "string",
42706 /// "enum": [
42707 /// "SELL",
42708 /// "BUY"
42709 /// ]
42710 ///}
42711 /// ```
42712 /// </details>
42713 #[derive(
42714 Clone,
42715 Copy,
42716 Debug,
42717 Deserialize,
42718 Eq,
42719 Hash,
42720 Ord,
42721 PartialEq,
42722 PartialOrd,
42723 Serialize
42724 )]
42725 pub enum ReplaceOrderSide {
42726 #[serde(rename = "SELL")]
42727 Sell,
42728 #[serde(rename = "BUY")]
42729 Buy,
42730 }
42731 impl From<&ReplaceOrderSide> for ReplaceOrderSide {
42732 fn from(value: &ReplaceOrderSide) -> Self {
42733 value.clone()
42734 }
42735 }
42736 impl ToString for ReplaceOrderSide {
42737 fn to_string(&self) -> String {
42738 match *self {
42739 Self::Sell => "SELL".to_string(),
42740 Self::Buy => "BUY".to_string(),
42741 }
42742 }
42743 }
42744 impl std::str::FromStr for ReplaceOrderSide {
42745 type Err = self::error::ConversionError;
42746 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
42747 match value {
42748 "SELL" => Ok(Self::Sell),
42749 "BUY" => Ok(Self::Buy),
42750 _ => Err("invalid value".into()),
42751 }
42752 }
42753 }
42754 impl std::convert::TryFrom<&str> for ReplaceOrderSide {
42755 type Error = self::error::ConversionError;
42756 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
42757 value.parse()
42758 }
42759 }
42760 impl std::convert::TryFrom<&String> for ReplaceOrderSide {
42761 type Error = self::error::ConversionError;
42762 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
42763 value.parse()
42764 }
42765 }
42766 impl std::convert::TryFrom<String> for ReplaceOrderSide {
42767 type Error = self::error::ConversionError;
42768 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
42769 value.parse()
42770 }
42771 }
42772 ///ReplaceOrderTimeInForce
42773 ///
42774 /// <details><summary>JSON schema</summary>
42775 ///
42776 /// ```json
42777 ///{
42778 /// "examples": [
42779 /// "GTC"
42780 /// ],
42781 /// "type": "string",
42782 /// "enum": [
42783 /// "GTC",
42784 /// "IOC",
42785 /// "FOK"
42786 /// ]
42787 ///}
42788 /// ```
42789 /// </details>
42790 #[derive(
42791 Clone,
42792 Copy,
42793 Debug,
42794 Deserialize,
42795 Eq,
42796 Hash,
42797 Ord,
42798 PartialEq,
42799 PartialOrd,
42800 Serialize
42801 )]
42802 pub enum ReplaceOrderTimeInForce {
42803 #[serde(rename = "GTC")]
42804 Gtc,
42805 #[serde(rename = "IOC")]
42806 Ioc,
42807 #[serde(rename = "FOK")]
42808 Fok,
42809 }
42810 impl From<&ReplaceOrderTimeInForce> for ReplaceOrderTimeInForce {
42811 fn from(value: &ReplaceOrderTimeInForce) -> Self {
42812 value.clone()
42813 }
42814 }
42815 impl ToString for ReplaceOrderTimeInForce {
42816 fn to_string(&self) -> String {
42817 match *self {
42818 Self::Gtc => "GTC".to_string(),
42819 Self::Ioc => "IOC".to_string(),
42820 Self::Fok => "FOK".to_string(),
42821 }
42822 }
42823 }
42824 impl std::str::FromStr for ReplaceOrderTimeInForce {
42825 type Err = self::error::ConversionError;
42826 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
42827 match value {
42828 "GTC" => Ok(Self::Gtc),
42829 "IOC" => Ok(Self::Ioc),
42830 "FOK" => Ok(Self::Fok),
42831 _ => Err("invalid value".into()),
42832 }
42833 }
42834 }
42835 impl std::convert::TryFrom<&str> for ReplaceOrderTimeInForce {
42836 type Error = self::error::ConversionError;
42837 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
42838 value.parse()
42839 }
42840 }
42841 impl std::convert::TryFrom<&String> for ReplaceOrderTimeInForce {
42842 type Error = self::error::ConversionError;
42843 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
42844 value.parse()
42845 }
42846 }
42847 impl std::convert::TryFrom<String> for ReplaceOrderTimeInForce {
42848 type Error = self::error::ConversionError;
42849 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
42850 value.parse()
42851 }
42852 }
42853 ///ReplaceOrderType
42854 ///
42855 /// <details><summary>JSON schema</summary>
42856 ///
42857 /// ```json
42858 ///{
42859 /// "examples": [
42860 /// "LIMIT"
42861 /// ],
42862 /// "type": "string",
42863 /// "enum": [
42864 /// "LIMIT",
42865 /// "MARKET",
42866 /// "STOP_LOSS",
42867 /// "STOP_LOSS_LIMIT",
42868 /// "TAKE_PROFIT",
42869 /// "TAKE_PROFIT_LIMIT",
42870 /// "LIMIT_MAKER"
42871 /// ]
42872 ///}
42873 /// ```
42874 /// </details>
42875 #[derive(
42876 Clone,
42877 Copy,
42878 Debug,
42879 Deserialize,
42880 Eq,
42881 Hash,
42882 Ord,
42883 PartialEq,
42884 PartialOrd,
42885 Serialize
42886 )]
42887 pub enum ReplaceOrderType {
42888 #[serde(rename = "LIMIT")]
42889 Limit,
42890 #[serde(rename = "MARKET")]
42891 Market,
42892 #[serde(rename = "STOP_LOSS")]
42893 StopLoss,
42894 #[serde(rename = "STOP_LOSS_LIMIT")]
42895 StopLossLimit,
42896 #[serde(rename = "TAKE_PROFIT")]
42897 TakeProfit,
42898 #[serde(rename = "TAKE_PROFIT_LIMIT")]
42899 TakeProfitLimit,
42900 #[serde(rename = "LIMIT_MAKER")]
42901 LimitMaker,
42902 }
42903 impl From<&ReplaceOrderType> for ReplaceOrderType {
42904 fn from(value: &ReplaceOrderType) -> Self {
42905 value.clone()
42906 }
42907 }
42908 impl ToString for ReplaceOrderType {
42909 fn to_string(&self) -> String {
42910 match *self {
42911 Self::Limit => "LIMIT".to_string(),
42912 Self::Market => "MARKET".to_string(),
42913 Self::StopLoss => "STOP_LOSS".to_string(),
42914 Self::StopLossLimit => "STOP_LOSS_LIMIT".to_string(),
42915 Self::TakeProfit => "TAKE_PROFIT".to_string(),
42916 Self::TakeProfitLimit => "TAKE_PROFIT_LIMIT".to_string(),
42917 Self::LimitMaker => "LIMIT_MAKER".to_string(),
42918 }
42919 }
42920 }
42921 impl std::str::FromStr for ReplaceOrderType {
42922 type Err = self::error::ConversionError;
42923 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
42924 match value {
42925 "LIMIT" => Ok(Self::Limit),
42926 "MARKET" => Ok(Self::Market),
42927 "STOP_LOSS" => Ok(Self::StopLoss),
42928 "STOP_LOSS_LIMIT" => Ok(Self::StopLossLimit),
42929 "TAKE_PROFIT" => Ok(Self::TakeProfit),
42930 "TAKE_PROFIT_LIMIT" => Ok(Self::TakeProfitLimit),
42931 "LIMIT_MAKER" => Ok(Self::LimitMaker),
42932 _ => Err("invalid value".into()),
42933 }
42934 }
42935 }
42936 impl std::convert::TryFrom<&str> for ReplaceOrderType {
42937 type Error = self::error::ConversionError;
42938 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
42939 value.parse()
42940 }
42941 }
42942 impl std::convert::TryFrom<&String> for ReplaceOrderType {
42943 type Error = self::error::ConversionError;
42944 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
42945 value.parse()
42946 }
42947 }
42948 impl std::convert::TryFrom<String> for ReplaceOrderType {
42949 type Error = self::error::ConversionError;
42950 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
42951 value.parse()
42952 }
42953 }
42954 ///SendMarginQueryOcoIsIsolated
42955 ///
42956 /// <details><summary>JSON schema</summary>
42957 ///
42958 /// ```json
42959 ///{
42960 /// "type": "string",
42961 /// "enum": [
42962 /// "TRUE",
42963 /// "FALSE"
42964 /// ]
42965 ///}
42966 /// ```
42967 /// </details>
42968 #[derive(
42969 Clone,
42970 Copy,
42971 Debug,
42972 Deserialize,
42973 Eq,
42974 Hash,
42975 Ord,
42976 PartialEq,
42977 PartialOrd,
42978 Serialize
42979 )]
42980 pub enum SendMarginQueryOcoIsIsolated {
42981 #[serde(rename = "TRUE")]
42982 True,
42983 #[serde(rename = "FALSE")]
42984 False,
42985 }
42986 impl From<&SendMarginQueryOcoIsIsolated> for SendMarginQueryOcoIsIsolated {
42987 fn from(value: &SendMarginQueryOcoIsIsolated) -> Self {
42988 value.clone()
42989 }
42990 }
42991 impl ToString for SendMarginQueryOcoIsIsolated {
42992 fn to_string(&self) -> String {
42993 match *self {
42994 Self::True => "TRUE".to_string(),
42995 Self::False => "FALSE".to_string(),
42996 }
42997 }
42998 }
42999 impl std::str::FromStr for SendMarginQueryOcoIsIsolated {
43000 type Err = self::error::ConversionError;
43001 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
43002 match value {
43003 "TRUE" => Ok(Self::True),
43004 "FALSE" => Ok(Self::False),
43005 _ => Err("invalid value".into()),
43006 }
43007 }
43008 }
43009 impl std::convert::TryFrom<&str> for SendMarginQueryOcoIsIsolated {
43010 type Error = self::error::ConversionError;
43011 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
43012 value.parse()
43013 }
43014 }
43015 impl std::convert::TryFrom<&String> for SendMarginQueryOcoIsIsolated {
43016 type Error = self::error::ConversionError;
43017 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
43018 value.parse()
43019 }
43020 }
43021 impl std::convert::TryFrom<String> for SendMarginQueryOcoIsIsolated {
43022 type Error = self::error::ConversionError;
43023 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
43024 value.parse()
43025 }
43026 }
43027 ///SendMarginQueryOcoNewOrderRespType
43028 ///
43029 /// <details><summary>JSON schema</summary>
43030 ///
43031 /// ```json
43032 ///{
43033 /// "type": "string",
43034 /// "enum": [
43035 /// "ACK",
43036 /// "RESULT",
43037 /// "FULL"
43038 /// ]
43039 ///}
43040 /// ```
43041 /// </details>
43042 #[derive(
43043 Clone,
43044 Copy,
43045 Debug,
43046 Deserialize,
43047 Eq,
43048 Hash,
43049 Ord,
43050 PartialEq,
43051 PartialOrd,
43052 Serialize
43053 )]
43054 pub enum SendMarginQueryOcoNewOrderRespType {
43055 #[serde(rename = "ACK")]
43056 Ack,
43057 #[serde(rename = "RESULT")]
43058 Result,
43059 #[serde(rename = "FULL")]
43060 Full,
43061 }
43062 impl From<&SendMarginQueryOcoNewOrderRespType>
43063 for SendMarginQueryOcoNewOrderRespType {
43064 fn from(value: &SendMarginQueryOcoNewOrderRespType) -> Self {
43065 value.clone()
43066 }
43067 }
43068 impl ToString for SendMarginQueryOcoNewOrderRespType {
43069 fn to_string(&self) -> String {
43070 match *self {
43071 Self::Ack => "ACK".to_string(),
43072 Self::Result => "RESULT".to_string(),
43073 Self::Full => "FULL".to_string(),
43074 }
43075 }
43076 }
43077 impl std::str::FromStr for SendMarginQueryOcoNewOrderRespType {
43078 type Err = self::error::ConversionError;
43079 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
43080 match value {
43081 "ACK" => Ok(Self::Ack),
43082 "RESULT" => Ok(Self::Result),
43083 "FULL" => Ok(Self::Full),
43084 _ => Err("invalid value".into()),
43085 }
43086 }
43087 }
43088 impl std::convert::TryFrom<&str> for SendMarginQueryOcoNewOrderRespType {
43089 type Error = self::error::ConversionError;
43090 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
43091 value.parse()
43092 }
43093 }
43094 impl std::convert::TryFrom<&String> for SendMarginQueryOcoNewOrderRespType {
43095 type Error = self::error::ConversionError;
43096 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
43097 value.parse()
43098 }
43099 }
43100 impl std::convert::TryFrom<String> for SendMarginQueryOcoNewOrderRespType {
43101 type Error = self::error::ConversionError;
43102 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
43103 value.parse()
43104 }
43105 }
43106 ///SendMarginQueryOcoResponse
43107 ///
43108 /// <details><summary>JSON schema</summary>
43109 ///
43110 /// ```json
43111 ///{
43112 /// "type": "object",
43113 /// "required": [
43114 /// "contingencyType",
43115 /// "isIsolated",
43116 /// "listClientOrderId",
43117 /// "listOrderStatus",
43118 /// "listStatusType",
43119 /// "marginBuyBorrowAmount",
43120 /// "marginBuyBorrowAsset",
43121 /// "orderListId",
43122 /// "orderReports",
43123 /// "orders",
43124 /// "symbol",
43125 /// "transactionTime"
43126 /// ],
43127 /// "properties": {
43128 /// "contingencyType": {
43129 /// "examples": [
43130 /// "OCO"
43131 /// ],
43132 /// "type": "string"
43133 /// },
43134 /// "isIsolated": {
43135 /// "examples": [
43136 /// false
43137 /// ],
43138 /// "type": "boolean"
43139 /// },
43140 /// "listClientOrderId": {
43141 /// "examples": [
43142 /// "JYVpp3F0f5CAG15DhtrqLp"
43143 /// ],
43144 /// "type": "string"
43145 /// },
43146 /// "listOrderStatus": {
43147 /// "examples": [
43148 /// "EXECUTING"
43149 /// ],
43150 /// "type": "string"
43151 /// },
43152 /// "listStatusType": {
43153 /// "examples": [
43154 /// "EXEC_STARTED"
43155 /// ],
43156 /// "type": "string"
43157 /// },
43158 /// "marginBuyBorrowAmount": {
43159 /// "description": "will not return if no margin trade happens",
43160 /// "examples": [
43161 /// "5"
43162 /// ],
43163 /// "type": "string"
43164 /// },
43165 /// "marginBuyBorrowAsset": {
43166 /// "description": "will not return if no margin trade happens",
43167 /// "examples": [
43168 /// "BTC"
43169 /// ],
43170 /// "type": "string"
43171 /// },
43172 /// "orderListId": {
43173 /// "examples": [
43174 /// 0
43175 /// ],
43176 /// "type": "integer",
43177 /// "format": "int64"
43178 /// },
43179 /// "orderReports": {
43180 /// "examples": [
43181 /// [
43182 /// {
43183 /// "clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos",
43184 /// "cummulativeQuoteQty": "0.000000",
43185 /// "executedQty": "0.000000",
43186 /// "orderId": 2,
43187 /// "orderListId": 0,
43188 /// "origQty": "0.624363",
43189 /// "price": "0.000000",
43190 /// "side": "BUY",
43191 /// "status": "NEW",
43192 /// "stopPrice": "0.960664",
43193 /// "symbol": "LTCBTC",
43194 /// "timeInForce": "GTC",
43195 /// "transactTime": 1563417480525,
43196 /// "type": "STOP_LOSS"
43197 /// },
43198 /// {
43199 /// "clientOrderId": "xTXKaGYd4bluPVp78IVRvl",
43200 /// "cummulativeQuoteQty": "0.000000",
43201 /// "executedQty": "0.000000",
43202 /// "orderId": 3,
43203 /// "orderListId": 0,
43204 /// "origQty": "0.624363",
43205 /// "price": "0.036435",
43206 /// "side": "BUY",
43207 /// "status": "NEW",
43208 /// "symbol": "LTCBTC",
43209 /// "timeInForce": "GTC",
43210 /// "transactTime": 1563417480525,
43211 /// "type": "LIMIT_MAKER"
43212 /// }
43213 /// ]
43214 /// ],
43215 /// "type": "array",
43216 /// "items": {
43217 /// "type": "object",
43218 /// "required": [
43219 /// "clientOrderId",
43220 /// "cummulativeQuoteQty",
43221 /// "executedQty",
43222 /// "orderId",
43223 /// "orderListId",
43224 /// "origQty",
43225 /// "price",
43226 /// "side",
43227 /// "status",
43228 /// "stopPrice",
43229 /// "symbol",
43230 /// "timeInForce",
43231 /// "transactTime",
43232 /// "type"
43233 /// ],
43234 /// "properties": {
43235 /// "clientOrderId": {
43236 /// "type": "string"
43237 /// },
43238 /// "cummulativeQuoteQty": {
43239 /// "type": "string"
43240 /// },
43241 /// "executedQty": {
43242 /// "type": "string"
43243 /// },
43244 /// "orderId": {
43245 /// "type": "integer",
43246 /// "format": "int64"
43247 /// },
43248 /// "orderListId": {
43249 /// "type": "integer",
43250 /// "format": "int64"
43251 /// },
43252 /// "origQty": {
43253 /// "type": "string"
43254 /// },
43255 /// "price": {
43256 /// "type": "string"
43257 /// },
43258 /// "side": {
43259 /// "type": "string"
43260 /// },
43261 /// "status": {
43262 /// "type": "string"
43263 /// },
43264 /// "stopPrice": {
43265 /// "type": "string"
43266 /// },
43267 /// "symbol": {
43268 /// "type": "string"
43269 /// },
43270 /// "timeInForce": {
43271 /// "type": "string"
43272 /// },
43273 /// "transactTime": {
43274 /// "type": "integer",
43275 /// "format": "int64"
43276 /// },
43277 /// "type": {
43278 /// "type": "string"
43279 /// }
43280 /// }
43281 /// }
43282 /// },
43283 /// "orders": {
43284 /// "examples": [
43285 /// [
43286 /// {
43287 /// "clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos",
43288 /// "orderId": 2,
43289 /// "symbol": "LTCBTC"
43290 /// },
43291 /// {
43292 /// "clientOrderId": "xTXKaGYd4bluPVp78IVRvl",
43293 /// "orderId": 3,
43294 /// "symbol": "LTCBTC"
43295 /// }
43296 /// ]
43297 /// ],
43298 /// "type": "array",
43299 /// "items": {
43300 /// "type": "object",
43301 /// "required": [
43302 /// "clientOrderId",
43303 /// "orderId",
43304 /// "symbol"
43305 /// ],
43306 /// "properties": {
43307 /// "clientOrderId": {
43308 /// "type": "string"
43309 /// },
43310 /// "orderId": {
43311 /// "type": "integer",
43312 /// "format": "int64"
43313 /// },
43314 /// "symbol": {
43315 /// "type": "string"
43316 /// }
43317 /// }
43318 /// }
43319 /// },
43320 /// "symbol": {
43321 /// "examples": [
43322 /// "LTCBTC"
43323 /// ],
43324 /// "type": "string"
43325 /// },
43326 /// "transactionTime": {
43327 /// "examples": [
43328 /// 1563417480525
43329 /// ],
43330 /// "type": "integer",
43331 /// "format": "int64"
43332 /// }
43333 /// }
43334 ///}
43335 /// ```
43336 /// </details>
43337 #[derive(Clone, Debug, Deserialize, Serialize)]
43338 pub struct SendMarginQueryOcoResponse {
43339 #[serde(rename = "contingencyType")]
43340 pub contingency_type: String,
43341 #[serde(rename = "isIsolated")]
43342 pub is_isolated: bool,
43343 #[serde(rename = "listClientOrderId")]
43344 pub list_client_order_id: String,
43345 #[serde(rename = "listOrderStatus")]
43346 pub list_order_status: String,
43347 #[serde(rename = "listStatusType")]
43348 pub list_status_type: String,
43349 ///will not return if no margin trade happens
43350 #[serde(rename = "marginBuyBorrowAmount")]
43351 pub margin_buy_borrow_amount: String,
43352 ///will not return if no margin trade happens
43353 #[serde(rename = "marginBuyBorrowAsset")]
43354 pub margin_buy_borrow_asset: String,
43355 #[serde(rename = "orderListId")]
43356 pub order_list_id: i64,
43357 #[serde(rename = "orderReports")]
43358 pub order_reports: Vec<SendMarginQueryOcoResponseOrderReportsItem>,
43359 pub orders: Vec<SendMarginQueryOcoResponseOrdersItem>,
43360 pub symbol: String,
43361 #[serde(rename = "transactionTime")]
43362 pub transaction_time: i64,
43363 }
43364 impl From<&SendMarginQueryOcoResponse> for SendMarginQueryOcoResponse {
43365 fn from(value: &SendMarginQueryOcoResponse) -> Self {
43366 value.clone()
43367 }
43368 }
43369 ///SendMarginQueryOcoResponseOrderReportsItem
43370 ///
43371 /// <details><summary>JSON schema</summary>
43372 ///
43373 /// ```json
43374 ///{
43375 /// "type": "object",
43376 /// "required": [
43377 /// "clientOrderId",
43378 /// "cummulativeQuoteQty",
43379 /// "executedQty",
43380 /// "orderId",
43381 /// "orderListId",
43382 /// "origQty",
43383 /// "price",
43384 /// "side",
43385 /// "status",
43386 /// "stopPrice",
43387 /// "symbol",
43388 /// "timeInForce",
43389 /// "transactTime",
43390 /// "type"
43391 /// ],
43392 /// "properties": {
43393 /// "clientOrderId": {
43394 /// "type": "string"
43395 /// },
43396 /// "cummulativeQuoteQty": {
43397 /// "type": "string"
43398 /// },
43399 /// "executedQty": {
43400 /// "type": "string"
43401 /// },
43402 /// "orderId": {
43403 /// "type": "integer",
43404 /// "format": "int64"
43405 /// },
43406 /// "orderListId": {
43407 /// "type": "integer",
43408 /// "format": "int64"
43409 /// },
43410 /// "origQty": {
43411 /// "type": "string"
43412 /// },
43413 /// "price": {
43414 /// "type": "string"
43415 /// },
43416 /// "side": {
43417 /// "type": "string"
43418 /// },
43419 /// "status": {
43420 /// "type": "string"
43421 /// },
43422 /// "stopPrice": {
43423 /// "type": "string"
43424 /// },
43425 /// "symbol": {
43426 /// "type": "string"
43427 /// },
43428 /// "timeInForce": {
43429 /// "type": "string"
43430 /// },
43431 /// "transactTime": {
43432 /// "type": "integer",
43433 /// "format": "int64"
43434 /// },
43435 /// "type": {
43436 /// "type": "string"
43437 /// }
43438 /// }
43439 ///}
43440 /// ```
43441 /// </details>
43442 #[derive(Clone, Debug, Deserialize, Serialize)]
43443 pub struct SendMarginQueryOcoResponseOrderReportsItem {
43444 #[serde(rename = "clientOrderId")]
43445 pub client_order_id: String,
43446 #[serde(rename = "cummulativeQuoteQty")]
43447 pub cummulative_quote_qty: String,
43448 #[serde(rename = "executedQty")]
43449 pub executed_qty: String,
43450 #[serde(rename = "orderId")]
43451 pub order_id: i64,
43452 #[serde(rename = "orderListId")]
43453 pub order_list_id: i64,
43454 #[serde(rename = "origQty")]
43455 pub orig_qty: String,
43456 pub price: String,
43457 pub side: String,
43458 pub status: String,
43459 #[serde(rename = "stopPrice")]
43460 pub stop_price: String,
43461 pub symbol: String,
43462 #[serde(rename = "timeInForce")]
43463 pub time_in_force: String,
43464 #[serde(rename = "transactTime")]
43465 pub transact_time: i64,
43466 #[serde(rename = "type")]
43467 pub type_: String,
43468 }
43469 impl From<&SendMarginQueryOcoResponseOrderReportsItem>
43470 for SendMarginQueryOcoResponseOrderReportsItem {
43471 fn from(value: &SendMarginQueryOcoResponseOrderReportsItem) -> Self {
43472 value.clone()
43473 }
43474 }
43475 ///SendMarginQueryOcoResponseOrdersItem
43476 ///
43477 /// <details><summary>JSON schema</summary>
43478 ///
43479 /// ```json
43480 ///{
43481 /// "type": "object",
43482 /// "required": [
43483 /// "clientOrderId",
43484 /// "orderId",
43485 /// "symbol"
43486 /// ],
43487 /// "properties": {
43488 /// "clientOrderId": {
43489 /// "type": "string"
43490 /// },
43491 /// "orderId": {
43492 /// "type": "integer",
43493 /// "format": "int64"
43494 /// },
43495 /// "symbol": {
43496 /// "type": "string"
43497 /// }
43498 /// }
43499 ///}
43500 /// ```
43501 /// </details>
43502 #[derive(Clone, Debug, Deserialize, Serialize)]
43503 pub struct SendMarginQueryOcoResponseOrdersItem {
43504 #[serde(rename = "clientOrderId")]
43505 pub client_order_id: String,
43506 #[serde(rename = "orderId")]
43507 pub order_id: i64,
43508 pub symbol: String,
43509 }
43510 impl From<&SendMarginQueryOcoResponseOrdersItem>
43511 for SendMarginQueryOcoResponseOrdersItem {
43512 fn from(value: &SendMarginQueryOcoResponseOrdersItem) -> Self {
43513 value.clone()
43514 }
43515 }
43516 ///SendMarginQueryOcoSelfTradePreventionMode
43517 ///
43518 /// <details><summary>JSON schema</summary>
43519 ///
43520 /// ```json
43521 ///{
43522 /// "examples": [
43523 /// "EXPIRE_TAKER"
43524 /// ],
43525 /// "type": "string",
43526 /// "enum": [
43527 /// "EXPIRE_TAKER",
43528 /// "EXPIRE_MAKER",
43529 /// "EXPIRE_BOTH",
43530 /// "NONE"
43531 /// ]
43532 ///}
43533 /// ```
43534 /// </details>
43535 #[derive(
43536 Clone,
43537 Copy,
43538 Debug,
43539 Deserialize,
43540 Eq,
43541 Hash,
43542 Ord,
43543 PartialEq,
43544 PartialOrd,
43545 Serialize
43546 )]
43547 pub enum SendMarginQueryOcoSelfTradePreventionMode {
43548 #[serde(rename = "EXPIRE_TAKER")]
43549 ExpireTaker,
43550 #[serde(rename = "EXPIRE_MAKER")]
43551 ExpireMaker,
43552 #[serde(rename = "EXPIRE_BOTH")]
43553 ExpireBoth,
43554 #[serde(rename = "NONE")]
43555 None,
43556 }
43557 impl From<&SendMarginQueryOcoSelfTradePreventionMode>
43558 for SendMarginQueryOcoSelfTradePreventionMode {
43559 fn from(value: &SendMarginQueryOcoSelfTradePreventionMode) -> Self {
43560 value.clone()
43561 }
43562 }
43563 impl ToString for SendMarginQueryOcoSelfTradePreventionMode {
43564 fn to_string(&self) -> String {
43565 match *self {
43566 Self::ExpireTaker => "EXPIRE_TAKER".to_string(),
43567 Self::ExpireMaker => "EXPIRE_MAKER".to_string(),
43568 Self::ExpireBoth => "EXPIRE_BOTH".to_string(),
43569 Self::None => "NONE".to_string(),
43570 }
43571 }
43572 }
43573 impl std::str::FromStr for SendMarginQueryOcoSelfTradePreventionMode {
43574 type Err = self::error::ConversionError;
43575 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
43576 match value {
43577 "EXPIRE_TAKER" => Ok(Self::ExpireTaker),
43578 "EXPIRE_MAKER" => Ok(Self::ExpireMaker),
43579 "EXPIRE_BOTH" => Ok(Self::ExpireBoth),
43580 "NONE" => Ok(Self::None),
43581 _ => Err("invalid value".into()),
43582 }
43583 }
43584 }
43585 impl std::convert::TryFrom<&str> for SendMarginQueryOcoSelfTradePreventionMode {
43586 type Error = self::error::ConversionError;
43587 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
43588 value.parse()
43589 }
43590 }
43591 impl std::convert::TryFrom<&String> for SendMarginQueryOcoSelfTradePreventionMode {
43592 type Error = self::error::ConversionError;
43593 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
43594 value.parse()
43595 }
43596 }
43597 impl std::convert::TryFrom<String> for SendMarginQueryOcoSelfTradePreventionMode {
43598 type Error = self::error::ConversionError;
43599 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
43600 value.parse()
43601 }
43602 }
43603 ///SendMarginQueryOcoSide
43604 ///
43605 /// <details><summary>JSON schema</summary>
43606 ///
43607 /// ```json
43608 ///{
43609 /// "examples": [
43610 /// "SELL"
43611 /// ],
43612 /// "type": "string",
43613 /// "enum": [
43614 /// "SELL",
43615 /// "BUY"
43616 /// ]
43617 ///}
43618 /// ```
43619 /// </details>
43620 #[derive(
43621 Clone,
43622 Copy,
43623 Debug,
43624 Deserialize,
43625 Eq,
43626 Hash,
43627 Ord,
43628 PartialEq,
43629 PartialOrd,
43630 Serialize
43631 )]
43632 pub enum SendMarginQueryOcoSide {
43633 #[serde(rename = "SELL")]
43634 Sell,
43635 #[serde(rename = "BUY")]
43636 Buy,
43637 }
43638 impl From<&SendMarginQueryOcoSide> for SendMarginQueryOcoSide {
43639 fn from(value: &SendMarginQueryOcoSide) -> Self {
43640 value.clone()
43641 }
43642 }
43643 impl ToString for SendMarginQueryOcoSide {
43644 fn to_string(&self) -> String {
43645 match *self {
43646 Self::Sell => "SELL".to_string(),
43647 Self::Buy => "BUY".to_string(),
43648 }
43649 }
43650 }
43651 impl std::str::FromStr for SendMarginQueryOcoSide {
43652 type Err = self::error::ConversionError;
43653 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
43654 match value {
43655 "SELL" => Ok(Self::Sell),
43656 "BUY" => Ok(Self::Buy),
43657 _ => Err("invalid value".into()),
43658 }
43659 }
43660 }
43661 impl std::convert::TryFrom<&str> for SendMarginQueryOcoSide {
43662 type Error = self::error::ConversionError;
43663 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
43664 value.parse()
43665 }
43666 }
43667 impl std::convert::TryFrom<&String> for SendMarginQueryOcoSide {
43668 type Error = self::error::ConversionError;
43669 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
43670 value.parse()
43671 }
43672 }
43673 impl std::convert::TryFrom<String> for SendMarginQueryOcoSide {
43674 type Error = self::error::ConversionError;
43675 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
43676 value.parse()
43677 }
43678 }
43679 ///SendMarginQueryOcoSideEffectType
43680 ///
43681 /// <details><summary>JSON schema</summary>
43682 ///
43683 /// ```json
43684 ///{
43685 /// "type": "string",
43686 /// "enum": [
43687 /// "NO_SIDE_EFFECT",
43688 /// "MARGIN_BUY",
43689 /// "AUTO_REPAY"
43690 /// ]
43691 ///}
43692 /// ```
43693 /// </details>
43694 #[derive(
43695 Clone,
43696 Copy,
43697 Debug,
43698 Deserialize,
43699 Eq,
43700 Hash,
43701 Ord,
43702 PartialEq,
43703 PartialOrd,
43704 Serialize
43705 )]
43706 pub enum SendMarginQueryOcoSideEffectType {
43707 #[serde(rename = "NO_SIDE_EFFECT")]
43708 NoSideEffect,
43709 #[serde(rename = "MARGIN_BUY")]
43710 MarginBuy,
43711 #[serde(rename = "AUTO_REPAY")]
43712 AutoRepay,
43713 }
43714 impl From<&SendMarginQueryOcoSideEffectType> for SendMarginQueryOcoSideEffectType {
43715 fn from(value: &SendMarginQueryOcoSideEffectType) -> Self {
43716 value.clone()
43717 }
43718 }
43719 impl ToString for SendMarginQueryOcoSideEffectType {
43720 fn to_string(&self) -> String {
43721 match *self {
43722 Self::NoSideEffect => "NO_SIDE_EFFECT".to_string(),
43723 Self::MarginBuy => "MARGIN_BUY".to_string(),
43724 Self::AutoRepay => "AUTO_REPAY".to_string(),
43725 }
43726 }
43727 }
43728 impl std::str::FromStr for SendMarginQueryOcoSideEffectType {
43729 type Err = self::error::ConversionError;
43730 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
43731 match value {
43732 "NO_SIDE_EFFECT" => Ok(Self::NoSideEffect),
43733 "MARGIN_BUY" => Ok(Self::MarginBuy),
43734 "AUTO_REPAY" => Ok(Self::AutoRepay),
43735 _ => Err("invalid value".into()),
43736 }
43737 }
43738 }
43739 impl std::convert::TryFrom<&str> for SendMarginQueryOcoSideEffectType {
43740 type Error = self::error::ConversionError;
43741 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
43742 value.parse()
43743 }
43744 }
43745 impl std::convert::TryFrom<&String> for SendMarginQueryOcoSideEffectType {
43746 type Error = self::error::ConversionError;
43747 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
43748 value.parse()
43749 }
43750 }
43751 impl std::convert::TryFrom<String> for SendMarginQueryOcoSideEffectType {
43752 type Error = self::error::ConversionError;
43753 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
43754 value.parse()
43755 }
43756 }
43757 ///SendMarginQueryOcoStopLimitTimeInForce
43758 ///
43759 /// <details><summary>JSON schema</summary>
43760 ///
43761 /// ```json
43762 ///{
43763 /// "type": "string",
43764 /// "enum": [
43765 /// "GTC",
43766 /// "FOK",
43767 /// "IOC"
43768 /// ]
43769 ///}
43770 /// ```
43771 /// </details>
43772 #[derive(
43773 Clone,
43774 Copy,
43775 Debug,
43776 Deserialize,
43777 Eq,
43778 Hash,
43779 Ord,
43780 PartialEq,
43781 PartialOrd,
43782 Serialize
43783 )]
43784 pub enum SendMarginQueryOcoStopLimitTimeInForce {
43785 #[serde(rename = "GTC")]
43786 Gtc,
43787 #[serde(rename = "FOK")]
43788 Fok,
43789 #[serde(rename = "IOC")]
43790 Ioc,
43791 }
43792 impl From<&SendMarginQueryOcoStopLimitTimeInForce>
43793 for SendMarginQueryOcoStopLimitTimeInForce {
43794 fn from(value: &SendMarginQueryOcoStopLimitTimeInForce) -> Self {
43795 value.clone()
43796 }
43797 }
43798 impl ToString for SendMarginQueryOcoStopLimitTimeInForce {
43799 fn to_string(&self) -> String {
43800 match *self {
43801 Self::Gtc => "GTC".to_string(),
43802 Self::Fok => "FOK".to_string(),
43803 Self::Ioc => "IOC".to_string(),
43804 }
43805 }
43806 }
43807 impl std::str::FromStr for SendMarginQueryOcoStopLimitTimeInForce {
43808 type Err = self::error::ConversionError;
43809 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
43810 match value {
43811 "GTC" => Ok(Self::Gtc),
43812 "FOK" => Ok(Self::Fok),
43813 "IOC" => Ok(Self::Ioc),
43814 _ => Err("invalid value".into()),
43815 }
43816 }
43817 }
43818 impl std::convert::TryFrom<&str> for SendMarginQueryOcoStopLimitTimeInForce {
43819 type Error = self::error::ConversionError;
43820 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
43821 value.parse()
43822 }
43823 }
43824 impl std::convert::TryFrom<&String> for SendMarginQueryOcoStopLimitTimeInForce {
43825 type Error = self::error::ConversionError;
43826 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
43827 value.parse()
43828 }
43829 }
43830 impl std::convert::TryFrom<String> for SendMarginQueryOcoStopLimitTimeInForce {
43831 type Error = self::error::ConversionError;
43832 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
43833 value.parse()
43834 }
43835 }
43836 ///SetSubAccountAssetsResponse
43837 ///
43838 /// <details><summary>JSON schema</summary>
43839 ///
43840 /// ```json
43841 ///{
43842 /// "type": "object",
43843 /// "required": [
43844 /// "balances"
43845 /// ],
43846 /// "properties": {
43847 /// "balances": {
43848 /// "type": "array",
43849 /// "items": {
43850 /// "type": "object",
43851 /// "required": [
43852 /// "asset",
43853 /// "free",
43854 /// "locked"
43855 /// ],
43856 /// "properties": {
43857 /// "asset": {
43858 /// "examples": [
43859 /// "ADA"
43860 /// ],
43861 /// "type": "string"
43862 /// },
43863 /// "free": {
43864 /// "examples": [
43865 /// 10000
43866 /// ],
43867 /// "type": "integer",
43868 /// "format": "int64"
43869 /// },
43870 /// "locked": {
43871 /// "examples": [
43872 /// 0
43873 /// ],
43874 /// "type": "integer",
43875 /// "format": "int64"
43876 /// }
43877 /// }
43878 /// }
43879 /// }
43880 /// }
43881 ///}
43882 /// ```
43883 /// </details>
43884 #[derive(Clone, Debug, Deserialize, Serialize)]
43885 pub struct SetSubAccountAssetsResponse {
43886 pub balances: Vec<SetSubAccountAssetsResponseBalancesItem>,
43887 }
43888 impl From<&SetSubAccountAssetsResponse> for SetSubAccountAssetsResponse {
43889 fn from(value: &SetSubAccountAssetsResponse) -> Self {
43890 value.clone()
43891 }
43892 }
43893 ///SetSubAccountAssetsResponseBalancesItem
43894 ///
43895 /// <details><summary>JSON schema</summary>
43896 ///
43897 /// ```json
43898 ///{
43899 /// "type": "object",
43900 /// "required": [
43901 /// "asset",
43902 /// "free",
43903 /// "locked"
43904 /// ],
43905 /// "properties": {
43906 /// "asset": {
43907 /// "examples": [
43908 /// "ADA"
43909 /// ],
43910 /// "type": "string"
43911 /// },
43912 /// "free": {
43913 /// "examples": [
43914 /// 10000
43915 /// ],
43916 /// "type": "integer",
43917 /// "format": "int64"
43918 /// },
43919 /// "locked": {
43920 /// "examples": [
43921 /// 0
43922 /// ],
43923 /// "type": "integer",
43924 /// "format": "int64"
43925 /// }
43926 /// }
43927 ///}
43928 /// ```
43929 /// </details>
43930 #[derive(Clone, Debug, Deserialize, Serialize)]
43931 pub struct SetSubAccountAssetsResponseBalancesItem {
43932 pub asset: String,
43933 pub free: i64,
43934 pub locked: i64,
43935 }
43936 impl From<&SetSubAccountAssetsResponseBalancesItem>
43937 for SetSubAccountAssetsResponseBalancesItem {
43938 fn from(value: &SetSubAccountAssetsResponseBalancesItem) -> Self {
43939 value.clone()
43940 }
43941 }
43942 ///SetSubAccountSubAccountApiIpRestrictionResponse
43943 ///
43944 /// <details><summary>JSON schema</summary>
43945 ///
43946 /// ```json
43947 ///{
43948 /// "type": "object",
43949 /// "required": [
43950 /// "apiKey",
43951 /// "ipList",
43952 /// "status",
43953 /// "updateTime"
43954 /// ],
43955 /// "properties": {
43956 /// "apiKey": {
43957 /// "examples": [
43958 /// "k5V49ldtn4tszj6W3hystegdfvmGbqDzjmkCtpTvC0G74WhK7yd4rfCTo4lShf"
43959 /// ],
43960 /// "type": "string"
43961 /// },
43962 /// "ipList": {
43963 /// "examples": [
43964 /// [
43965 /// "69.210.67.14",
43966 /// "8.34.21.10",
43967 /// "thirdPartyName"
43968 /// ]
43969 /// ],
43970 /// "type": "array",
43971 /// "items": {
43972 /// "type": "string"
43973 /// }
43974 /// },
43975 /// "status": {
43976 /// "examples": [
43977 /// "2"
43978 /// ],
43979 /// "type": "string"
43980 /// },
43981 /// "updateTime": {
43982 /// "examples": [
43983 /// 1636369557189
43984 /// ],
43985 /// "type": "integer",
43986 /// "format": "int64"
43987 /// }
43988 /// }
43989 ///}
43990 /// ```
43991 /// </details>
43992 #[derive(Clone, Debug, Deserialize, Serialize)]
43993 pub struct SetSubAccountSubAccountApiIpRestrictionResponse {
43994 #[serde(rename = "apiKey")]
43995 pub api_key: String,
43996 #[serde(rename = "ipList")]
43997 pub ip_list: Vec<String>,
43998 pub status: String,
43999 #[serde(rename = "updateTime")]
44000 pub update_time: i64,
44001 }
44002 impl From<&SetSubAccountSubAccountApiIpRestrictionResponse>
44003 for SetSubAccountSubAccountApiIpRestrictionResponse {
44004 fn from(value: &SetSubAccountSubAccountApiIpRestrictionResponse) -> Self {
44005 value.clone()
44006 }
44007 }
44008 ///SimpleEarnAccountResponse
44009 ///
44010 /// <details><summary>JSON schema</summary>
44011 ///
44012 /// ```json
44013 ///{
44014 /// "type": "object",
44015 /// "required": [
44016 /// "totalAmountInBTC",
44017 /// "totalAmountInUSDT",
44018 /// "totalFlexibleAmountInBTC",
44019 /// "totalFlexibleAmountInUSDT",
44020 /// "totalLockedInBTC",
44021 /// "totalLockedInUSDT"
44022 /// ],
44023 /// "properties": {
44024 /// "totalAmountInBTC": {
44025 /// "examples": [
44026 /// "0.01067982"
44027 /// ],
44028 /// "type": "string"
44029 /// },
44030 /// "totalAmountInUSDT": {
44031 /// "examples": [
44032 /// "77.13289230"
44033 /// ],
44034 /// "type": "string"
44035 /// },
44036 /// "totalFlexibleAmountInBTC": {
44037 /// "examples": [
44038 /// "0.00000000"
44039 /// ],
44040 /// "type": "string"
44041 /// },
44042 /// "totalFlexibleAmountInUSDT": {
44043 /// "examples": [
44044 /// "0.00000000"
44045 /// ],
44046 /// "type": "string"
44047 /// },
44048 /// "totalLockedInBTC": {
44049 /// "examples": [
44050 /// "0.01067982"
44051 /// ],
44052 /// "type": "string"
44053 /// },
44054 /// "totalLockedInUSDT": {
44055 /// "examples": [
44056 /// "77.13289230"
44057 /// ],
44058 /// "type": "string"
44059 /// }
44060 /// }
44061 ///}
44062 /// ```
44063 /// </details>
44064 #[derive(Clone, Debug, Deserialize, Serialize)]
44065 pub struct SimpleEarnAccountResponse {
44066 #[serde(rename = "totalAmountInBTC")]
44067 pub total_amount_in_btc: String,
44068 #[serde(rename = "totalAmountInUSDT")]
44069 pub total_amount_in_usdt: String,
44070 #[serde(rename = "totalFlexibleAmountInBTC")]
44071 pub total_flexible_amount_in_btc: String,
44072 #[serde(rename = "totalFlexibleAmountInUSDT")]
44073 pub total_flexible_amount_in_usdt: String,
44074 #[serde(rename = "totalLockedInBTC")]
44075 pub total_locked_in_btc: String,
44076 #[serde(rename = "totalLockedInUSDT")]
44077 pub total_locked_in_usdt: String,
44078 }
44079 impl From<&SimpleEarnAccountResponse> for SimpleEarnAccountResponse {
44080 fn from(value: &SimpleEarnAccountResponse) -> Self {
44081 value.clone()
44082 }
44083 }
44084 ///SimpleEarnFlexibleHistoryCollateralRecordResponse
44085 ///
44086 /// <details><summary>JSON schema</summary>
44087 ///
44088 /// ```json
44089 ///{
44090 /// "type": "object",
44091 /// "required": [
44092 /// "rows",
44093 /// "total"
44094 /// ],
44095 /// "properties": {
44096 /// "rows": {
44097 /// "type": "array",
44098 /// "items": {
44099 /// "type": "object",
44100 /// "required": [
44101 /// "amount",
44102 /// "asset",
44103 /// "createTime",
44104 /// "orderId",
44105 /// "productId",
44106 /// "productName",
44107 /// "type"
44108 /// ],
44109 /// "properties": {
44110 /// "amount": {
44111 /// "examples": [
44112 /// "100.00000000"
44113 /// ],
44114 /// "type": "string"
44115 /// },
44116 /// "asset": {
44117 /// "examples": [
44118 /// "USDT"
44119 /// ],
44120 /// "type": "string"
44121 /// },
44122 /// "createTime": {
44123 /// "examples": [
44124 /// 1575018510000
44125 /// ],
44126 /// "type": "integer",
44127 /// "format": "int64"
44128 /// },
44129 /// "orderId": {
44130 /// "examples": [
44131 /// 26055
44132 /// ],
44133 /// "type": "integer",
44134 /// "format": "int64"
44135 /// },
44136 /// "productId": {
44137 /// "examples": [
44138 /// "BUSD001"
44139 /// ],
44140 /// "type": "string"
44141 /// },
44142 /// "productName": {
44143 /// "examples": [
44144 /// "USDT"
44145 /// ],
44146 /// "type": "string"
44147 /// },
44148 /// "type": {
44149 /// "examples": [
44150 /// "REPAY"
44151 /// ],
44152 /// "type": "string"
44153 /// }
44154 /// }
44155 /// }
44156 /// },
44157 /// "total": {
44158 /// "examples": [
44159 /// 1
44160 /// ],
44161 /// "type": "integer",
44162 /// "format": "int64"
44163 /// }
44164 /// }
44165 ///}
44166 /// ```
44167 /// </details>
44168 #[derive(Clone, Debug, Deserialize, Serialize)]
44169 pub struct SimpleEarnFlexibleHistoryCollateralRecordResponse {
44170 pub rows: Vec<SimpleEarnFlexibleHistoryCollateralRecordResponseRowsItem>,
44171 pub total: i64,
44172 }
44173 impl From<&SimpleEarnFlexibleHistoryCollateralRecordResponse>
44174 for SimpleEarnFlexibleHistoryCollateralRecordResponse {
44175 fn from(value: &SimpleEarnFlexibleHistoryCollateralRecordResponse) -> Self {
44176 value.clone()
44177 }
44178 }
44179 ///SimpleEarnFlexibleHistoryCollateralRecordResponseRowsItem
44180 ///
44181 /// <details><summary>JSON schema</summary>
44182 ///
44183 /// ```json
44184 ///{
44185 /// "type": "object",
44186 /// "required": [
44187 /// "amount",
44188 /// "asset",
44189 /// "createTime",
44190 /// "orderId",
44191 /// "productId",
44192 /// "productName",
44193 /// "type"
44194 /// ],
44195 /// "properties": {
44196 /// "amount": {
44197 /// "examples": [
44198 /// "100.00000000"
44199 /// ],
44200 /// "type": "string"
44201 /// },
44202 /// "asset": {
44203 /// "examples": [
44204 /// "USDT"
44205 /// ],
44206 /// "type": "string"
44207 /// },
44208 /// "createTime": {
44209 /// "examples": [
44210 /// 1575018510000
44211 /// ],
44212 /// "type": "integer",
44213 /// "format": "int64"
44214 /// },
44215 /// "orderId": {
44216 /// "examples": [
44217 /// 26055
44218 /// ],
44219 /// "type": "integer",
44220 /// "format": "int64"
44221 /// },
44222 /// "productId": {
44223 /// "examples": [
44224 /// "BUSD001"
44225 /// ],
44226 /// "type": "string"
44227 /// },
44228 /// "productName": {
44229 /// "examples": [
44230 /// "USDT"
44231 /// ],
44232 /// "type": "string"
44233 /// },
44234 /// "type": {
44235 /// "examples": [
44236 /// "REPAY"
44237 /// ],
44238 /// "type": "string"
44239 /// }
44240 /// }
44241 ///}
44242 /// ```
44243 /// </details>
44244 #[derive(Clone, Debug, Deserialize, Serialize)]
44245 pub struct SimpleEarnFlexibleHistoryCollateralRecordResponseRowsItem {
44246 pub amount: String,
44247 pub asset: String,
44248 #[serde(rename = "createTime")]
44249 pub create_time: i64,
44250 #[serde(rename = "orderId")]
44251 pub order_id: i64,
44252 #[serde(rename = "productId")]
44253 pub product_id: String,
44254 #[serde(rename = "productName")]
44255 pub product_name: String,
44256 #[serde(rename = "type")]
44257 pub type_: String,
44258 }
44259 impl From<&SimpleEarnFlexibleHistoryCollateralRecordResponseRowsItem>
44260 for SimpleEarnFlexibleHistoryCollateralRecordResponseRowsItem {
44261 fn from(
44262 value: &SimpleEarnFlexibleHistoryCollateralRecordResponseRowsItem,
44263 ) -> Self {
44264 value.clone()
44265 }
44266 }
44267 ///SimpleEarnFlexibleHistoryRateHistoryResponse
44268 ///
44269 /// <details><summary>JSON schema</summary>
44270 ///
44271 /// ```json
44272 ///{
44273 /// "type": "object",
44274 /// "required": [
44275 /// "rows",
44276 /// "total"
44277 /// ],
44278 /// "properties": {
44279 /// "rows": {
44280 /// "type": "array",
44281 /// "items": {
44282 /// "type": "object",
44283 /// "required": [
44284 /// "annualPercentageRate",
44285 /// "asset",
44286 /// "productId",
44287 /// "time"
44288 /// ],
44289 /// "properties": {
44290 /// "annualPercentageRate": {
44291 /// "examples": [
44292 /// "0.00006408"
44293 /// ],
44294 /// "type": "string"
44295 /// },
44296 /// "asset": {
44297 /// "examples": [
44298 /// "BUSD"
44299 /// ],
44300 /// "type": "string"
44301 /// },
44302 /// "productId": {
44303 /// "examples": [
44304 /// "BUSD001"
44305 /// ],
44306 /// "type": "string"
44307 /// },
44308 /// "time": {
44309 /// "examples": [
44310 /// 1577233578000
44311 /// ],
44312 /// "type": "integer",
44313 /// "format": "int64"
44314 /// }
44315 /// }
44316 /// }
44317 /// },
44318 /// "total": {
44319 /// "examples": [
44320 /// 1
44321 /// ],
44322 /// "type": "integer",
44323 /// "format": "int64"
44324 /// }
44325 /// }
44326 ///}
44327 /// ```
44328 /// </details>
44329 #[derive(Clone, Debug, Deserialize, Serialize)]
44330 pub struct SimpleEarnFlexibleHistoryRateHistoryResponse {
44331 pub rows: Vec<SimpleEarnFlexibleHistoryRateHistoryResponseRowsItem>,
44332 pub total: i64,
44333 }
44334 impl From<&SimpleEarnFlexibleHistoryRateHistoryResponse>
44335 for SimpleEarnFlexibleHistoryRateHistoryResponse {
44336 fn from(value: &SimpleEarnFlexibleHistoryRateHistoryResponse) -> Self {
44337 value.clone()
44338 }
44339 }
44340 ///SimpleEarnFlexibleHistoryRateHistoryResponseRowsItem
44341 ///
44342 /// <details><summary>JSON schema</summary>
44343 ///
44344 /// ```json
44345 ///{
44346 /// "type": "object",
44347 /// "required": [
44348 /// "annualPercentageRate",
44349 /// "asset",
44350 /// "productId",
44351 /// "time"
44352 /// ],
44353 /// "properties": {
44354 /// "annualPercentageRate": {
44355 /// "examples": [
44356 /// "0.00006408"
44357 /// ],
44358 /// "type": "string"
44359 /// },
44360 /// "asset": {
44361 /// "examples": [
44362 /// "BUSD"
44363 /// ],
44364 /// "type": "string"
44365 /// },
44366 /// "productId": {
44367 /// "examples": [
44368 /// "BUSD001"
44369 /// ],
44370 /// "type": "string"
44371 /// },
44372 /// "time": {
44373 /// "examples": [
44374 /// 1577233578000
44375 /// ],
44376 /// "type": "integer",
44377 /// "format": "int64"
44378 /// }
44379 /// }
44380 ///}
44381 /// ```
44382 /// </details>
44383 #[derive(Clone, Debug, Deserialize, Serialize)]
44384 pub struct SimpleEarnFlexibleHistoryRateHistoryResponseRowsItem {
44385 #[serde(rename = "annualPercentageRate")]
44386 pub annual_percentage_rate: String,
44387 pub asset: String,
44388 #[serde(rename = "productId")]
44389 pub product_id: String,
44390 pub time: i64,
44391 }
44392 impl From<&SimpleEarnFlexibleHistoryRateHistoryResponseRowsItem>
44393 for SimpleEarnFlexibleHistoryRateHistoryResponseRowsItem {
44394 fn from(value: &SimpleEarnFlexibleHistoryRateHistoryResponseRowsItem) -> Self {
44395 value.clone()
44396 }
44397 }
44398 ///SimpleEarnFlexibleHistoryRedemptionRecordResponse
44399 ///
44400 /// <details><summary>JSON schema</summary>
44401 ///
44402 /// ```json
44403 ///{
44404 /// "type": "object",
44405 /// "required": [
44406 /// "rows",
44407 /// "total"
44408 /// ],
44409 /// "properties": {
44410 /// "rows": {
44411 /// "type": "array",
44412 /// "items": {
44413 /// "type": "object",
44414 /// "required": [
44415 /// "amount",
44416 /// "asset",
44417 /// "destAccount",
44418 /// "projectId",
44419 /// "redeemId",
44420 /// "status",
44421 /// "time"
44422 /// ],
44423 /// "properties": {
44424 /// "amount": {
44425 /// "examples": [
44426 /// "10.54000000"
44427 /// ],
44428 /// "type": "string"
44429 /// },
44430 /// "asset": {
44431 /// "examples": [
44432 /// "USDT"
44433 /// ],
44434 /// "type": "string"
44435 /// },
44436 /// "destAccount": {
44437 /// "description": "SPOT, FUNDING",
44438 /// "examples": [
44439 /// "SPOT"
44440 /// ],
44441 /// "type": "string"
44442 /// },
44443 /// "projectId": {
44444 /// "examples": [
44445 /// "USDT001"
44446 /// ],
44447 /// "type": "string"
44448 /// },
44449 /// "redeemId": {
44450 /// "examples": [
44451 /// 40607
44452 /// ],
44453 /// "type": "integer",
44454 /// "format": "int64"
44455 /// },
44456 /// "status": {
44457 /// "examples": [
44458 /// "PAID"
44459 /// ],
44460 /// "type": "string"
44461 /// },
44462 /// "time": {
44463 /// "examples": [
44464 /// 1577257222000
44465 /// ],
44466 /// "type": "integer",
44467 /// "format": "int64"
44468 /// }
44469 /// }
44470 /// }
44471 /// },
44472 /// "total": {
44473 /// "examples": [
44474 /// 1
44475 /// ],
44476 /// "type": "integer",
44477 /// "format": "int64"
44478 /// }
44479 /// }
44480 ///}
44481 /// ```
44482 /// </details>
44483 #[derive(Clone, Debug, Deserialize, Serialize)]
44484 pub struct SimpleEarnFlexibleHistoryRedemptionRecordResponse {
44485 pub rows: Vec<SimpleEarnFlexibleHistoryRedemptionRecordResponseRowsItem>,
44486 pub total: i64,
44487 }
44488 impl From<&SimpleEarnFlexibleHistoryRedemptionRecordResponse>
44489 for SimpleEarnFlexibleHistoryRedemptionRecordResponse {
44490 fn from(value: &SimpleEarnFlexibleHistoryRedemptionRecordResponse) -> Self {
44491 value.clone()
44492 }
44493 }
44494 ///SimpleEarnFlexibleHistoryRedemptionRecordResponseRowsItem
44495 ///
44496 /// <details><summary>JSON schema</summary>
44497 ///
44498 /// ```json
44499 ///{
44500 /// "type": "object",
44501 /// "required": [
44502 /// "amount",
44503 /// "asset",
44504 /// "destAccount",
44505 /// "projectId",
44506 /// "redeemId",
44507 /// "status",
44508 /// "time"
44509 /// ],
44510 /// "properties": {
44511 /// "amount": {
44512 /// "examples": [
44513 /// "10.54000000"
44514 /// ],
44515 /// "type": "string"
44516 /// },
44517 /// "asset": {
44518 /// "examples": [
44519 /// "USDT"
44520 /// ],
44521 /// "type": "string"
44522 /// },
44523 /// "destAccount": {
44524 /// "description": "SPOT, FUNDING",
44525 /// "examples": [
44526 /// "SPOT"
44527 /// ],
44528 /// "type": "string"
44529 /// },
44530 /// "projectId": {
44531 /// "examples": [
44532 /// "USDT001"
44533 /// ],
44534 /// "type": "string"
44535 /// },
44536 /// "redeemId": {
44537 /// "examples": [
44538 /// 40607
44539 /// ],
44540 /// "type": "integer",
44541 /// "format": "int64"
44542 /// },
44543 /// "status": {
44544 /// "examples": [
44545 /// "PAID"
44546 /// ],
44547 /// "type": "string"
44548 /// },
44549 /// "time": {
44550 /// "examples": [
44551 /// 1577257222000
44552 /// ],
44553 /// "type": "integer",
44554 /// "format": "int64"
44555 /// }
44556 /// }
44557 ///}
44558 /// ```
44559 /// </details>
44560 #[derive(Clone, Debug, Deserialize, Serialize)]
44561 pub struct SimpleEarnFlexibleHistoryRedemptionRecordResponseRowsItem {
44562 pub amount: String,
44563 pub asset: String,
44564 ///SPOT, FUNDING
44565 #[serde(rename = "destAccount")]
44566 pub dest_account: String,
44567 #[serde(rename = "projectId")]
44568 pub project_id: String,
44569 #[serde(rename = "redeemId")]
44570 pub redeem_id: i64,
44571 pub status: String,
44572 pub time: i64,
44573 }
44574 impl From<&SimpleEarnFlexibleHistoryRedemptionRecordResponseRowsItem>
44575 for SimpleEarnFlexibleHistoryRedemptionRecordResponseRowsItem {
44576 fn from(
44577 value: &SimpleEarnFlexibleHistoryRedemptionRecordResponseRowsItem,
44578 ) -> Self {
44579 value.clone()
44580 }
44581 }
44582 ///SimpleEarnFlexibleHistoryRewardsRecordResponse
44583 ///
44584 /// <details><summary>JSON schema</summary>
44585 ///
44586 /// ```json
44587 ///{
44588 /// "type": "object",
44589 /// "required": [
44590 /// "rows",
44591 /// "total"
44592 /// ],
44593 /// "properties": {
44594 /// "rows": {
44595 /// "type": "array",
44596 /// "items": {
44597 /// "type": "object",
44598 /// "required": [
44599 /// "asset",
44600 /// "projectId",
44601 /// "rewards",
44602 /// "time",
44603 /// "type"
44604 /// ],
44605 /// "properties": {
44606 /// "asset": {
44607 /// "examples": [
44608 /// "BUSD"
44609 /// ],
44610 /// "type": "string"
44611 /// },
44612 /// "projectId": {
44613 /// "examples": [
44614 /// "USDT001"
44615 /// ],
44616 /// "type": "string"
44617 /// },
44618 /// "rewards": {
44619 /// "examples": [
44620 /// "0.00006408"
44621 /// ],
44622 /// "type": "string"
44623 /// },
44624 /// "time": {
44625 /// "examples": [
44626 /// 1577257222000
44627 /// ],
44628 /// "type": "integer",
44629 /// "format": "int64"
44630 /// },
44631 /// "type": {
44632 /// "examples": [
44633 /// "BONUS"
44634 /// ],
44635 /// "type": "string"
44636 /// }
44637 /// }
44638 /// }
44639 /// },
44640 /// "total": {
44641 /// "examples": [
44642 /// 2
44643 /// ],
44644 /// "type": "integer",
44645 /// "format": "int64"
44646 /// }
44647 /// }
44648 ///}
44649 /// ```
44650 /// </details>
44651 #[derive(Clone, Debug, Deserialize, Serialize)]
44652 pub struct SimpleEarnFlexibleHistoryRewardsRecordResponse {
44653 pub rows: Vec<SimpleEarnFlexibleHistoryRewardsRecordResponseRowsItem>,
44654 pub total: i64,
44655 }
44656 impl From<&SimpleEarnFlexibleHistoryRewardsRecordResponse>
44657 for SimpleEarnFlexibleHistoryRewardsRecordResponse {
44658 fn from(value: &SimpleEarnFlexibleHistoryRewardsRecordResponse) -> Self {
44659 value.clone()
44660 }
44661 }
44662 ///SimpleEarnFlexibleHistoryRewardsRecordResponseRowsItem
44663 ///
44664 /// <details><summary>JSON schema</summary>
44665 ///
44666 /// ```json
44667 ///{
44668 /// "type": "object",
44669 /// "required": [
44670 /// "asset",
44671 /// "projectId",
44672 /// "rewards",
44673 /// "time",
44674 /// "type"
44675 /// ],
44676 /// "properties": {
44677 /// "asset": {
44678 /// "examples": [
44679 /// "BUSD"
44680 /// ],
44681 /// "type": "string"
44682 /// },
44683 /// "projectId": {
44684 /// "examples": [
44685 /// "USDT001"
44686 /// ],
44687 /// "type": "string"
44688 /// },
44689 /// "rewards": {
44690 /// "examples": [
44691 /// "0.00006408"
44692 /// ],
44693 /// "type": "string"
44694 /// },
44695 /// "time": {
44696 /// "examples": [
44697 /// 1577257222000
44698 /// ],
44699 /// "type": "integer",
44700 /// "format": "int64"
44701 /// },
44702 /// "type": {
44703 /// "examples": [
44704 /// "BONUS"
44705 /// ],
44706 /// "type": "string"
44707 /// }
44708 /// }
44709 ///}
44710 /// ```
44711 /// </details>
44712 #[derive(Clone, Debug, Deserialize, Serialize)]
44713 pub struct SimpleEarnFlexibleHistoryRewardsRecordResponseRowsItem {
44714 pub asset: String,
44715 #[serde(rename = "projectId")]
44716 pub project_id: String,
44717 pub rewards: String,
44718 pub time: i64,
44719 #[serde(rename = "type")]
44720 pub type_: String,
44721 }
44722 impl From<&SimpleEarnFlexibleHistoryRewardsRecordResponseRowsItem>
44723 for SimpleEarnFlexibleHistoryRewardsRecordResponseRowsItem {
44724 fn from(value: &SimpleEarnFlexibleHistoryRewardsRecordResponseRowsItem) -> Self {
44725 value.clone()
44726 }
44727 }
44728 ///SimpleEarnFlexibleHistorySubscriptionRecordResponse
44729 ///
44730 /// <details><summary>JSON schema</summary>
44731 ///
44732 /// ```json
44733 ///{
44734 /// "type": "object",
44735 /// "required": [
44736 /// "rows",
44737 /// "total"
44738 /// ],
44739 /// "properties": {
44740 /// "rows": {
44741 /// "type": "array",
44742 /// "items": {
44743 /// "type": "object",
44744 /// "required": [
44745 /// "amount",
44746 /// "amtFromFunding",
44747 /// "amtFromSpot",
44748 /// "asset",
44749 /// "purchaseId",
44750 /// "sourceAccount",
44751 /// "status",
44752 /// "time",
44753 /// "type"
44754 /// ],
44755 /// "properties": {
44756 /// "amount": {
44757 /// "examples": [
44758 /// "100.00000000"
44759 /// ],
44760 /// "type": "string"
44761 /// },
44762 /// "amtFromFunding": {
44763 /// "description": "Display if sourceAccount is SPOTANDFUNDING",
44764 /// "examples": [
44765 /// "70"
44766 /// ],
44767 /// "type": "string"
44768 /// },
44769 /// "amtFromSpot": {
44770 /// "description": "Display if sourceAccount is SPOTANDFUNDING ",
44771 /// "examples": [
44772 /// "30"
44773 /// ],
44774 /// "type": "string"
44775 /// },
44776 /// "asset": {
44777 /// "examples": [
44778 /// "USDT"
44779 /// ],
44780 /// "type": "string"
44781 /// },
44782 /// "purchaseId": {
44783 /// "examples": [
44784 /// 26055
44785 /// ],
44786 /// "type": "integer",
44787 /// "format": "int64"
44788 /// },
44789 /// "sourceAccount": {
44790 /// "description": "SPOT, FUNDING, SPOTANDFUNDING",
44791 /// "examples": [
44792 /// "SPOT"
44793 /// ],
44794 /// "type": "string"
44795 /// },
44796 /// "status": {
44797 /// "description": "PURCHASING/SUCCESS/FAILED",
44798 /// "examples": [
44799 /// "SUCCESS"
44800 /// ],
44801 /// "type": "string"
44802 /// },
44803 /// "time": {
44804 /// "examples": [
44805 /// 1575018510000
44806 /// ],
44807 /// "type": "integer",
44808 /// "format": "int64"
44809 /// },
44810 /// "type": {
44811 /// "description": "AUTO for auto subscribe, NORMAL for normal subscription, CONVERT for Locked to Flexible, LOAN for flexible loan collateral, AI for Auto Invest subscribe, TRANSFER for Locked Savings to Flexible",
44812 /// "examples": [
44813 /// "AUTO"
44814 /// ],
44815 /// "type": "string"
44816 /// }
44817 /// }
44818 /// }
44819 /// },
44820 /// "total": {
44821 /// "examples": [
44822 /// 1
44823 /// ],
44824 /// "type": "integer",
44825 /// "format": "int64"
44826 /// }
44827 /// }
44828 ///}
44829 /// ```
44830 /// </details>
44831 #[derive(Clone, Debug, Deserialize, Serialize)]
44832 pub struct SimpleEarnFlexibleHistorySubscriptionRecordResponse {
44833 pub rows: Vec<SimpleEarnFlexibleHistorySubscriptionRecordResponseRowsItem>,
44834 pub total: i64,
44835 }
44836 impl From<&SimpleEarnFlexibleHistorySubscriptionRecordResponse>
44837 for SimpleEarnFlexibleHistorySubscriptionRecordResponse {
44838 fn from(value: &SimpleEarnFlexibleHistorySubscriptionRecordResponse) -> Self {
44839 value.clone()
44840 }
44841 }
44842 ///SimpleEarnFlexibleHistorySubscriptionRecordResponseRowsItem
44843 ///
44844 /// <details><summary>JSON schema</summary>
44845 ///
44846 /// ```json
44847 ///{
44848 /// "type": "object",
44849 /// "required": [
44850 /// "amount",
44851 /// "amtFromFunding",
44852 /// "amtFromSpot",
44853 /// "asset",
44854 /// "purchaseId",
44855 /// "sourceAccount",
44856 /// "status",
44857 /// "time",
44858 /// "type"
44859 /// ],
44860 /// "properties": {
44861 /// "amount": {
44862 /// "examples": [
44863 /// "100.00000000"
44864 /// ],
44865 /// "type": "string"
44866 /// },
44867 /// "amtFromFunding": {
44868 /// "description": "Display if sourceAccount is SPOTANDFUNDING",
44869 /// "examples": [
44870 /// "70"
44871 /// ],
44872 /// "type": "string"
44873 /// },
44874 /// "amtFromSpot": {
44875 /// "description": "Display if sourceAccount is SPOTANDFUNDING ",
44876 /// "examples": [
44877 /// "30"
44878 /// ],
44879 /// "type": "string"
44880 /// },
44881 /// "asset": {
44882 /// "examples": [
44883 /// "USDT"
44884 /// ],
44885 /// "type": "string"
44886 /// },
44887 /// "purchaseId": {
44888 /// "examples": [
44889 /// 26055
44890 /// ],
44891 /// "type": "integer",
44892 /// "format": "int64"
44893 /// },
44894 /// "sourceAccount": {
44895 /// "description": "SPOT, FUNDING, SPOTANDFUNDING",
44896 /// "examples": [
44897 /// "SPOT"
44898 /// ],
44899 /// "type": "string"
44900 /// },
44901 /// "status": {
44902 /// "description": "PURCHASING/SUCCESS/FAILED",
44903 /// "examples": [
44904 /// "SUCCESS"
44905 /// ],
44906 /// "type": "string"
44907 /// },
44908 /// "time": {
44909 /// "examples": [
44910 /// 1575018510000
44911 /// ],
44912 /// "type": "integer",
44913 /// "format": "int64"
44914 /// },
44915 /// "type": {
44916 /// "description": "AUTO for auto subscribe, NORMAL for normal subscription, CONVERT for Locked to Flexible, LOAN for flexible loan collateral, AI for Auto Invest subscribe, TRANSFER for Locked Savings to Flexible",
44917 /// "examples": [
44918 /// "AUTO"
44919 /// ],
44920 /// "type": "string"
44921 /// }
44922 /// }
44923 ///}
44924 /// ```
44925 /// </details>
44926 #[derive(Clone, Debug, Deserialize, Serialize)]
44927 pub struct SimpleEarnFlexibleHistorySubscriptionRecordResponseRowsItem {
44928 pub amount: String,
44929 ///Display if sourceAccount is SPOTANDFUNDING
44930 #[serde(rename = "amtFromFunding")]
44931 pub amt_from_funding: String,
44932 ///Display if sourceAccount is SPOTANDFUNDING
44933 #[serde(rename = "amtFromSpot")]
44934 pub amt_from_spot: String,
44935 pub asset: String,
44936 #[serde(rename = "purchaseId")]
44937 pub purchase_id: i64,
44938 ///SPOT, FUNDING, SPOTANDFUNDING
44939 #[serde(rename = "sourceAccount")]
44940 pub source_account: String,
44941 ///PURCHASING/SUCCESS/FAILED
44942 pub status: String,
44943 pub time: i64,
44944 ///AUTO for auto subscribe, NORMAL for normal subscription, CONVERT for Locked to Flexible, LOAN for flexible loan collateral, AI for Auto Invest subscribe, TRANSFER for Locked Savings to Flexible
44945 #[serde(rename = "type")]
44946 pub type_: String,
44947 }
44948 impl From<&SimpleEarnFlexibleHistorySubscriptionRecordResponseRowsItem>
44949 for SimpleEarnFlexibleHistorySubscriptionRecordResponseRowsItem {
44950 fn from(
44951 value: &SimpleEarnFlexibleHistorySubscriptionRecordResponseRowsItem,
44952 ) -> Self {
44953 value.clone()
44954 }
44955 }
44956 ///SimpleEarnFlexibleListResponse
44957 ///
44958 /// <details><summary>JSON schema</summary>
44959 ///
44960 /// ```json
44961 ///{
44962 /// "type": "object",
44963 /// "required": [
44964 /// "rows",
44965 /// "total"
44966 /// ],
44967 /// "properties": {
44968 /// "rows": {
44969 /// "type": "array",
44970 /// "items": {
44971 /// "type": "object",
44972 /// "required": [
44973 /// "airDropPercentageRate",
44974 /// "asset",
44975 /// "canPurchase",
44976 /// "canRedeem",
44977 /// "hot",
44978 /// "isSoldOut",
44979 /// "latestAnnualPercentageRate",
44980 /// "minPurchaseAmount",
44981 /// "productId",
44982 /// "status",
44983 /// "subscriptionStartTime",
44984 /// "tierAnnualPercentageRate"
44985 /// ],
44986 /// "properties": {
44987 /// "airDropPercentageRate": {
44988 /// "examples": [
44989 /// "0.05000000"
44990 /// ],
44991 /// "type": "string"
44992 /// },
44993 /// "asset": {
44994 /// "examples": [
44995 /// "BTC"
44996 /// ],
44997 /// "type": "string"
44998 /// },
44999 /// "canPurchase": {
45000 /// "examples": [
45001 /// true
45002 /// ],
45003 /// "type": "boolean"
45004 /// },
45005 /// "canRedeem": {
45006 /// "examples": [
45007 /// true
45008 /// ],
45009 /// "type": "boolean"
45010 /// },
45011 /// "hot": {
45012 /// "examples": [
45013 /// true
45014 /// ],
45015 /// "type": "boolean"
45016 /// },
45017 /// "isSoldOut": {
45018 /// "examples": [
45019 /// true
45020 /// ],
45021 /// "type": "boolean"
45022 /// },
45023 /// "latestAnnualPercentageRate": {
45024 /// "examples": [
45025 /// "0.05000000"
45026 /// ],
45027 /// "type": "string"
45028 /// },
45029 /// "minPurchaseAmount": {
45030 /// "examples": [
45031 /// "0.01000000"
45032 /// ],
45033 /// "type": "string"
45034 /// },
45035 /// "productId": {
45036 /// "examples": [
45037 /// "BTC001"
45038 /// ],
45039 /// "type": "string"
45040 /// },
45041 /// "status": {
45042 /// "examples": [
45043 /// "PURCHASING"
45044 /// ],
45045 /// "type": "string"
45046 /// },
45047 /// "subscriptionStartTime": {
45048 /// "examples": [
45049 /// "1646182276000"
45050 /// ],
45051 /// "type": "string"
45052 /// },
45053 /// "tierAnnualPercentageRate": {
45054 /// "type": "object",
45055 /// "required": [
45056 /// "0-5BTC",
45057 /// "5-10BTC"
45058 /// ],
45059 /// "properties": {
45060 /// "0-5BTC": {
45061 /// "examples": [
45062 /// 0.05
45063 /// ],
45064 /// "type": "number",
45065 /// "format": "double"
45066 /// },
45067 /// "5-10BTC": {
45068 /// "examples": [
45069 /// 0.03
45070 /// ],
45071 /// "type": "number",
45072 /// "format": "double"
45073 /// }
45074 /// }
45075 /// }
45076 /// }
45077 /// }
45078 /// },
45079 /// "total": {
45080 /// "examples": [
45081 /// 1
45082 /// ],
45083 /// "type": "integer",
45084 /// "format": "int64"
45085 /// }
45086 /// }
45087 ///}
45088 /// ```
45089 /// </details>
45090 #[derive(Clone, Debug, Deserialize, Serialize)]
45091 pub struct SimpleEarnFlexibleListResponse {
45092 pub rows: Vec<SimpleEarnFlexibleListResponseRowsItem>,
45093 pub total: i64,
45094 }
45095 impl From<&SimpleEarnFlexibleListResponse> for SimpleEarnFlexibleListResponse {
45096 fn from(value: &SimpleEarnFlexibleListResponse) -> Self {
45097 value.clone()
45098 }
45099 }
45100 ///SimpleEarnFlexibleListResponseRowsItem
45101 ///
45102 /// <details><summary>JSON schema</summary>
45103 ///
45104 /// ```json
45105 ///{
45106 /// "type": "object",
45107 /// "required": [
45108 /// "airDropPercentageRate",
45109 /// "asset",
45110 /// "canPurchase",
45111 /// "canRedeem",
45112 /// "hot",
45113 /// "isSoldOut",
45114 /// "latestAnnualPercentageRate",
45115 /// "minPurchaseAmount",
45116 /// "productId",
45117 /// "status",
45118 /// "subscriptionStartTime",
45119 /// "tierAnnualPercentageRate"
45120 /// ],
45121 /// "properties": {
45122 /// "airDropPercentageRate": {
45123 /// "examples": [
45124 /// "0.05000000"
45125 /// ],
45126 /// "type": "string"
45127 /// },
45128 /// "asset": {
45129 /// "examples": [
45130 /// "BTC"
45131 /// ],
45132 /// "type": "string"
45133 /// },
45134 /// "canPurchase": {
45135 /// "examples": [
45136 /// true
45137 /// ],
45138 /// "type": "boolean"
45139 /// },
45140 /// "canRedeem": {
45141 /// "examples": [
45142 /// true
45143 /// ],
45144 /// "type": "boolean"
45145 /// },
45146 /// "hot": {
45147 /// "examples": [
45148 /// true
45149 /// ],
45150 /// "type": "boolean"
45151 /// },
45152 /// "isSoldOut": {
45153 /// "examples": [
45154 /// true
45155 /// ],
45156 /// "type": "boolean"
45157 /// },
45158 /// "latestAnnualPercentageRate": {
45159 /// "examples": [
45160 /// "0.05000000"
45161 /// ],
45162 /// "type": "string"
45163 /// },
45164 /// "minPurchaseAmount": {
45165 /// "examples": [
45166 /// "0.01000000"
45167 /// ],
45168 /// "type": "string"
45169 /// },
45170 /// "productId": {
45171 /// "examples": [
45172 /// "BTC001"
45173 /// ],
45174 /// "type": "string"
45175 /// },
45176 /// "status": {
45177 /// "examples": [
45178 /// "PURCHASING"
45179 /// ],
45180 /// "type": "string"
45181 /// },
45182 /// "subscriptionStartTime": {
45183 /// "examples": [
45184 /// "1646182276000"
45185 /// ],
45186 /// "type": "string"
45187 /// },
45188 /// "tierAnnualPercentageRate": {
45189 /// "type": "object",
45190 /// "required": [
45191 /// "0-5BTC",
45192 /// "5-10BTC"
45193 /// ],
45194 /// "properties": {
45195 /// "0-5BTC": {
45196 /// "examples": [
45197 /// 0.05
45198 /// ],
45199 /// "type": "number",
45200 /// "format": "double"
45201 /// },
45202 /// "5-10BTC": {
45203 /// "examples": [
45204 /// 0.03
45205 /// ],
45206 /// "type": "number",
45207 /// "format": "double"
45208 /// }
45209 /// }
45210 /// }
45211 /// }
45212 ///}
45213 /// ```
45214 /// </details>
45215 #[derive(Clone, Debug, Deserialize, Serialize)]
45216 pub struct SimpleEarnFlexibleListResponseRowsItem {
45217 #[serde(rename = "airDropPercentageRate")]
45218 pub air_drop_percentage_rate: String,
45219 pub asset: String,
45220 #[serde(rename = "canPurchase")]
45221 pub can_purchase: bool,
45222 #[serde(rename = "canRedeem")]
45223 pub can_redeem: bool,
45224 pub hot: bool,
45225 #[serde(rename = "isSoldOut")]
45226 pub is_sold_out: bool,
45227 #[serde(rename = "latestAnnualPercentageRate")]
45228 pub latest_annual_percentage_rate: String,
45229 #[serde(rename = "minPurchaseAmount")]
45230 pub min_purchase_amount: String,
45231 #[serde(rename = "productId")]
45232 pub product_id: String,
45233 pub status: String,
45234 #[serde(rename = "subscriptionStartTime")]
45235 pub subscription_start_time: String,
45236 #[serde(rename = "tierAnnualPercentageRate")]
45237 pub tier_annual_percentage_rate: SimpleEarnFlexibleListResponseRowsItemTierAnnualPercentageRate,
45238 }
45239 impl From<&SimpleEarnFlexibleListResponseRowsItem>
45240 for SimpleEarnFlexibleListResponseRowsItem {
45241 fn from(value: &SimpleEarnFlexibleListResponseRowsItem) -> Self {
45242 value.clone()
45243 }
45244 }
45245 ///SimpleEarnFlexibleListResponseRowsItemTierAnnualPercentageRate
45246 ///
45247 /// <details><summary>JSON schema</summary>
45248 ///
45249 /// ```json
45250 ///{
45251 /// "type": "object",
45252 /// "required": [
45253 /// "0-5BTC",
45254 /// "5-10BTC"
45255 /// ],
45256 /// "properties": {
45257 /// "0-5BTC": {
45258 /// "examples": [
45259 /// 0.05
45260 /// ],
45261 /// "type": "number",
45262 /// "format": "double"
45263 /// },
45264 /// "5-10BTC": {
45265 /// "examples": [
45266 /// 0.03
45267 /// ],
45268 /// "type": "number",
45269 /// "format": "double"
45270 /// }
45271 /// }
45272 ///}
45273 /// ```
45274 /// </details>
45275 #[derive(Clone, Debug, Deserialize, Serialize)]
45276 pub struct SimpleEarnFlexibleListResponseRowsItemTierAnnualPercentageRate {
45277 #[serde(rename = "0-5BTC")]
45278 pub _0_5btc: f64,
45279 #[serde(rename = "5-10BTC")]
45280 pub _5_10btc: f64,
45281 }
45282 impl From<&SimpleEarnFlexibleListResponseRowsItemTierAnnualPercentageRate>
45283 for SimpleEarnFlexibleListResponseRowsItemTierAnnualPercentageRate {
45284 fn from(
45285 value: &SimpleEarnFlexibleListResponseRowsItemTierAnnualPercentageRate,
45286 ) -> Self {
45287 value.clone()
45288 }
45289 }
45290 ///SimpleEarnFlexiblePersonalLeftQuotaResponse
45291 ///
45292 /// <details><summary>JSON schema</summary>
45293 ///
45294 /// ```json
45295 ///{
45296 /// "type": "object",
45297 /// "required": [
45298 /// "leftPersonalQuota"
45299 /// ],
45300 /// "properties": {
45301 /// "leftPersonalQuota": {
45302 /// "examples": [
45303 /// "1000"
45304 /// ],
45305 /// "type": "string"
45306 /// }
45307 /// }
45308 ///}
45309 /// ```
45310 /// </details>
45311 #[derive(Clone, Debug, Deserialize, Serialize)]
45312 pub struct SimpleEarnFlexiblePersonalLeftQuotaResponse {
45313 #[serde(rename = "leftPersonalQuota")]
45314 pub left_personal_quota: String,
45315 }
45316 impl From<&SimpleEarnFlexiblePersonalLeftQuotaResponse>
45317 for SimpleEarnFlexiblePersonalLeftQuotaResponse {
45318 fn from(value: &SimpleEarnFlexiblePersonalLeftQuotaResponse) -> Self {
45319 value.clone()
45320 }
45321 }
45322 ///SimpleEarnFlexiblePositionResponse
45323 ///
45324 /// <details><summary>JSON schema</summary>
45325 ///
45326 /// ```json
45327 ///{
45328 /// "type": "object",
45329 /// "required": [
45330 /// "rows",
45331 /// "total"
45332 /// ],
45333 /// "properties": {
45334 /// "rows": {
45335 /// "type": "array",
45336 /// "items": {
45337 /// "type": "object",
45338 /// "required": [
45339 /// "airDropAsset",
45340 /// "asset",
45341 /// "autoSubscribe",
45342 /// "canRedeem",
45343 /// "collateralAmount",
45344 /// "cumulativeBonusRewards",
45345 /// "cumulativeRealTimeRewards",
45346 /// "cumulativeTotalRewards",
45347 /// "latestAnnualPercentageRate",
45348 /// "productId",
45349 /// "tierAnnualPercentageRate",
45350 /// "totalAmount",
45351 /// "yesterdayAirdropPercentageRate",
45352 /// "yesterdayRealTimeRewards"
45353 /// ],
45354 /// "properties": {
45355 /// "airDropAsset": {
45356 /// "examples": [
45357 /// "BETH"
45358 /// ],
45359 /// "type": "string"
45360 /// },
45361 /// "asset": {
45362 /// "examples": [
45363 /// "USDT"
45364 /// ],
45365 /// "type": "string"
45366 /// },
45367 /// "autoSubscribe": {
45368 /// "examples": [
45369 /// true
45370 /// ],
45371 /// "type": "boolean"
45372 /// },
45373 /// "canRedeem": {
45374 /// "examples": [
45375 /// true
45376 /// ],
45377 /// "type": "boolean"
45378 /// },
45379 /// "collateralAmount": {
45380 /// "examples": [
45381 /// "232.23123213"
45382 /// ],
45383 /// "type": "string"
45384 /// },
45385 /// "cumulativeBonusRewards": {
45386 /// "examples": [
45387 /// "0.22759183"
45388 /// ],
45389 /// "type": "string"
45390 /// },
45391 /// "cumulativeRealTimeRewards": {
45392 /// "examples": [
45393 /// "0.22759183"
45394 /// ],
45395 /// "type": "string"
45396 /// },
45397 /// "cumulativeTotalRewards": {
45398 /// "examples": [
45399 /// "0.45459183"
45400 /// ],
45401 /// "type": "string"
45402 /// },
45403 /// "latestAnnualPercentageRate": {
45404 /// "examples": [
45405 /// "0.02599895"
45406 /// ],
45407 /// "type": "string"
45408 /// },
45409 /// "productId": {
45410 /// "examples": [
45411 /// "USDT001"
45412 /// ],
45413 /// "type": "string"
45414 /// },
45415 /// "tierAnnualPercentageRate": {
45416 /// "type": "object",
45417 /// "required": [
45418 /// "0-5BTC",
45419 /// "5-10BTC"
45420 /// ],
45421 /// "properties": {
45422 /// "0-5BTC": {
45423 /// "examples": [
45424 /// 0.05
45425 /// ],
45426 /// "type": "number",
45427 /// "format": "double"
45428 /// },
45429 /// "5-10BTC": {
45430 /// "examples": [
45431 /// 0.03
45432 /// ],
45433 /// "type": "number",
45434 /// "format": "double"
45435 /// }
45436 /// }
45437 /// },
45438 /// "totalAmount": {
45439 /// "examples": [
45440 /// "75.46000000"
45441 /// ],
45442 /// "type": "string"
45443 /// },
45444 /// "yesterdayAirdropPercentageRate": {
45445 /// "examples": [
45446 /// "0.02599895"
45447 /// ],
45448 /// "type": "string"
45449 /// },
45450 /// "yesterdayRealTimeRewards": {
45451 /// "examples": [
45452 /// "0.10293829"
45453 /// ],
45454 /// "type": "string"
45455 /// }
45456 /// }
45457 /// }
45458 /// },
45459 /// "total": {
45460 /// "examples": [
45461 /// 1
45462 /// ],
45463 /// "type": "integer",
45464 /// "format": "int64"
45465 /// }
45466 /// }
45467 ///}
45468 /// ```
45469 /// </details>
45470 #[derive(Clone, Debug, Deserialize, Serialize)]
45471 pub struct SimpleEarnFlexiblePositionResponse {
45472 pub rows: Vec<SimpleEarnFlexiblePositionResponseRowsItem>,
45473 pub total: i64,
45474 }
45475 impl From<&SimpleEarnFlexiblePositionResponse>
45476 for SimpleEarnFlexiblePositionResponse {
45477 fn from(value: &SimpleEarnFlexiblePositionResponse) -> Self {
45478 value.clone()
45479 }
45480 }
45481 ///SimpleEarnFlexiblePositionResponseRowsItem
45482 ///
45483 /// <details><summary>JSON schema</summary>
45484 ///
45485 /// ```json
45486 ///{
45487 /// "type": "object",
45488 /// "required": [
45489 /// "airDropAsset",
45490 /// "asset",
45491 /// "autoSubscribe",
45492 /// "canRedeem",
45493 /// "collateralAmount",
45494 /// "cumulativeBonusRewards",
45495 /// "cumulativeRealTimeRewards",
45496 /// "cumulativeTotalRewards",
45497 /// "latestAnnualPercentageRate",
45498 /// "productId",
45499 /// "tierAnnualPercentageRate",
45500 /// "totalAmount",
45501 /// "yesterdayAirdropPercentageRate",
45502 /// "yesterdayRealTimeRewards"
45503 /// ],
45504 /// "properties": {
45505 /// "airDropAsset": {
45506 /// "examples": [
45507 /// "BETH"
45508 /// ],
45509 /// "type": "string"
45510 /// },
45511 /// "asset": {
45512 /// "examples": [
45513 /// "USDT"
45514 /// ],
45515 /// "type": "string"
45516 /// },
45517 /// "autoSubscribe": {
45518 /// "examples": [
45519 /// true
45520 /// ],
45521 /// "type": "boolean"
45522 /// },
45523 /// "canRedeem": {
45524 /// "examples": [
45525 /// true
45526 /// ],
45527 /// "type": "boolean"
45528 /// },
45529 /// "collateralAmount": {
45530 /// "examples": [
45531 /// "232.23123213"
45532 /// ],
45533 /// "type": "string"
45534 /// },
45535 /// "cumulativeBonusRewards": {
45536 /// "examples": [
45537 /// "0.22759183"
45538 /// ],
45539 /// "type": "string"
45540 /// },
45541 /// "cumulativeRealTimeRewards": {
45542 /// "examples": [
45543 /// "0.22759183"
45544 /// ],
45545 /// "type": "string"
45546 /// },
45547 /// "cumulativeTotalRewards": {
45548 /// "examples": [
45549 /// "0.45459183"
45550 /// ],
45551 /// "type": "string"
45552 /// },
45553 /// "latestAnnualPercentageRate": {
45554 /// "examples": [
45555 /// "0.02599895"
45556 /// ],
45557 /// "type": "string"
45558 /// },
45559 /// "productId": {
45560 /// "examples": [
45561 /// "USDT001"
45562 /// ],
45563 /// "type": "string"
45564 /// },
45565 /// "tierAnnualPercentageRate": {
45566 /// "type": "object",
45567 /// "required": [
45568 /// "0-5BTC",
45569 /// "5-10BTC"
45570 /// ],
45571 /// "properties": {
45572 /// "0-5BTC": {
45573 /// "examples": [
45574 /// 0.05
45575 /// ],
45576 /// "type": "number",
45577 /// "format": "double"
45578 /// },
45579 /// "5-10BTC": {
45580 /// "examples": [
45581 /// 0.03
45582 /// ],
45583 /// "type": "number",
45584 /// "format": "double"
45585 /// }
45586 /// }
45587 /// },
45588 /// "totalAmount": {
45589 /// "examples": [
45590 /// "75.46000000"
45591 /// ],
45592 /// "type": "string"
45593 /// },
45594 /// "yesterdayAirdropPercentageRate": {
45595 /// "examples": [
45596 /// "0.02599895"
45597 /// ],
45598 /// "type": "string"
45599 /// },
45600 /// "yesterdayRealTimeRewards": {
45601 /// "examples": [
45602 /// "0.10293829"
45603 /// ],
45604 /// "type": "string"
45605 /// }
45606 /// }
45607 ///}
45608 /// ```
45609 /// </details>
45610 #[derive(Clone, Debug, Deserialize, Serialize)]
45611 pub struct SimpleEarnFlexiblePositionResponseRowsItem {
45612 #[serde(rename = "airDropAsset")]
45613 pub air_drop_asset: String,
45614 pub asset: String,
45615 #[serde(rename = "autoSubscribe")]
45616 pub auto_subscribe: bool,
45617 #[serde(rename = "canRedeem")]
45618 pub can_redeem: bool,
45619 #[serde(rename = "collateralAmount")]
45620 pub collateral_amount: String,
45621 #[serde(rename = "cumulativeBonusRewards")]
45622 pub cumulative_bonus_rewards: String,
45623 #[serde(rename = "cumulativeRealTimeRewards")]
45624 pub cumulative_real_time_rewards: String,
45625 #[serde(rename = "cumulativeTotalRewards")]
45626 pub cumulative_total_rewards: String,
45627 #[serde(rename = "latestAnnualPercentageRate")]
45628 pub latest_annual_percentage_rate: String,
45629 #[serde(rename = "productId")]
45630 pub product_id: String,
45631 #[serde(rename = "tierAnnualPercentageRate")]
45632 pub tier_annual_percentage_rate: SimpleEarnFlexiblePositionResponseRowsItemTierAnnualPercentageRate,
45633 #[serde(rename = "totalAmount")]
45634 pub total_amount: String,
45635 #[serde(rename = "yesterdayAirdropPercentageRate")]
45636 pub yesterday_airdrop_percentage_rate: String,
45637 #[serde(rename = "yesterdayRealTimeRewards")]
45638 pub yesterday_real_time_rewards: String,
45639 }
45640 impl From<&SimpleEarnFlexiblePositionResponseRowsItem>
45641 for SimpleEarnFlexiblePositionResponseRowsItem {
45642 fn from(value: &SimpleEarnFlexiblePositionResponseRowsItem) -> Self {
45643 value.clone()
45644 }
45645 }
45646 ///SimpleEarnFlexiblePositionResponseRowsItemTierAnnualPercentageRate
45647 ///
45648 /// <details><summary>JSON schema</summary>
45649 ///
45650 /// ```json
45651 ///{
45652 /// "type": "object",
45653 /// "required": [
45654 /// "0-5BTC",
45655 /// "5-10BTC"
45656 /// ],
45657 /// "properties": {
45658 /// "0-5BTC": {
45659 /// "examples": [
45660 /// 0.05
45661 /// ],
45662 /// "type": "number",
45663 /// "format": "double"
45664 /// },
45665 /// "5-10BTC": {
45666 /// "examples": [
45667 /// 0.03
45668 /// ],
45669 /// "type": "number",
45670 /// "format": "double"
45671 /// }
45672 /// }
45673 ///}
45674 /// ```
45675 /// </details>
45676 #[derive(Clone, Debug, Deserialize, Serialize)]
45677 pub struct SimpleEarnFlexiblePositionResponseRowsItemTierAnnualPercentageRate {
45678 #[serde(rename = "0-5BTC")]
45679 pub _0_5btc: f64,
45680 #[serde(rename = "5-10BTC")]
45681 pub _5_10btc: f64,
45682 }
45683 impl From<&SimpleEarnFlexiblePositionResponseRowsItemTierAnnualPercentageRate>
45684 for SimpleEarnFlexiblePositionResponseRowsItemTierAnnualPercentageRate {
45685 fn from(
45686 value: &SimpleEarnFlexiblePositionResponseRowsItemTierAnnualPercentageRate,
45687 ) -> Self {
45688 value.clone()
45689 }
45690 }
45691 ///SimpleEarnFlexibleRedeemResponse
45692 ///
45693 /// <details><summary>JSON schema</summary>
45694 ///
45695 /// ```json
45696 ///{
45697 /// "type": "object",
45698 /// "required": [
45699 /// "redeemId",
45700 /// "success"
45701 /// ],
45702 /// "properties": {
45703 /// "redeemId": {
45704 /// "examples": [
45705 /// 40607
45706 /// ],
45707 /// "type": "integer",
45708 /// "format": "int64"
45709 /// },
45710 /// "success": {
45711 /// "examples": [
45712 /// true
45713 /// ],
45714 /// "type": "boolean"
45715 /// }
45716 /// }
45717 ///}
45718 /// ```
45719 /// </details>
45720 #[derive(Clone, Debug, Deserialize, Serialize)]
45721 pub struct SimpleEarnFlexibleRedeemResponse {
45722 #[serde(rename = "redeemId")]
45723 pub redeem_id: i64,
45724 pub success: bool,
45725 }
45726 impl From<&SimpleEarnFlexibleRedeemResponse> for SimpleEarnFlexibleRedeemResponse {
45727 fn from(value: &SimpleEarnFlexibleRedeemResponse) -> Self {
45728 value.clone()
45729 }
45730 }
45731 ///SimpleEarnFlexibleSetAutoSubscribeResponse
45732 ///
45733 /// <details><summary>JSON schema</summary>
45734 ///
45735 /// ```json
45736 ///{
45737 /// "type": "object",
45738 /// "required": [
45739 /// "success"
45740 /// ],
45741 /// "properties": {
45742 /// "success": {
45743 /// "examples": [
45744 /// true
45745 /// ],
45746 /// "type": "boolean"
45747 /// }
45748 /// }
45749 ///}
45750 /// ```
45751 /// </details>
45752 #[derive(Clone, Debug, Deserialize, Serialize)]
45753 pub struct SimpleEarnFlexibleSetAutoSubscribeResponse {
45754 pub success: bool,
45755 }
45756 impl From<&SimpleEarnFlexibleSetAutoSubscribeResponse>
45757 for SimpleEarnFlexibleSetAutoSubscribeResponse {
45758 fn from(value: &SimpleEarnFlexibleSetAutoSubscribeResponse) -> Self {
45759 value.clone()
45760 }
45761 }
45762 ///SimpleEarnFlexibleSubscribeResponse
45763 ///
45764 /// <details><summary>JSON schema</summary>
45765 ///
45766 /// ```json
45767 ///{
45768 /// "type": "object",
45769 /// "required": [
45770 /// "purchaseId",
45771 /// "success"
45772 /// ],
45773 /// "properties": {
45774 /// "purchaseId": {
45775 /// "examples": [
45776 /// 40607
45777 /// ],
45778 /// "type": "integer",
45779 /// "format": "int64"
45780 /// },
45781 /// "success": {
45782 /// "examples": [
45783 /// true
45784 /// ],
45785 /// "type": "boolean"
45786 /// }
45787 /// }
45788 ///}
45789 /// ```
45790 /// </details>
45791 #[derive(Clone, Debug, Deserialize, Serialize)]
45792 pub struct SimpleEarnFlexibleSubscribeResponse {
45793 #[serde(rename = "purchaseId")]
45794 pub purchase_id: i64,
45795 pub success: bool,
45796 }
45797 impl From<&SimpleEarnFlexibleSubscribeResponse>
45798 for SimpleEarnFlexibleSubscribeResponse {
45799 fn from(value: &SimpleEarnFlexibleSubscribeResponse) -> Self {
45800 value.clone()
45801 }
45802 }
45803 ///SimpleEarnFlexibleSubscriptionPreviewResponse
45804 ///
45805 /// <details><summary>JSON schema</summary>
45806 ///
45807 /// ```json
45808 ///{
45809 /// "type": "object",
45810 /// "required": [
45811 /// "airDropAsset",
45812 /// "estDailyAirdropRewards",
45813 /// "estDailyBonusRewards",
45814 /// "estDailyRealTimeRewards",
45815 /// "rewardAsset",
45816 /// "totalAmount"
45817 /// ],
45818 /// "properties": {
45819 /// "airDropAsset": {
45820 /// "examples": [
45821 /// "BETH"
45822 /// ],
45823 /// "type": "string"
45824 /// },
45825 /// "estDailyAirdropRewards": {
45826 /// "examples": [
45827 /// "0.22759183"
45828 /// ],
45829 /// "type": "string"
45830 /// },
45831 /// "estDailyBonusRewards": {
45832 /// "examples": [
45833 /// "0.22759183"
45834 /// ],
45835 /// "type": "string"
45836 /// },
45837 /// "estDailyRealTimeRewards": {
45838 /// "examples": [
45839 /// "0.22759183"
45840 /// ],
45841 /// "type": "string"
45842 /// },
45843 /// "rewardAsset": {
45844 /// "examples": [
45845 /// "BUSD"
45846 /// ],
45847 /// "type": "string"
45848 /// },
45849 /// "totalAmount": {
45850 /// "examples": [
45851 /// "1232.32230982"
45852 /// ],
45853 /// "type": "string"
45854 /// }
45855 /// }
45856 ///}
45857 /// ```
45858 /// </details>
45859 #[derive(Clone, Debug, Deserialize, Serialize)]
45860 pub struct SimpleEarnFlexibleSubscriptionPreviewResponse {
45861 #[serde(rename = "airDropAsset")]
45862 pub air_drop_asset: String,
45863 #[serde(rename = "estDailyAirdropRewards")]
45864 pub est_daily_airdrop_rewards: String,
45865 #[serde(rename = "estDailyBonusRewards")]
45866 pub est_daily_bonus_rewards: String,
45867 #[serde(rename = "estDailyRealTimeRewards")]
45868 pub est_daily_real_time_rewards: String,
45869 #[serde(rename = "rewardAsset")]
45870 pub reward_asset: String,
45871 #[serde(rename = "totalAmount")]
45872 pub total_amount: String,
45873 }
45874 impl From<&SimpleEarnFlexibleSubscriptionPreviewResponse>
45875 for SimpleEarnFlexibleSubscriptionPreviewResponse {
45876 fn from(value: &SimpleEarnFlexibleSubscriptionPreviewResponse) -> Self {
45877 value.clone()
45878 }
45879 }
45880 ///SimpleEarnLockedHistoryRedemptionRecordResponse
45881 ///
45882 /// <details><summary>JSON schema</summary>
45883 ///
45884 /// ```json
45885 ///{
45886 /// "type": "object",
45887 /// "required": [
45888 /// "rows",
45889 /// "total"
45890 /// ],
45891 /// "properties": {
45892 /// "rows": {
45893 /// "type": "array",
45894 /// "items": {
45895 /// "type": "object",
45896 /// "required": [
45897 /// "amount",
45898 /// "asset",
45899 /// "deliverDate",
45900 /// "lockPeriod",
45901 /// "positionId",
45902 /// "redeemId",
45903 /// "status",
45904 /// "time",
45905 /// "type"
45906 /// ],
45907 /// "properties": {
45908 /// "amount": {
45909 /// "examples": [
45910 /// "21312.23223"
45911 /// ],
45912 /// "type": "string"
45913 /// },
45914 /// "asset": {
45915 /// "examples": [
45916 /// "BNB"
45917 /// ],
45918 /// "type": "string"
45919 /// },
45920 /// "deliverDate": {
45921 /// "examples": [
45922 /// "1575018510000"
45923 /// ],
45924 /// "type": "string"
45925 /// },
45926 /// "lockPeriod": {
45927 /// "examples": [
45928 /// "30"
45929 /// ],
45930 /// "type": "string"
45931 /// },
45932 /// "positionId": {
45933 /// "examples": [
45934 /// "123123"
45935 /// ],
45936 /// "type": "string"
45937 /// },
45938 /// "redeemId": {
45939 /// "examples": [
45940 /// 40607
45941 /// ],
45942 /// "type": "integer",
45943 /// "format": "int64"
45944 /// },
45945 /// "status": {
45946 /// "examples": [
45947 /// "PAID"
45948 /// ],
45949 /// "type": "string"
45950 /// },
45951 /// "time": {
45952 /// "examples": [
45953 /// 1575018510000
45954 /// ],
45955 /// "type": "integer",
45956 /// "format": "int64"
45957 /// },
45958 /// "type": {
45959 /// "description": "MATURE for redeem to Spot Wallet, NEW_TRANSFERRED for redeem to Flexible product, AHEAD for early redemption",
45960 /// "examples": [
45961 /// "MATURE"
45962 /// ],
45963 /// "type": "string"
45964 /// }
45965 /// }
45966 /// }
45967 /// },
45968 /// "total": {
45969 /// "examples": [
45970 /// 1
45971 /// ],
45972 /// "type": "integer",
45973 /// "format": "int64"
45974 /// }
45975 /// }
45976 ///}
45977 /// ```
45978 /// </details>
45979 #[derive(Clone, Debug, Deserialize, Serialize)]
45980 pub struct SimpleEarnLockedHistoryRedemptionRecordResponse {
45981 pub rows: Vec<SimpleEarnLockedHistoryRedemptionRecordResponseRowsItem>,
45982 pub total: i64,
45983 }
45984 impl From<&SimpleEarnLockedHistoryRedemptionRecordResponse>
45985 for SimpleEarnLockedHistoryRedemptionRecordResponse {
45986 fn from(value: &SimpleEarnLockedHistoryRedemptionRecordResponse) -> Self {
45987 value.clone()
45988 }
45989 }
45990 ///SimpleEarnLockedHistoryRedemptionRecordResponseRowsItem
45991 ///
45992 /// <details><summary>JSON schema</summary>
45993 ///
45994 /// ```json
45995 ///{
45996 /// "type": "object",
45997 /// "required": [
45998 /// "amount",
45999 /// "asset",
46000 /// "deliverDate",
46001 /// "lockPeriod",
46002 /// "positionId",
46003 /// "redeemId",
46004 /// "status",
46005 /// "time",
46006 /// "type"
46007 /// ],
46008 /// "properties": {
46009 /// "amount": {
46010 /// "examples": [
46011 /// "21312.23223"
46012 /// ],
46013 /// "type": "string"
46014 /// },
46015 /// "asset": {
46016 /// "examples": [
46017 /// "BNB"
46018 /// ],
46019 /// "type": "string"
46020 /// },
46021 /// "deliverDate": {
46022 /// "examples": [
46023 /// "1575018510000"
46024 /// ],
46025 /// "type": "string"
46026 /// },
46027 /// "lockPeriod": {
46028 /// "examples": [
46029 /// "30"
46030 /// ],
46031 /// "type": "string"
46032 /// },
46033 /// "positionId": {
46034 /// "examples": [
46035 /// "123123"
46036 /// ],
46037 /// "type": "string"
46038 /// },
46039 /// "redeemId": {
46040 /// "examples": [
46041 /// 40607
46042 /// ],
46043 /// "type": "integer",
46044 /// "format": "int64"
46045 /// },
46046 /// "status": {
46047 /// "examples": [
46048 /// "PAID"
46049 /// ],
46050 /// "type": "string"
46051 /// },
46052 /// "time": {
46053 /// "examples": [
46054 /// 1575018510000
46055 /// ],
46056 /// "type": "integer",
46057 /// "format": "int64"
46058 /// },
46059 /// "type": {
46060 /// "description": "MATURE for redeem to Spot Wallet, NEW_TRANSFERRED for redeem to Flexible product, AHEAD for early redemption",
46061 /// "examples": [
46062 /// "MATURE"
46063 /// ],
46064 /// "type": "string"
46065 /// }
46066 /// }
46067 ///}
46068 /// ```
46069 /// </details>
46070 #[derive(Clone, Debug, Deserialize, Serialize)]
46071 pub struct SimpleEarnLockedHistoryRedemptionRecordResponseRowsItem {
46072 pub amount: String,
46073 pub asset: String,
46074 #[serde(rename = "deliverDate")]
46075 pub deliver_date: String,
46076 #[serde(rename = "lockPeriod")]
46077 pub lock_period: String,
46078 #[serde(rename = "positionId")]
46079 pub position_id: String,
46080 #[serde(rename = "redeemId")]
46081 pub redeem_id: i64,
46082 pub status: String,
46083 pub time: i64,
46084 ///MATURE for redeem to Spot Wallet, NEW_TRANSFERRED for redeem to Flexible product, AHEAD for early redemption
46085 #[serde(rename = "type")]
46086 pub type_: String,
46087 }
46088 impl From<&SimpleEarnLockedHistoryRedemptionRecordResponseRowsItem>
46089 for SimpleEarnLockedHistoryRedemptionRecordResponseRowsItem {
46090 fn from(
46091 value: &SimpleEarnLockedHistoryRedemptionRecordResponseRowsItem,
46092 ) -> Self {
46093 value.clone()
46094 }
46095 }
46096 ///SimpleEarnLockedHistoryRewardsRecordResponse
46097 ///
46098 /// <details><summary>JSON schema</summary>
46099 ///
46100 /// ```json
46101 ///{
46102 /// "type": "object",
46103 /// "required": [
46104 /// "rows",
46105 /// "total"
46106 /// ],
46107 /// "properties": {
46108 /// "rows": {
46109 /// "type": "array",
46110 /// "items": {
46111 /// "type": "object",
46112 /// "required": [
46113 /// "amount",
46114 /// "asset",
46115 /// "lockPeriod",
46116 /// "positionId",
46117 /// "time"
46118 /// ],
46119 /// "properties": {
46120 /// "amount": {
46121 /// "examples": [
46122 /// "21312.23223"
46123 /// ],
46124 /// "type": "string"
46125 /// },
46126 /// "asset": {
46127 /// "examples": [
46128 /// "BNB"
46129 /// ],
46130 /// "type": "string"
46131 /// },
46132 /// "lockPeriod": {
46133 /// "examples": [
46134 /// "30"
46135 /// ],
46136 /// "type": "string"
46137 /// },
46138 /// "positionId": {
46139 /// "examples": [
46140 /// "123123"
46141 /// ],
46142 /// "type": "string"
46143 /// },
46144 /// "time": {
46145 /// "examples": [
46146 /// 1577257222000
46147 /// ],
46148 /// "type": "integer",
46149 /// "format": "int64"
46150 /// }
46151 /// }
46152 /// }
46153 /// },
46154 /// "total": {
46155 /// "examples": [
46156 /// 1
46157 /// ],
46158 /// "type": "integer",
46159 /// "format": "int64"
46160 /// }
46161 /// }
46162 ///}
46163 /// ```
46164 /// </details>
46165 #[derive(Clone, Debug, Deserialize, Serialize)]
46166 pub struct SimpleEarnLockedHistoryRewardsRecordResponse {
46167 pub rows: Vec<SimpleEarnLockedHistoryRewardsRecordResponseRowsItem>,
46168 pub total: i64,
46169 }
46170 impl From<&SimpleEarnLockedHistoryRewardsRecordResponse>
46171 for SimpleEarnLockedHistoryRewardsRecordResponse {
46172 fn from(value: &SimpleEarnLockedHistoryRewardsRecordResponse) -> Self {
46173 value.clone()
46174 }
46175 }
46176 ///SimpleEarnLockedHistoryRewardsRecordResponseRowsItem
46177 ///
46178 /// <details><summary>JSON schema</summary>
46179 ///
46180 /// ```json
46181 ///{
46182 /// "type": "object",
46183 /// "required": [
46184 /// "amount",
46185 /// "asset",
46186 /// "lockPeriod",
46187 /// "positionId",
46188 /// "time"
46189 /// ],
46190 /// "properties": {
46191 /// "amount": {
46192 /// "examples": [
46193 /// "21312.23223"
46194 /// ],
46195 /// "type": "string"
46196 /// },
46197 /// "asset": {
46198 /// "examples": [
46199 /// "BNB"
46200 /// ],
46201 /// "type": "string"
46202 /// },
46203 /// "lockPeriod": {
46204 /// "examples": [
46205 /// "30"
46206 /// ],
46207 /// "type": "string"
46208 /// },
46209 /// "positionId": {
46210 /// "examples": [
46211 /// "123123"
46212 /// ],
46213 /// "type": "string"
46214 /// },
46215 /// "time": {
46216 /// "examples": [
46217 /// 1577257222000
46218 /// ],
46219 /// "type": "integer",
46220 /// "format": "int64"
46221 /// }
46222 /// }
46223 ///}
46224 /// ```
46225 /// </details>
46226 #[derive(Clone, Debug, Deserialize, Serialize)]
46227 pub struct SimpleEarnLockedHistoryRewardsRecordResponseRowsItem {
46228 pub amount: String,
46229 pub asset: String,
46230 #[serde(rename = "lockPeriod")]
46231 pub lock_period: String,
46232 #[serde(rename = "positionId")]
46233 pub position_id: String,
46234 pub time: i64,
46235 }
46236 impl From<&SimpleEarnLockedHistoryRewardsRecordResponseRowsItem>
46237 for SimpleEarnLockedHistoryRewardsRecordResponseRowsItem {
46238 fn from(value: &SimpleEarnLockedHistoryRewardsRecordResponseRowsItem) -> Self {
46239 value.clone()
46240 }
46241 }
46242 ///SimpleEarnLockedHistorySubscriptionRecordResponse
46243 ///
46244 /// <details><summary>JSON schema</summary>
46245 ///
46246 /// ```json
46247 ///{
46248 /// "type": "object",
46249 /// "required": [
46250 /// "rows",
46251 /// "total"
46252 /// ],
46253 /// "properties": {
46254 /// "rows": {
46255 /// "type": "array",
46256 /// "items": {
46257 /// "type": "object",
46258 /// "required": [
46259 /// "amount",
46260 /// "amtFromFunding",
46261 /// "amtFromSpot",
46262 /// "asset",
46263 /// "lockPeriod",
46264 /// "positionId",
46265 /// "purchaseId",
46266 /// "sourceAccount",
46267 /// "status",
46268 /// "time",
46269 /// "type"
46270 /// ],
46271 /// "properties": {
46272 /// "amount": {
46273 /// "examples": [
46274 /// "21312.23223"
46275 /// ],
46276 /// "type": "string"
46277 /// },
46278 /// "amtFromFunding": {
46279 /// "description": "Display if sourceAccount is SPOTANDFUNDING",
46280 /// "examples": [
46281 /// "70"
46282 /// ],
46283 /// "type": "string"
46284 /// },
46285 /// "amtFromSpot": {
46286 /// "description": "Display if sourceAccount is SPOTANDFUNDING ",
46287 /// "examples": [
46288 /// "30"
46289 /// ],
46290 /// "type": "string"
46291 /// },
46292 /// "asset": {
46293 /// "examples": [
46294 /// "BNB"
46295 /// ],
46296 /// "type": "string"
46297 /// },
46298 /// "lockPeriod": {
46299 /// "examples": [
46300 /// "30"
46301 /// ],
46302 /// "type": "string"
46303 /// },
46304 /// "positionId": {
46305 /// "examples": [
46306 /// "123123"
46307 /// ],
46308 /// "type": "string"
46309 /// },
46310 /// "purchaseId": {
46311 /// "examples": [
46312 /// 26055
46313 /// ],
46314 /// "type": "integer",
46315 /// "format": "int64"
46316 /// },
46317 /// "sourceAccount": {
46318 /// "description": "SPOT, FUNDING, SPOTANDFUNDING",
46319 /// "examples": [
46320 /// "SPOT"
46321 /// ],
46322 /// "type": "string"
46323 /// },
46324 /// "status": {
46325 /// "description": "PURCHASING/SUCCESS/FAILED",
46326 /// "examples": [
46327 /// "SUCCESS"
46328 /// ],
46329 /// "type": "string"
46330 /// },
46331 /// "time": {
46332 /// "examples": [
46333 /// 1575018510000
46334 /// ],
46335 /// "type": "integer",
46336 /// "format": "int64"
46337 /// },
46338 /// "type": {
46339 /// "description": "NORMAL for normal subscription, AUTO for auto-subscription order, ACTIVITY for activity order, TRIAL for trial fund order, RESTAKE for restake order",
46340 /// "examples": [
46341 /// "AUTO"
46342 /// ],
46343 /// "type": "string"
46344 /// }
46345 /// }
46346 /// }
46347 /// },
46348 /// "total": {
46349 /// "examples": [
46350 /// 1
46351 /// ],
46352 /// "type": "integer",
46353 /// "format": "int64"
46354 /// }
46355 /// }
46356 ///}
46357 /// ```
46358 /// </details>
46359 #[derive(Clone, Debug, Deserialize, Serialize)]
46360 pub struct SimpleEarnLockedHistorySubscriptionRecordResponse {
46361 pub rows: Vec<SimpleEarnLockedHistorySubscriptionRecordResponseRowsItem>,
46362 pub total: i64,
46363 }
46364 impl From<&SimpleEarnLockedHistorySubscriptionRecordResponse>
46365 for SimpleEarnLockedHistorySubscriptionRecordResponse {
46366 fn from(value: &SimpleEarnLockedHistorySubscriptionRecordResponse) -> Self {
46367 value.clone()
46368 }
46369 }
46370 ///SimpleEarnLockedHistorySubscriptionRecordResponseRowsItem
46371 ///
46372 /// <details><summary>JSON schema</summary>
46373 ///
46374 /// ```json
46375 ///{
46376 /// "type": "object",
46377 /// "required": [
46378 /// "amount",
46379 /// "amtFromFunding",
46380 /// "amtFromSpot",
46381 /// "asset",
46382 /// "lockPeriod",
46383 /// "positionId",
46384 /// "purchaseId",
46385 /// "sourceAccount",
46386 /// "status",
46387 /// "time",
46388 /// "type"
46389 /// ],
46390 /// "properties": {
46391 /// "amount": {
46392 /// "examples": [
46393 /// "21312.23223"
46394 /// ],
46395 /// "type": "string"
46396 /// },
46397 /// "amtFromFunding": {
46398 /// "description": "Display if sourceAccount is SPOTANDFUNDING",
46399 /// "examples": [
46400 /// "70"
46401 /// ],
46402 /// "type": "string"
46403 /// },
46404 /// "amtFromSpot": {
46405 /// "description": "Display if sourceAccount is SPOTANDFUNDING ",
46406 /// "examples": [
46407 /// "30"
46408 /// ],
46409 /// "type": "string"
46410 /// },
46411 /// "asset": {
46412 /// "examples": [
46413 /// "BNB"
46414 /// ],
46415 /// "type": "string"
46416 /// },
46417 /// "lockPeriod": {
46418 /// "examples": [
46419 /// "30"
46420 /// ],
46421 /// "type": "string"
46422 /// },
46423 /// "positionId": {
46424 /// "examples": [
46425 /// "123123"
46426 /// ],
46427 /// "type": "string"
46428 /// },
46429 /// "purchaseId": {
46430 /// "examples": [
46431 /// 26055
46432 /// ],
46433 /// "type": "integer",
46434 /// "format": "int64"
46435 /// },
46436 /// "sourceAccount": {
46437 /// "description": "SPOT, FUNDING, SPOTANDFUNDING",
46438 /// "examples": [
46439 /// "SPOT"
46440 /// ],
46441 /// "type": "string"
46442 /// },
46443 /// "status": {
46444 /// "description": "PURCHASING/SUCCESS/FAILED",
46445 /// "examples": [
46446 /// "SUCCESS"
46447 /// ],
46448 /// "type": "string"
46449 /// },
46450 /// "time": {
46451 /// "examples": [
46452 /// 1575018510000
46453 /// ],
46454 /// "type": "integer",
46455 /// "format": "int64"
46456 /// },
46457 /// "type": {
46458 /// "description": "NORMAL for normal subscription, AUTO for auto-subscription order, ACTIVITY for activity order, TRIAL for trial fund order, RESTAKE for restake order",
46459 /// "examples": [
46460 /// "AUTO"
46461 /// ],
46462 /// "type": "string"
46463 /// }
46464 /// }
46465 ///}
46466 /// ```
46467 /// </details>
46468 #[derive(Clone, Debug, Deserialize, Serialize)]
46469 pub struct SimpleEarnLockedHistorySubscriptionRecordResponseRowsItem {
46470 pub amount: String,
46471 ///Display if sourceAccount is SPOTANDFUNDING
46472 #[serde(rename = "amtFromFunding")]
46473 pub amt_from_funding: String,
46474 ///Display if sourceAccount is SPOTANDFUNDING
46475 #[serde(rename = "amtFromSpot")]
46476 pub amt_from_spot: String,
46477 pub asset: String,
46478 #[serde(rename = "lockPeriod")]
46479 pub lock_period: String,
46480 #[serde(rename = "positionId")]
46481 pub position_id: String,
46482 #[serde(rename = "purchaseId")]
46483 pub purchase_id: i64,
46484 ///SPOT, FUNDING, SPOTANDFUNDING
46485 #[serde(rename = "sourceAccount")]
46486 pub source_account: String,
46487 ///PURCHASING/SUCCESS/FAILED
46488 pub status: String,
46489 pub time: i64,
46490 ///NORMAL for normal subscription, AUTO for auto-subscription order, ACTIVITY for activity order, TRIAL for trial fund order, RESTAKE for restake order
46491 #[serde(rename = "type")]
46492 pub type_: String,
46493 }
46494 impl From<&SimpleEarnLockedHistorySubscriptionRecordResponseRowsItem>
46495 for SimpleEarnLockedHistorySubscriptionRecordResponseRowsItem {
46496 fn from(
46497 value: &SimpleEarnLockedHistorySubscriptionRecordResponseRowsItem,
46498 ) -> Self {
46499 value.clone()
46500 }
46501 }
46502 ///SimpleEarnLockedListResponse
46503 ///
46504 /// <details><summary>JSON schema</summary>
46505 ///
46506 /// ```json
46507 ///{
46508 /// "type": "object",
46509 /// "required": [
46510 /// "rows",
46511 /// "total"
46512 /// ],
46513 /// "properties": {
46514 /// "rows": {
46515 /// "type": "array",
46516 /// "items": {
46517 /// "type": "object",
46518 /// "required": [
46519 /// "detail",
46520 /// "projectId",
46521 /// "quota"
46522 /// ],
46523 /// "properties": {
46524 /// "detail": {
46525 /// "type": "object",
46526 /// "required": [
46527 /// "apr",
46528 /// "asset",
46529 /// "duration",
46530 /// "extraRewardAPR",
46531 /// "extraRewardAsset",
46532 /// "isSoldOut",
46533 /// "renewable",
46534 /// "rewardAsset",
46535 /// "status",
46536 /// "subscriptionStartTime"
46537 /// ],
46538 /// "properties": {
46539 /// "apr": {
46540 /// "examples": [
46541 /// "1.2069"
46542 /// ],
46543 /// "type": "string"
46544 /// },
46545 /// "asset": {
46546 /// "examples": [
46547 /// "AXS"
46548 /// ],
46549 /// "type": "string"
46550 /// },
46551 /// "duration": {
46552 /// "examples": [
46553 /// 90
46554 /// ],
46555 /// "type": "integer",
46556 /// "format": "int64"
46557 /// },
46558 /// "extraRewardAPR": {
46559 /// "examples": [
46560 /// "0.23"
46561 /// ],
46562 /// "type": "string"
46563 /// },
46564 /// "extraRewardAsset": {
46565 /// "examples": [
46566 /// "BNB"
46567 /// ],
46568 /// "type": "string"
46569 /// },
46570 /// "isSoldOut": {
46571 /// "examples": [
46572 /// true
46573 /// ],
46574 /// "type": "boolean"
46575 /// },
46576 /// "renewable": {
46577 /// "examples": [
46578 /// true
46579 /// ],
46580 /// "type": "boolean"
46581 /// },
46582 /// "rewardAsset": {
46583 /// "examples": [
46584 /// "AXS"
46585 /// ],
46586 /// "type": "string"
46587 /// },
46588 /// "status": {
46589 /// "examples": [
46590 /// "CREATED"
46591 /// ],
46592 /// "type": "string"
46593 /// },
46594 /// "subscriptionStartTime": {
46595 /// "examples": [
46596 /// "1646182276000"
46597 /// ],
46598 /// "type": "string"
46599 /// }
46600 /// }
46601 /// },
46602 /// "projectId": {
46603 /// "examples": [
46604 /// "BNB"
46605 /// ],
46606 /// "type": "string"
46607 /// },
46608 /// "quota": {
46609 /// "type": "object",
46610 /// "required": [
46611 /// "minimum",
46612 /// "totalPersonalQuota"
46613 /// ],
46614 /// "properties": {
46615 /// "minimum": {
46616 /// "examples": [
46617 /// "0.001"
46618 /// ],
46619 /// "type": "string"
46620 /// },
46621 /// "totalPersonalQuota": {
46622 /// "examples": [
46623 /// "2"
46624 /// ],
46625 /// "type": "string"
46626 /// }
46627 /// }
46628 /// }
46629 /// }
46630 /// }
46631 /// },
46632 /// "total": {
46633 /// "examples": [
46634 /// 1
46635 /// ],
46636 /// "type": "integer",
46637 /// "format": "int64"
46638 /// }
46639 /// }
46640 ///}
46641 /// ```
46642 /// </details>
46643 #[derive(Clone, Debug, Deserialize, Serialize)]
46644 pub struct SimpleEarnLockedListResponse {
46645 pub rows: Vec<SimpleEarnLockedListResponseRowsItem>,
46646 pub total: i64,
46647 }
46648 impl From<&SimpleEarnLockedListResponse> for SimpleEarnLockedListResponse {
46649 fn from(value: &SimpleEarnLockedListResponse) -> Self {
46650 value.clone()
46651 }
46652 }
46653 ///SimpleEarnLockedListResponseRowsItem
46654 ///
46655 /// <details><summary>JSON schema</summary>
46656 ///
46657 /// ```json
46658 ///{
46659 /// "type": "object",
46660 /// "required": [
46661 /// "detail",
46662 /// "projectId",
46663 /// "quota"
46664 /// ],
46665 /// "properties": {
46666 /// "detail": {
46667 /// "type": "object",
46668 /// "required": [
46669 /// "apr",
46670 /// "asset",
46671 /// "duration",
46672 /// "extraRewardAPR",
46673 /// "extraRewardAsset",
46674 /// "isSoldOut",
46675 /// "renewable",
46676 /// "rewardAsset",
46677 /// "status",
46678 /// "subscriptionStartTime"
46679 /// ],
46680 /// "properties": {
46681 /// "apr": {
46682 /// "examples": [
46683 /// "1.2069"
46684 /// ],
46685 /// "type": "string"
46686 /// },
46687 /// "asset": {
46688 /// "examples": [
46689 /// "AXS"
46690 /// ],
46691 /// "type": "string"
46692 /// },
46693 /// "duration": {
46694 /// "examples": [
46695 /// 90
46696 /// ],
46697 /// "type": "integer",
46698 /// "format": "int64"
46699 /// },
46700 /// "extraRewardAPR": {
46701 /// "examples": [
46702 /// "0.23"
46703 /// ],
46704 /// "type": "string"
46705 /// },
46706 /// "extraRewardAsset": {
46707 /// "examples": [
46708 /// "BNB"
46709 /// ],
46710 /// "type": "string"
46711 /// },
46712 /// "isSoldOut": {
46713 /// "examples": [
46714 /// true
46715 /// ],
46716 /// "type": "boolean"
46717 /// },
46718 /// "renewable": {
46719 /// "examples": [
46720 /// true
46721 /// ],
46722 /// "type": "boolean"
46723 /// },
46724 /// "rewardAsset": {
46725 /// "examples": [
46726 /// "AXS"
46727 /// ],
46728 /// "type": "string"
46729 /// },
46730 /// "status": {
46731 /// "examples": [
46732 /// "CREATED"
46733 /// ],
46734 /// "type": "string"
46735 /// },
46736 /// "subscriptionStartTime": {
46737 /// "examples": [
46738 /// "1646182276000"
46739 /// ],
46740 /// "type": "string"
46741 /// }
46742 /// }
46743 /// },
46744 /// "projectId": {
46745 /// "examples": [
46746 /// "BNB"
46747 /// ],
46748 /// "type": "string"
46749 /// },
46750 /// "quota": {
46751 /// "type": "object",
46752 /// "required": [
46753 /// "minimum",
46754 /// "totalPersonalQuota"
46755 /// ],
46756 /// "properties": {
46757 /// "minimum": {
46758 /// "examples": [
46759 /// "0.001"
46760 /// ],
46761 /// "type": "string"
46762 /// },
46763 /// "totalPersonalQuota": {
46764 /// "examples": [
46765 /// "2"
46766 /// ],
46767 /// "type": "string"
46768 /// }
46769 /// }
46770 /// }
46771 /// }
46772 ///}
46773 /// ```
46774 /// </details>
46775 #[derive(Clone, Debug, Deserialize, Serialize)]
46776 pub struct SimpleEarnLockedListResponseRowsItem {
46777 pub detail: SimpleEarnLockedListResponseRowsItemDetail,
46778 #[serde(rename = "projectId")]
46779 pub project_id: String,
46780 pub quota: SimpleEarnLockedListResponseRowsItemQuota,
46781 }
46782 impl From<&SimpleEarnLockedListResponseRowsItem>
46783 for SimpleEarnLockedListResponseRowsItem {
46784 fn from(value: &SimpleEarnLockedListResponseRowsItem) -> Self {
46785 value.clone()
46786 }
46787 }
46788 ///SimpleEarnLockedListResponseRowsItemDetail
46789 ///
46790 /// <details><summary>JSON schema</summary>
46791 ///
46792 /// ```json
46793 ///{
46794 /// "type": "object",
46795 /// "required": [
46796 /// "apr",
46797 /// "asset",
46798 /// "duration",
46799 /// "extraRewardAPR",
46800 /// "extraRewardAsset",
46801 /// "isSoldOut",
46802 /// "renewable",
46803 /// "rewardAsset",
46804 /// "status",
46805 /// "subscriptionStartTime"
46806 /// ],
46807 /// "properties": {
46808 /// "apr": {
46809 /// "examples": [
46810 /// "1.2069"
46811 /// ],
46812 /// "type": "string"
46813 /// },
46814 /// "asset": {
46815 /// "examples": [
46816 /// "AXS"
46817 /// ],
46818 /// "type": "string"
46819 /// },
46820 /// "duration": {
46821 /// "examples": [
46822 /// 90
46823 /// ],
46824 /// "type": "integer",
46825 /// "format": "int64"
46826 /// },
46827 /// "extraRewardAPR": {
46828 /// "examples": [
46829 /// "0.23"
46830 /// ],
46831 /// "type": "string"
46832 /// },
46833 /// "extraRewardAsset": {
46834 /// "examples": [
46835 /// "BNB"
46836 /// ],
46837 /// "type": "string"
46838 /// },
46839 /// "isSoldOut": {
46840 /// "examples": [
46841 /// true
46842 /// ],
46843 /// "type": "boolean"
46844 /// },
46845 /// "renewable": {
46846 /// "examples": [
46847 /// true
46848 /// ],
46849 /// "type": "boolean"
46850 /// },
46851 /// "rewardAsset": {
46852 /// "examples": [
46853 /// "AXS"
46854 /// ],
46855 /// "type": "string"
46856 /// },
46857 /// "status": {
46858 /// "examples": [
46859 /// "CREATED"
46860 /// ],
46861 /// "type": "string"
46862 /// },
46863 /// "subscriptionStartTime": {
46864 /// "examples": [
46865 /// "1646182276000"
46866 /// ],
46867 /// "type": "string"
46868 /// }
46869 /// }
46870 ///}
46871 /// ```
46872 /// </details>
46873 #[derive(Clone, Debug, Deserialize, Serialize)]
46874 pub struct SimpleEarnLockedListResponseRowsItemDetail {
46875 pub apr: String,
46876 pub asset: String,
46877 pub duration: i64,
46878 #[serde(rename = "extraRewardAPR")]
46879 pub extra_reward_apr: String,
46880 #[serde(rename = "extraRewardAsset")]
46881 pub extra_reward_asset: String,
46882 #[serde(rename = "isSoldOut")]
46883 pub is_sold_out: bool,
46884 pub renewable: bool,
46885 #[serde(rename = "rewardAsset")]
46886 pub reward_asset: String,
46887 pub status: String,
46888 #[serde(rename = "subscriptionStartTime")]
46889 pub subscription_start_time: String,
46890 }
46891 impl From<&SimpleEarnLockedListResponseRowsItemDetail>
46892 for SimpleEarnLockedListResponseRowsItemDetail {
46893 fn from(value: &SimpleEarnLockedListResponseRowsItemDetail) -> Self {
46894 value.clone()
46895 }
46896 }
46897 ///SimpleEarnLockedListResponseRowsItemQuota
46898 ///
46899 /// <details><summary>JSON schema</summary>
46900 ///
46901 /// ```json
46902 ///{
46903 /// "type": "object",
46904 /// "required": [
46905 /// "minimum",
46906 /// "totalPersonalQuota"
46907 /// ],
46908 /// "properties": {
46909 /// "minimum": {
46910 /// "examples": [
46911 /// "0.001"
46912 /// ],
46913 /// "type": "string"
46914 /// },
46915 /// "totalPersonalQuota": {
46916 /// "examples": [
46917 /// "2"
46918 /// ],
46919 /// "type": "string"
46920 /// }
46921 /// }
46922 ///}
46923 /// ```
46924 /// </details>
46925 #[derive(Clone, Debug, Deserialize, Serialize)]
46926 pub struct SimpleEarnLockedListResponseRowsItemQuota {
46927 pub minimum: String,
46928 #[serde(rename = "totalPersonalQuota")]
46929 pub total_personal_quota: String,
46930 }
46931 impl From<&SimpleEarnLockedListResponseRowsItemQuota>
46932 for SimpleEarnLockedListResponseRowsItemQuota {
46933 fn from(value: &SimpleEarnLockedListResponseRowsItemQuota) -> Self {
46934 value.clone()
46935 }
46936 }
46937 ///SimpleEarnLockedPersonalLeftQuotaResponse
46938 ///
46939 /// <details><summary>JSON schema</summary>
46940 ///
46941 /// ```json
46942 ///{
46943 /// "type": "object",
46944 /// "required": [
46945 /// "leftPersonalQuota"
46946 /// ],
46947 /// "properties": {
46948 /// "leftPersonalQuota": {
46949 /// "examples": [
46950 /// "1000"
46951 /// ],
46952 /// "type": "string"
46953 /// }
46954 /// }
46955 ///}
46956 /// ```
46957 /// </details>
46958 #[derive(Clone, Debug, Deserialize, Serialize)]
46959 pub struct SimpleEarnLockedPersonalLeftQuotaResponse {
46960 #[serde(rename = "leftPersonalQuota")]
46961 pub left_personal_quota: String,
46962 }
46963 impl From<&SimpleEarnLockedPersonalLeftQuotaResponse>
46964 for SimpleEarnLockedPersonalLeftQuotaResponse {
46965 fn from(value: &SimpleEarnLockedPersonalLeftQuotaResponse) -> Self {
46966 value.clone()
46967 }
46968 }
46969 ///SimpleEarnLockedPositionResponse
46970 ///
46971 /// <details><summary>JSON schema</summary>
46972 ///
46973 /// ```json
46974 ///{
46975 /// "type": "object",
46976 /// "required": [
46977 /// "rows",
46978 /// "total"
46979 /// ],
46980 /// "properties": {
46981 /// "rows": {
46982 /// "type": "array",
46983 /// "items": {
46984 /// "type": "object",
46985 /// "required": [
46986 /// "APY",
46987 /// "accrualDays",
46988 /// "amount",
46989 /// "asset",
46990 /// "duration",
46991 /// "isAutoRenew",
46992 /// "isRenewable",
46993 /// "positionId",
46994 /// "projectId",
46995 /// "purchaseTime",
46996 /// "redeemDate",
46997 /// "rewardAsset"
46998 /// ],
46999 /// "properties": {
47000 /// "APY": {
47001 /// "examples": [
47002 /// "0.23"
47003 /// ],
47004 /// "type": "string"
47005 /// },
47006 /// "accrualDays": {
47007 /// "examples": [
47008 /// "4"
47009 /// ],
47010 /// "type": "string"
47011 /// },
47012 /// "amount": {
47013 /// "examples": [
47014 /// "122.09202928"
47015 /// ],
47016 /// "type": "string"
47017 /// },
47018 /// "asset": {
47019 /// "examples": [
47020 /// "AXS"
47021 /// ],
47022 /// "type": "string"
47023 /// },
47024 /// "duration": {
47025 /// "examples": [
47026 /// "60"
47027 /// ],
47028 /// "type": "string"
47029 /// },
47030 /// "isAutoRenew": {
47031 /// "examples": [
47032 /// true
47033 /// ],
47034 /// "type": "boolean"
47035 /// },
47036 /// "isRenewable": {
47037 /// "examples": [
47038 /// true
47039 /// ],
47040 /// "type": "boolean"
47041 /// },
47042 /// "positionId": {
47043 /// "examples": [
47044 /// "123123"
47045 /// ],
47046 /// "type": "string"
47047 /// },
47048 /// "projectId": {
47049 /// "examples": [
47050 /// "Axs*90"
47051 /// ],
47052 /// "type": "string"
47053 /// },
47054 /// "purchaseTime": {
47055 /// "examples": [
47056 /// "1646182276000"
47057 /// ],
47058 /// "type": "string"
47059 /// },
47060 /// "redeemDate": {
47061 /// "examples": [
47062 /// "1732182276000"
47063 /// ],
47064 /// "type": "string"
47065 /// },
47066 /// "rewardAsset": {
47067 /// "examples": [
47068 /// "AXS"
47069 /// ],
47070 /// "type": "string"
47071 /// }
47072 /// }
47073 /// }
47074 /// },
47075 /// "total": {
47076 /// "examples": [
47077 /// 1
47078 /// ],
47079 /// "type": "integer",
47080 /// "format": "int64"
47081 /// }
47082 /// }
47083 ///}
47084 /// ```
47085 /// </details>
47086 #[derive(Clone, Debug, Deserialize, Serialize)]
47087 pub struct SimpleEarnLockedPositionResponse {
47088 pub rows: Vec<SimpleEarnLockedPositionResponseRowsItem>,
47089 pub total: i64,
47090 }
47091 impl From<&SimpleEarnLockedPositionResponse> for SimpleEarnLockedPositionResponse {
47092 fn from(value: &SimpleEarnLockedPositionResponse) -> Self {
47093 value.clone()
47094 }
47095 }
47096 ///SimpleEarnLockedPositionResponseRowsItem
47097 ///
47098 /// <details><summary>JSON schema</summary>
47099 ///
47100 /// ```json
47101 ///{
47102 /// "type": "object",
47103 /// "required": [
47104 /// "APY",
47105 /// "accrualDays",
47106 /// "amount",
47107 /// "asset",
47108 /// "duration",
47109 /// "isAutoRenew",
47110 /// "isRenewable",
47111 /// "positionId",
47112 /// "projectId",
47113 /// "purchaseTime",
47114 /// "redeemDate",
47115 /// "rewardAsset"
47116 /// ],
47117 /// "properties": {
47118 /// "APY": {
47119 /// "examples": [
47120 /// "0.23"
47121 /// ],
47122 /// "type": "string"
47123 /// },
47124 /// "accrualDays": {
47125 /// "examples": [
47126 /// "4"
47127 /// ],
47128 /// "type": "string"
47129 /// },
47130 /// "amount": {
47131 /// "examples": [
47132 /// "122.09202928"
47133 /// ],
47134 /// "type": "string"
47135 /// },
47136 /// "asset": {
47137 /// "examples": [
47138 /// "AXS"
47139 /// ],
47140 /// "type": "string"
47141 /// },
47142 /// "duration": {
47143 /// "examples": [
47144 /// "60"
47145 /// ],
47146 /// "type": "string"
47147 /// },
47148 /// "isAutoRenew": {
47149 /// "examples": [
47150 /// true
47151 /// ],
47152 /// "type": "boolean"
47153 /// },
47154 /// "isRenewable": {
47155 /// "examples": [
47156 /// true
47157 /// ],
47158 /// "type": "boolean"
47159 /// },
47160 /// "positionId": {
47161 /// "examples": [
47162 /// "123123"
47163 /// ],
47164 /// "type": "string"
47165 /// },
47166 /// "projectId": {
47167 /// "examples": [
47168 /// "Axs*90"
47169 /// ],
47170 /// "type": "string"
47171 /// },
47172 /// "purchaseTime": {
47173 /// "examples": [
47174 /// "1646182276000"
47175 /// ],
47176 /// "type": "string"
47177 /// },
47178 /// "redeemDate": {
47179 /// "examples": [
47180 /// "1732182276000"
47181 /// ],
47182 /// "type": "string"
47183 /// },
47184 /// "rewardAsset": {
47185 /// "examples": [
47186 /// "AXS"
47187 /// ],
47188 /// "type": "string"
47189 /// }
47190 /// }
47191 ///}
47192 /// ```
47193 /// </details>
47194 #[derive(Clone, Debug, Deserialize, Serialize)]
47195 pub struct SimpleEarnLockedPositionResponseRowsItem {
47196 #[serde(rename = "accrualDays")]
47197 pub accrual_days: String,
47198 pub amount: String,
47199 #[serde(rename = "APY")]
47200 pub apy: String,
47201 pub asset: String,
47202 pub duration: String,
47203 #[serde(rename = "isAutoRenew")]
47204 pub is_auto_renew: bool,
47205 #[serde(rename = "isRenewable")]
47206 pub is_renewable: bool,
47207 #[serde(rename = "positionId")]
47208 pub position_id: String,
47209 #[serde(rename = "projectId")]
47210 pub project_id: String,
47211 #[serde(rename = "purchaseTime")]
47212 pub purchase_time: String,
47213 #[serde(rename = "redeemDate")]
47214 pub redeem_date: String,
47215 #[serde(rename = "rewardAsset")]
47216 pub reward_asset: String,
47217 }
47218 impl From<&SimpleEarnLockedPositionResponseRowsItem>
47219 for SimpleEarnLockedPositionResponseRowsItem {
47220 fn from(value: &SimpleEarnLockedPositionResponseRowsItem) -> Self {
47221 value.clone()
47222 }
47223 }
47224 ///SimpleEarnLockedRedeemResponse
47225 ///
47226 /// <details><summary>JSON schema</summary>
47227 ///
47228 /// ```json
47229 ///{
47230 /// "type": "object",
47231 /// "required": [
47232 /// "redeemId",
47233 /// "success"
47234 /// ],
47235 /// "properties": {
47236 /// "redeemId": {
47237 /// "examples": [
47238 /// 40607
47239 /// ],
47240 /// "type": "integer",
47241 /// "format": "int64"
47242 /// },
47243 /// "success": {
47244 /// "examples": [
47245 /// true
47246 /// ],
47247 /// "type": "boolean"
47248 /// }
47249 /// }
47250 ///}
47251 /// ```
47252 /// </details>
47253 #[derive(Clone, Debug, Deserialize, Serialize)]
47254 pub struct SimpleEarnLockedRedeemResponse {
47255 #[serde(rename = "redeemId")]
47256 pub redeem_id: i64,
47257 pub success: bool,
47258 }
47259 impl From<&SimpleEarnLockedRedeemResponse> for SimpleEarnLockedRedeemResponse {
47260 fn from(value: &SimpleEarnLockedRedeemResponse) -> Self {
47261 value.clone()
47262 }
47263 }
47264 ///SimpleEarnLockedSetAutoSubscribeResponse
47265 ///
47266 /// <details><summary>JSON schema</summary>
47267 ///
47268 /// ```json
47269 ///{
47270 /// "type": "object",
47271 /// "required": [
47272 /// "success"
47273 /// ],
47274 /// "properties": {
47275 /// "success": {
47276 /// "examples": [
47277 /// true
47278 /// ],
47279 /// "type": "boolean"
47280 /// }
47281 /// }
47282 ///}
47283 /// ```
47284 /// </details>
47285 #[derive(Clone, Debug, Deserialize, Serialize)]
47286 pub struct SimpleEarnLockedSetAutoSubscribeResponse {
47287 pub success: bool,
47288 }
47289 impl From<&SimpleEarnLockedSetAutoSubscribeResponse>
47290 for SimpleEarnLockedSetAutoSubscribeResponse {
47291 fn from(value: &SimpleEarnLockedSetAutoSubscribeResponse) -> Self {
47292 value.clone()
47293 }
47294 }
47295 ///SimpleEarnLockedSubscribeResponse
47296 ///
47297 /// <details><summary>JSON schema</summary>
47298 ///
47299 /// ```json
47300 ///{
47301 /// "type": "object",
47302 /// "required": [
47303 /// "positionId",
47304 /// "purchaseId",
47305 /// "success"
47306 /// ],
47307 /// "properties": {
47308 /// "positionId": {
47309 /// "examples": [
47310 /// "12345"
47311 /// ],
47312 /// "type": "string"
47313 /// },
47314 /// "purchaseId": {
47315 /// "examples": [
47316 /// 40607
47317 /// ],
47318 /// "type": "integer",
47319 /// "format": "int64"
47320 /// },
47321 /// "success": {
47322 /// "examples": [
47323 /// true
47324 /// ],
47325 /// "type": "boolean"
47326 /// }
47327 /// }
47328 ///}
47329 /// ```
47330 /// </details>
47331 #[derive(Clone, Debug, Deserialize, Serialize)]
47332 pub struct SimpleEarnLockedSubscribeResponse {
47333 #[serde(rename = "positionId")]
47334 pub position_id: String,
47335 #[serde(rename = "purchaseId")]
47336 pub purchase_id: i64,
47337 pub success: bool,
47338 }
47339 impl From<&SimpleEarnLockedSubscribeResponse> for SimpleEarnLockedSubscribeResponse {
47340 fn from(value: &SimpleEarnLockedSubscribeResponse) -> Self {
47341 value.clone()
47342 }
47343 }
47344 ///SimpleEarnLockedSubscriptionPreviewResponseItem
47345 ///
47346 /// <details><summary>JSON schema</summary>
47347 ///
47348 /// ```json
47349 ///{
47350 /// "type": "object",
47351 /// "required": [
47352 /// "deliverDate",
47353 /// "estTotalExtraRewardAmt",
47354 /// "extraRewardAsset",
47355 /// "nextPay",
47356 /// "nextPayDate",
47357 /// "nextSubscriptionDate",
47358 /// "rewardAsset",
47359 /// "rewardsEndDate",
47360 /// "totalRewardAmt",
47361 /// "valueDate"
47362 /// ],
47363 /// "properties": {
47364 /// "deliverDate": {
47365 /// "examples": [
47366 /// "1651536000000"
47367 /// ],
47368 /// "type": "string"
47369 /// },
47370 /// "estTotalExtraRewardAmt": {
47371 /// "examples": [
47372 /// "5.17181528"
47373 /// ],
47374 /// "type": "string"
47375 /// },
47376 /// "extraRewardAsset": {
47377 /// "examples": [
47378 /// "BNB"
47379 /// ],
47380 /// "type": "string"
47381 /// },
47382 /// "nextPay": {
47383 /// "examples": [
47384 /// "1.29295383"
47385 /// ],
47386 /// "type": "string"
47387 /// },
47388 /// "nextPayDate": {
47389 /// "examples": [
47390 /// "1646697600000"
47391 /// ],
47392 /// "type": "string"
47393 /// },
47394 /// "nextSubscriptionDate": {
47395 /// "examples": [
47396 /// "1651536000000"
47397 /// ],
47398 /// "type": "string"
47399 /// },
47400 /// "rewardAsset": {
47401 /// "examples": [
47402 /// "AXS"
47403 /// ],
47404 /// "type": "string"
47405 /// },
47406 /// "rewardsEndDate": {
47407 /// "examples": [
47408 /// "1651449600000"
47409 /// ],
47410 /// "type": "string"
47411 /// },
47412 /// "totalRewardAmt": {
47413 /// "examples": [
47414 /// "5.17181528"
47415 /// ],
47416 /// "type": "string"
47417 /// },
47418 /// "valueDate": {
47419 /// "examples": [
47420 /// "1646697600000"
47421 /// ],
47422 /// "type": "string"
47423 /// }
47424 /// }
47425 ///}
47426 /// ```
47427 /// </details>
47428 #[derive(Clone, Debug, Deserialize, Serialize)]
47429 pub struct SimpleEarnLockedSubscriptionPreviewResponseItem {
47430 #[serde(rename = "deliverDate")]
47431 pub deliver_date: String,
47432 #[serde(rename = "estTotalExtraRewardAmt")]
47433 pub est_total_extra_reward_amt: String,
47434 #[serde(rename = "extraRewardAsset")]
47435 pub extra_reward_asset: String,
47436 #[serde(rename = "nextPay")]
47437 pub next_pay: String,
47438 #[serde(rename = "nextPayDate")]
47439 pub next_pay_date: String,
47440 #[serde(rename = "nextSubscriptionDate")]
47441 pub next_subscription_date: String,
47442 #[serde(rename = "rewardAsset")]
47443 pub reward_asset: String,
47444 #[serde(rename = "rewardsEndDate")]
47445 pub rewards_end_date: String,
47446 #[serde(rename = "totalRewardAmt")]
47447 pub total_reward_amt: String,
47448 #[serde(rename = "valueDate")]
47449 pub value_date: String,
47450 }
47451 impl From<&SimpleEarnLockedSubscriptionPreviewResponseItem>
47452 for SimpleEarnLockedSubscriptionPreviewResponseItem {
47453 fn from(value: &SimpleEarnLockedSubscriptionPreviewResponseItem) -> Self {
47454 value.clone()
47455 }
47456 }
47457 ///SnapshotFutures
47458 ///
47459 /// <details><summary>JSON schema</summary>
47460 ///
47461 /// ```json
47462 ///{
47463 /// "type": "object",
47464 /// "required": [
47465 /// "code",
47466 /// "msg",
47467 /// "snapshotVos"
47468 /// ],
47469 /// "properties": {
47470 /// "code": {
47471 /// "examples": [
47472 /// 200
47473 /// ],
47474 /// "type": "integer",
47475 /// "format": "int64"
47476 /// },
47477 /// "msg": {
47478 /// "examples": [
47479 /// ""
47480 /// ],
47481 /// "type": "string"
47482 /// },
47483 /// "snapshotVos": {
47484 /// "type": "array",
47485 /// "items": {
47486 /// "type": "object",
47487 /// "required": [
47488 /// "data",
47489 /// "type",
47490 /// "updateTime"
47491 /// ],
47492 /// "properties": {
47493 /// "data": {
47494 /// "type": "object",
47495 /// "required": [
47496 /// "assets",
47497 /// "position"
47498 /// ],
47499 /// "properties": {
47500 /// "assets": {
47501 /// "type": "array",
47502 /// "items": {
47503 /// "type": "object",
47504 /// "required": [
47505 /// "asset",
47506 /// "marginBalance",
47507 /// "walletBalance"
47508 /// ],
47509 /// "properties": {
47510 /// "asset": {
47511 /// "examples": [
47512 /// "USDT"
47513 /// ],
47514 /// "type": "string"
47515 /// },
47516 /// "marginBalance": {
47517 /// "examples": [
47518 /// "118.99782335"
47519 /// ],
47520 /// "type": "string"
47521 /// },
47522 /// "walletBalance": {
47523 /// "examples": [
47524 /// "120.23811389"
47525 /// ],
47526 /// "type": "string"
47527 /// }
47528 /// }
47529 /// }
47530 /// },
47531 /// "position": {
47532 /// "type": "array",
47533 /// "items": {
47534 /// "type": "object",
47535 /// "required": [
47536 /// "entryPrice",
47537 /// "markPrice",
47538 /// "positionAmt",
47539 /// "symbol",
47540 /// "unRealizedProfit"
47541 /// ],
47542 /// "properties": {
47543 /// "entryPrice": {
47544 /// "examples": [
47545 /// "7130.41000000"
47546 /// ],
47547 /// "type": "string"
47548 /// },
47549 /// "markPrice": {
47550 /// "examples": [
47551 /// "7257.66239673"
47552 /// ],
47553 /// "type": "string"
47554 /// },
47555 /// "positionAmt": {
47556 /// "examples": [
47557 /// "0.01000000"
47558 /// ],
47559 /// "type": "string"
47560 /// },
47561 /// "symbol": {
47562 /// "examples": [
47563 /// "BTCUSDT"
47564 /// ],
47565 /// "type": "string"
47566 /// },
47567 /// "unRealizedProfit": {
47568 /// "examples": [
47569 /// "1.24029054"
47570 /// ],
47571 /// "type": "string"
47572 /// }
47573 /// }
47574 /// }
47575 /// }
47576 /// }
47577 /// },
47578 /// "type": {
47579 /// "examples": [
47580 /// "futures"
47581 /// ],
47582 /// "type": "string"
47583 /// },
47584 /// "updateTime": {
47585 /// "examples": [
47586 /// 1576281599000
47587 /// ],
47588 /// "type": "integer",
47589 /// "format": "int64"
47590 /// }
47591 /// }
47592 /// }
47593 /// }
47594 /// }
47595 ///}
47596 /// ```
47597 /// </details>
47598 #[derive(Clone, Debug, Deserialize, Serialize)]
47599 pub struct SnapshotFutures {
47600 pub code: i64,
47601 pub msg: String,
47602 #[serde(rename = "snapshotVos")]
47603 pub snapshot_vos: Vec<SnapshotFuturesSnapshotVosItem>,
47604 }
47605 impl From<&SnapshotFutures> for SnapshotFutures {
47606 fn from(value: &SnapshotFutures) -> Self {
47607 value.clone()
47608 }
47609 }
47610 ///SnapshotFuturesSnapshotVosItem
47611 ///
47612 /// <details><summary>JSON schema</summary>
47613 ///
47614 /// ```json
47615 ///{
47616 /// "type": "object",
47617 /// "required": [
47618 /// "data",
47619 /// "type",
47620 /// "updateTime"
47621 /// ],
47622 /// "properties": {
47623 /// "data": {
47624 /// "type": "object",
47625 /// "required": [
47626 /// "assets",
47627 /// "position"
47628 /// ],
47629 /// "properties": {
47630 /// "assets": {
47631 /// "type": "array",
47632 /// "items": {
47633 /// "type": "object",
47634 /// "required": [
47635 /// "asset",
47636 /// "marginBalance",
47637 /// "walletBalance"
47638 /// ],
47639 /// "properties": {
47640 /// "asset": {
47641 /// "examples": [
47642 /// "USDT"
47643 /// ],
47644 /// "type": "string"
47645 /// },
47646 /// "marginBalance": {
47647 /// "examples": [
47648 /// "118.99782335"
47649 /// ],
47650 /// "type": "string"
47651 /// },
47652 /// "walletBalance": {
47653 /// "examples": [
47654 /// "120.23811389"
47655 /// ],
47656 /// "type": "string"
47657 /// }
47658 /// }
47659 /// }
47660 /// },
47661 /// "position": {
47662 /// "type": "array",
47663 /// "items": {
47664 /// "type": "object",
47665 /// "required": [
47666 /// "entryPrice",
47667 /// "markPrice",
47668 /// "positionAmt",
47669 /// "symbol",
47670 /// "unRealizedProfit"
47671 /// ],
47672 /// "properties": {
47673 /// "entryPrice": {
47674 /// "examples": [
47675 /// "7130.41000000"
47676 /// ],
47677 /// "type": "string"
47678 /// },
47679 /// "markPrice": {
47680 /// "examples": [
47681 /// "7257.66239673"
47682 /// ],
47683 /// "type": "string"
47684 /// },
47685 /// "positionAmt": {
47686 /// "examples": [
47687 /// "0.01000000"
47688 /// ],
47689 /// "type": "string"
47690 /// },
47691 /// "symbol": {
47692 /// "examples": [
47693 /// "BTCUSDT"
47694 /// ],
47695 /// "type": "string"
47696 /// },
47697 /// "unRealizedProfit": {
47698 /// "examples": [
47699 /// "1.24029054"
47700 /// ],
47701 /// "type": "string"
47702 /// }
47703 /// }
47704 /// }
47705 /// }
47706 /// }
47707 /// },
47708 /// "type": {
47709 /// "examples": [
47710 /// "futures"
47711 /// ],
47712 /// "type": "string"
47713 /// },
47714 /// "updateTime": {
47715 /// "examples": [
47716 /// 1576281599000
47717 /// ],
47718 /// "type": "integer",
47719 /// "format": "int64"
47720 /// }
47721 /// }
47722 ///}
47723 /// ```
47724 /// </details>
47725 #[derive(Clone, Debug, Deserialize, Serialize)]
47726 pub struct SnapshotFuturesSnapshotVosItem {
47727 pub data: SnapshotFuturesSnapshotVosItemData,
47728 #[serde(rename = "type")]
47729 pub type_: String,
47730 #[serde(rename = "updateTime")]
47731 pub update_time: i64,
47732 }
47733 impl From<&SnapshotFuturesSnapshotVosItem> for SnapshotFuturesSnapshotVosItem {
47734 fn from(value: &SnapshotFuturesSnapshotVosItem) -> Self {
47735 value.clone()
47736 }
47737 }
47738 ///SnapshotFuturesSnapshotVosItemData
47739 ///
47740 /// <details><summary>JSON schema</summary>
47741 ///
47742 /// ```json
47743 ///{
47744 /// "type": "object",
47745 /// "required": [
47746 /// "assets",
47747 /// "position"
47748 /// ],
47749 /// "properties": {
47750 /// "assets": {
47751 /// "type": "array",
47752 /// "items": {
47753 /// "type": "object",
47754 /// "required": [
47755 /// "asset",
47756 /// "marginBalance",
47757 /// "walletBalance"
47758 /// ],
47759 /// "properties": {
47760 /// "asset": {
47761 /// "examples": [
47762 /// "USDT"
47763 /// ],
47764 /// "type": "string"
47765 /// },
47766 /// "marginBalance": {
47767 /// "examples": [
47768 /// "118.99782335"
47769 /// ],
47770 /// "type": "string"
47771 /// },
47772 /// "walletBalance": {
47773 /// "examples": [
47774 /// "120.23811389"
47775 /// ],
47776 /// "type": "string"
47777 /// }
47778 /// }
47779 /// }
47780 /// },
47781 /// "position": {
47782 /// "type": "array",
47783 /// "items": {
47784 /// "type": "object",
47785 /// "required": [
47786 /// "entryPrice",
47787 /// "markPrice",
47788 /// "positionAmt",
47789 /// "symbol",
47790 /// "unRealizedProfit"
47791 /// ],
47792 /// "properties": {
47793 /// "entryPrice": {
47794 /// "examples": [
47795 /// "7130.41000000"
47796 /// ],
47797 /// "type": "string"
47798 /// },
47799 /// "markPrice": {
47800 /// "examples": [
47801 /// "7257.66239673"
47802 /// ],
47803 /// "type": "string"
47804 /// },
47805 /// "positionAmt": {
47806 /// "examples": [
47807 /// "0.01000000"
47808 /// ],
47809 /// "type": "string"
47810 /// },
47811 /// "symbol": {
47812 /// "examples": [
47813 /// "BTCUSDT"
47814 /// ],
47815 /// "type": "string"
47816 /// },
47817 /// "unRealizedProfit": {
47818 /// "examples": [
47819 /// "1.24029054"
47820 /// ],
47821 /// "type": "string"
47822 /// }
47823 /// }
47824 /// }
47825 /// }
47826 /// }
47827 ///}
47828 /// ```
47829 /// </details>
47830 #[derive(Clone, Debug, Deserialize, Serialize)]
47831 pub struct SnapshotFuturesSnapshotVosItemData {
47832 pub assets: Vec<SnapshotFuturesSnapshotVosItemDataAssetsItem>,
47833 pub position: Vec<SnapshotFuturesSnapshotVosItemDataPositionItem>,
47834 }
47835 impl From<&SnapshotFuturesSnapshotVosItemData>
47836 for SnapshotFuturesSnapshotVosItemData {
47837 fn from(value: &SnapshotFuturesSnapshotVosItemData) -> Self {
47838 value.clone()
47839 }
47840 }
47841 ///SnapshotFuturesSnapshotVosItemDataAssetsItem
47842 ///
47843 /// <details><summary>JSON schema</summary>
47844 ///
47845 /// ```json
47846 ///{
47847 /// "type": "object",
47848 /// "required": [
47849 /// "asset",
47850 /// "marginBalance",
47851 /// "walletBalance"
47852 /// ],
47853 /// "properties": {
47854 /// "asset": {
47855 /// "examples": [
47856 /// "USDT"
47857 /// ],
47858 /// "type": "string"
47859 /// },
47860 /// "marginBalance": {
47861 /// "examples": [
47862 /// "118.99782335"
47863 /// ],
47864 /// "type": "string"
47865 /// },
47866 /// "walletBalance": {
47867 /// "examples": [
47868 /// "120.23811389"
47869 /// ],
47870 /// "type": "string"
47871 /// }
47872 /// }
47873 ///}
47874 /// ```
47875 /// </details>
47876 #[derive(Clone, Debug, Deserialize, Serialize)]
47877 pub struct SnapshotFuturesSnapshotVosItemDataAssetsItem {
47878 pub asset: String,
47879 #[serde(rename = "marginBalance")]
47880 pub margin_balance: String,
47881 #[serde(rename = "walletBalance")]
47882 pub wallet_balance: String,
47883 }
47884 impl From<&SnapshotFuturesSnapshotVosItemDataAssetsItem>
47885 for SnapshotFuturesSnapshotVosItemDataAssetsItem {
47886 fn from(value: &SnapshotFuturesSnapshotVosItemDataAssetsItem) -> Self {
47887 value.clone()
47888 }
47889 }
47890 ///SnapshotFuturesSnapshotVosItemDataPositionItem
47891 ///
47892 /// <details><summary>JSON schema</summary>
47893 ///
47894 /// ```json
47895 ///{
47896 /// "type": "object",
47897 /// "required": [
47898 /// "entryPrice",
47899 /// "markPrice",
47900 /// "positionAmt",
47901 /// "symbol",
47902 /// "unRealizedProfit"
47903 /// ],
47904 /// "properties": {
47905 /// "entryPrice": {
47906 /// "examples": [
47907 /// "7130.41000000"
47908 /// ],
47909 /// "type": "string"
47910 /// },
47911 /// "markPrice": {
47912 /// "examples": [
47913 /// "7257.66239673"
47914 /// ],
47915 /// "type": "string"
47916 /// },
47917 /// "positionAmt": {
47918 /// "examples": [
47919 /// "0.01000000"
47920 /// ],
47921 /// "type": "string"
47922 /// },
47923 /// "symbol": {
47924 /// "examples": [
47925 /// "BTCUSDT"
47926 /// ],
47927 /// "type": "string"
47928 /// },
47929 /// "unRealizedProfit": {
47930 /// "examples": [
47931 /// "1.24029054"
47932 /// ],
47933 /// "type": "string"
47934 /// }
47935 /// }
47936 ///}
47937 /// ```
47938 /// </details>
47939 #[derive(Clone, Debug, Deserialize, Serialize)]
47940 pub struct SnapshotFuturesSnapshotVosItemDataPositionItem {
47941 #[serde(rename = "entryPrice")]
47942 pub entry_price: String,
47943 #[serde(rename = "markPrice")]
47944 pub mark_price: String,
47945 #[serde(rename = "positionAmt")]
47946 pub position_amt: String,
47947 pub symbol: String,
47948 #[serde(rename = "unRealizedProfit")]
47949 pub un_realized_profit: String,
47950 }
47951 impl From<&SnapshotFuturesSnapshotVosItemDataPositionItem>
47952 for SnapshotFuturesSnapshotVosItemDataPositionItem {
47953 fn from(value: &SnapshotFuturesSnapshotVosItemDataPositionItem) -> Self {
47954 value.clone()
47955 }
47956 }
47957 ///SnapshotMargin
47958 ///
47959 /// <details><summary>JSON schema</summary>
47960 ///
47961 /// ```json
47962 ///{
47963 /// "type": "object",
47964 /// "required": [
47965 /// "code",
47966 /// "msg",
47967 /// "snapshotVos"
47968 /// ],
47969 /// "properties": {
47970 /// "code": {
47971 /// "examples": [
47972 /// 200
47973 /// ],
47974 /// "type": "integer",
47975 /// "format": "int64"
47976 /// },
47977 /// "msg": {
47978 /// "examples": [
47979 /// ""
47980 /// ],
47981 /// "type": "string"
47982 /// },
47983 /// "snapshotVos": {
47984 /// "type": "array",
47985 /// "items": {
47986 /// "type": "object",
47987 /// "required": [
47988 /// "data",
47989 /// "type",
47990 /// "updateTime"
47991 /// ],
47992 /// "properties": {
47993 /// "data": {
47994 /// "type": "object",
47995 /// "required": [
47996 /// "marginLevel",
47997 /// "totalAssetOfBtc",
47998 /// "totalLiabilityOfBtc",
47999 /// "totalNetAssetOfBtc",
48000 /// "userAssets"
48001 /// ],
48002 /// "properties": {
48003 /// "marginLevel": {
48004 /// "examples": [
48005 /// "2748.02909813"
48006 /// ],
48007 /// "type": "string"
48008 /// },
48009 /// "totalAssetOfBtc": {
48010 /// "examples": [
48011 /// "0.00274803"
48012 /// ],
48013 /// "type": "string"
48014 /// },
48015 /// "totalLiabilityOfBtc": {
48016 /// "examples": [
48017 /// "0.00000100"
48018 /// ],
48019 /// "type": "string"
48020 /// },
48021 /// "totalNetAssetOfBtc": {
48022 /// "examples": [
48023 /// "0.00274750"
48024 /// ],
48025 /// "type": "string"
48026 /// },
48027 /// "userAssets": {
48028 /// "type": "array",
48029 /// "items": {
48030 /// "type": "object",
48031 /// "required": [
48032 /// "asset",
48033 /// "borrowed",
48034 /// "free",
48035 /// "interest",
48036 /// "locked",
48037 /// "netAsset"
48038 /// ],
48039 /// "properties": {
48040 /// "asset": {
48041 /// "examples": [
48042 /// "XRP"
48043 /// ],
48044 /// "type": "string"
48045 /// },
48046 /// "borrowed": {
48047 /// "examples": [
48048 /// "0.00000000"
48049 /// ],
48050 /// "type": "string"
48051 /// },
48052 /// "free": {
48053 /// "examples": [
48054 /// "1.00000000"
48055 /// ],
48056 /// "type": "string"
48057 /// },
48058 /// "interest": {
48059 /// "examples": [
48060 /// "0.00000000"
48061 /// ],
48062 /// "type": "string"
48063 /// },
48064 /// "locked": {
48065 /// "examples": [
48066 /// "0.00000000"
48067 /// ],
48068 /// "type": "string"
48069 /// },
48070 /// "netAsset": {
48071 /// "examples": [
48072 /// "1.00000000"
48073 /// ],
48074 /// "type": "string"
48075 /// }
48076 /// }
48077 /// }
48078 /// }
48079 /// }
48080 /// },
48081 /// "type": {
48082 /// "examples": [
48083 /// "margin"
48084 /// ],
48085 /// "type": "string"
48086 /// },
48087 /// "updateTime": {
48088 /// "examples": [
48089 /// 1576281599000
48090 /// ],
48091 /// "type": "integer",
48092 /// "format": "int64"
48093 /// }
48094 /// }
48095 /// }
48096 /// }
48097 /// }
48098 ///}
48099 /// ```
48100 /// </details>
48101 #[derive(Clone, Debug, Deserialize, Serialize)]
48102 pub struct SnapshotMargin {
48103 pub code: i64,
48104 pub msg: String,
48105 #[serde(rename = "snapshotVos")]
48106 pub snapshot_vos: Vec<SnapshotMarginSnapshotVosItem>,
48107 }
48108 impl From<&SnapshotMargin> for SnapshotMargin {
48109 fn from(value: &SnapshotMargin) -> Self {
48110 value.clone()
48111 }
48112 }
48113 ///SnapshotMarginSnapshotVosItem
48114 ///
48115 /// <details><summary>JSON schema</summary>
48116 ///
48117 /// ```json
48118 ///{
48119 /// "type": "object",
48120 /// "required": [
48121 /// "data",
48122 /// "type",
48123 /// "updateTime"
48124 /// ],
48125 /// "properties": {
48126 /// "data": {
48127 /// "type": "object",
48128 /// "required": [
48129 /// "marginLevel",
48130 /// "totalAssetOfBtc",
48131 /// "totalLiabilityOfBtc",
48132 /// "totalNetAssetOfBtc",
48133 /// "userAssets"
48134 /// ],
48135 /// "properties": {
48136 /// "marginLevel": {
48137 /// "examples": [
48138 /// "2748.02909813"
48139 /// ],
48140 /// "type": "string"
48141 /// },
48142 /// "totalAssetOfBtc": {
48143 /// "examples": [
48144 /// "0.00274803"
48145 /// ],
48146 /// "type": "string"
48147 /// },
48148 /// "totalLiabilityOfBtc": {
48149 /// "examples": [
48150 /// "0.00000100"
48151 /// ],
48152 /// "type": "string"
48153 /// },
48154 /// "totalNetAssetOfBtc": {
48155 /// "examples": [
48156 /// "0.00274750"
48157 /// ],
48158 /// "type": "string"
48159 /// },
48160 /// "userAssets": {
48161 /// "type": "array",
48162 /// "items": {
48163 /// "type": "object",
48164 /// "required": [
48165 /// "asset",
48166 /// "borrowed",
48167 /// "free",
48168 /// "interest",
48169 /// "locked",
48170 /// "netAsset"
48171 /// ],
48172 /// "properties": {
48173 /// "asset": {
48174 /// "examples": [
48175 /// "XRP"
48176 /// ],
48177 /// "type": "string"
48178 /// },
48179 /// "borrowed": {
48180 /// "examples": [
48181 /// "0.00000000"
48182 /// ],
48183 /// "type": "string"
48184 /// },
48185 /// "free": {
48186 /// "examples": [
48187 /// "1.00000000"
48188 /// ],
48189 /// "type": "string"
48190 /// },
48191 /// "interest": {
48192 /// "examples": [
48193 /// "0.00000000"
48194 /// ],
48195 /// "type": "string"
48196 /// },
48197 /// "locked": {
48198 /// "examples": [
48199 /// "0.00000000"
48200 /// ],
48201 /// "type": "string"
48202 /// },
48203 /// "netAsset": {
48204 /// "examples": [
48205 /// "1.00000000"
48206 /// ],
48207 /// "type": "string"
48208 /// }
48209 /// }
48210 /// }
48211 /// }
48212 /// }
48213 /// },
48214 /// "type": {
48215 /// "examples": [
48216 /// "margin"
48217 /// ],
48218 /// "type": "string"
48219 /// },
48220 /// "updateTime": {
48221 /// "examples": [
48222 /// 1576281599000
48223 /// ],
48224 /// "type": "integer",
48225 /// "format": "int64"
48226 /// }
48227 /// }
48228 ///}
48229 /// ```
48230 /// </details>
48231 #[derive(Clone, Debug, Deserialize, Serialize)]
48232 pub struct SnapshotMarginSnapshotVosItem {
48233 pub data: SnapshotMarginSnapshotVosItemData,
48234 #[serde(rename = "type")]
48235 pub type_: String,
48236 #[serde(rename = "updateTime")]
48237 pub update_time: i64,
48238 }
48239 impl From<&SnapshotMarginSnapshotVosItem> for SnapshotMarginSnapshotVosItem {
48240 fn from(value: &SnapshotMarginSnapshotVosItem) -> Self {
48241 value.clone()
48242 }
48243 }
48244 ///SnapshotMarginSnapshotVosItemData
48245 ///
48246 /// <details><summary>JSON schema</summary>
48247 ///
48248 /// ```json
48249 ///{
48250 /// "type": "object",
48251 /// "required": [
48252 /// "marginLevel",
48253 /// "totalAssetOfBtc",
48254 /// "totalLiabilityOfBtc",
48255 /// "totalNetAssetOfBtc",
48256 /// "userAssets"
48257 /// ],
48258 /// "properties": {
48259 /// "marginLevel": {
48260 /// "examples": [
48261 /// "2748.02909813"
48262 /// ],
48263 /// "type": "string"
48264 /// },
48265 /// "totalAssetOfBtc": {
48266 /// "examples": [
48267 /// "0.00274803"
48268 /// ],
48269 /// "type": "string"
48270 /// },
48271 /// "totalLiabilityOfBtc": {
48272 /// "examples": [
48273 /// "0.00000100"
48274 /// ],
48275 /// "type": "string"
48276 /// },
48277 /// "totalNetAssetOfBtc": {
48278 /// "examples": [
48279 /// "0.00274750"
48280 /// ],
48281 /// "type": "string"
48282 /// },
48283 /// "userAssets": {
48284 /// "type": "array",
48285 /// "items": {
48286 /// "type": "object",
48287 /// "required": [
48288 /// "asset",
48289 /// "borrowed",
48290 /// "free",
48291 /// "interest",
48292 /// "locked",
48293 /// "netAsset"
48294 /// ],
48295 /// "properties": {
48296 /// "asset": {
48297 /// "examples": [
48298 /// "XRP"
48299 /// ],
48300 /// "type": "string"
48301 /// },
48302 /// "borrowed": {
48303 /// "examples": [
48304 /// "0.00000000"
48305 /// ],
48306 /// "type": "string"
48307 /// },
48308 /// "free": {
48309 /// "examples": [
48310 /// "1.00000000"
48311 /// ],
48312 /// "type": "string"
48313 /// },
48314 /// "interest": {
48315 /// "examples": [
48316 /// "0.00000000"
48317 /// ],
48318 /// "type": "string"
48319 /// },
48320 /// "locked": {
48321 /// "examples": [
48322 /// "0.00000000"
48323 /// ],
48324 /// "type": "string"
48325 /// },
48326 /// "netAsset": {
48327 /// "examples": [
48328 /// "1.00000000"
48329 /// ],
48330 /// "type": "string"
48331 /// }
48332 /// }
48333 /// }
48334 /// }
48335 /// }
48336 ///}
48337 /// ```
48338 /// </details>
48339 #[derive(Clone, Debug, Deserialize, Serialize)]
48340 pub struct SnapshotMarginSnapshotVosItemData {
48341 #[serde(rename = "marginLevel")]
48342 pub margin_level: String,
48343 #[serde(rename = "totalAssetOfBtc")]
48344 pub total_asset_of_btc: String,
48345 #[serde(rename = "totalLiabilityOfBtc")]
48346 pub total_liability_of_btc: String,
48347 #[serde(rename = "totalNetAssetOfBtc")]
48348 pub total_net_asset_of_btc: String,
48349 #[serde(rename = "userAssets")]
48350 pub user_assets: Vec<SnapshotMarginSnapshotVosItemDataUserAssetsItem>,
48351 }
48352 impl From<&SnapshotMarginSnapshotVosItemData> for SnapshotMarginSnapshotVosItemData {
48353 fn from(value: &SnapshotMarginSnapshotVosItemData) -> Self {
48354 value.clone()
48355 }
48356 }
48357 ///SnapshotMarginSnapshotVosItemDataUserAssetsItem
48358 ///
48359 /// <details><summary>JSON schema</summary>
48360 ///
48361 /// ```json
48362 ///{
48363 /// "type": "object",
48364 /// "required": [
48365 /// "asset",
48366 /// "borrowed",
48367 /// "free",
48368 /// "interest",
48369 /// "locked",
48370 /// "netAsset"
48371 /// ],
48372 /// "properties": {
48373 /// "asset": {
48374 /// "examples": [
48375 /// "XRP"
48376 /// ],
48377 /// "type": "string"
48378 /// },
48379 /// "borrowed": {
48380 /// "examples": [
48381 /// "0.00000000"
48382 /// ],
48383 /// "type": "string"
48384 /// },
48385 /// "free": {
48386 /// "examples": [
48387 /// "1.00000000"
48388 /// ],
48389 /// "type": "string"
48390 /// },
48391 /// "interest": {
48392 /// "examples": [
48393 /// "0.00000000"
48394 /// ],
48395 /// "type": "string"
48396 /// },
48397 /// "locked": {
48398 /// "examples": [
48399 /// "0.00000000"
48400 /// ],
48401 /// "type": "string"
48402 /// },
48403 /// "netAsset": {
48404 /// "examples": [
48405 /// "1.00000000"
48406 /// ],
48407 /// "type": "string"
48408 /// }
48409 /// }
48410 ///}
48411 /// ```
48412 /// </details>
48413 #[derive(Clone, Debug, Deserialize, Serialize)]
48414 pub struct SnapshotMarginSnapshotVosItemDataUserAssetsItem {
48415 pub asset: String,
48416 pub borrowed: String,
48417 pub free: String,
48418 pub interest: String,
48419 pub locked: String,
48420 #[serde(rename = "netAsset")]
48421 pub net_asset: String,
48422 }
48423 impl From<&SnapshotMarginSnapshotVosItemDataUserAssetsItem>
48424 for SnapshotMarginSnapshotVosItemDataUserAssetsItem {
48425 fn from(value: &SnapshotMarginSnapshotVosItemDataUserAssetsItem) -> Self {
48426 value.clone()
48427 }
48428 }
48429 ///SnapshotSpot
48430 ///
48431 /// <details><summary>JSON schema</summary>
48432 ///
48433 /// ```json
48434 ///{
48435 /// "type": "object",
48436 /// "required": [
48437 /// "code",
48438 /// "msg",
48439 /// "snapshotVos"
48440 /// ],
48441 /// "properties": {
48442 /// "code": {
48443 /// "examples": [
48444 /// 200
48445 /// ],
48446 /// "type": "integer",
48447 /// "format": "int64"
48448 /// },
48449 /// "msg": {
48450 /// "examples": [
48451 /// ""
48452 /// ],
48453 /// "type": "string"
48454 /// },
48455 /// "snapshotVos": {
48456 /// "type": "array",
48457 /// "items": {
48458 /// "type": "object",
48459 /// "required": [
48460 /// "data",
48461 /// "type",
48462 /// "updateTime"
48463 /// ],
48464 /// "properties": {
48465 /// "data": {
48466 /// "type": "object",
48467 /// "required": [
48468 /// "balances",
48469 /// "totalAssetOfBtc"
48470 /// ],
48471 /// "properties": {
48472 /// "balances": {
48473 /// "type": "array",
48474 /// "items": {
48475 /// "type": "object",
48476 /// "required": [
48477 /// "asset",
48478 /// "free",
48479 /// "locked"
48480 /// ],
48481 /// "properties": {
48482 /// "asset": {
48483 /// "examples": [
48484 /// "BTC"
48485 /// ],
48486 /// "type": "string"
48487 /// },
48488 /// "free": {
48489 /// "examples": [
48490 /// "0.2"
48491 /// ],
48492 /// "type": "string"
48493 /// },
48494 /// "locked": {
48495 /// "examples": [
48496 /// "0.001"
48497 /// ],
48498 /// "type": "string"
48499 /// }
48500 /// }
48501 /// }
48502 /// },
48503 /// "totalAssetOfBtc": {
48504 /// "examples": [
48505 /// "0.09905021"
48506 /// ],
48507 /// "type": "string"
48508 /// }
48509 /// }
48510 /// },
48511 /// "type": {
48512 /// "examples": [
48513 /// "spot"
48514 /// ],
48515 /// "type": "string"
48516 /// },
48517 /// "updateTime": {
48518 /// "examples": [
48519 /// 1576281599000
48520 /// ],
48521 /// "type": "integer",
48522 /// "format": "int64"
48523 /// }
48524 /// }
48525 /// }
48526 /// }
48527 /// }
48528 ///}
48529 /// ```
48530 /// </details>
48531 #[derive(Clone, Debug, Deserialize, Serialize)]
48532 pub struct SnapshotSpot {
48533 pub code: i64,
48534 pub msg: String,
48535 #[serde(rename = "snapshotVos")]
48536 pub snapshot_vos: Vec<SnapshotSpotSnapshotVosItem>,
48537 }
48538 impl From<&SnapshotSpot> for SnapshotSpot {
48539 fn from(value: &SnapshotSpot) -> Self {
48540 value.clone()
48541 }
48542 }
48543 ///SnapshotSpotSnapshotVosItem
48544 ///
48545 /// <details><summary>JSON schema</summary>
48546 ///
48547 /// ```json
48548 ///{
48549 /// "type": "object",
48550 /// "required": [
48551 /// "data",
48552 /// "type",
48553 /// "updateTime"
48554 /// ],
48555 /// "properties": {
48556 /// "data": {
48557 /// "type": "object",
48558 /// "required": [
48559 /// "balances",
48560 /// "totalAssetOfBtc"
48561 /// ],
48562 /// "properties": {
48563 /// "balances": {
48564 /// "type": "array",
48565 /// "items": {
48566 /// "type": "object",
48567 /// "required": [
48568 /// "asset",
48569 /// "free",
48570 /// "locked"
48571 /// ],
48572 /// "properties": {
48573 /// "asset": {
48574 /// "examples": [
48575 /// "BTC"
48576 /// ],
48577 /// "type": "string"
48578 /// },
48579 /// "free": {
48580 /// "examples": [
48581 /// "0.2"
48582 /// ],
48583 /// "type": "string"
48584 /// },
48585 /// "locked": {
48586 /// "examples": [
48587 /// "0.001"
48588 /// ],
48589 /// "type": "string"
48590 /// }
48591 /// }
48592 /// }
48593 /// },
48594 /// "totalAssetOfBtc": {
48595 /// "examples": [
48596 /// "0.09905021"
48597 /// ],
48598 /// "type": "string"
48599 /// }
48600 /// }
48601 /// },
48602 /// "type": {
48603 /// "examples": [
48604 /// "spot"
48605 /// ],
48606 /// "type": "string"
48607 /// },
48608 /// "updateTime": {
48609 /// "examples": [
48610 /// 1576281599000
48611 /// ],
48612 /// "type": "integer",
48613 /// "format": "int64"
48614 /// }
48615 /// }
48616 ///}
48617 /// ```
48618 /// </details>
48619 #[derive(Clone, Debug, Deserialize, Serialize)]
48620 pub struct SnapshotSpotSnapshotVosItem {
48621 pub data: SnapshotSpotSnapshotVosItemData,
48622 #[serde(rename = "type")]
48623 pub type_: String,
48624 #[serde(rename = "updateTime")]
48625 pub update_time: i64,
48626 }
48627 impl From<&SnapshotSpotSnapshotVosItem> for SnapshotSpotSnapshotVosItem {
48628 fn from(value: &SnapshotSpotSnapshotVosItem) -> Self {
48629 value.clone()
48630 }
48631 }
48632 ///SnapshotSpotSnapshotVosItemData
48633 ///
48634 /// <details><summary>JSON schema</summary>
48635 ///
48636 /// ```json
48637 ///{
48638 /// "type": "object",
48639 /// "required": [
48640 /// "balances",
48641 /// "totalAssetOfBtc"
48642 /// ],
48643 /// "properties": {
48644 /// "balances": {
48645 /// "type": "array",
48646 /// "items": {
48647 /// "type": "object",
48648 /// "required": [
48649 /// "asset",
48650 /// "free",
48651 /// "locked"
48652 /// ],
48653 /// "properties": {
48654 /// "asset": {
48655 /// "examples": [
48656 /// "BTC"
48657 /// ],
48658 /// "type": "string"
48659 /// },
48660 /// "free": {
48661 /// "examples": [
48662 /// "0.2"
48663 /// ],
48664 /// "type": "string"
48665 /// },
48666 /// "locked": {
48667 /// "examples": [
48668 /// "0.001"
48669 /// ],
48670 /// "type": "string"
48671 /// }
48672 /// }
48673 /// }
48674 /// },
48675 /// "totalAssetOfBtc": {
48676 /// "examples": [
48677 /// "0.09905021"
48678 /// ],
48679 /// "type": "string"
48680 /// }
48681 /// }
48682 ///}
48683 /// ```
48684 /// </details>
48685 #[derive(Clone, Debug, Deserialize, Serialize)]
48686 pub struct SnapshotSpotSnapshotVosItemData {
48687 pub balances: Vec<SnapshotSpotSnapshotVosItemDataBalancesItem>,
48688 #[serde(rename = "totalAssetOfBtc")]
48689 pub total_asset_of_btc: String,
48690 }
48691 impl From<&SnapshotSpotSnapshotVosItemData> for SnapshotSpotSnapshotVosItemData {
48692 fn from(value: &SnapshotSpotSnapshotVosItemData) -> Self {
48693 value.clone()
48694 }
48695 }
48696 ///SnapshotSpotSnapshotVosItemDataBalancesItem
48697 ///
48698 /// <details><summary>JSON schema</summary>
48699 ///
48700 /// ```json
48701 ///{
48702 /// "type": "object",
48703 /// "required": [
48704 /// "asset",
48705 /// "free",
48706 /// "locked"
48707 /// ],
48708 /// "properties": {
48709 /// "asset": {
48710 /// "examples": [
48711 /// "BTC"
48712 /// ],
48713 /// "type": "string"
48714 /// },
48715 /// "free": {
48716 /// "examples": [
48717 /// "0.2"
48718 /// ],
48719 /// "type": "string"
48720 /// },
48721 /// "locked": {
48722 /// "examples": [
48723 /// "0.001"
48724 /// ],
48725 /// "type": "string"
48726 /// }
48727 /// }
48728 ///}
48729 /// ```
48730 /// </details>
48731 #[derive(Clone, Debug, Deserialize, Serialize)]
48732 pub struct SnapshotSpotSnapshotVosItemDataBalancesItem {
48733 pub asset: String,
48734 pub free: String,
48735 pub locked: String,
48736 }
48737 impl From<&SnapshotSpotSnapshotVosItemDataBalancesItem>
48738 for SnapshotSpotSnapshotVosItemDataBalancesItem {
48739 fn from(value: &SnapshotSpotSnapshotVosItemDataBalancesItem) -> Self {
48740 value.clone()
48741 }
48742 }
48743 ///SorOrderNewOrderRespType
48744 ///
48745 /// <details><summary>JSON schema</summary>
48746 ///
48747 /// ```json
48748 ///{
48749 /// "type": "string",
48750 /// "enum": [
48751 /// "ACK",
48752 /// "RESULT",
48753 /// "FULL"
48754 /// ]
48755 ///}
48756 /// ```
48757 /// </details>
48758 #[derive(
48759 Clone,
48760 Copy,
48761 Debug,
48762 Deserialize,
48763 Eq,
48764 Hash,
48765 Ord,
48766 PartialEq,
48767 PartialOrd,
48768 Serialize
48769 )]
48770 pub enum SorOrderNewOrderRespType {
48771 #[serde(rename = "ACK")]
48772 Ack,
48773 #[serde(rename = "RESULT")]
48774 Result,
48775 #[serde(rename = "FULL")]
48776 Full,
48777 }
48778 impl From<&SorOrderNewOrderRespType> for SorOrderNewOrderRespType {
48779 fn from(value: &SorOrderNewOrderRespType) -> Self {
48780 value.clone()
48781 }
48782 }
48783 impl ToString for SorOrderNewOrderRespType {
48784 fn to_string(&self) -> String {
48785 match *self {
48786 Self::Ack => "ACK".to_string(),
48787 Self::Result => "RESULT".to_string(),
48788 Self::Full => "FULL".to_string(),
48789 }
48790 }
48791 }
48792 impl std::str::FromStr for SorOrderNewOrderRespType {
48793 type Err = self::error::ConversionError;
48794 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
48795 match value {
48796 "ACK" => Ok(Self::Ack),
48797 "RESULT" => Ok(Self::Result),
48798 "FULL" => Ok(Self::Full),
48799 _ => Err("invalid value".into()),
48800 }
48801 }
48802 }
48803 impl std::convert::TryFrom<&str> for SorOrderNewOrderRespType {
48804 type Error = self::error::ConversionError;
48805 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
48806 value.parse()
48807 }
48808 }
48809 impl std::convert::TryFrom<&String> for SorOrderNewOrderRespType {
48810 type Error = self::error::ConversionError;
48811 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
48812 value.parse()
48813 }
48814 }
48815 impl std::convert::TryFrom<String> for SorOrderNewOrderRespType {
48816 type Error = self::error::ConversionError;
48817 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
48818 value.parse()
48819 }
48820 }
48821 ///SorOrderResponse
48822 ///
48823 /// <details><summary>JSON schema</summary>
48824 ///
48825 /// ```json
48826 ///{
48827 /// "type": "object",
48828 /// "required": [
48829 /// "clientOrderId",
48830 /// "cummulativeQuoteQty",
48831 /// "executedQty",
48832 /// "fills",
48833 /// "orderId",
48834 /// "orderListId",
48835 /// "origQty",
48836 /// "price",
48837 /// "selfTradePreventionMode",
48838 /// "side",
48839 /// "status",
48840 /// "symbol",
48841 /// "timeInForce",
48842 /// "transactTime",
48843 /// "type",
48844 /// "usedSor",
48845 /// "workingFloor",
48846 /// "workingTime"
48847 /// ],
48848 /// "properties": {
48849 /// "clientOrderId": {
48850 /// "examples": [
48851 /// "sBI1KM6nNtOfj5tccZSKly"
48852 /// ],
48853 /// "type": "string"
48854 /// },
48855 /// "cummulativeQuoteQty": {
48856 /// "examples": [
48857 /// "14000.00000000"
48858 /// ],
48859 /// "type": "string"
48860 /// },
48861 /// "executedQty": {
48862 /// "examples": [
48863 /// "0.50000000"
48864 /// ],
48865 /// "type": "string"
48866 /// },
48867 /// "fills": {
48868 /// "type": "array",
48869 /// "items": {
48870 /// "type": "object",
48871 /// "required": [
48872 /// "allocId",
48873 /// "commission",
48874 /// "commissionAsset",
48875 /// "matchType",
48876 /// "price",
48877 /// "qty",
48878 /// "tradeId"
48879 /// ],
48880 /// "properties": {
48881 /// "allocId": {
48882 /// "examples": [
48883 /// 0
48884 /// ],
48885 /// "type": "integer",
48886 /// "format": "int64"
48887 /// },
48888 /// "commission": {
48889 /// "examples": [
48890 /// "0.00000000"
48891 /// ],
48892 /// "type": "string"
48893 /// },
48894 /// "commissionAsset": {
48895 /// "examples": [
48896 /// "BTC"
48897 /// ],
48898 /// "type": "string"
48899 /// },
48900 /// "matchType": {
48901 /// "examples": [
48902 /// "ONE_PARTY_TRADE_REPORT"
48903 /// ],
48904 /// "type": "string"
48905 /// },
48906 /// "price": {
48907 /// "examples": [
48908 /// "28000.00000000"
48909 /// ],
48910 /// "type": "string"
48911 /// },
48912 /// "qty": {
48913 /// "examples": [
48914 /// "0.50000000"
48915 /// ],
48916 /// "type": "string"
48917 /// },
48918 /// "tradeId": {
48919 /// "examples": [
48920 /// -1
48921 /// ],
48922 /// "type": "integer",
48923 /// "format": "int64"
48924 /// }
48925 /// }
48926 /// }
48927 /// },
48928 /// "orderId": {
48929 /// "examples": [
48930 /// 2
48931 /// ],
48932 /// "type": "integer",
48933 /// "format": "int64"
48934 /// },
48935 /// "orderListId": {
48936 /// "examples": [
48937 /// -1
48938 /// ],
48939 /// "type": "integer",
48940 /// "format": "int64"
48941 /// },
48942 /// "origQty": {
48943 /// "examples": [
48944 /// "0.50000000"
48945 /// ],
48946 /// "type": "string"
48947 /// },
48948 /// "price": {
48949 /// "examples": [
48950 /// "31000.00000000"
48951 /// ],
48952 /// "type": "string"
48953 /// },
48954 /// "selfTradePreventionMode": {
48955 /// "examples": [
48956 /// "NONE"
48957 /// ],
48958 /// "type": "string"
48959 /// },
48960 /// "side": {
48961 /// "examples": [
48962 /// "BUY"
48963 /// ],
48964 /// "type": "string"
48965 /// },
48966 /// "status": {
48967 /// "examples": [
48968 /// "FILLED"
48969 /// ],
48970 /// "type": "string"
48971 /// },
48972 /// "symbol": {
48973 /// "examples": [
48974 /// "BTCUSDT"
48975 /// ],
48976 /// "type": "string"
48977 /// },
48978 /// "timeInForce": {
48979 /// "examples": [
48980 /// "GTC"
48981 /// ],
48982 /// "type": "string"
48983 /// },
48984 /// "transactTime": {
48985 /// "examples": [
48986 /// 1689149087774
48987 /// ],
48988 /// "type": "integer",
48989 /// "format": "int64"
48990 /// },
48991 /// "type": {
48992 /// "examples": [
48993 /// "LIMIT"
48994 /// ],
48995 /// "type": "string"
48996 /// },
48997 /// "usedSor": {
48998 /// "examples": [
48999 /// true
49000 /// ],
49001 /// "type": "boolean"
49002 /// },
49003 /// "workingFloor": {
49004 /// "examples": [
49005 /// "SOR"
49006 /// ],
49007 /// "type": "string"
49008 /// },
49009 /// "workingTime": {
49010 /// "examples": [
49011 /// 1689149087774
49012 /// ],
49013 /// "type": "integer",
49014 /// "format": "int64"
49015 /// }
49016 /// }
49017 ///}
49018 /// ```
49019 /// </details>
49020 #[derive(Clone, Debug, Deserialize, Serialize)]
49021 pub struct SorOrderResponse {
49022 #[serde(rename = "clientOrderId")]
49023 pub client_order_id: String,
49024 #[serde(rename = "cummulativeQuoteQty")]
49025 pub cummulative_quote_qty: String,
49026 #[serde(rename = "executedQty")]
49027 pub executed_qty: String,
49028 pub fills: Vec<SorOrderResponseFillsItem>,
49029 #[serde(rename = "orderId")]
49030 pub order_id: i64,
49031 #[serde(rename = "orderListId")]
49032 pub order_list_id: i64,
49033 #[serde(rename = "origQty")]
49034 pub orig_qty: String,
49035 pub price: String,
49036 #[serde(rename = "selfTradePreventionMode")]
49037 pub self_trade_prevention_mode: String,
49038 pub side: String,
49039 pub status: String,
49040 pub symbol: String,
49041 #[serde(rename = "timeInForce")]
49042 pub time_in_force: String,
49043 #[serde(rename = "transactTime")]
49044 pub transact_time: i64,
49045 #[serde(rename = "type")]
49046 pub type_: String,
49047 #[serde(rename = "usedSor")]
49048 pub used_sor: bool,
49049 #[serde(rename = "workingFloor")]
49050 pub working_floor: String,
49051 #[serde(rename = "workingTime")]
49052 pub working_time: i64,
49053 }
49054 impl From<&SorOrderResponse> for SorOrderResponse {
49055 fn from(value: &SorOrderResponse) -> Self {
49056 value.clone()
49057 }
49058 }
49059 ///SorOrderResponseFillsItem
49060 ///
49061 /// <details><summary>JSON schema</summary>
49062 ///
49063 /// ```json
49064 ///{
49065 /// "type": "object",
49066 /// "required": [
49067 /// "allocId",
49068 /// "commission",
49069 /// "commissionAsset",
49070 /// "matchType",
49071 /// "price",
49072 /// "qty",
49073 /// "tradeId"
49074 /// ],
49075 /// "properties": {
49076 /// "allocId": {
49077 /// "examples": [
49078 /// 0
49079 /// ],
49080 /// "type": "integer",
49081 /// "format": "int64"
49082 /// },
49083 /// "commission": {
49084 /// "examples": [
49085 /// "0.00000000"
49086 /// ],
49087 /// "type": "string"
49088 /// },
49089 /// "commissionAsset": {
49090 /// "examples": [
49091 /// "BTC"
49092 /// ],
49093 /// "type": "string"
49094 /// },
49095 /// "matchType": {
49096 /// "examples": [
49097 /// "ONE_PARTY_TRADE_REPORT"
49098 /// ],
49099 /// "type": "string"
49100 /// },
49101 /// "price": {
49102 /// "examples": [
49103 /// "28000.00000000"
49104 /// ],
49105 /// "type": "string"
49106 /// },
49107 /// "qty": {
49108 /// "examples": [
49109 /// "0.50000000"
49110 /// ],
49111 /// "type": "string"
49112 /// },
49113 /// "tradeId": {
49114 /// "examples": [
49115 /// -1
49116 /// ],
49117 /// "type": "integer",
49118 /// "format": "int64"
49119 /// }
49120 /// }
49121 ///}
49122 /// ```
49123 /// </details>
49124 #[derive(Clone, Debug, Deserialize, Serialize)]
49125 pub struct SorOrderResponseFillsItem {
49126 #[serde(rename = "allocId")]
49127 pub alloc_id: i64,
49128 pub commission: String,
49129 #[serde(rename = "commissionAsset")]
49130 pub commission_asset: String,
49131 #[serde(rename = "matchType")]
49132 pub match_type: String,
49133 pub price: String,
49134 pub qty: String,
49135 #[serde(rename = "tradeId")]
49136 pub trade_id: i64,
49137 }
49138 impl From<&SorOrderResponseFillsItem> for SorOrderResponseFillsItem {
49139 fn from(value: &SorOrderResponseFillsItem) -> Self {
49140 value.clone()
49141 }
49142 }
49143 ///SorOrderSelfTradePreventionMode
49144 ///
49145 /// <details><summary>JSON schema</summary>
49146 ///
49147 /// ```json
49148 ///{
49149 /// "examples": [
49150 /// "EXPIRE_TAKER"
49151 /// ],
49152 /// "type": "string",
49153 /// "enum": [
49154 /// "EXPIRE_TAKER",
49155 /// "EXPIRE_MAKER",
49156 /// "EXPIRE_BOTH",
49157 /// "NONE"
49158 /// ]
49159 ///}
49160 /// ```
49161 /// </details>
49162 #[derive(
49163 Clone,
49164 Copy,
49165 Debug,
49166 Deserialize,
49167 Eq,
49168 Hash,
49169 Ord,
49170 PartialEq,
49171 PartialOrd,
49172 Serialize
49173 )]
49174 pub enum SorOrderSelfTradePreventionMode {
49175 #[serde(rename = "EXPIRE_TAKER")]
49176 ExpireTaker,
49177 #[serde(rename = "EXPIRE_MAKER")]
49178 ExpireMaker,
49179 #[serde(rename = "EXPIRE_BOTH")]
49180 ExpireBoth,
49181 #[serde(rename = "NONE")]
49182 None,
49183 }
49184 impl From<&SorOrderSelfTradePreventionMode> for SorOrderSelfTradePreventionMode {
49185 fn from(value: &SorOrderSelfTradePreventionMode) -> Self {
49186 value.clone()
49187 }
49188 }
49189 impl ToString for SorOrderSelfTradePreventionMode {
49190 fn to_string(&self) -> String {
49191 match *self {
49192 Self::ExpireTaker => "EXPIRE_TAKER".to_string(),
49193 Self::ExpireMaker => "EXPIRE_MAKER".to_string(),
49194 Self::ExpireBoth => "EXPIRE_BOTH".to_string(),
49195 Self::None => "NONE".to_string(),
49196 }
49197 }
49198 }
49199 impl std::str::FromStr for SorOrderSelfTradePreventionMode {
49200 type Err = self::error::ConversionError;
49201 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
49202 match value {
49203 "EXPIRE_TAKER" => Ok(Self::ExpireTaker),
49204 "EXPIRE_MAKER" => Ok(Self::ExpireMaker),
49205 "EXPIRE_BOTH" => Ok(Self::ExpireBoth),
49206 "NONE" => Ok(Self::None),
49207 _ => Err("invalid value".into()),
49208 }
49209 }
49210 }
49211 impl std::convert::TryFrom<&str> for SorOrderSelfTradePreventionMode {
49212 type Error = self::error::ConversionError;
49213 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
49214 value.parse()
49215 }
49216 }
49217 impl std::convert::TryFrom<&String> for SorOrderSelfTradePreventionMode {
49218 type Error = self::error::ConversionError;
49219 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
49220 value.parse()
49221 }
49222 }
49223 impl std::convert::TryFrom<String> for SorOrderSelfTradePreventionMode {
49224 type Error = self::error::ConversionError;
49225 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
49226 value.parse()
49227 }
49228 }
49229 ///SorOrderSide
49230 ///
49231 /// <details><summary>JSON schema</summary>
49232 ///
49233 /// ```json
49234 ///{
49235 /// "examples": [
49236 /// "SELL"
49237 /// ],
49238 /// "type": "string",
49239 /// "enum": [
49240 /// "SELL",
49241 /// "BUY"
49242 /// ]
49243 ///}
49244 /// ```
49245 /// </details>
49246 #[derive(
49247 Clone,
49248 Copy,
49249 Debug,
49250 Deserialize,
49251 Eq,
49252 Hash,
49253 Ord,
49254 PartialEq,
49255 PartialOrd,
49256 Serialize
49257 )]
49258 pub enum SorOrderSide {
49259 #[serde(rename = "SELL")]
49260 Sell,
49261 #[serde(rename = "BUY")]
49262 Buy,
49263 }
49264 impl From<&SorOrderSide> for SorOrderSide {
49265 fn from(value: &SorOrderSide) -> Self {
49266 value.clone()
49267 }
49268 }
49269 impl ToString for SorOrderSide {
49270 fn to_string(&self) -> String {
49271 match *self {
49272 Self::Sell => "SELL".to_string(),
49273 Self::Buy => "BUY".to_string(),
49274 }
49275 }
49276 }
49277 impl std::str::FromStr for SorOrderSide {
49278 type Err = self::error::ConversionError;
49279 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
49280 match value {
49281 "SELL" => Ok(Self::Sell),
49282 "BUY" => Ok(Self::Buy),
49283 _ => Err("invalid value".into()),
49284 }
49285 }
49286 }
49287 impl std::convert::TryFrom<&str> for SorOrderSide {
49288 type Error = self::error::ConversionError;
49289 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
49290 value.parse()
49291 }
49292 }
49293 impl std::convert::TryFrom<&String> for SorOrderSide {
49294 type Error = self::error::ConversionError;
49295 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
49296 value.parse()
49297 }
49298 }
49299 impl std::convert::TryFrom<String> for SorOrderSide {
49300 type Error = self::error::ConversionError;
49301 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
49302 value.parse()
49303 }
49304 }
49305 ///SorOrderTestNewOrderRespType
49306 ///
49307 /// <details><summary>JSON schema</summary>
49308 ///
49309 /// ```json
49310 ///{
49311 /// "type": "string",
49312 /// "enum": [
49313 /// "ACK",
49314 /// "RESULT",
49315 /// "FULL"
49316 /// ]
49317 ///}
49318 /// ```
49319 /// </details>
49320 #[derive(
49321 Clone,
49322 Copy,
49323 Debug,
49324 Deserialize,
49325 Eq,
49326 Hash,
49327 Ord,
49328 PartialEq,
49329 PartialOrd,
49330 Serialize
49331 )]
49332 pub enum SorOrderTestNewOrderRespType {
49333 #[serde(rename = "ACK")]
49334 Ack,
49335 #[serde(rename = "RESULT")]
49336 Result,
49337 #[serde(rename = "FULL")]
49338 Full,
49339 }
49340 impl From<&SorOrderTestNewOrderRespType> for SorOrderTestNewOrderRespType {
49341 fn from(value: &SorOrderTestNewOrderRespType) -> Self {
49342 value.clone()
49343 }
49344 }
49345 impl ToString for SorOrderTestNewOrderRespType {
49346 fn to_string(&self) -> String {
49347 match *self {
49348 Self::Ack => "ACK".to_string(),
49349 Self::Result => "RESULT".to_string(),
49350 Self::Full => "FULL".to_string(),
49351 }
49352 }
49353 }
49354 impl std::str::FromStr for SorOrderTestNewOrderRespType {
49355 type Err = self::error::ConversionError;
49356 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
49357 match value {
49358 "ACK" => Ok(Self::Ack),
49359 "RESULT" => Ok(Self::Result),
49360 "FULL" => Ok(Self::Full),
49361 _ => Err("invalid value".into()),
49362 }
49363 }
49364 }
49365 impl std::convert::TryFrom<&str> for SorOrderTestNewOrderRespType {
49366 type Error = self::error::ConversionError;
49367 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
49368 value.parse()
49369 }
49370 }
49371 impl std::convert::TryFrom<&String> for SorOrderTestNewOrderRespType {
49372 type Error = self::error::ConversionError;
49373 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
49374 value.parse()
49375 }
49376 }
49377 impl std::convert::TryFrom<String> for SorOrderTestNewOrderRespType {
49378 type Error = self::error::ConversionError;
49379 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
49380 value.parse()
49381 }
49382 }
49383 ///SorOrderTestSelfTradePreventionMode
49384 ///
49385 /// <details><summary>JSON schema</summary>
49386 ///
49387 /// ```json
49388 ///{
49389 /// "examples": [
49390 /// "EXPIRE_TAKER"
49391 /// ],
49392 /// "type": "string",
49393 /// "enum": [
49394 /// "EXPIRE_TAKER",
49395 /// "EXPIRE_MAKER",
49396 /// "EXPIRE_BOTH",
49397 /// "NONE"
49398 /// ]
49399 ///}
49400 /// ```
49401 /// </details>
49402 #[derive(
49403 Clone,
49404 Copy,
49405 Debug,
49406 Deserialize,
49407 Eq,
49408 Hash,
49409 Ord,
49410 PartialEq,
49411 PartialOrd,
49412 Serialize
49413 )]
49414 pub enum SorOrderTestSelfTradePreventionMode {
49415 #[serde(rename = "EXPIRE_TAKER")]
49416 ExpireTaker,
49417 #[serde(rename = "EXPIRE_MAKER")]
49418 ExpireMaker,
49419 #[serde(rename = "EXPIRE_BOTH")]
49420 ExpireBoth,
49421 #[serde(rename = "NONE")]
49422 None,
49423 }
49424 impl From<&SorOrderTestSelfTradePreventionMode>
49425 for SorOrderTestSelfTradePreventionMode {
49426 fn from(value: &SorOrderTestSelfTradePreventionMode) -> Self {
49427 value.clone()
49428 }
49429 }
49430 impl ToString for SorOrderTestSelfTradePreventionMode {
49431 fn to_string(&self) -> String {
49432 match *self {
49433 Self::ExpireTaker => "EXPIRE_TAKER".to_string(),
49434 Self::ExpireMaker => "EXPIRE_MAKER".to_string(),
49435 Self::ExpireBoth => "EXPIRE_BOTH".to_string(),
49436 Self::None => "NONE".to_string(),
49437 }
49438 }
49439 }
49440 impl std::str::FromStr for SorOrderTestSelfTradePreventionMode {
49441 type Err = self::error::ConversionError;
49442 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
49443 match value {
49444 "EXPIRE_TAKER" => Ok(Self::ExpireTaker),
49445 "EXPIRE_MAKER" => Ok(Self::ExpireMaker),
49446 "EXPIRE_BOTH" => Ok(Self::ExpireBoth),
49447 "NONE" => Ok(Self::None),
49448 _ => Err("invalid value".into()),
49449 }
49450 }
49451 }
49452 impl std::convert::TryFrom<&str> for SorOrderTestSelfTradePreventionMode {
49453 type Error = self::error::ConversionError;
49454 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
49455 value.parse()
49456 }
49457 }
49458 impl std::convert::TryFrom<&String> for SorOrderTestSelfTradePreventionMode {
49459 type Error = self::error::ConversionError;
49460 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
49461 value.parse()
49462 }
49463 }
49464 impl std::convert::TryFrom<String> for SorOrderTestSelfTradePreventionMode {
49465 type Error = self::error::ConversionError;
49466 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
49467 value.parse()
49468 }
49469 }
49470 ///SorOrderTestSide
49471 ///
49472 /// <details><summary>JSON schema</summary>
49473 ///
49474 /// ```json
49475 ///{
49476 /// "examples": [
49477 /// "SELL"
49478 /// ],
49479 /// "type": "string",
49480 /// "enum": [
49481 /// "SELL",
49482 /// "BUY"
49483 /// ]
49484 ///}
49485 /// ```
49486 /// </details>
49487 #[derive(
49488 Clone,
49489 Copy,
49490 Debug,
49491 Deserialize,
49492 Eq,
49493 Hash,
49494 Ord,
49495 PartialEq,
49496 PartialOrd,
49497 Serialize
49498 )]
49499 pub enum SorOrderTestSide {
49500 #[serde(rename = "SELL")]
49501 Sell,
49502 #[serde(rename = "BUY")]
49503 Buy,
49504 }
49505 impl From<&SorOrderTestSide> for SorOrderTestSide {
49506 fn from(value: &SorOrderTestSide) -> Self {
49507 value.clone()
49508 }
49509 }
49510 impl ToString for SorOrderTestSide {
49511 fn to_string(&self) -> String {
49512 match *self {
49513 Self::Sell => "SELL".to_string(),
49514 Self::Buy => "BUY".to_string(),
49515 }
49516 }
49517 }
49518 impl std::str::FromStr for SorOrderTestSide {
49519 type Err = self::error::ConversionError;
49520 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
49521 match value {
49522 "SELL" => Ok(Self::Sell),
49523 "BUY" => Ok(Self::Buy),
49524 _ => Err("invalid value".into()),
49525 }
49526 }
49527 }
49528 impl std::convert::TryFrom<&str> for SorOrderTestSide {
49529 type Error = self::error::ConversionError;
49530 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
49531 value.parse()
49532 }
49533 }
49534 impl std::convert::TryFrom<&String> for SorOrderTestSide {
49535 type Error = self::error::ConversionError;
49536 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
49537 value.parse()
49538 }
49539 }
49540 impl std::convert::TryFrom<String> for SorOrderTestSide {
49541 type Error = self::error::ConversionError;
49542 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
49543 value.parse()
49544 }
49545 }
49546 ///SorOrderTestTimeInForce
49547 ///
49548 /// <details><summary>JSON schema</summary>
49549 ///
49550 /// ```json
49551 ///{
49552 /// "examples": [
49553 /// "GTC"
49554 /// ],
49555 /// "type": "string",
49556 /// "enum": [
49557 /// "GTC",
49558 /// "IOC",
49559 /// "FOK"
49560 /// ]
49561 ///}
49562 /// ```
49563 /// </details>
49564 #[derive(
49565 Clone,
49566 Copy,
49567 Debug,
49568 Deserialize,
49569 Eq,
49570 Hash,
49571 Ord,
49572 PartialEq,
49573 PartialOrd,
49574 Serialize
49575 )]
49576 pub enum SorOrderTestTimeInForce {
49577 #[serde(rename = "GTC")]
49578 Gtc,
49579 #[serde(rename = "IOC")]
49580 Ioc,
49581 #[serde(rename = "FOK")]
49582 Fok,
49583 }
49584 impl From<&SorOrderTestTimeInForce> for SorOrderTestTimeInForce {
49585 fn from(value: &SorOrderTestTimeInForce) -> Self {
49586 value.clone()
49587 }
49588 }
49589 impl ToString for SorOrderTestTimeInForce {
49590 fn to_string(&self) -> String {
49591 match *self {
49592 Self::Gtc => "GTC".to_string(),
49593 Self::Ioc => "IOC".to_string(),
49594 Self::Fok => "FOK".to_string(),
49595 }
49596 }
49597 }
49598 impl std::str::FromStr for SorOrderTestTimeInForce {
49599 type Err = self::error::ConversionError;
49600 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
49601 match value {
49602 "GTC" => Ok(Self::Gtc),
49603 "IOC" => Ok(Self::Ioc),
49604 "FOK" => Ok(Self::Fok),
49605 _ => Err("invalid value".into()),
49606 }
49607 }
49608 }
49609 impl std::convert::TryFrom<&str> for SorOrderTestTimeInForce {
49610 type Error = self::error::ConversionError;
49611 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
49612 value.parse()
49613 }
49614 }
49615 impl std::convert::TryFrom<&String> for SorOrderTestTimeInForce {
49616 type Error = self::error::ConversionError;
49617 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
49618 value.parse()
49619 }
49620 }
49621 impl std::convert::TryFrom<String> for SorOrderTestTimeInForce {
49622 type Error = self::error::ConversionError;
49623 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
49624 value.parse()
49625 }
49626 }
49627 ///SorOrderTestType
49628 ///
49629 /// <details><summary>JSON schema</summary>
49630 ///
49631 /// ```json
49632 ///{
49633 /// "examples": [
49634 /// "LIMIT"
49635 /// ],
49636 /// "type": "string",
49637 /// "enum": [
49638 /// "LIMIT",
49639 /// "MARKET",
49640 /// "STOP_LOSS",
49641 /// "STOP_LOSS_LIMIT",
49642 /// "TAKE_PROFIT",
49643 /// "TAKE_PROFIT_LIMIT",
49644 /// "LIMIT_MAKER"
49645 /// ]
49646 ///}
49647 /// ```
49648 /// </details>
49649 #[derive(
49650 Clone,
49651 Copy,
49652 Debug,
49653 Deserialize,
49654 Eq,
49655 Hash,
49656 Ord,
49657 PartialEq,
49658 PartialOrd,
49659 Serialize
49660 )]
49661 pub enum SorOrderTestType {
49662 #[serde(rename = "LIMIT")]
49663 Limit,
49664 #[serde(rename = "MARKET")]
49665 Market,
49666 #[serde(rename = "STOP_LOSS")]
49667 StopLoss,
49668 #[serde(rename = "STOP_LOSS_LIMIT")]
49669 StopLossLimit,
49670 #[serde(rename = "TAKE_PROFIT")]
49671 TakeProfit,
49672 #[serde(rename = "TAKE_PROFIT_LIMIT")]
49673 TakeProfitLimit,
49674 #[serde(rename = "LIMIT_MAKER")]
49675 LimitMaker,
49676 }
49677 impl From<&SorOrderTestType> for SorOrderTestType {
49678 fn from(value: &SorOrderTestType) -> Self {
49679 value.clone()
49680 }
49681 }
49682 impl ToString for SorOrderTestType {
49683 fn to_string(&self) -> String {
49684 match *self {
49685 Self::Limit => "LIMIT".to_string(),
49686 Self::Market => "MARKET".to_string(),
49687 Self::StopLoss => "STOP_LOSS".to_string(),
49688 Self::StopLossLimit => "STOP_LOSS_LIMIT".to_string(),
49689 Self::TakeProfit => "TAKE_PROFIT".to_string(),
49690 Self::TakeProfitLimit => "TAKE_PROFIT_LIMIT".to_string(),
49691 Self::LimitMaker => "LIMIT_MAKER".to_string(),
49692 }
49693 }
49694 }
49695 impl std::str::FromStr for SorOrderTestType {
49696 type Err = self::error::ConversionError;
49697 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
49698 match value {
49699 "LIMIT" => Ok(Self::Limit),
49700 "MARKET" => Ok(Self::Market),
49701 "STOP_LOSS" => Ok(Self::StopLoss),
49702 "STOP_LOSS_LIMIT" => Ok(Self::StopLossLimit),
49703 "TAKE_PROFIT" => Ok(Self::TakeProfit),
49704 "TAKE_PROFIT_LIMIT" => Ok(Self::TakeProfitLimit),
49705 "LIMIT_MAKER" => Ok(Self::LimitMaker),
49706 _ => Err("invalid value".into()),
49707 }
49708 }
49709 }
49710 impl std::convert::TryFrom<&str> for SorOrderTestType {
49711 type Error = self::error::ConversionError;
49712 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
49713 value.parse()
49714 }
49715 }
49716 impl std::convert::TryFrom<&String> for SorOrderTestType {
49717 type Error = self::error::ConversionError;
49718 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
49719 value.parse()
49720 }
49721 }
49722 impl std::convert::TryFrom<String> for SorOrderTestType {
49723 type Error = self::error::ConversionError;
49724 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
49725 value.parse()
49726 }
49727 }
49728 ///SorOrderTimeInForce
49729 ///
49730 /// <details><summary>JSON schema</summary>
49731 ///
49732 /// ```json
49733 ///{
49734 /// "examples": [
49735 /// "GTC"
49736 /// ],
49737 /// "type": "string",
49738 /// "enum": [
49739 /// "GTC",
49740 /// "IOC",
49741 /// "FOK"
49742 /// ]
49743 ///}
49744 /// ```
49745 /// </details>
49746 #[derive(
49747 Clone,
49748 Copy,
49749 Debug,
49750 Deserialize,
49751 Eq,
49752 Hash,
49753 Ord,
49754 PartialEq,
49755 PartialOrd,
49756 Serialize
49757 )]
49758 pub enum SorOrderTimeInForce {
49759 #[serde(rename = "GTC")]
49760 Gtc,
49761 #[serde(rename = "IOC")]
49762 Ioc,
49763 #[serde(rename = "FOK")]
49764 Fok,
49765 }
49766 impl From<&SorOrderTimeInForce> for SorOrderTimeInForce {
49767 fn from(value: &SorOrderTimeInForce) -> Self {
49768 value.clone()
49769 }
49770 }
49771 impl ToString for SorOrderTimeInForce {
49772 fn to_string(&self) -> String {
49773 match *self {
49774 Self::Gtc => "GTC".to_string(),
49775 Self::Ioc => "IOC".to_string(),
49776 Self::Fok => "FOK".to_string(),
49777 }
49778 }
49779 }
49780 impl std::str::FromStr for SorOrderTimeInForce {
49781 type Err = self::error::ConversionError;
49782 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
49783 match value {
49784 "GTC" => Ok(Self::Gtc),
49785 "IOC" => Ok(Self::Ioc),
49786 "FOK" => Ok(Self::Fok),
49787 _ => Err("invalid value".into()),
49788 }
49789 }
49790 }
49791 impl std::convert::TryFrom<&str> for SorOrderTimeInForce {
49792 type Error = self::error::ConversionError;
49793 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
49794 value.parse()
49795 }
49796 }
49797 impl std::convert::TryFrom<&String> for SorOrderTimeInForce {
49798 type Error = self::error::ConversionError;
49799 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
49800 value.parse()
49801 }
49802 }
49803 impl std::convert::TryFrom<String> for SorOrderTimeInForce {
49804 type Error = self::error::ConversionError;
49805 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
49806 value.parse()
49807 }
49808 }
49809 ///SorOrderType
49810 ///
49811 /// <details><summary>JSON schema</summary>
49812 ///
49813 /// ```json
49814 ///{
49815 /// "examples": [
49816 /// "LIMIT"
49817 /// ],
49818 /// "type": "string",
49819 /// "enum": [
49820 /// "LIMIT",
49821 /// "MARKET",
49822 /// "STOP_LOSS",
49823 /// "STOP_LOSS_LIMIT",
49824 /// "TAKE_PROFIT",
49825 /// "TAKE_PROFIT_LIMIT",
49826 /// "LIMIT_MAKER"
49827 /// ]
49828 ///}
49829 /// ```
49830 /// </details>
49831 #[derive(
49832 Clone,
49833 Copy,
49834 Debug,
49835 Deserialize,
49836 Eq,
49837 Hash,
49838 Ord,
49839 PartialEq,
49840 PartialOrd,
49841 Serialize
49842 )]
49843 pub enum SorOrderType {
49844 #[serde(rename = "LIMIT")]
49845 Limit,
49846 #[serde(rename = "MARKET")]
49847 Market,
49848 #[serde(rename = "STOP_LOSS")]
49849 StopLoss,
49850 #[serde(rename = "STOP_LOSS_LIMIT")]
49851 StopLossLimit,
49852 #[serde(rename = "TAKE_PROFIT")]
49853 TakeProfit,
49854 #[serde(rename = "TAKE_PROFIT_LIMIT")]
49855 TakeProfitLimit,
49856 #[serde(rename = "LIMIT_MAKER")]
49857 LimitMaker,
49858 }
49859 impl From<&SorOrderType> for SorOrderType {
49860 fn from(value: &SorOrderType) -> Self {
49861 value.clone()
49862 }
49863 }
49864 impl ToString for SorOrderType {
49865 fn to_string(&self) -> String {
49866 match *self {
49867 Self::Limit => "LIMIT".to_string(),
49868 Self::Market => "MARKET".to_string(),
49869 Self::StopLoss => "STOP_LOSS".to_string(),
49870 Self::StopLossLimit => "STOP_LOSS_LIMIT".to_string(),
49871 Self::TakeProfit => "TAKE_PROFIT".to_string(),
49872 Self::TakeProfitLimit => "TAKE_PROFIT_LIMIT".to_string(),
49873 Self::LimitMaker => "LIMIT_MAKER".to_string(),
49874 }
49875 }
49876 }
49877 impl std::str::FromStr for SorOrderType {
49878 type Err = self::error::ConversionError;
49879 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
49880 match value {
49881 "LIMIT" => Ok(Self::Limit),
49882 "MARKET" => Ok(Self::Market),
49883 "STOP_LOSS" => Ok(Self::StopLoss),
49884 "STOP_LOSS_LIMIT" => Ok(Self::StopLossLimit),
49885 "TAKE_PROFIT" => Ok(Self::TakeProfit),
49886 "TAKE_PROFIT_LIMIT" => Ok(Self::TakeProfitLimit),
49887 "LIMIT_MAKER" => Ok(Self::LimitMaker),
49888 _ => Err("invalid value".into()),
49889 }
49890 }
49891 }
49892 impl std::convert::TryFrom<&str> for SorOrderType {
49893 type Error = self::error::ConversionError;
49894 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
49895 value.parse()
49896 }
49897 }
49898 impl std::convert::TryFrom<&String> for SorOrderType {
49899 type Error = self::error::ConversionError;
49900 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
49901 value.parse()
49902 }
49903 }
49904 impl std::convert::TryFrom<String> for SorOrderType {
49905 type Error = self::error::ConversionError;
49906 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
49907 value.parse()
49908 }
49909 }
49910 ///StakingPersonalLeftQuotaResponseItem
49911 ///
49912 /// <details><summary>JSON schema</summary>
49913 ///
49914 /// ```json
49915 ///{
49916 /// "type": "object",
49917 /// "required": [
49918 /// "leftPersonalQuota"
49919 /// ],
49920 /// "properties": {
49921 /// "leftPersonalQuota": {
49922 /// "examples": [
49923 /// "1000"
49924 /// ],
49925 /// "type": "string"
49926 /// }
49927 /// }
49928 ///}
49929 /// ```
49930 /// </details>
49931 #[derive(Clone, Debug, Deserialize, Serialize)]
49932 pub struct StakingPersonalLeftQuotaResponseItem {
49933 #[serde(rename = "leftPersonalQuota")]
49934 pub left_personal_quota: String,
49935 }
49936 impl From<&StakingPersonalLeftQuotaResponseItem>
49937 for StakingPersonalLeftQuotaResponseItem {
49938 fn from(value: &StakingPersonalLeftQuotaResponseItem) -> Self {
49939 value.clone()
49940 }
49941 }
49942 ///StakingPositionResponseItem
49943 ///
49944 /// <details><summary>JSON schema</summary>
49945 ///
49946 /// ```json
49947 ///{
49948 /// "type": "object",
49949 /// "required": [
49950 /// "APY",
49951 /// "accrualDays",
49952 /// "amount",
49953 /// "asset",
49954 /// "canRedeemEarly",
49955 /// "deliverDate",
49956 /// "duration",
49957 /// "estExtraRewardAmt",
49958 /// "extraRewardAPY",
49959 /// "extraRewardAsset",
49960 /// "interestEndDate",
49961 /// "nextInterestPay",
49962 /// "nextInterestPayDate",
49963 /// "partialAmtDeliverDate",
49964 /// "payInterestPeriod",
49965 /// "positionId",
49966 /// "projectId",
49967 /// "purchaseTime",
49968 /// "redeemAmountEarly",
49969 /// "redeemPeriod",
49970 /// "redeemingAmt",
49971 /// "renewable",
49972 /// "rewardAmt",
49973 /// "rewardAsset",
49974 /// "status",
49975 /// "type"
49976 /// ],
49977 /// "properties": {
49978 /// "APY": {
49979 /// "examples": [
49980 /// "0.2032"
49981 /// ],
49982 /// "type": "string"
49983 /// },
49984 /// "accrualDays": {
49985 /// "examples": [
49986 /// "4"
49987 /// ],
49988 /// "type": "string"
49989 /// },
49990 /// "amount": {
49991 /// "examples": [
49992 /// "122.09202928"
49993 /// ],
49994 /// "type": "string"
49995 /// },
49996 /// "asset": {
49997 /// "examples": [
49998 /// "AXS"
49999 /// ],
50000 /// "type": "string"
50001 /// },
50002 /// "canRedeemEarly": {
50003 /// "examples": [
50004 /// true
50005 /// ],
50006 /// "type": "boolean"
50007 /// },
50008 /// "deliverDate": {
50009 /// "examples": [
50010 /// "1651536000000"
50011 /// ],
50012 /// "type": "string"
50013 /// },
50014 /// "duration": {
50015 /// "examples": [
50016 /// "60"
50017 /// ],
50018 /// "type": "string"
50019 /// },
50020 /// "estExtraRewardAmt": {
50021 /// "examples": [
50022 /// "5.17181528"
50023 /// ],
50024 /// "type": "string"
50025 /// },
50026 /// "extraRewardAPY": {
50027 /// "examples": [
50028 /// "0.0203"
50029 /// ],
50030 /// "type": "string"
50031 /// },
50032 /// "extraRewardAsset": {
50033 /// "examples": [
50034 /// "BNB"
50035 /// ],
50036 /// "type": "string"
50037 /// },
50038 /// "interestEndDate": {
50039 /// "examples": [
50040 /// "1651449600000"
50041 /// ],
50042 /// "type": "string"
50043 /// },
50044 /// "nextInterestPay": {
50045 /// "examples": [
50046 /// "1.29295383"
50047 /// ],
50048 /// "type": "string"
50049 /// },
50050 /// "nextInterestPayDate": {
50051 /// "examples": [
50052 /// "1646697600000"
50053 /// ],
50054 /// "type": "string"
50055 /// },
50056 /// "partialAmtDeliverDate": {
50057 /// "examples": [
50058 /// "1651536000000"
50059 /// ],
50060 /// "type": "string"
50061 /// },
50062 /// "payInterestPeriod": {
50063 /// "examples": [
50064 /// "1"
50065 /// ],
50066 /// "type": "string"
50067 /// },
50068 /// "positionId": {
50069 /// "examples": [
50070 /// "123123"
50071 /// ],
50072 /// "type": "string"
50073 /// },
50074 /// "projectId": {
50075 /// "examples": [
50076 /// "Axs*90"
50077 /// ],
50078 /// "type": "string"
50079 /// },
50080 /// "purchaseTime": {
50081 /// "examples": [
50082 /// "1646182276000"
50083 /// ],
50084 /// "type": "string"
50085 /// },
50086 /// "redeemAmountEarly": {
50087 /// "examples": [
50088 /// "2802.24068892"
50089 /// ],
50090 /// "type": "string"
50091 /// },
50092 /// "redeemPeriod": {
50093 /// "examples": [
50094 /// "1"
50095 /// ],
50096 /// "type": "string"
50097 /// },
50098 /// "redeemingAmt": {
50099 /// "examples": [
50100 /// "232.2323"
50101 /// ],
50102 /// "type": "string"
50103 /// },
50104 /// "renewable": {
50105 /// "examples": [
50106 /// true
50107 /// ],
50108 /// "type": "boolean"
50109 /// },
50110 /// "rewardAmt": {
50111 /// "examples": [
50112 /// "5.17181528"
50113 /// ],
50114 /// "type": "string"
50115 /// },
50116 /// "rewardAsset": {
50117 /// "examples": [
50118 /// "AXS"
50119 /// ],
50120 /// "type": "string"
50121 /// },
50122 /// "status": {
50123 /// "examples": [
50124 /// "HOLDING"
50125 /// ],
50126 /// "type": "string"
50127 /// },
50128 /// "type": {
50129 /// "examples": [
50130 /// "AUTO"
50131 /// ],
50132 /// "type": "string"
50133 /// }
50134 /// }
50135 ///}
50136 /// ```
50137 /// </details>
50138 #[derive(Clone, Debug, Deserialize, Serialize)]
50139 pub struct StakingPositionResponseItem {
50140 #[serde(rename = "accrualDays")]
50141 pub accrual_days: String,
50142 pub amount: String,
50143 #[serde(rename = "APY")]
50144 pub apy: String,
50145 pub asset: String,
50146 #[serde(rename = "canRedeemEarly")]
50147 pub can_redeem_early: bool,
50148 #[serde(rename = "deliverDate")]
50149 pub deliver_date: String,
50150 pub duration: String,
50151 #[serde(rename = "estExtraRewardAmt")]
50152 pub est_extra_reward_amt: String,
50153 #[serde(rename = "extraRewardAPY")]
50154 pub extra_reward_apy: String,
50155 #[serde(rename = "extraRewardAsset")]
50156 pub extra_reward_asset: String,
50157 #[serde(rename = "interestEndDate")]
50158 pub interest_end_date: String,
50159 #[serde(rename = "nextInterestPay")]
50160 pub next_interest_pay: String,
50161 #[serde(rename = "nextInterestPayDate")]
50162 pub next_interest_pay_date: String,
50163 #[serde(rename = "partialAmtDeliverDate")]
50164 pub partial_amt_deliver_date: String,
50165 #[serde(rename = "payInterestPeriod")]
50166 pub pay_interest_period: String,
50167 #[serde(rename = "positionId")]
50168 pub position_id: String,
50169 #[serde(rename = "projectId")]
50170 pub project_id: String,
50171 #[serde(rename = "purchaseTime")]
50172 pub purchase_time: String,
50173 #[serde(rename = "redeemAmountEarly")]
50174 pub redeem_amount_early: String,
50175 #[serde(rename = "redeemPeriod")]
50176 pub redeem_period: String,
50177 #[serde(rename = "redeemingAmt")]
50178 pub redeeming_amt: String,
50179 pub renewable: bool,
50180 #[serde(rename = "rewardAmt")]
50181 pub reward_amt: String,
50182 #[serde(rename = "rewardAsset")]
50183 pub reward_asset: String,
50184 pub status: String,
50185 #[serde(rename = "type")]
50186 pub type_: String,
50187 }
50188 impl From<&StakingPositionResponseItem> for StakingPositionResponseItem {
50189 fn from(value: &StakingPositionResponseItem) -> Self {
50190 value.clone()
50191 }
50192 }
50193 ///StakingProductListResponseItem
50194 ///
50195 /// <details><summary>JSON schema</summary>
50196 ///
50197 /// ```json
50198 ///{
50199 /// "type": "object",
50200 /// "required": [
50201 /// "detail",
50202 /// "projectId",
50203 /// "quota"
50204 /// ],
50205 /// "properties": {
50206 /// "detail": {
50207 /// "type": "object",
50208 /// "required": [
50209 /// "apy",
50210 /// "asset",
50211 /// "duration",
50212 /// "renewable",
50213 /// "rewardAsset"
50214 /// ],
50215 /// "properties": {
50216 /// "apy": {
50217 /// "examples": [
50218 /// "1.2069"
50219 /// ],
50220 /// "type": "string"
50221 /// },
50222 /// "asset": {
50223 /// "examples": [
50224 /// "AXS"
50225 /// ],
50226 /// "type": "string"
50227 /// },
50228 /// "duration": {
50229 /// "examples": [
50230 /// 90
50231 /// ],
50232 /// "type": "integer",
50233 /// "format": "int64"
50234 /// },
50235 /// "renewable": {
50236 /// "examples": [
50237 /// true
50238 /// ],
50239 /// "type": "boolean"
50240 /// },
50241 /// "rewardAsset": {
50242 /// "examples": [
50243 /// "AXS"
50244 /// ],
50245 /// "type": "string"
50246 /// }
50247 /// }
50248 /// },
50249 /// "projectId": {
50250 /// "examples": [
50251 /// "Axs*90"
50252 /// ],
50253 /// "type": "string"
50254 /// },
50255 /// "quota": {
50256 /// "type": "object",
50257 /// "required": [
50258 /// "minimum",
50259 /// "totalPersonalQuota"
50260 /// ],
50261 /// "properties": {
50262 /// "minimum": {
50263 /// "examples": [
50264 /// "0.001"
50265 /// ],
50266 /// "type": "string"
50267 /// },
50268 /// "totalPersonalQuota": {
50269 /// "examples": [
50270 /// "2"
50271 /// ],
50272 /// "type": "string"
50273 /// }
50274 /// }
50275 /// }
50276 /// }
50277 ///}
50278 /// ```
50279 /// </details>
50280 #[derive(Clone, Debug, Deserialize, Serialize)]
50281 pub struct StakingProductListResponseItem {
50282 pub detail: StakingProductListResponseItemDetail,
50283 #[serde(rename = "projectId")]
50284 pub project_id: String,
50285 pub quota: StakingProductListResponseItemQuota,
50286 }
50287 impl From<&StakingProductListResponseItem> for StakingProductListResponseItem {
50288 fn from(value: &StakingProductListResponseItem) -> Self {
50289 value.clone()
50290 }
50291 }
50292 ///StakingProductListResponseItemDetail
50293 ///
50294 /// <details><summary>JSON schema</summary>
50295 ///
50296 /// ```json
50297 ///{
50298 /// "type": "object",
50299 /// "required": [
50300 /// "apy",
50301 /// "asset",
50302 /// "duration",
50303 /// "renewable",
50304 /// "rewardAsset"
50305 /// ],
50306 /// "properties": {
50307 /// "apy": {
50308 /// "examples": [
50309 /// "1.2069"
50310 /// ],
50311 /// "type": "string"
50312 /// },
50313 /// "asset": {
50314 /// "examples": [
50315 /// "AXS"
50316 /// ],
50317 /// "type": "string"
50318 /// },
50319 /// "duration": {
50320 /// "examples": [
50321 /// 90
50322 /// ],
50323 /// "type": "integer",
50324 /// "format": "int64"
50325 /// },
50326 /// "renewable": {
50327 /// "examples": [
50328 /// true
50329 /// ],
50330 /// "type": "boolean"
50331 /// },
50332 /// "rewardAsset": {
50333 /// "examples": [
50334 /// "AXS"
50335 /// ],
50336 /// "type": "string"
50337 /// }
50338 /// }
50339 ///}
50340 /// ```
50341 /// </details>
50342 #[derive(Clone, Debug, Deserialize, Serialize)]
50343 pub struct StakingProductListResponseItemDetail {
50344 pub apy: String,
50345 pub asset: String,
50346 pub duration: i64,
50347 pub renewable: bool,
50348 #[serde(rename = "rewardAsset")]
50349 pub reward_asset: String,
50350 }
50351 impl From<&StakingProductListResponseItemDetail>
50352 for StakingProductListResponseItemDetail {
50353 fn from(value: &StakingProductListResponseItemDetail) -> Self {
50354 value.clone()
50355 }
50356 }
50357 ///StakingProductListResponseItemQuota
50358 ///
50359 /// <details><summary>JSON schema</summary>
50360 ///
50361 /// ```json
50362 ///{
50363 /// "type": "object",
50364 /// "required": [
50365 /// "minimum",
50366 /// "totalPersonalQuota"
50367 /// ],
50368 /// "properties": {
50369 /// "minimum": {
50370 /// "examples": [
50371 /// "0.001"
50372 /// ],
50373 /// "type": "string"
50374 /// },
50375 /// "totalPersonalQuota": {
50376 /// "examples": [
50377 /// "2"
50378 /// ],
50379 /// "type": "string"
50380 /// }
50381 /// }
50382 ///}
50383 /// ```
50384 /// </details>
50385 #[derive(Clone, Debug, Deserialize, Serialize)]
50386 pub struct StakingProductListResponseItemQuota {
50387 pub minimum: String,
50388 #[serde(rename = "totalPersonalQuota")]
50389 pub total_personal_quota: String,
50390 }
50391 impl From<&StakingProductListResponseItemQuota>
50392 for StakingProductListResponseItemQuota {
50393 fn from(value: &StakingProductListResponseItemQuota) -> Self {
50394 value.clone()
50395 }
50396 }
50397 ///StakingPurchaseResponse
50398 ///
50399 /// <details><summary>JSON schema</summary>
50400 ///
50401 /// ```json
50402 ///{
50403 /// "type": "object",
50404 /// "required": [
50405 /// "positionId",
50406 /// "success"
50407 /// ],
50408 /// "properties": {
50409 /// "positionId": {
50410 /// "examples": [
50411 /// "12345"
50412 /// ],
50413 /// "type": "string"
50414 /// },
50415 /// "success": {
50416 /// "examples": [
50417 /// true
50418 /// ],
50419 /// "type": "boolean"
50420 /// }
50421 /// }
50422 ///}
50423 /// ```
50424 /// </details>
50425 #[derive(Clone, Debug, Deserialize, Serialize)]
50426 pub struct StakingPurchaseResponse {
50427 #[serde(rename = "positionId")]
50428 pub position_id: String,
50429 pub success: bool,
50430 }
50431 impl From<&StakingPurchaseResponse> for StakingPurchaseResponse {
50432 fn from(value: &StakingPurchaseResponse) -> Self {
50433 value.clone()
50434 }
50435 }
50436 ///StakingRedeemResponse
50437 ///
50438 /// <details><summary>JSON schema</summary>
50439 ///
50440 /// ```json
50441 ///{
50442 /// "type": "object",
50443 /// "required": [
50444 /// "success"
50445 /// ],
50446 /// "properties": {
50447 /// "success": {
50448 /// "examples": [
50449 /// true
50450 /// ],
50451 /// "type": "boolean"
50452 /// }
50453 /// }
50454 ///}
50455 /// ```
50456 /// </details>
50457 #[derive(Clone, Debug, Deserialize, Serialize)]
50458 pub struct StakingRedeemResponse {
50459 pub success: bool,
50460 }
50461 impl From<&StakingRedeemResponse> for StakingRedeemResponse {
50462 fn from(value: &StakingRedeemResponse) -> Self {
50463 value.clone()
50464 }
50465 }
50466 ///StakingSetAutoStakingResponse
50467 ///
50468 /// <details><summary>JSON schema</summary>
50469 ///
50470 /// ```json
50471 ///{
50472 /// "type": "object",
50473 /// "required": [
50474 /// "success"
50475 /// ],
50476 /// "properties": {
50477 /// "success": {
50478 /// "examples": [
50479 /// true
50480 /// ],
50481 /// "type": "boolean"
50482 /// }
50483 /// }
50484 ///}
50485 /// ```
50486 /// </details>
50487 #[derive(Clone, Debug, Deserialize, Serialize)]
50488 pub struct StakingSetAutoStakingResponse {
50489 pub success: bool,
50490 }
50491 impl From<&StakingSetAutoStakingResponse> for StakingSetAutoStakingResponse {
50492 fn from(value: &StakingSetAutoStakingResponse) -> Self {
50493 value.clone()
50494 }
50495 }
50496 ///StakingStakingRecordResponseItem
50497 ///
50498 /// <details><summary>JSON schema</summary>
50499 ///
50500 /// ```json
50501 ///{
50502 /// "type": "object",
50503 /// "required": [
50504 /// "amount",
50505 /// "asset",
50506 /// "deliverDate",
50507 /// "lockPeriod",
50508 /// "positionId",
50509 /// "project",
50510 /// "status",
50511 /// "time",
50512 /// "type"
50513 /// ],
50514 /// "properties": {
50515 /// "amount": {
50516 /// "examples": [
50517 /// "21312.23223"
50518 /// ],
50519 /// "type": "string"
50520 /// },
50521 /// "asset": {
50522 /// "examples": [
50523 /// "BNB"
50524 /// ],
50525 /// "type": "string"
50526 /// },
50527 /// "deliverDate": {
50528 /// "examples": [
50529 /// "1575018510000"
50530 /// ],
50531 /// "type": "string"
50532 /// },
50533 /// "lockPeriod": {
50534 /// "examples": [
50535 /// "30"
50536 /// ],
50537 /// "type": "string"
50538 /// },
50539 /// "positionId": {
50540 /// "examples": [
50541 /// "123123"
50542 /// ],
50543 /// "type": "string"
50544 /// },
50545 /// "project": {
50546 /// "examples": [
50547 /// "BSC"
50548 /// ],
50549 /// "type": "string"
50550 /// },
50551 /// "status": {
50552 /// "examples": [
50553 /// "success"
50554 /// ],
50555 /// "type": "string"
50556 /// },
50557 /// "time": {
50558 /// "examples": [
50559 /// 1575018510000
50560 /// ],
50561 /// "type": "integer",
50562 /// "format": "int64"
50563 /// },
50564 /// "type": {
50565 /// "examples": [
50566 /// "AUTO"
50567 /// ],
50568 /// "type": "string"
50569 /// }
50570 /// }
50571 ///}
50572 /// ```
50573 /// </details>
50574 #[derive(Clone, Debug, Deserialize, Serialize)]
50575 pub struct StakingStakingRecordResponseItem {
50576 pub amount: String,
50577 pub asset: String,
50578 #[serde(rename = "deliverDate")]
50579 pub deliver_date: String,
50580 #[serde(rename = "lockPeriod")]
50581 pub lock_period: String,
50582 #[serde(rename = "positionId")]
50583 pub position_id: String,
50584 pub project: String,
50585 pub status: String,
50586 pub time: i64,
50587 #[serde(rename = "type")]
50588 pub type_: String,
50589 }
50590 impl From<&StakingStakingRecordResponseItem> for StakingStakingRecordResponseItem {
50591 fn from(value: &StakingStakingRecordResponseItem) -> Self {
50592 value.clone()
50593 }
50594 }
50595 ///SubAccountBlvtEnableResponse
50596 ///
50597 /// <details><summary>JSON schema</summary>
50598 ///
50599 /// ```json
50600 ///{
50601 /// "type": "object",
50602 /// "required": [
50603 /// "email",
50604 /// "enableBlvt"
50605 /// ],
50606 /// "properties": {
50607 /// "email": {
50608 /// "examples": [
50609 /// "123@test.com"
50610 /// ],
50611 /// "type": "string"
50612 /// },
50613 /// "enableBlvt": {
50614 /// "type": "boolean"
50615 /// }
50616 /// }
50617 ///}
50618 /// ```
50619 /// </details>
50620 #[derive(Clone, Debug, Deserialize, Serialize)]
50621 pub struct SubAccountBlvtEnableResponse {
50622 pub email: String,
50623 #[serde(rename = "enableBlvt")]
50624 pub enable_blvt: bool,
50625 }
50626 impl From<&SubAccountBlvtEnableResponse> for SubAccountBlvtEnableResponse {
50627 fn from(value: &SubAccountBlvtEnableResponse) -> Self {
50628 value.clone()
50629 }
50630 }
50631 ///SubAccountCoinFuturesDetails
50632 ///
50633 /// <details><summary>JSON schema</summary>
50634 ///
50635 /// ```json
50636 ///{
50637 /// "type": "object",
50638 /// "required": [
50639 /// "assets",
50640 /// "canDeposit",
50641 /// "canTrade",
50642 /// "canWithdraw",
50643 /// "email",
50644 /// "feeTier",
50645 /// "updateTime"
50646 /// ],
50647 /// "properties": {
50648 /// "assets": {
50649 /// "type": "array",
50650 /// "items": {
50651 /// "type": "object",
50652 /// "required": [
50653 /// "asset",
50654 /// "initialMargin",
50655 /// "maintenanceMargin",
50656 /// "marginBalance",
50657 /// "maxWithdrawAmount",
50658 /// "openOrderInitialMargin",
50659 /// "positionInitialMargin",
50660 /// "unrealizedProfit",
50661 /// "walletBalance"
50662 /// ],
50663 /// "properties": {
50664 /// "asset": {
50665 /// "examples": [
50666 /// "BTC"
50667 /// ],
50668 /// "type": "string"
50669 /// },
50670 /// "initialMargin": {
50671 /// "examples": [
50672 /// "0.00000000"
50673 /// ],
50674 /// "type": "string"
50675 /// },
50676 /// "maintenanceMargin": {
50677 /// "examples": [
50678 /// "0.00000000"
50679 /// ],
50680 /// "type": "string"
50681 /// },
50682 /// "marginBalance": {
50683 /// "examples": [
50684 /// "0.88308000"
50685 /// ],
50686 /// "type": "string"
50687 /// },
50688 /// "maxWithdrawAmount": {
50689 /// "examples": [
50690 /// "0.88308000"
50691 /// ],
50692 /// "type": "string"
50693 /// },
50694 /// "openOrderInitialMargin": {
50695 /// "examples": [
50696 /// "0.00000000"
50697 /// ],
50698 /// "type": "string"
50699 /// },
50700 /// "positionInitialMargin": {
50701 /// "examples": [
50702 /// "0.00000000"
50703 /// ],
50704 /// "type": "string"
50705 /// },
50706 /// "unrealizedProfit": {
50707 /// "examples": [
50708 /// "0.00000000"
50709 /// ],
50710 /// "type": "string"
50711 /// },
50712 /// "walletBalance": {
50713 /// "examples": [
50714 /// "0.88308000"
50715 /// ],
50716 /// "type": "string"
50717 /// }
50718 /// }
50719 /// }
50720 /// },
50721 /// "canDeposit": {
50722 /// "type": "boolean"
50723 /// },
50724 /// "canTrade": {
50725 /// "type": "boolean"
50726 /// },
50727 /// "canWithdraw": {
50728 /// "type": "boolean"
50729 /// },
50730 /// "email": {
50731 /// "examples": [
50732 /// "abc@test.com"
50733 /// ],
50734 /// "type": "string"
50735 /// },
50736 /// "feeTier": {
50737 /// "examples": [
50738 /// 2
50739 /// ],
50740 /// "type": "integer",
50741 /// "format": "int64"
50742 /// },
50743 /// "updateTime": {
50744 /// "examples": [
50745 /// 1598959682001
50746 /// ],
50747 /// "type": "integer",
50748 /// "format": "int64"
50749 /// }
50750 /// }
50751 ///}
50752 /// ```
50753 /// </details>
50754 #[derive(Clone, Debug, Deserialize, Serialize)]
50755 pub struct SubAccountCoinFuturesDetails {
50756 pub assets: Vec<SubAccountCoinFuturesDetailsAssetsItem>,
50757 #[serde(rename = "canDeposit")]
50758 pub can_deposit: bool,
50759 #[serde(rename = "canTrade")]
50760 pub can_trade: bool,
50761 #[serde(rename = "canWithdraw")]
50762 pub can_withdraw: bool,
50763 pub email: String,
50764 #[serde(rename = "feeTier")]
50765 pub fee_tier: i64,
50766 #[serde(rename = "updateTime")]
50767 pub update_time: i64,
50768 }
50769 impl From<&SubAccountCoinFuturesDetails> for SubAccountCoinFuturesDetails {
50770 fn from(value: &SubAccountCoinFuturesDetails) -> Self {
50771 value.clone()
50772 }
50773 }
50774 ///SubAccountCoinFuturesDetailsAssetsItem
50775 ///
50776 /// <details><summary>JSON schema</summary>
50777 ///
50778 /// ```json
50779 ///{
50780 /// "type": "object",
50781 /// "required": [
50782 /// "asset",
50783 /// "initialMargin",
50784 /// "maintenanceMargin",
50785 /// "marginBalance",
50786 /// "maxWithdrawAmount",
50787 /// "openOrderInitialMargin",
50788 /// "positionInitialMargin",
50789 /// "unrealizedProfit",
50790 /// "walletBalance"
50791 /// ],
50792 /// "properties": {
50793 /// "asset": {
50794 /// "examples": [
50795 /// "BTC"
50796 /// ],
50797 /// "type": "string"
50798 /// },
50799 /// "initialMargin": {
50800 /// "examples": [
50801 /// "0.00000000"
50802 /// ],
50803 /// "type": "string"
50804 /// },
50805 /// "maintenanceMargin": {
50806 /// "examples": [
50807 /// "0.00000000"
50808 /// ],
50809 /// "type": "string"
50810 /// },
50811 /// "marginBalance": {
50812 /// "examples": [
50813 /// "0.88308000"
50814 /// ],
50815 /// "type": "string"
50816 /// },
50817 /// "maxWithdrawAmount": {
50818 /// "examples": [
50819 /// "0.88308000"
50820 /// ],
50821 /// "type": "string"
50822 /// },
50823 /// "openOrderInitialMargin": {
50824 /// "examples": [
50825 /// "0.00000000"
50826 /// ],
50827 /// "type": "string"
50828 /// },
50829 /// "positionInitialMargin": {
50830 /// "examples": [
50831 /// "0.00000000"
50832 /// ],
50833 /// "type": "string"
50834 /// },
50835 /// "unrealizedProfit": {
50836 /// "examples": [
50837 /// "0.00000000"
50838 /// ],
50839 /// "type": "string"
50840 /// },
50841 /// "walletBalance": {
50842 /// "examples": [
50843 /// "0.88308000"
50844 /// ],
50845 /// "type": "string"
50846 /// }
50847 /// }
50848 ///}
50849 /// ```
50850 /// </details>
50851 #[derive(Clone, Debug, Deserialize, Serialize)]
50852 pub struct SubAccountCoinFuturesDetailsAssetsItem {
50853 pub asset: String,
50854 #[serde(rename = "initialMargin")]
50855 pub initial_margin: String,
50856 #[serde(rename = "maintenanceMargin")]
50857 pub maintenance_margin: String,
50858 #[serde(rename = "marginBalance")]
50859 pub margin_balance: String,
50860 #[serde(rename = "maxWithdrawAmount")]
50861 pub max_withdraw_amount: String,
50862 #[serde(rename = "openOrderInitialMargin")]
50863 pub open_order_initial_margin: String,
50864 #[serde(rename = "positionInitialMargin")]
50865 pub position_initial_margin: String,
50866 #[serde(rename = "unrealizedProfit")]
50867 pub unrealized_profit: String,
50868 #[serde(rename = "walletBalance")]
50869 pub wallet_balance: String,
50870 }
50871 impl From<&SubAccountCoinFuturesDetailsAssetsItem>
50872 for SubAccountCoinFuturesDetailsAssetsItem {
50873 fn from(value: &SubAccountCoinFuturesDetailsAssetsItem) -> Self {
50874 value.clone()
50875 }
50876 }
50877 ///SubAccountCoinFuturesPositionRisk
50878 ///
50879 /// <details><summary>JSON schema</summary>
50880 ///
50881 /// ```json
50882 ///{
50883 /// "type": "object",
50884 /// "required": [
50885 /// "deliveryPositionRiskVos"
50886 /// ],
50887 /// "properties": {
50888 /// "deliveryPositionRiskVos": {
50889 /// "type": "array",
50890 /// "items": {
50891 /// "type": "object",
50892 /// "required": [
50893 /// "entryPrice",
50894 /// "isAutoAddMargin",
50895 /// "isolated",
50896 /// "isolatedMargin",
50897 /// "isolatedWallet",
50898 /// "leverage",
50899 /// "markPrice",
50900 /// "positionAmount",
50901 /// "positionSide",
50902 /// "symbol",
50903 /// "unrealizedProfit"
50904 /// ],
50905 /// "properties": {
50906 /// "entryPrice": {
50907 /// "examples": [
50908 /// "9975.12000"
50909 /// ],
50910 /// "type": "string"
50911 /// },
50912 /// "isAutoAddMargin": {
50913 /// "examples": [
50914 /// "false"
50915 /// ],
50916 /// "type": "string"
50917 /// },
50918 /// "isolated": {
50919 /// "examples": [
50920 /// false
50921 /// ],
50922 /// "type": "string"
50923 /// },
50924 /// "isolatedMargin": {
50925 /// "examples": [
50926 /// "0.00000000"
50927 /// ],
50928 /// "type": "string"
50929 /// },
50930 /// "isolatedWallet": {
50931 /// "examples": [
50932 /// "9973.50770517"
50933 /// ],
50934 /// "type": "string"
50935 /// },
50936 /// "leverage": {
50937 /// "examples": [
50938 /// "20"
50939 /// ],
50940 /// "type": "string"
50941 /// },
50942 /// "markPrice": {
50943 /// "examples": [
50944 /// "9973.50770517"
50945 /// ],
50946 /// "type": "string"
50947 /// },
50948 /// "positionAmount": {
50949 /// "examples": [
50950 /// "1.230"
50951 /// ],
50952 /// "type": "string"
50953 /// },
50954 /// "positionSide": {
50955 /// "examples": [
50956 /// "BOTH"
50957 /// ],
50958 /// "type": "string"
50959 /// },
50960 /// "symbol": {
50961 /// "examples": [
50962 /// "BTCUSD_201225"
50963 /// ],
50964 /// "type": "string"
50965 /// },
50966 /// "unrealizedProfit": {
50967 /// "examples": [
50968 /// "-0.01612295"
50969 /// ],
50970 /// "type": "string"
50971 /// }
50972 /// }
50973 /// }
50974 /// }
50975 /// }
50976 ///}
50977 /// ```
50978 /// </details>
50979 #[derive(Clone, Debug, Deserialize, Serialize)]
50980 pub struct SubAccountCoinFuturesPositionRisk {
50981 #[serde(rename = "deliveryPositionRiskVos")]
50982 pub delivery_position_risk_vos: Vec<
50983 SubAccountCoinFuturesPositionRiskDeliveryPositionRiskVosItem,
50984 >,
50985 }
50986 impl From<&SubAccountCoinFuturesPositionRisk> for SubAccountCoinFuturesPositionRisk {
50987 fn from(value: &SubAccountCoinFuturesPositionRisk) -> Self {
50988 value.clone()
50989 }
50990 }
50991 ///SubAccountCoinFuturesPositionRiskDeliveryPositionRiskVosItem
50992 ///
50993 /// <details><summary>JSON schema</summary>
50994 ///
50995 /// ```json
50996 ///{
50997 /// "type": "object",
50998 /// "required": [
50999 /// "entryPrice",
51000 /// "isAutoAddMargin",
51001 /// "isolated",
51002 /// "isolatedMargin",
51003 /// "isolatedWallet",
51004 /// "leverage",
51005 /// "markPrice",
51006 /// "positionAmount",
51007 /// "positionSide",
51008 /// "symbol",
51009 /// "unrealizedProfit"
51010 /// ],
51011 /// "properties": {
51012 /// "entryPrice": {
51013 /// "examples": [
51014 /// "9975.12000"
51015 /// ],
51016 /// "type": "string"
51017 /// },
51018 /// "isAutoAddMargin": {
51019 /// "examples": [
51020 /// "false"
51021 /// ],
51022 /// "type": "string"
51023 /// },
51024 /// "isolated": {
51025 /// "examples": [
51026 /// false
51027 /// ],
51028 /// "type": "string"
51029 /// },
51030 /// "isolatedMargin": {
51031 /// "examples": [
51032 /// "0.00000000"
51033 /// ],
51034 /// "type": "string"
51035 /// },
51036 /// "isolatedWallet": {
51037 /// "examples": [
51038 /// "9973.50770517"
51039 /// ],
51040 /// "type": "string"
51041 /// },
51042 /// "leverage": {
51043 /// "examples": [
51044 /// "20"
51045 /// ],
51046 /// "type": "string"
51047 /// },
51048 /// "markPrice": {
51049 /// "examples": [
51050 /// "9973.50770517"
51051 /// ],
51052 /// "type": "string"
51053 /// },
51054 /// "positionAmount": {
51055 /// "examples": [
51056 /// "1.230"
51057 /// ],
51058 /// "type": "string"
51059 /// },
51060 /// "positionSide": {
51061 /// "examples": [
51062 /// "BOTH"
51063 /// ],
51064 /// "type": "string"
51065 /// },
51066 /// "symbol": {
51067 /// "examples": [
51068 /// "BTCUSD_201225"
51069 /// ],
51070 /// "type": "string"
51071 /// },
51072 /// "unrealizedProfit": {
51073 /// "examples": [
51074 /// "-0.01612295"
51075 /// ],
51076 /// "type": "string"
51077 /// }
51078 /// }
51079 ///}
51080 /// ```
51081 /// </details>
51082 #[derive(Clone, Debug, Deserialize, Serialize)]
51083 pub struct SubAccountCoinFuturesPositionRiskDeliveryPositionRiskVosItem {
51084 #[serde(rename = "entryPrice")]
51085 pub entry_price: String,
51086 #[serde(rename = "isAutoAddMargin")]
51087 pub is_auto_add_margin: String,
51088 pub isolated: String,
51089 #[serde(rename = "isolatedMargin")]
51090 pub isolated_margin: String,
51091 #[serde(rename = "isolatedWallet")]
51092 pub isolated_wallet: String,
51093 pub leverage: String,
51094 #[serde(rename = "markPrice")]
51095 pub mark_price: String,
51096 #[serde(rename = "positionAmount")]
51097 pub position_amount: String,
51098 #[serde(rename = "positionSide")]
51099 pub position_side: String,
51100 pub symbol: String,
51101 #[serde(rename = "unrealizedProfit")]
51102 pub unrealized_profit: String,
51103 }
51104 impl From<&SubAccountCoinFuturesPositionRiskDeliveryPositionRiskVosItem>
51105 for SubAccountCoinFuturesPositionRiskDeliveryPositionRiskVosItem {
51106 fn from(
51107 value: &SubAccountCoinFuturesPositionRiskDeliveryPositionRiskVosItem,
51108 ) -> Self {
51109 value.clone()
51110 }
51111 }
51112 ///SubAccountCoinFuturesSummary
51113 ///
51114 /// <details><summary>JSON schema</summary>
51115 ///
51116 /// ```json
51117 ///{
51118 /// "type": "object",
51119 /// "required": [
51120 /// "deliveryAccountSummaryResp"
51121 /// ],
51122 /// "properties": {
51123 /// "deliveryAccountSummaryResp": {
51124 /// "type": "object",
51125 /// "required": [
51126 /// "asset",
51127 /// "subAccountList",
51128 /// "totalMarginBalanceOfBTC",
51129 /// "totalUnrealizedProfitOfBTC",
51130 /// "totalWalletBalanceOfBTC"
51131 /// ],
51132 /// "properties": {
51133 /// "asset": {
51134 /// "examples": [
51135 /// "BTC"
51136 /// ],
51137 /// "type": "string"
51138 /// },
51139 /// "subAccountList": {
51140 /// "type": "array",
51141 /// "items": {
51142 /// "type": "object",
51143 /// "required": [
51144 /// "asset",
51145 /// "email",
51146 /// "totalMarginBalance",
51147 /// "totalUnrealizedProfit",
51148 /// "totalWalletBalance"
51149 /// ],
51150 /// "properties": {
51151 /// "asset": {
51152 /// "examples": [
51153 /// "BTC"
51154 /// ],
51155 /// "type": "string"
51156 /// },
51157 /// "email": {
51158 /// "examples": [
51159 /// "123@test.com"
51160 /// ],
51161 /// "type": "string"
51162 /// },
51163 /// "totalMarginBalance": {
51164 /// "examples": [
51165 /// 22.12659734
51166 /// ],
51167 /// "type": "string"
51168 /// },
51169 /// "totalUnrealizedProfit": {
51170 /// "examples": [
51171 /// 0.0
51172 /// ],
51173 /// "type": "string"
51174 /// },
51175 /// "totalWalletBalance": {
51176 /// "examples": [
51177 /// 22.12659734
51178 /// ],
51179 /// "type": "string"
51180 /// }
51181 /// }
51182 /// }
51183 /// },
51184 /// "totalMarginBalanceOfBTC": {
51185 /// "examples": [
51186 /// 25.03221121
51187 /// ],
51188 /// "type": "string"
51189 /// },
51190 /// "totalUnrealizedProfitOfBTC": {
51191 /// "examples": [
51192 /// 0.1223341
51193 /// ],
51194 /// "type": "string"
51195 /// },
51196 /// "totalWalletBalanceOfBTC": {
51197 /// "examples": [
51198 /// 22.15879444
51199 /// ],
51200 /// "type": "string"
51201 /// }
51202 /// }
51203 /// }
51204 /// }
51205 ///}
51206 /// ```
51207 /// </details>
51208 #[derive(Clone, Debug, Deserialize, Serialize)]
51209 pub struct SubAccountCoinFuturesSummary {
51210 #[serde(rename = "deliveryAccountSummaryResp")]
51211 pub delivery_account_summary_resp: SubAccountCoinFuturesSummaryDeliveryAccountSummaryResp,
51212 }
51213 impl From<&SubAccountCoinFuturesSummary> for SubAccountCoinFuturesSummary {
51214 fn from(value: &SubAccountCoinFuturesSummary) -> Self {
51215 value.clone()
51216 }
51217 }
51218 ///SubAccountCoinFuturesSummaryDeliveryAccountSummaryResp
51219 ///
51220 /// <details><summary>JSON schema</summary>
51221 ///
51222 /// ```json
51223 ///{
51224 /// "type": "object",
51225 /// "required": [
51226 /// "asset",
51227 /// "subAccountList",
51228 /// "totalMarginBalanceOfBTC",
51229 /// "totalUnrealizedProfitOfBTC",
51230 /// "totalWalletBalanceOfBTC"
51231 /// ],
51232 /// "properties": {
51233 /// "asset": {
51234 /// "examples": [
51235 /// "BTC"
51236 /// ],
51237 /// "type": "string"
51238 /// },
51239 /// "subAccountList": {
51240 /// "type": "array",
51241 /// "items": {
51242 /// "type": "object",
51243 /// "required": [
51244 /// "asset",
51245 /// "email",
51246 /// "totalMarginBalance",
51247 /// "totalUnrealizedProfit",
51248 /// "totalWalletBalance"
51249 /// ],
51250 /// "properties": {
51251 /// "asset": {
51252 /// "examples": [
51253 /// "BTC"
51254 /// ],
51255 /// "type": "string"
51256 /// },
51257 /// "email": {
51258 /// "examples": [
51259 /// "123@test.com"
51260 /// ],
51261 /// "type": "string"
51262 /// },
51263 /// "totalMarginBalance": {
51264 /// "examples": [
51265 /// 22.12659734
51266 /// ],
51267 /// "type": "string"
51268 /// },
51269 /// "totalUnrealizedProfit": {
51270 /// "examples": [
51271 /// 0.0
51272 /// ],
51273 /// "type": "string"
51274 /// },
51275 /// "totalWalletBalance": {
51276 /// "examples": [
51277 /// 22.12659734
51278 /// ],
51279 /// "type": "string"
51280 /// }
51281 /// }
51282 /// }
51283 /// },
51284 /// "totalMarginBalanceOfBTC": {
51285 /// "examples": [
51286 /// 25.03221121
51287 /// ],
51288 /// "type": "string"
51289 /// },
51290 /// "totalUnrealizedProfitOfBTC": {
51291 /// "examples": [
51292 /// 0.1223341
51293 /// ],
51294 /// "type": "string"
51295 /// },
51296 /// "totalWalletBalanceOfBTC": {
51297 /// "examples": [
51298 /// 22.15879444
51299 /// ],
51300 /// "type": "string"
51301 /// }
51302 /// }
51303 ///}
51304 /// ```
51305 /// </details>
51306 #[derive(Clone, Debug, Deserialize, Serialize)]
51307 pub struct SubAccountCoinFuturesSummaryDeliveryAccountSummaryResp {
51308 pub asset: String,
51309 #[serde(rename = "subAccountList")]
51310 pub sub_account_list: Vec<
51311 SubAccountCoinFuturesSummaryDeliveryAccountSummaryRespSubAccountListItem,
51312 >,
51313 #[serde(rename = "totalMarginBalanceOfBTC")]
51314 pub total_margin_balance_of_btc: String,
51315 #[serde(rename = "totalUnrealizedProfitOfBTC")]
51316 pub total_unrealized_profit_of_btc: String,
51317 #[serde(rename = "totalWalletBalanceOfBTC")]
51318 pub total_wallet_balance_of_btc: String,
51319 }
51320 impl From<&SubAccountCoinFuturesSummaryDeliveryAccountSummaryResp>
51321 for SubAccountCoinFuturesSummaryDeliveryAccountSummaryResp {
51322 fn from(value: &SubAccountCoinFuturesSummaryDeliveryAccountSummaryResp) -> Self {
51323 value.clone()
51324 }
51325 }
51326 ///SubAccountCoinFuturesSummaryDeliveryAccountSummaryRespSubAccountListItem
51327 ///
51328 /// <details><summary>JSON schema</summary>
51329 ///
51330 /// ```json
51331 ///{
51332 /// "type": "object",
51333 /// "required": [
51334 /// "asset",
51335 /// "email",
51336 /// "totalMarginBalance",
51337 /// "totalUnrealizedProfit",
51338 /// "totalWalletBalance"
51339 /// ],
51340 /// "properties": {
51341 /// "asset": {
51342 /// "examples": [
51343 /// "BTC"
51344 /// ],
51345 /// "type": "string"
51346 /// },
51347 /// "email": {
51348 /// "examples": [
51349 /// "123@test.com"
51350 /// ],
51351 /// "type": "string"
51352 /// },
51353 /// "totalMarginBalance": {
51354 /// "examples": [
51355 /// 22.12659734
51356 /// ],
51357 /// "type": "string"
51358 /// },
51359 /// "totalUnrealizedProfit": {
51360 /// "examples": [
51361 /// 0.0
51362 /// ],
51363 /// "type": "string"
51364 /// },
51365 /// "totalWalletBalance": {
51366 /// "examples": [
51367 /// 22.12659734
51368 /// ],
51369 /// "type": "string"
51370 /// }
51371 /// }
51372 ///}
51373 /// ```
51374 /// </details>
51375 #[derive(Clone, Debug, Deserialize, Serialize)]
51376 pub struct SubAccountCoinFuturesSummaryDeliveryAccountSummaryRespSubAccountListItem {
51377 pub asset: String,
51378 pub email: String,
51379 #[serde(rename = "totalMarginBalance")]
51380 pub total_margin_balance: String,
51381 #[serde(rename = "totalUnrealizedProfit")]
51382 pub total_unrealized_profit: String,
51383 #[serde(rename = "totalWalletBalance")]
51384 pub total_wallet_balance: String,
51385 }
51386 impl From<&SubAccountCoinFuturesSummaryDeliveryAccountSummaryRespSubAccountListItem>
51387 for SubAccountCoinFuturesSummaryDeliveryAccountSummaryRespSubAccountListItem {
51388 fn from(
51389 value: &SubAccountCoinFuturesSummaryDeliveryAccountSummaryRespSubAccountListItem,
51390 ) -> Self {
51391 value.clone()
51392 }
51393 }
51394 ///SubAccountDeleteIpListResponse
51395 ///
51396 /// <details><summary>JSON schema</summary>
51397 ///
51398 /// ```json
51399 ///{
51400 /// "type": "object",
51401 /// "required": [
51402 /// "apiKey",
51403 /// "ipList",
51404 /// "ipRestrict",
51405 /// "updateTime"
51406 /// ],
51407 /// "properties": {
51408 /// "apiKey": {
51409 /// "examples": [
51410 /// "k5V49ldtn4tszj6W3hystegdfvmGbqDzjmkCtpTvC0G74WhK7yd4rfCTo4lShf"
51411 /// ],
51412 /// "type": "string"
51413 /// },
51414 /// "ipList": {
51415 /// "examples": [
51416 /// [
51417 /// "69.210.67.14",
51418 /// "thirdPartyName"
51419 /// ]
51420 /// ],
51421 /// "type": "array",
51422 /// "items": {
51423 /// "type": "string"
51424 /// }
51425 /// },
51426 /// "ipRestrict": {
51427 /// "examples": [
51428 /// "true"
51429 /// ],
51430 /// "type": "string"
51431 /// },
51432 /// "updateTime": {
51433 /// "examples": [
51434 /// 1636369557189
51435 /// ],
51436 /// "type": "integer",
51437 /// "format": "int64"
51438 /// }
51439 /// }
51440 ///}
51441 /// ```
51442 /// </details>
51443 #[derive(Clone, Debug, Deserialize, Serialize)]
51444 pub struct SubAccountDeleteIpListResponse {
51445 #[serde(rename = "apiKey")]
51446 pub api_key: String,
51447 #[serde(rename = "ipList")]
51448 pub ip_list: Vec<String>,
51449 #[serde(rename = "ipRestrict")]
51450 pub ip_restrict: String,
51451 #[serde(rename = "updateTime")]
51452 pub update_time: i64,
51453 }
51454 impl From<&SubAccountDeleteIpListResponse> for SubAccountDeleteIpListResponse {
51455 fn from(value: &SubAccountDeleteIpListResponse) -> Self {
51456 value.clone()
51457 }
51458 }
51459 ///SubAccountEoptionsEnableResponse
51460 ///
51461 /// <details><summary>JSON schema</summary>
51462 ///
51463 /// ```json
51464 ///{
51465 /// "type": "object",
51466 /// "required": [
51467 /// "email",
51468 /// "isEOptionsEnabled"
51469 /// ],
51470 /// "properties": {
51471 /// "email": {
51472 /// "examples": [
51473 /// "alice@test.com"
51474 /// ],
51475 /// "type": "string"
51476 /// },
51477 /// "isEOptionsEnabled": {
51478 /// "examples": [
51479 /// true
51480 /// ],
51481 /// "type": "boolean"
51482 /// }
51483 /// }
51484 ///}
51485 /// ```
51486 /// </details>
51487 #[derive(Clone, Debug, Deserialize, Serialize)]
51488 pub struct SubAccountEoptionsEnableResponse {
51489 pub email: String,
51490 #[serde(rename = "isEOptionsEnabled")]
51491 pub is_e_options_enabled: bool,
51492 }
51493 impl From<&SubAccountEoptionsEnableResponse> for SubAccountEoptionsEnableResponse {
51494 fn from(value: &SubAccountEoptionsEnableResponse) -> Self {
51495 value.clone()
51496 }
51497 }
51498 ///SubAccountFuturesAccountSummaryResponse
51499 ///
51500 /// <details><summary>JSON schema</summary>
51501 ///
51502 /// ```json
51503 ///{
51504 /// "type": "object",
51505 /// "required": [
51506 /// "asset",
51507 /// "subAccountList",
51508 /// "totalInitialMargin",
51509 /// "totalMaintenanceMargin",
51510 /// "totalMarginBalance",
51511 /// "totalOpenOrderInitialMargin",
51512 /// "totalPositionInitialMargin",
51513 /// "totalUnrealizedProfit",
51514 /// "totalWalletBalance"
51515 /// ],
51516 /// "properties": {
51517 /// "asset": {
51518 /// "examples": [
51519 /// "USD"
51520 /// ],
51521 /// "type": "string"
51522 /// },
51523 /// "subAccountList": {
51524 /// "type": "array",
51525 /// "items": {
51526 /// "type": "object",
51527 /// "required": [
51528 /// "asset",
51529 /// "email",
51530 /// "totalInitialMargin",
51531 /// "totalMaintenanceMargin",
51532 /// "totalMarginBalance",
51533 /// "totalOpenOrderInitialMargin",
51534 /// "totalPositionInitialMargin",
51535 /// "totalUnrealizedProfit",
51536 /// "totalWalletBalance"
51537 /// ],
51538 /// "properties": {
51539 /// "asset": {
51540 /// "examples": [
51541 /// "USD"
51542 /// ],
51543 /// "type": "string"
51544 /// },
51545 /// "email": {
51546 /// "examples": [
51547 /// "123@test.com"
51548 /// ],
51549 /// "type": "string"
51550 /// },
51551 /// "totalInitialMargin": {
51552 /// "examples": [
51553 /// "9.00000000"
51554 /// ],
51555 /// "type": "string"
51556 /// },
51557 /// "totalMaintenanceMargin": {
51558 /// "examples": [
51559 /// "0.00000000"
51560 /// ],
51561 /// "type": "string"
51562 /// },
51563 /// "totalMarginBalance": {
51564 /// "examples": [
51565 /// "22.12659734"
51566 /// ],
51567 /// "type": "string"
51568 /// },
51569 /// "totalOpenOrderInitialMargin": {
51570 /// "examples": [
51571 /// "9.00000000"
51572 /// ],
51573 /// "type": "string"
51574 /// },
51575 /// "totalPositionInitialMargin": {
51576 /// "examples": [
51577 /// "0.00000000"
51578 /// ],
51579 /// "type": "string"
51580 /// },
51581 /// "totalUnrealizedProfit": {
51582 /// "examples": [
51583 /// "0.00000000"
51584 /// ],
51585 /// "type": "string"
51586 /// },
51587 /// "totalWalletBalance": {
51588 /// "examples": [
51589 /// "22.12659734"
51590 /// ],
51591 /// "type": "string"
51592 /// }
51593 /// }
51594 /// }
51595 /// },
51596 /// "totalInitialMargin": {
51597 /// "examples": [
51598 /// "9.83137400"
51599 /// ],
51600 /// "type": "string"
51601 /// },
51602 /// "totalMaintenanceMargin": {
51603 /// "examples": [
51604 /// "0.41568700"
51605 /// ],
51606 /// "type": "string"
51607 /// },
51608 /// "totalMarginBalance": {
51609 /// "examples": [
51610 /// "23.03235621"
51611 /// ],
51612 /// "type": "string"
51613 /// },
51614 /// "totalOpenOrderInitialMargin": {
51615 /// "examples": [
51616 /// "9.00000000"
51617 /// ],
51618 /// "type": "string"
51619 /// },
51620 /// "totalPositionInitialMargin": {
51621 /// "examples": [
51622 /// "0.83137400"
51623 /// ],
51624 /// "type": "string"
51625 /// },
51626 /// "totalUnrealizedProfit": {
51627 /// "examples": [
51628 /// "0.03219710"
51629 /// ],
51630 /// "type": "string"
51631 /// },
51632 /// "totalWalletBalance": {
51633 /// "examples": [
51634 /// "22.15879444"
51635 /// ],
51636 /// "type": "string"
51637 /// }
51638 /// }
51639 ///}
51640 /// ```
51641 /// </details>
51642 #[derive(Clone, Debug, Deserialize, Serialize)]
51643 pub struct SubAccountFuturesAccountSummaryResponse {
51644 pub asset: String,
51645 #[serde(rename = "subAccountList")]
51646 pub sub_account_list: Vec<
51647 SubAccountFuturesAccountSummaryResponseSubAccountListItem,
51648 >,
51649 #[serde(rename = "totalInitialMargin")]
51650 pub total_initial_margin: String,
51651 #[serde(rename = "totalMaintenanceMargin")]
51652 pub total_maintenance_margin: String,
51653 #[serde(rename = "totalMarginBalance")]
51654 pub total_margin_balance: String,
51655 #[serde(rename = "totalOpenOrderInitialMargin")]
51656 pub total_open_order_initial_margin: String,
51657 #[serde(rename = "totalPositionInitialMargin")]
51658 pub total_position_initial_margin: String,
51659 #[serde(rename = "totalUnrealizedProfit")]
51660 pub total_unrealized_profit: String,
51661 #[serde(rename = "totalWalletBalance")]
51662 pub total_wallet_balance: String,
51663 }
51664 impl From<&SubAccountFuturesAccountSummaryResponse>
51665 for SubAccountFuturesAccountSummaryResponse {
51666 fn from(value: &SubAccountFuturesAccountSummaryResponse) -> Self {
51667 value.clone()
51668 }
51669 }
51670 ///SubAccountFuturesAccountSummaryResponseSubAccountListItem
51671 ///
51672 /// <details><summary>JSON schema</summary>
51673 ///
51674 /// ```json
51675 ///{
51676 /// "type": "object",
51677 /// "required": [
51678 /// "asset",
51679 /// "email",
51680 /// "totalInitialMargin",
51681 /// "totalMaintenanceMargin",
51682 /// "totalMarginBalance",
51683 /// "totalOpenOrderInitialMargin",
51684 /// "totalPositionInitialMargin",
51685 /// "totalUnrealizedProfit",
51686 /// "totalWalletBalance"
51687 /// ],
51688 /// "properties": {
51689 /// "asset": {
51690 /// "examples": [
51691 /// "USD"
51692 /// ],
51693 /// "type": "string"
51694 /// },
51695 /// "email": {
51696 /// "examples": [
51697 /// "123@test.com"
51698 /// ],
51699 /// "type": "string"
51700 /// },
51701 /// "totalInitialMargin": {
51702 /// "examples": [
51703 /// "9.00000000"
51704 /// ],
51705 /// "type": "string"
51706 /// },
51707 /// "totalMaintenanceMargin": {
51708 /// "examples": [
51709 /// "0.00000000"
51710 /// ],
51711 /// "type": "string"
51712 /// },
51713 /// "totalMarginBalance": {
51714 /// "examples": [
51715 /// "22.12659734"
51716 /// ],
51717 /// "type": "string"
51718 /// },
51719 /// "totalOpenOrderInitialMargin": {
51720 /// "examples": [
51721 /// "9.00000000"
51722 /// ],
51723 /// "type": "string"
51724 /// },
51725 /// "totalPositionInitialMargin": {
51726 /// "examples": [
51727 /// "0.00000000"
51728 /// ],
51729 /// "type": "string"
51730 /// },
51731 /// "totalUnrealizedProfit": {
51732 /// "examples": [
51733 /// "0.00000000"
51734 /// ],
51735 /// "type": "string"
51736 /// },
51737 /// "totalWalletBalance": {
51738 /// "examples": [
51739 /// "22.12659734"
51740 /// ],
51741 /// "type": "string"
51742 /// }
51743 /// }
51744 ///}
51745 /// ```
51746 /// </details>
51747 #[derive(Clone, Debug, Deserialize, Serialize)]
51748 pub struct SubAccountFuturesAccountSummaryResponseSubAccountListItem {
51749 pub asset: String,
51750 pub email: String,
51751 #[serde(rename = "totalInitialMargin")]
51752 pub total_initial_margin: String,
51753 #[serde(rename = "totalMaintenanceMargin")]
51754 pub total_maintenance_margin: String,
51755 #[serde(rename = "totalMarginBalance")]
51756 pub total_margin_balance: String,
51757 #[serde(rename = "totalOpenOrderInitialMargin")]
51758 pub total_open_order_initial_margin: String,
51759 #[serde(rename = "totalPositionInitialMargin")]
51760 pub total_position_initial_margin: String,
51761 #[serde(rename = "totalUnrealizedProfit")]
51762 pub total_unrealized_profit: String,
51763 #[serde(rename = "totalWalletBalance")]
51764 pub total_wallet_balance: String,
51765 }
51766 impl From<&SubAccountFuturesAccountSummaryResponseSubAccountListItem>
51767 for SubAccountFuturesAccountSummaryResponseSubAccountListItem {
51768 fn from(
51769 value: &SubAccountFuturesAccountSummaryResponseSubAccountListItem,
51770 ) -> Self {
51771 value.clone()
51772 }
51773 }
51774 ///SubAccountFuturesEnableResponse
51775 ///
51776 /// <details><summary>JSON schema</summary>
51777 ///
51778 /// ```json
51779 ///{
51780 /// "type": "object",
51781 /// "required": [
51782 /// "email",
51783 /// "isFuturesEnabled"
51784 /// ],
51785 /// "properties": {
51786 /// "email": {
51787 /// "examples": [
51788 /// "123@test.com"
51789 /// ],
51790 /// "type": "string"
51791 /// },
51792 /// "isFuturesEnabled": {
51793 /// "type": "boolean"
51794 /// }
51795 /// }
51796 ///}
51797 /// ```
51798 /// </details>
51799 #[derive(Clone, Debug, Deserialize, Serialize)]
51800 pub struct SubAccountFuturesEnableResponse {
51801 pub email: String,
51802 #[serde(rename = "isFuturesEnabled")]
51803 pub is_futures_enabled: bool,
51804 }
51805 impl From<&SubAccountFuturesEnableResponse> for SubAccountFuturesEnableResponse {
51806 fn from(value: &SubAccountFuturesEnableResponse) -> Self {
51807 value.clone()
51808 }
51809 }
51810 ///SubAccountFuturesInternalTransferResponse
51811 ///
51812 /// <details><summary>JSON schema</summary>
51813 ///
51814 /// ```json
51815 ///{
51816 /// "type": "object",
51817 /// "required": [
51818 /// "futuresType",
51819 /// "success",
51820 /// "transfers"
51821 /// ],
51822 /// "properties": {
51823 /// "futuresType": {
51824 /// "examples": [
51825 /// 2
51826 /// ],
51827 /// "type": "integer",
51828 /// "format": "int32"
51829 /// },
51830 /// "success": {
51831 /// "type": "boolean"
51832 /// },
51833 /// "transfers": {
51834 /// "type": "array",
51835 /// "items": {
51836 /// "type": "object",
51837 /// "required": [
51838 /// "asset",
51839 /// "from",
51840 /// "qty",
51841 /// "time",
51842 /// "to",
51843 /// "tranId"
51844 /// ],
51845 /// "properties": {
51846 /// "asset": {
51847 /// "examples": [
51848 /// "BTC"
51849 /// ],
51850 /// "type": "string"
51851 /// },
51852 /// "from": {
51853 /// "examples": [
51854 /// "aaa@test.com"
51855 /// ],
51856 /// "type": "string"
51857 /// },
51858 /// "qty": {
51859 /// "examples": [
51860 /// "1"
51861 /// ],
51862 /// "type": "string"
51863 /// },
51864 /// "time": {
51865 /// "examples": [
51866 /// 1544433328000
51867 /// ],
51868 /// "type": "integer",
51869 /// "format": "int64"
51870 /// },
51871 /// "to": {
51872 /// "examples": [
51873 /// "bbb@test.com"
51874 /// ],
51875 /// "type": "string"
51876 /// },
51877 /// "tranId": {
51878 /// "examples": [
51879 /// 11897001102
51880 /// ],
51881 /// "type": "integer",
51882 /// "format": "int64"
51883 /// }
51884 /// }
51885 /// }
51886 /// }
51887 /// }
51888 ///}
51889 /// ```
51890 /// </details>
51891 #[derive(Clone, Debug, Deserialize, Serialize)]
51892 pub struct SubAccountFuturesInternalTransferResponse {
51893 #[serde(rename = "futuresType")]
51894 pub futures_type: i32,
51895 pub success: bool,
51896 pub transfers: Vec<SubAccountFuturesInternalTransferResponseTransfersItem>,
51897 }
51898 impl From<&SubAccountFuturesInternalTransferResponse>
51899 for SubAccountFuturesInternalTransferResponse {
51900 fn from(value: &SubAccountFuturesInternalTransferResponse) -> Self {
51901 value.clone()
51902 }
51903 }
51904 ///SubAccountFuturesInternalTransferResponseTransfersItem
51905 ///
51906 /// <details><summary>JSON schema</summary>
51907 ///
51908 /// ```json
51909 ///{
51910 /// "type": "object",
51911 /// "required": [
51912 /// "asset",
51913 /// "from",
51914 /// "qty",
51915 /// "time",
51916 /// "to",
51917 /// "tranId"
51918 /// ],
51919 /// "properties": {
51920 /// "asset": {
51921 /// "examples": [
51922 /// "BTC"
51923 /// ],
51924 /// "type": "string"
51925 /// },
51926 /// "from": {
51927 /// "examples": [
51928 /// "aaa@test.com"
51929 /// ],
51930 /// "type": "string"
51931 /// },
51932 /// "qty": {
51933 /// "examples": [
51934 /// "1"
51935 /// ],
51936 /// "type": "string"
51937 /// },
51938 /// "time": {
51939 /// "examples": [
51940 /// 1544433328000
51941 /// ],
51942 /// "type": "integer",
51943 /// "format": "int64"
51944 /// },
51945 /// "to": {
51946 /// "examples": [
51947 /// "bbb@test.com"
51948 /// ],
51949 /// "type": "string"
51950 /// },
51951 /// "tranId": {
51952 /// "examples": [
51953 /// 11897001102
51954 /// ],
51955 /// "type": "integer",
51956 /// "format": "int64"
51957 /// }
51958 /// }
51959 ///}
51960 /// ```
51961 /// </details>
51962 #[derive(Clone, Debug, Deserialize, Serialize)]
51963 pub struct SubAccountFuturesInternalTransferResponseTransfersItem {
51964 pub asset: String,
51965 pub from: String,
51966 pub qty: String,
51967 pub time: i64,
51968 pub to: String,
51969 #[serde(rename = "tranId")]
51970 pub tran_id: i64,
51971 }
51972 impl From<&SubAccountFuturesInternalTransferResponseTransfersItem>
51973 for SubAccountFuturesInternalTransferResponseTransfersItem {
51974 fn from(value: &SubAccountFuturesInternalTransferResponseTransfersItem) -> Self {
51975 value.clone()
51976 }
51977 }
51978 ///SubAccountFuturesPositionRiskResponseItem
51979 ///
51980 /// <details><summary>JSON schema</summary>
51981 ///
51982 /// ```json
51983 ///{
51984 /// "type": "object",
51985 /// "required": [
51986 /// "entryPrice",
51987 /// "leverage",
51988 /// "liquidationPrice",
51989 /// "markPrice",
51990 /// "maxNotional",
51991 /// "positionAmount",
51992 /// "symbol",
51993 /// "unrealizedProfit"
51994 /// ],
51995 /// "properties": {
51996 /// "entryPrice": {
51997 /// "examples": [
51998 /// "9975.12000"
51999 /// ],
52000 /// "type": "string"
52001 /// },
52002 /// "leverage": {
52003 /// "description": "current initial leverage",
52004 /// "examples": [
52005 /// "50"
52006 /// ],
52007 /// "type": "string"
52008 /// },
52009 /// "liquidationPrice": {
52010 /// "examples": [
52011 /// "7963.54"
52012 /// ],
52013 /// "type": "string"
52014 /// },
52015 /// "markPrice": {
52016 /// "examples": [
52017 /// "9973.50770517"
52018 /// ],
52019 /// "type": "string"
52020 /// },
52021 /// "maxNotional": {
52022 /// "description": "notional value limit of current initial leverage",
52023 /// "examples": [
52024 /// "1000000"
52025 /// ],
52026 /// "type": "string"
52027 /// },
52028 /// "positionAmount": {
52029 /// "examples": [
52030 /// "0.010"
52031 /// ],
52032 /// "type": "string"
52033 /// },
52034 /// "symbol": {
52035 /// "examples": [
52036 /// "BTCUSDT"
52037 /// ],
52038 /// "type": "string"
52039 /// },
52040 /// "unrealizedProfit": {
52041 /// "examples": [
52042 /// "-0.01612295"
52043 /// ],
52044 /// "type": "string"
52045 /// }
52046 /// }
52047 ///}
52048 /// ```
52049 /// </details>
52050 #[derive(Clone, Debug, Deserialize, Serialize)]
52051 pub struct SubAccountFuturesPositionRiskResponseItem {
52052 #[serde(rename = "entryPrice")]
52053 pub entry_price: String,
52054 ///current initial leverage
52055 pub leverage: String,
52056 #[serde(rename = "liquidationPrice")]
52057 pub liquidation_price: String,
52058 #[serde(rename = "markPrice")]
52059 pub mark_price: String,
52060 ///notional value limit of current initial leverage
52061 #[serde(rename = "maxNotional")]
52062 pub max_notional: String,
52063 #[serde(rename = "positionAmount")]
52064 pub position_amount: String,
52065 pub symbol: String,
52066 #[serde(rename = "unrealizedProfit")]
52067 pub unrealized_profit: String,
52068 }
52069 impl From<&SubAccountFuturesPositionRiskResponseItem>
52070 for SubAccountFuturesPositionRiskResponseItem {
52071 fn from(value: &SubAccountFuturesPositionRiskResponseItem) -> Self {
52072 value.clone()
52073 }
52074 }
52075 ///SubAccountFuturesTransferResponse
52076 ///
52077 /// <details><summary>JSON schema</summary>
52078 ///
52079 /// ```json
52080 ///{
52081 /// "type": "object",
52082 /// "required": [
52083 /// "txnId"
52084 /// ],
52085 /// "properties": {
52086 /// "txnId": {
52087 /// "examples": [
52088 /// "2966662589"
52089 /// ],
52090 /// "type": "string"
52091 /// }
52092 /// }
52093 ///}
52094 /// ```
52095 /// </details>
52096 #[derive(Clone, Debug, Deserialize, Serialize)]
52097 pub struct SubAccountFuturesTransferResponse {
52098 #[serde(rename = "txnId")]
52099 pub txn_id: String,
52100 }
52101 impl From<&SubAccountFuturesTransferResponse> for SubAccountFuturesTransferResponse {
52102 fn from(value: &SubAccountFuturesTransferResponse) -> Self {
52103 value.clone()
52104 }
52105 }
52106 ///SubAccountListIsFreeze
52107 ///
52108 /// <details><summary>JSON schema</summary>
52109 ///
52110 /// ```json
52111 ///{
52112 /// "type": "string",
52113 /// "enum": [
52114 /// "true",
52115 /// "false"
52116 /// ]
52117 ///}
52118 /// ```
52119 /// </details>
52120 #[derive(
52121 Clone,
52122 Copy,
52123 Debug,
52124 Deserialize,
52125 Eq,
52126 Hash,
52127 Ord,
52128 PartialEq,
52129 PartialOrd,
52130 Serialize
52131 )]
52132 pub enum SubAccountListIsFreeze {
52133 #[serde(rename = "true")]
52134 True,
52135 #[serde(rename = "false")]
52136 False,
52137 }
52138 impl From<&SubAccountListIsFreeze> for SubAccountListIsFreeze {
52139 fn from(value: &SubAccountListIsFreeze) -> Self {
52140 value.clone()
52141 }
52142 }
52143 impl ToString for SubAccountListIsFreeze {
52144 fn to_string(&self) -> String {
52145 match *self {
52146 Self::True => "true".to_string(),
52147 Self::False => "false".to_string(),
52148 }
52149 }
52150 }
52151 impl std::str::FromStr for SubAccountListIsFreeze {
52152 type Err = self::error::ConversionError;
52153 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
52154 match value {
52155 "true" => Ok(Self::True),
52156 "false" => Ok(Self::False),
52157 _ => Err("invalid value".into()),
52158 }
52159 }
52160 }
52161 impl std::convert::TryFrom<&str> for SubAccountListIsFreeze {
52162 type Error = self::error::ConversionError;
52163 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
52164 value.parse()
52165 }
52166 }
52167 impl std::convert::TryFrom<&String> for SubAccountListIsFreeze {
52168 type Error = self::error::ConversionError;
52169 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
52170 value.parse()
52171 }
52172 }
52173 impl std::convert::TryFrom<String> for SubAccountListIsFreeze {
52174 type Error = self::error::ConversionError;
52175 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
52176 value.parse()
52177 }
52178 }
52179 ///SubAccountListResponse
52180 ///
52181 /// <details><summary>JSON schema</summary>
52182 ///
52183 /// ```json
52184 ///{
52185 /// "type": "object",
52186 /// "required": [
52187 /// "subAccounts"
52188 /// ],
52189 /// "properties": {
52190 /// "subAccounts": {
52191 /// "type": "array",
52192 /// "items": {
52193 /// "type": "object",
52194 /// "required": [
52195 /// "createTime",
52196 /// "email",
52197 /// "isAssetManagementSubAccount",
52198 /// "isFreeze",
52199 /// "isManagedSubAccount"
52200 /// ],
52201 /// "properties": {
52202 /// "createTime": {
52203 /// "examples": [
52204 /// 1544433328000
52205 /// ],
52206 /// "type": "integer",
52207 /// "format": "int64"
52208 /// },
52209 /// "email": {
52210 /// "examples": [
52211 /// "testsub@gmail.com"
52212 /// ],
52213 /// "type": "string"
52214 /// },
52215 /// "isAssetManagementSubAccount": {
52216 /// "examples": [
52217 /// false
52218 /// ],
52219 /// "type": "boolean"
52220 /// },
52221 /// "isFreeze": {
52222 /// "examples": [
52223 /// false
52224 /// ],
52225 /// "type": "boolean"
52226 /// },
52227 /// "isManagedSubAccount": {
52228 /// "examples": [
52229 /// false
52230 /// ],
52231 /// "type": "boolean"
52232 /// }
52233 /// }
52234 /// }
52235 /// }
52236 /// }
52237 ///}
52238 /// ```
52239 /// </details>
52240 #[derive(Clone, Debug, Deserialize, Serialize)]
52241 pub struct SubAccountListResponse {
52242 #[serde(rename = "subAccounts")]
52243 pub sub_accounts: Vec<SubAccountListResponseSubAccountsItem>,
52244 }
52245 impl From<&SubAccountListResponse> for SubAccountListResponse {
52246 fn from(value: &SubAccountListResponse) -> Self {
52247 value.clone()
52248 }
52249 }
52250 ///SubAccountListResponseSubAccountsItem
52251 ///
52252 /// <details><summary>JSON schema</summary>
52253 ///
52254 /// ```json
52255 ///{
52256 /// "type": "object",
52257 /// "required": [
52258 /// "createTime",
52259 /// "email",
52260 /// "isAssetManagementSubAccount",
52261 /// "isFreeze",
52262 /// "isManagedSubAccount"
52263 /// ],
52264 /// "properties": {
52265 /// "createTime": {
52266 /// "examples": [
52267 /// 1544433328000
52268 /// ],
52269 /// "type": "integer",
52270 /// "format": "int64"
52271 /// },
52272 /// "email": {
52273 /// "examples": [
52274 /// "testsub@gmail.com"
52275 /// ],
52276 /// "type": "string"
52277 /// },
52278 /// "isAssetManagementSubAccount": {
52279 /// "examples": [
52280 /// false
52281 /// ],
52282 /// "type": "boolean"
52283 /// },
52284 /// "isFreeze": {
52285 /// "examples": [
52286 /// false
52287 /// ],
52288 /// "type": "boolean"
52289 /// },
52290 /// "isManagedSubAccount": {
52291 /// "examples": [
52292 /// false
52293 /// ],
52294 /// "type": "boolean"
52295 /// }
52296 /// }
52297 ///}
52298 /// ```
52299 /// </details>
52300 #[derive(Clone, Debug, Deserialize, Serialize)]
52301 pub struct SubAccountListResponseSubAccountsItem {
52302 #[serde(rename = "createTime")]
52303 pub create_time: i64,
52304 pub email: String,
52305 #[serde(rename = "isAssetManagementSubAccount")]
52306 pub is_asset_management_sub_account: bool,
52307 #[serde(rename = "isFreeze")]
52308 pub is_freeze: bool,
52309 #[serde(rename = "isManagedSubAccount")]
52310 pub is_managed_sub_account: bool,
52311 }
52312 impl From<&SubAccountListResponseSubAccountsItem>
52313 for SubAccountListResponseSubAccountsItem {
52314 fn from(value: &SubAccountListResponseSubAccountsItem) -> Self {
52315 value.clone()
52316 }
52317 }
52318 ///SubAccountMarginAccountResponse
52319 ///
52320 /// <details><summary>JSON schema</summary>
52321 ///
52322 /// ```json
52323 ///{
52324 /// "type": "object",
52325 /// "required": [
52326 /// "email",
52327 /// "marginLevel",
52328 /// "marginTradeCoeffVo",
52329 /// "marginUserAssetVoList",
52330 /// "totalAssetOfBtc",
52331 /// "totalLiabilityOfBtc",
52332 /// "totalNetAssetOfBtc"
52333 /// ],
52334 /// "properties": {
52335 /// "email": {
52336 /// "examples": [
52337 /// "123@test.com"
52338 /// ],
52339 /// "type": "string"
52340 /// },
52341 /// "marginLevel": {
52342 /// "examples": [
52343 /// "11.64405625"
52344 /// ],
52345 /// "type": "string"
52346 /// },
52347 /// "marginTradeCoeffVo": {
52348 /// "type": "object",
52349 /// "required": [
52350 /// "forceLiquidationBar",
52351 /// "marginCallBar",
52352 /// "normalBar"
52353 /// ],
52354 /// "properties": {
52355 /// "forceLiquidationBar": {
52356 /// "description": "Liquidation margin ratio",
52357 /// "examples": [
52358 /// "1.10000000"
52359 /// ],
52360 /// "type": "string"
52361 /// },
52362 /// "marginCallBar": {
52363 /// "description": "Margin call margin ratio",
52364 /// "examples": [
52365 /// "1.50000000"
52366 /// ],
52367 /// "type": "string"
52368 /// },
52369 /// "normalBar": {
52370 /// "description": "Initial margin ratio",
52371 /// "examples": [
52372 /// "2.00000000"
52373 /// ],
52374 /// "type": "string"
52375 /// }
52376 /// }
52377 /// },
52378 /// "marginUserAssetVoList": {
52379 /// "type": "array",
52380 /// "items": {
52381 /// "type": "object",
52382 /// "required": [
52383 /// "asset",
52384 /// "borrowed",
52385 /// "free",
52386 /// "interest",
52387 /// "locked",
52388 /// "netAsset"
52389 /// ],
52390 /// "properties": {
52391 /// "asset": {
52392 /// "examples": [
52393 /// "BTC"
52394 /// ],
52395 /// "type": "string"
52396 /// },
52397 /// "borrowed": {
52398 /// "examples": [
52399 /// "0.00000000"
52400 /// ],
52401 /// "type": "string"
52402 /// },
52403 /// "free": {
52404 /// "examples": [
52405 /// "0.00499500"
52406 /// ],
52407 /// "type": "string"
52408 /// },
52409 /// "interest": {
52410 /// "examples": [
52411 /// "0.00000000"
52412 /// ],
52413 /// "type": "string"
52414 /// },
52415 /// "locked": {
52416 /// "examples": [
52417 /// "0.00000000"
52418 /// ],
52419 /// "type": "string"
52420 /// },
52421 /// "netAsset": {
52422 /// "examples": [
52423 /// "0.00499500"
52424 /// ],
52425 /// "type": "string"
52426 /// }
52427 /// }
52428 /// }
52429 /// },
52430 /// "totalAssetOfBtc": {
52431 /// "examples": [
52432 /// "6.82728457"
52433 /// ],
52434 /// "type": "string"
52435 /// },
52436 /// "totalLiabilityOfBtc": {
52437 /// "examples": [
52438 /// "0.58633215"
52439 /// ],
52440 /// "type": "string"
52441 /// },
52442 /// "totalNetAssetOfBtc": {
52443 /// "examples": [
52444 /// "6.24095242"
52445 /// ],
52446 /// "type": "string"
52447 /// }
52448 /// }
52449 ///}
52450 /// ```
52451 /// </details>
52452 #[derive(Clone, Debug, Deserialize, Serialize)]
52453 pub struct SubAccountMarginAccountResponse {
52454 pub email: String,
52455 #[serde(rename = "marginLevel")]
52456 pub margin_level: String,
52457 #[serde(rename = "marginTradeCoeffVo")]
52458 pub margin_trade_coeff_vo: SubAccountMarginAccountResponseMarginTradeCoeffVo,
52459 #[serde(rename = "marginUserAssetVoList")]
52460 pub margin_user_asset_vo_list: Vec<
52461 SubAccountMarginAccountResponseMarginUserAssetVoListItem,
52462 >,
52463 #[serde(rename = "totalAssetOfBtc")]
52464 pub total_asset_of_btc: String,
52465 #[serde(rename = "totalLiabilityOfBtc")]
52466 pub total_liability_of_btc: String,
52467 #[serde(rename = "totalNetAssetOfBtc")]
52468 pub total_net_asset_of_btc: String,
52469 }
52470 impl From<&SubAccountMarginAccountResponse> for SubAccountMarginAccountResponse {
52471 fn from(value: &SubAccountMarginAccountResponse) -> Self {
52472 value.clone()
52473 }
52474 }
52475 ///SubAccountMarginAccountResponseMarginTradeCoeffVo
52476 ///
52477 /// <details><summary>JSON schema</summary>
52478 ///
52479 /// ```json
52480 ///{
52481 /// "type": "object",
52482 /// "required": [
52483 /// "forceLiquidationBar",
52484 /// "marginCallBar",
52485 /// "normalBar"
52486 /// ],
52487 /// "properties": {
52488 /// "forceLiquidationBar": {
52489 /// "description": "Liquidation margin ratio",
52490 /// "examples": [
52491 /// "1.10000000"
52492 /// ],
52493 /// "type": "string"
52494 /// },
52495 /// "marginCallBar": {
52496 /// "description": "Margin call margin ratio",
52497 /// "examples": [
52498 /// "1.50000000"
52499 /// ],
52500 /// "type": "string"
52501 /// },
52502 /// "normalBar": {
52503 /// "description": "Initial margin ratio",
52504 /// "examples": [
52505 /// "2.00000000"
52506 /// ],
52507 /// "type": "string"
52508 /// }
52509 /// }
52510 ///}
52511 /// ```
52512 /// </details>
52513 #[derive(Clone, Debug, Deserialize, Serialize)]
52514 pub struct SubAccountMarginAccountResponseMarginTradeCoeffVo {
52515 ///Liquidation margin ratio
52516 #[serde(rename = "forceLiquidationBar")]
52517 pub force_liquidation_bar: String,
52518 ///Margin call margin ratio
52519 #[serde(rename = "marginCallBar")]
52520 pub margin_call_bar: String,
52521 ///Initial margin ratio
52522 #[serde(rename = "normalBar")]
52523 pub normal_bar: String,
52524 }
52525 impl From<&SubAccountMarginAccountResponseMarginTradeCoeffVo>
52526 for SubAccountMarginAccountResponseMarginTradeCoeffVo {
52527 fn from(value: &SubAccountMarginAccountResponseMarginTradeCoeffVo) -> Self {
52528 value.clone()
52529 }
52530 }
52531 ///SubAccountMarginAccountResponseMarginUserAssetVoListItem
52532 ///
52533 /// <details><summary>JSON schema</summary>
52534 ///
52535 /// ```json
52536 ///{
52537 /// "type": "object",
52538 /// "required": [
52539 /// "asset",
52540 /// "borrowed",
52541 /// "free",
52542 /// "interest",
52543 /// "locked",
52544 /// "netAsset"
52545 /// ],
52546 /// "properties": {
52547 /// "asset": {
52548 /// "examples": [
52549 /// "BTC"
52550 /// ],
52551 /// "type": "string"
52552 /// },
52553 /// "borrowed": {
52554 /// "examples": [
52555 /// "0.00000000"
52556 /// ],
52557 /// "type": "string"
52558 /// },
52559 /// "free": {
52560 /// "examples": [
52561 /// "0.00499500"
52562 /// ],
52563 /// "type": "string"
52564 /// },
52565 /// "interest": {
52566 /// "examples": [
52567 /// "0.00000000"
52568 /// ],
52569 /// "type": "string"
52570 /// },
52571 /// "locked": {
52572 /// "examples": [
52573 /// "0.00000000"
52574 /// ],
52575 /// "type": "string"
52576 /// },
52577 /// "netAsset": {
52578 /// "examples": [
52579 /// "0.00499500"
52580 /// ],
52581 /// "type": "string"
52582 /// }
52583 /// }
52584 ///}
52585 /// ```
52586 /// </details>
52587 #[derive(Clone, Debug, Deserialize, Serialize)]
52588 pub struct SubAccountMarginAccountResponseMarginUserAssetVoListItem {
52589 pub asset: String,
52590 pub borrowed: String,
52591 pub free: String,
52592 pub interest: String,
52593 pub locked: String,
52594 #[serde(rename = "netAsset")]
52595 pub net_asset: String,
52596 }
52597 impl From<&SubAccountMarginAccountResponseMarginUserAssetVoListItem>
52598 for SubAccountMarginAccountResponseMarginUserAssetVoListItem {
52599 fn from(
52600 value: &SubAccountMarginAccountResponseMarginUserAssetVoListItem,
52601 ) -> Self {
52602 value.clone()
52603 }
52604 }
52605 ///SubAccountMarginAccountSummaryResponse
52606 ///
52607 /// <details><summary>JSON schema</summary>
52608 ///
52609 /// ```json
52610 ///{
52611 /// "type": "object",
52612 /// "required": [
52613 /// "subAccountList",
52614 /// "totalAssetOfBtc",
52615 /// "totalLiabilityOfBtc",
52616 /// "totalNetAssetOfBtc"
52617 /// ],
52618 /// "properties": {
52619 /// "subAccountList": {
52620 /// "type": "array",
52621 /// "items": {
52622 /// "type": "object",
52623 /// "required": [
52624 /// "email",
52625 /// "totalAssetOfBtc",
52626 /// "totalLiabilityOfBtc",
52627 /// "totalNetAssetOfBtc"
52628 /// ],
52629 /// "properties": {
52630 /// "email": {
52631 /// "examples": [
52632 /// "123@test.com"
52633 /// ],
52634 /// "type": "string"
52635 /// },
52636 /// "totalAssetOfBtc": {
52637 /// "examples": [
52638 /// "2.11111111"
52639 /// ],
52640 /// "type": "string"
52641 /// },
52642 /// "totalLiabilityOfBtc": {
52643 /// "examples": [
52644 /// "1.11111111"
52645 /// ],
52646 /// "type": "string"
52647 /// },
52648 /// "totalNetAssetOfBtc": {
52649 /// "examples": [
52650 /// "1.00000000"
52651 /// ],
52652 /// "type": "string"
52653 /// }
52654 /// }
52655 /// }
52656 /// },
52657 /// "totalAssetOfBtc": {
52658 /// "examples": [
52659 /// "4.33333333"
52660 /// ],
52661 /// "type": "string"
52662 /// },
52663 /// "totalLiabilityOfBtc": {
52664 /// "examples": [
52665 /// "2.11111112"
52666 /// ],
52667 /// "type": "string"
52668 /// },
52669 /// "totalNetAssetOfBtc": {
52670 /// "examples": [
52671 /// "2.22222221"
52672 /// ],
52673 /// "type": "string"
52674 /// }
52675 /// }
52676 ///}
52677 /// ```
52678 /// </details>
52679 #[derive(Clone, Debug, Deserialize, Serialize)]
52680 pub struct SubAccountMarginAccountSummaryResponse {
52681 #[serde(rename = "subAccountList")]
52682 pub sub_account_list: Vec<
52683 SubAccountMarginAccountSummaryResponseSubAccountListItem,
52684 >,
52685 #[serde(rename = "totalAssetOfBtc")]
52686 pub total_asset_of_btc: String,
52687 #[serde(rename = "totalLiabilityOfBtc")]
52688 pub total_liability_of_btc: String,
52689 #[serde(rename = "totalNetAssetOfBtc")]
52690 pub total_net_asset_of_btc: String,
52691 }
52692 impl From<&SubAccountMarginAccountSummaryResponse>
52693 for SubAccountMarginAccountSummaryResponse {
52694 fn from(value: &SubAccountMarginAccountSummaryResponse) -> Self {
52695 value.clone()
52696 }
52697 }
52698 ///SubAccountMarginAccountSummaryResponseSubAccountListItem
52699 ///
52700 /// <details><summary>JSON schema</summary>
52701 ///
52702 /// ```json
52703 ///{
52704 /// "type": "object",
52705 /// "required": [
52706 /// "email",
52707 /// "totalAssetOfBtc",
52708 /// "totalLiabilityOfBtc",
52709 /// "totalNetAssetOfBtc"
52710 /// ],
52711 /// "properties": {
52712 /// "email": {
52713 /// "examples": [
52714 /// "123@test.com"
52715 /// ],
52716 /// "type": "string"
52717 /// },
52718 /// "totalAssetOfBtc": {
52719 /// "examples": [
52720 /// "2.11111111"
52721 /// ],
52722 /// "type": "string"
52723 /// },
52724 /// "totalLiabilityOfBtc": {
52725 /// "examples": [
52726 /// "1.11111111"
52727 /// ],
52728 /// "type": "string"
52729 /// },
52730 /// "totalNetAssetOfBtc": {
52731 /// "examples": [
52732 /// "1.00000000"
52733 /// ],
52734 /// "type": "string"
52735 /// }
52736 /// }
52737 ///}
52738 /// ```
52739 /// </details>
52740 #[derive(Clone, Debug, Deserialize, Serialize)]
52741 pub struct SubAccountMarginAccountSummaryResponseSubAccountListItem {
52742 pub email: String,
52743 #[serde(rename = "totalAssetOfBtc")]
52744 pub total_asset_of_btc: String,
52745 #[serde(rename = "totalLiabilityOfBtc")]
52746 pub total_liability_of_btc: String,
52747 #[serde(rename = "totalNetAssetOfBtc")]
52748 pub total_net_asset_of_btc: String,
52749 }
52750 impl From<&SubAccountMarginAccountSummaryResponseSubAccountListItem>
52751 for SubAccountMarginAccountSummaryResponseSubAccountListItem {
52752 fn from(
52753 value: &SubAccountMarginAccountSummaryResponseSubAccountListItem,
52754 ) -> Self {
52755 value.clone()
52756 }
52757 }
52758 ///SubAccountMarginEnableResponse
52759 ///
52760 /// <details><summary>JSON schema</summary>
52761 ///
52762 /// ```json
52763 ///{
52764 /// "type": "object",
52765 /// "required": [
52766 /// "email",
52767 /// "isMarginEnabled"
52768 /// ],
52769 /// "properties": {
52770 /// "email": {
52771 /// "examples": [
52772 /// "123@test.com"
52773 /// ],
52774 /// "type": "string"
52775 /// },
52776 /// "isMarginEnabled": {
52777 /// "type": "boolean"
52778 /// }
52779 /// }
52780 ///}
52781 /// ```
52782 /// </details>
52783 #[derive(Clone, Debug, Deserialize, Serialize)]
52784 pub struct SubAccountMarginEnableResponse {
52785 pub email: String,
52786 #[serde(rename = "isMarginEnabled")]
52787 pub is_margin_enabled: bool,
52788 }
52789 impl From<&SubAccountMarginEnableResponse> for SubAccountMarginEnableResponse {
52790 fn from(value: &SubAccountMarginEnableResponse) -> Self {
52791 value.clone()
52792 }
52793 }
52794 ///SubAccountMarginTransferResponse
52795 ///
52796 /// <details><summary>JSON schema</summary>
52797 ///
52798 /// ```json
52799 ///{
52800 /// "type": "object",
52801 /// "required": [
52802 /// "txnId"
52803 /// ],
52804 /// "properties": {
52805 /// "txnId": {
52806 /// "examples": [
52807 /// "2966662589"
52808 /// ],
52809 /// "type": "string"
52810 /// }
52811 /// }
52812 ///}
52813 /// ```
52814 /// </details>
52815 #[derive(Clone, Debug, Deserialize, Serialize)]
52816 pub struct SubAccountMarginTransferResponse {
52817 #[serde(rename = "txnId")]
52818 pub txn_id: String,
52819 }
52820 impl From<&SubAccountMarginTransferResponse> for SubAccountMarginTransferResponse {
52821 fn from(value: &SubAccountMarginTransferResponse) -> Self {
52822 value.clone()
52823 }
52824 }
52825 ///SubAccountSpotSummaryResponse
52826 ///
52827 /// <details><summary>JSON schema</summary>
52828 ///
52829 /// ```json
52830 ///{
52831 /// "type": "object",
52832 /// "required": [
52833 /// "masterAccountTotalAsset",
52834 /// "spotSubUserAssetBtcVoList",
52835 /// "totalCount"
52836 /// ],
52837 /// "properties": {
52838 /// "masterAccountTotalAsset": {
52839 /// "examples": [
52840 /// "0.23231201"
52841 /// ],
52842 /// "type": "string"
52843 /// },
52844 /// "spotSubUserAssetBtcVoList": {
52845 /// "type": "array",
52846 /// "items": {
52847 /// "type": "object",
52848 /// "required": [
52849 /// "email",
52850 /// "totalAsset"
52851 /// ],
52852 /// "properties": {
52853 /// "email": {
52854 /// "examples": [
52855 /// "sub123@test.com"
52856 /// ],
52857 /// "type": "string"
52858 /// },
52859 /// "totalAsset": {
52860 /// "examples": [
52861 /// "9999.00000000"
52862 /// ],
52863 /// "type": "string"
52864 /// }
52865 /// }
52866 /// }
52867 /// },
52868 /// "totalCount": {
52869 /// "examples": [
52870 /// 1
52871 /// ],
52872 /// "type": "integer",
52873 /// "format": "int64"
52874 /// }
52875 /// }
52876 ///}
52877 /// ```
52878 /// </details>
52879 #[derive(Clone, Debug, Deserialize, Serialize)]
52880 pub struct SubAccountSpotSummaryResponse {
52881 #[serde(rename = "masterAccountTotalAsset")]
52882 pub master_account_total_asset: String,
52883 #[serde(rename = "spotSubUserAssetBtcVoList")]
52884 pub spot_sub_user_asset_btc_vo_list: Vec<
52885 SubAccountSpotSummaryResponseSpotSubUserAssetBtcVoListItem,
52886 >,
52887 #[serde(rename = "totalCount")]
52888 pub total_count: i64,
52889 }
52890 impl From<&SubAccountSpotSummaryResponse> for SubAccountSpotSummaryResponse {
52891 fn from(value: &SubAccountSpotSummaryResponse) -> Self {
52892 value.clone()
52893 }
52894 }
52895 ///SubAccountSpotSummaryResponseSpotSubUserAssetBtcVoListItem
52896 ///
52897 /// <details><summary>JSON schema</summary>
52898 ///
52899 /// ```json
52900 ///{
52901 /// "type": "object",
52902 /// "required": [
52903 /// "email",
52904 /// "totalAsset"
52905 /// ],
52906 /// "properties": {
52907 /// "email": {
52908 /// "examples": [
52909 /// "sub123@test.com"
52910 /// ],
52911 /// "type": "string"
52912 /// },
52913 /// "totalAsset": {
52914 /// "examples": [
52915 /// "9999.00000000"
52916 /// ],
52917 /// "type": "string"
52918 /// }
52919 /// }
52920 ///}
52921 /// ```
52922 /// </details>
52923 #[derive(Clone, Debug, Deserialize, Serialize)]
52924 pub struct SubAccountSpotSummaryResponseSpotSubUserAssetBtcVoListItem {
52925 pub email: String,
52926 #[serde(rename = "totalAsset")]
52927 pub total_asset: String,
52928 }
52929 impl From<&SubAccountSpotSummaryResponseSpotSubUserAssetBtcVoListItem>
52930 for SubAccountSpotSummaryResponseSpotSubUserAssetBtcVoListItem {
52931 fn from(
52932 value: &SubAccountSpotSummaryResponseSpotSubUserAssetBtcVoListItem,
52933 ) -> Self {
52934 value.clone()
52935 }
52936 }
52937 ///SubAccountStatusResponseItem
52938 ///
52939 /// <details><summary>JSON schema</summary>
52940 ///
52941 /// ```json
52942 ///{
52943 /// "type": "object",
52944 /// "required": [
52945 /// "email",
52946 /// "insertTime",
52947 /// "isFutureEnabled",
52948 /// "isMarginEnabled",
52949 /// "isSubUserEnabled",
52950 /// "isUserActive",
52951 /// "mobile"
52952 /// ],
52953 /// "properties": {
52954 /// "email": {
52955 /// "examples": [
52956 /// "123@test.com"
52957 /// ],
52958 /// "type": "string"
52959 /// },
52960 /// "insertTime": {
52961 /// "description": "sub account create time",
52962 /// "examples": [
52963 /// 1570791523523
52964 /// ],
52965 /// "type": "integer",
52966 /// "format": "int64"
52967 /// },
52968 /// "isFutureEnabled": {
52969 /// "type": "boolean"
52970 /// },
52971 /// "isMarginEnabled": {
52972 /// "type": "boolean"
52973 /// },
52974 /// "isSubUserEnabled": {
52975 /// "type": "boolean"
52976 /// },
52977 /// "isUserActive": {
52978 /// "type": "boolean"
52979 /// },
52980 /// "mobile": {
52981 /// "description": "user mobile number",
52982 /// "examples": [
52983 /// 1570791523523
52984 /// ],
52985 /// "type": "integer",
52986 /// "format": "int64"
52987 /// }
52988 /// }
52989 ///}
52990 /// ```
52991 /// </details>
52992 #[derive(Clone, Debug, Deserialize, Serialize)]
52993 pub struct SubAccountStatusResponseItem {
52994 pub email: String,
52995 ///sub account create time
52996 #[serde(rename = "insertTime")]
52997 pub insert_time: i64,
52998 #[serde(rename = "isFutureEnabled")]
52999 pub is_future_enabled: bool,
53000 #[serde(rename = "isMarginEnabled")]
53001 pub is_margin_enabled: bool,
53002 #[serde(rename = "isSubUserEnabled")]
53003 pub is_sub_user_enabled: bool,
53004 #[serde(rename = "isUserActive")]
53005 pub is_user_active: bool,
53006 ///user mobile number
53007 pub mobile: i64,
53008 }
53009 impl From<&SubAccountStatusResponseItem> for SubAccountStatusResponseItem {
53010 fn from(value: &SubAccountStatusResponseItem) -> Self {
53011 value.clone()
53012 }
53013 }
53014 ///SubAccountSubTransferHistoryResponseItem
53015 ///
53016 /// <details><summary>JSON schema</summary>
53017 ///
53018 /// ```json
53019 ///{
53020 /// "type": "object",
53021 /// "required": [
53022 /// "asset",
53023 /// "from",
53024 /// "qty",
53025 /// "status",
53026 /// "time",
53027 /// "to",
53028 /// "tranId"
53029 /// ],
53030 /// "properties": {
53031 /// "asset": {
53032 /// "examples": [
53033 /// "BTC"
53034 /// ],
53035 /// "type": "string"
53036 /// },
53037 /// "from": {
53038 /// "examples": [
53039 /// "aaa@test.com"
53040 /// ],
53041 /// "type": "string"
53042 /// },
53043 /// "qty": {
53044 /// "examples": [
53045 /// 10
53046 /// ],
53047 /// "type": "string"
53048 /// },
53049 /// "status": {
53050 /// "examples": [
53051 /// "SUCCESS"
53052 /// ],
53053 /// "type": "string"
53054 /// },
53055 /// "time": {
53056 /// "examples": [
53057 /// 1544433328000
53058 /// ],
53059 /// "type": "integer",
53060 /// "format": "int64"
53061 /// },
53062 /// "to": {
53063 /// "examples": [
53064 /// "bbb@test.com"
53065 /// ],
53066 /// "type": "string"
53067 /// },
53068 /// "tranId": {
53069 /// "examples": [
53070 /// 6489943656
53071 /// ],
53072 /// "type": "integer",
53073 /// "format": "int64"
53074 /// }
53075 /// }
53076 ///}
53077 /// ```
53078 /// </details>
53079 #[derive(Clone, Debug, Deserialize, Serialize)]
53080 pub struct SubAccountSubTransferHistoryResponseItem {
53081 pub asset: String,
53082 pub from: String,
53083 pub qty: String,
53084 pub status: String,
53085 pub time: i64,
53086 pub to: String,
53087 #[serde(rename = "tranId")]
53088 pub tran_id: i64,
53089 }
53090 impl From<&SubAccountSubTransferHistoryResponseItem>
53091 for SubAccountSubTransferHistoryResponseItem {
53092 fn from(value: &SubAccountSubTransferHistoryResponseItem) -> Self {
53093 value.clone()
53094 }
53095 }
53096 ///SubAccountTransactionStatisticsResponse
53097 ///
53098 /// <details><summary>JSON schema</summary>
53099 ///
53100 /// ```json
53101 ///{
53102 /// "type": "object",
53103 /// "required": [
53104 /// "recent30BtcFuturesTotal",
53105 /// "recent30BtcMarginTotal",
53106 /// "recent30BtcTotal",
53107 /// "recent30BusdFuturesTotal",
53108 /// "recent30BusdMarginTotal",
53109 /// "recent30BusdTotal",
53110 /// "tradeInfoVos"
53111 /// ],
53112 /// "properties": {
53113 /// "recent30BtcFuturesTotal": {
53114 /// "examples": [
53115 /// "0"
53116 /// ],
53117 /// "type": "string"
53118 /// },
53119 /// "recent30BtcMarginTotal": {
53120 /// "examples": [
53121 /// "0"
53122 /// ],
53123 /// "type": "string"
53124 /// },
53125 /// "recent30BtcTotal": {
53126 /// "examples": [
53127 /// "0"
53128 /// ],
53129 /// "type": "string"
53130 /// },
53131 /// "recent30BusdFuturesTotal": {
53132 /// "examples": [
53133 /// "0"
53134 /// ],
53135 /// "type": "string"
53136 /// },
53137 /// "recent30BusdMarginTotal": {
53138 /// "examples": [
53139 /// "0"
53140 /// ],
53141 /// "type": "string"
53142 /// },
53143 /// "recent30BusdTotal": {
53144 /// "examples": [
53145 /// "0"
53146 /// ],
53147 /// "type": "string"
53148 /// },
53149 /// "tradeInfoVos": {
53150 /// "type": "array",
53151 /// "items": {
53152 /// "type": "object",
53153 /// "properties": {
53154 /// "btc": {
53155 /// "examples": [
53156 /// 0
53157 /// ],
53158 /// "type": "number",
53159 /// "format": "float"
53160 /// },
53161 /// "btcFutures": {
53162 /// "examples": [
53163 /// 0
53164 /// ],
53165 /// "type": "number",
53166 /// "format": "float"
53167 /// },
53168 /// "btcMargin": {
53169 /// "examples": [
53170 /// 0
53171 /// ],
53172 /// "type": "number",
53173 /// "format": "float"
53174 /// },
53175 /// "busd": {
53176 /// "examples": [
53177 /// 0
53178 /// ],
53179 /// "type": "number",
53180 /// "format": "float"
53181 /// },
53182 /// "busdFutures": {
53183 /// "examples": [
53184 /// 0
53185 /// ],
53186 /// "type": "number",
53187 /// "format": "float"
53188 /// },
53189 /// "busdMargin": {
53190 /// "examples": [
53191 /// 0
53192 /// ],
53193 /// "type": "number",
53194 /// "format": "float"
53195 /// },
53196 /// "date": {
53197 /// "examples": [
53198 /// 1676851200000
53199 /// ],
53200 /// "type": "integer",
53201 /// "format": "int64"
53202 /// },
53203 /// "userId": {
53204 /// "examples": [
53205 /// 1000138138384
53206 /// ],
53207 /// "type": "integer",
53208 /// "format": "int64"
53209 /// }
53210 /// }
53211 /// }
53212 /// }
53213 /// }
53214 ///}
53215 /// ```
53216 /// </details>
53217 #[derive(Clone, Debug, Deserialize, Serialize)]
53218 pub struct SubAccountTransactionStatisticsResponse {
53219 #[serde(rename = "recent30BtcFuturesTotal")]
53220 pub recent30_btc_futures_total: String,
53221 #[serde(rename = "recent30BtcMarginTotal")]
53222 pub recent30_btc_margin_total: String,
53223 #[serde(rename = "recent30BtcTotal")]
53224 pub recent30_btc_total: String,
53225 #[serde(rename = "recent30BusdFuturesTotal")]
53226 pub recent30_busd_futures_total: String,
53227 #[serde(rename = "recent30BusdMarginTotal")]
53228 pub recent30_busd_margin_total: String,
53229 #[serde(rename = "recent30BusdTotal")]
53230 pub recent30_busd_total: String,
53231 #[serde(rename = "tradeInfoVos")]
53232 pub trade_info_vos: Vec<SubAccountTransactionStatisticsResponseTradeInfoVosItem>,
53233 }
53234 impl From<&SubAccountTransactionStatisticsResponse>
53235 for SubAccountTransactionStatisticsResponse {
53236 fn from(value: &SubAccountTransactionStatisticsResponse) -> Self {
53237 value.clone()
53238 }
53239 }
53240 ///SubAccountTransactionStatisticsResponseTradeInfoVosItem
53241 ///
53242 /// <details><summary>JSON schema</summary>
53243 ///
53244 /// ```json
53245 ///{
53246 /// "type": "object",
53247 /// "properties": {
53248 /// "btc": {
53249 /// "examples": [
53250 /// 0
53251 /// ],
53252 /// "type": "number",
53253 /// "format": "float"
53254 /// },
53255 /// "btcFutures": {
53256 /// "examples": [
53257 /// 0
53258 /// ],
53259 /// "type": "number",
53260 /// "format": "float"
53261 /// },
53262 /// "btcMargin": {
53263 /// "examples": [
53264 /// 0
53265 /// ],
53266 /// "type": "number",
53267 /// "format": "float"
53268 /// },
53269 /// "busd": {
53270 /// "examples": [
53271 /// 0
53272 /// ],
53273 /// "type": "number",
53274 /// "format": "float"
53275 /// },
53276 /// "busdFutures": {
53277 /// "examples": [
53278 /// 0
53279 /// ],
53280 /// "type": "number",
53281 /// "format": "float"
53282 /// },
53283 /// "busdMargin": {
53284 /// "examples": [
53285 /// 0
53286 /// ],
53287 /// "type": "number",
53288 /// "format": "float"
53289 /// },
53290 /// "date": {
53291 /// "examples": [
53292 /// 1676851200000
53293 /// ],
53294 /// "type": "integer",
53295 /// "format": "int64"
53296 /// },
53297 /// "userId": {
53298 /// "examples": [
53299 /// 1000138138384
53300 /// ],
53301 /// "type": "integer",
53302 /// "format": "int64"
53303 /// }
53304 /// }
53305 ///}
53306 /// ```
53307 /// </details>
53308 #[derive(Clone, Debug, Deserialize, Serialize)]
53309 pub struct SubAccountTransactionStatisticsResponseTradeInfoVosItem {
53310 #[serde(default, skip_serializing_if = "Option::is_none")]
53311 pub btc: Option<f32>,
53312 #[serde(rename = "btcFutures", default, skip_serializing_if = "Option::is_none")]
53313 pub btc_futures: Option<f32>,
53314 #[serde(rename = "btcMargin", default, skip_serializing_if = "Option::is_none")]
53315 pub btc_margin: Option<f32>,
53316 #[serde(default, skip_serializing_if = "Option::is_none")]
53317 pub busd: Option<f32>,
53318 #[serde(
53319 rename = "busdFutures",
53320 default,
53321 skip_serializing_if = "Option::is_none"
53322 )]
53323 pub busd_futures: Option<f32>,
53324 #[serde(rename = "busdMargin", default, skip_serializing_if = "Option::is_none")]
53325 pub busd_margin: Option<f32>,
53326 #[serde(default, skip_serializing_if = "Option::is_none")]
53327 pub date: Option<i64>,
53328 #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")]
53329 pub user_id: Option<i64>,
53330 }
53331 impl From<&SubAccountTransactionStatisticsResponseTradeInfoVosItem>
53332 for SubAccountTransactionStatisticsResponseTradeInfoVosItem {
53333 fn from(
53334 value: &SubAccountTransactionStatisticsResponseTradeInfoVosItem,
53335 ) -> Self {
53336 value.clone()
53337 }
53338 }
53339 ///SubAccountTransferSubToMasterResponse
53340 ///
53341 /// <details><summary>JSON schema</summary>
53342 ///
53343 /// ```json
53344 ///{
53345 /// "type": "object",
53346 /// "required": [
53347 /// "txnId"
53348 /// ],
53349 /// "properties": {
53350 /// "txnId": {
53351 /// "examples": [
53352 /// "2966662589"
53353 /// ],
53354 /// "type": "string"
53355 /// }
53356 /// }
53357 ///}
53358 /// ```
53359 /// </details>
53360 #[derive(Clone, Debug, Deserialize, Serialize)]
53361 pub struct SubAccountTransferSubToMasterResponse {
53362 #[serde(rename = "txnId")]
53363 pub txn_id: String,
53364 }
53365 impl From<&SubAccountTransferSubToMasterResponse>
53366 for SubAccountTransferSubToMasterResponse {
53367 fn from(value: &SubAccountTransferSubToMasterResponse) -> Self {
53368 value.clone()
53369 }
53370 }
53371 ///SubAccountTransferSubToSubResponse
53372 ///
53373 /// <details><summary>JSON schema</summary>
53374 ///
53375 /// ```json
53376 ///{
53377 /// "type": "object",
53378 /// "required": [
53379 /// "txnId"
53380 /// ],
53381 /// "properties": {
53382 /// "txnId": {
53383 /// "examples": [
53384 /// "2966662589"
53385 /// ],
53386 /// "type": "string"
53387 /// }
53388 /// }
53389 ///}
53390 /// ```
53391 /// </details>
53392 #[derive(Clone, Debug, Deserialize, Serialize)]
53393 pub struct SubAccountTransferSubToSubResponse {
53394 #[serde(rename = "txnId")]
53395 pub txn_id: String,
53396 }
53397 impl From<&SubAccountTransferSubToSubResponse>
53398 for SubAccountTransferSubToSubResponse {
53399 fn from(value: &SubAccountTransferSubToSubResponse) -> Self {
53400 value.clone()
53401 }
53402 }
53403 ///SubAccountTransferSubUserHistoryResponseItem
53404 ///
53405 /// <details><summary>JSON schema</summary>
53406 ///
53407 /// ```json
53408 ///{
53409 /// "type": "object",
53410 /// "required": [
53411 /// "asset",
53412 /// "counterParty",
53413 /// "email",
53414 /// "fromAccountType",
53415 /// "qty",
53416 /// "status",
53417 /// "time",
53418 /// "toAccountType",
53419 /// "tranId",
53420 /// "type"
53421 /// ],
53422 /// "properties": {
53423 /// "asset": {
53424 /// "examples": [
53425 /// "BTC"
53426 /// ],
53427 /// "type": "string"
53428 /// },
53429 /// "counterParty": {
53430 /// "examples": [
53431 /// "master"
53432 /// ],
53433 /// "type": "string"
53434 /// },
53435 /// "email": {
53436 /// "examples": [
53437 /// "master@test.com"
53438 /// ],
53439 /// "type": "string"
53440 /// },
53441 /// "fromAccountType": {
53442 /// "examples": [
53443 /// "SPOT"
53444 /// ],
53445 /// "type": "string"
53446 /// },
53447 /// "qty": {
53448 /// "examples": [
53449 /// "1"
53450 /// ],
53451 /// "type": "string"
53452 /// },
53453 /// "status": {
53454 /// "examples": [
53455 /// "SUCCESS"
53456 /// ],
53457 /// "type": "string"
53458 /// },
53459 /// "time": {
53460 /// "examples": [
53461 /// 1544433325000
53462 /// ],
53463 /// "type": "integer",
53464 /// "format": "int64"
53465 /// },
53466 /// "toAccountType": {
53467 /// "examples": [
53468 /// "SPOT"
53469 /// ],
53470 /// "type": "string"
53471 /// },
53472 /// "tranId": {
53473 /// "examples": [
53474 /// 11798835829
53475 /// ],
53476 /// "type": "integer",
53477 /// "format": "int64"
53478 /// },
53479 /// "type": {
53480 /// "description": "1 for transfer in, 2 for transfer out",
53481 /// "examples": [
53482 /// 1
53483 /// ],
53484 /// "type": "integer",
53485 /// "format": "int32"
53486 /// }
53487 /// }
53488 ///}
53489 /// ```
53490 /// </details>
53491 #[derive(Clone, Debug, Deserialize, Serialize)]
53492 pub struct SubAccountTransferSubUserHistoryResponseItem {
53493 pub asset: String,
53494 #[serde(rename = "counterParty")]
53495 pub counter_party: String,
53496 pub email: String,
53497 #[serde(rename = "fromAccountType")]
53498 pub from_account_type: String,
53499 pub qty: String,
53500 pub status: String,
53501 pub time: i64,
53502 #[serde(rename = "toAccountType")]
53503 pub to_account_type: String,
53504 #[serde(rename = "tranId")]
53505 pub tran_id: i64,
53506 ///1 for transfer in, 2 for transfer out
53507 #[serde(rename = "type")]
53508 pub type_: i32,
53509 }
53510 impl From<&SubAccountTransferSubUserHistoryResponseItem>
53511 for SubAccountTransferSubUserHistoryResponseItem {
53512 fn from(value: &SubAccountTransferSubUserHistoryResponseItem) -> Self {
53513 value.clone()
53514 }
53515 }
53516 ///SubAccountUniversalTransferResponseItem
53517 ///
53518 /// <details><summary>JSON schema</summary>
53519 ///
53520 /// ```json
53521 ///{
53522 /// "type": "object",
53523 /// "required": [
53524 /// "amount",
53525 /// "asset",
53526 /// "clientTranId",
53527 /// "createTimeStamp",
53528 /// "fromAccountType",
53529 /// "fromEmail",
53530 /// "status",
53531 /// "toAccountType",
53532 /// "toEmail",
53533 /// "tranId"
53534 /// ],
53535 /// "properties": {
53536 /// "amount": {
53537 /// "examples": [
53538 /// "0.1"
53539 /// ],
53540 /// "type": "string"
53541 /// },
53542 /// "asset": {
53543 /// "examples": [
53544 /// "BTC"
53545 /// ],
53546 /// "type": "string"
53547 /// },
53548 /// "clientTranId": {
53549 /// "examples": [
53550 /// "11945860694"
53551 /// ],
53552 /// "type": "string"
53553 /// },
53554 /// "createTimeStamp": {
53555 /// "examples": [
53556 /// 1544433325000
53557 /// ],
53558 /// "type": "integer",
53559 /// "format": "int64"
53560 /// },
53561 /// "fromAccountType": {
53562 /// "examples": [
53563 /// "SPOT"
53564 /// ],
53565 /// "type": "string"
53566 /// },
53567 /// "fromEmail": {
53568 /// "examples": [
53569 /// "master@test.com"
53570 /// ],
53571 /// "type": "string"
53572 /// },
53573 /// "status": {
53574 /// "examples": [
53575 /// "SUCCESS"
53576 /// ],
53577 /// "type": "string"
53578 /// },
53579 /// "toAccountType": {
53580 /// "examples": [
53581 /// "COIN_FUTURE"
53582 /// ],
53583 /// "type": "string"
53584 /// },
53585 /// "toEmail": {
53586 /// "examples": [
53587 /// "subaccount1@test.com"
53588 /// ],
53589 /// "type": "string"
53590 /// },
53591 /// "tranId": {
53592 /// "examples": [
53593 /// 11945860693
53594 /// ],
53595 /// "type": "integer",
53596 /// "format": "int64"
53597 /// }
53598 /// }
53599 ///}
53600 /// ```
53601 /// </details>
53602 #[derive(Clone, Debug, Deserialize, Serialize)]
53603 pub struct SubAccountUniversalTransferResponseItem {
53604 pub amount: String,
53605 pub asset: String,
53606 #[serde(rename = "clientTranId")]
53607 pub client_tran_id: String,
53608 #[serde(rename = "createTimeStamp")]
53609 pub create_time_stamp: i64,
53610 #[serde(rename = "fromAccountType")]
53611 pub from_account_type: String,
53612 #[serde(rename = "fromEmail")]
53613 pub from_email: String,
53614 pub status: String,
53615 #[serde(rename = "toAccountType")]
53616 pub to_account_type: String,
53617 #[serde(rename = "toEmail")]
53618 pub to_email: String,
53619 #[serde(rename = "tranId")]
53620 pub tran_id: i64,
53621 }
53622 impl From<&SubAccountUniversalTransferResponseItem>
53623 for SubAccountUniversalTransferResponseItem {
53624 fn from(value: &SubAccountUniversalTransferResponseItem) -> Self {
53625 value.clone()
53626 }
53627 }
53628 ///SubAccountUsdtFuturesDetails
53629 ///
53630 /// <details><summary>JSON schema</summary>
53631 ///
53632 /// ```json
53633 ///{
53634 /// "type": "object",
53635 /// "required": [
53636 /// "futureAccountResp"
53637 /// ],
53638 /// "properties": {
53639 /// "futureAccountResp": {
53640 /// "type": "object",
53641 /// "required": [
53642 /// "assets",
53643 /// "canDeposit",
53644 /// "canTrade",
53645 /// "canWithdraw",
53646 /// "email",
53647 /// "feeTier",
53648 /// "maxWithdrawAmount",
53649 /// "totalInitialMargin",
53650 /// "totalMaintenanceMargin",
53651 /// "totalMarginBalance",
53652 /// "totalOpenOrderInitialMargin",
53653 /// "totalPositionInitialMargin",
53654 /// "totalUnrealizedProfit",
53655 /// "totalWalletBalance",
53656 /// "updateTime"
53657 /// ],
53658 /// "properties": {
53659 /// "assets": {
53660 /// "type": "array",
53661 /// "items": {
53662 /// "type": "object",
53663 /// "required": [
53664 /// "asset",
53665 /// "initialMargin",
53666 /// "maintenanceMargin",
53667 /// "marginBalance",
53668 /// "maxWithdrawAmount",
53669 /// "openOrderInitialMargin",
53670 /// "positionInitialMargin",
53671 /// "unrealizedProfit",
53672 /// "walletBalance"
53673 /// ],
53674 /// "properties": {
53675 /// "asset": {
53676 /// "examples": [
53677 /// "USDT"
53678 /// ],
53679 /// "type": "string"
53680 /// },
53681 /// "initialMargin": {
53682 /// "examples": [
53683 /// "0.00000000"
53684 /// ],
53685 /// "type": "string"
53686 /// },
53687 /// "maintenanceMargin": {
53688 /// "examples": [
53689 /// "0.00000000"
53690 /// ],
53691 /// "type": "string"
53692 /// },
53693 /// "marginBalance": {
53694 /// "examples": [
53695 /// "0.88308000"
53696 /// ],
53697 /// "type": "string"
53698 /// },
53699 /// "maxWithdrawAmount": {
53700 /// "examples": [
53701 /// "0.88308000"
53702 /// ],
53703 /// "type": "string"
53704 /// },
53705 /// "openOrderInitialMargin": {
53706 /// "examples": [
53707 /// "0.00000000"
53708 /// ],
53709 /// "type": "string"
53710 /// },
53711 /// "positionInitialMargin": {
53712 /// "examples": [
53713 /// "0.00000000"
53714 /// ],
53715 /// "type": "string"
53716 /// },
53717 /// "unrealizedProfit": {
53718 /// "examples": [
53719 /// "0.00000000"
53720 /// ],
53721 /// "type": "string"
53722 /// },
53723 /// "walletBalance": {
53724 /// "examples": [
53725 /// "0.88308000"
53726 /// ],
53727 /// "type": "string"
53728 /// }
53729 /// }
53730 /// }
53731 /// },
53732 /// "canDeposit": {
53733 /// "type": "boolean"
53734 /// },
53735 /// "canTrade": {
53736 /// "type": "boolean"
53737 /// },
53738 /// "canWithdraw": {
53739 /// "type": "boolean"
53740 /// },
53741 /// "email": {
53742 /// "examples": [
53743 /// "abc@test.com"
53744 /// ],
53745 /// "type": "string"
53746 /// },
53747 /// "feeTier": {
53748 /// "examples": [
53749 /// 2
53750 /// ],
53751 /// "type": "integer",
53752 /// "format": "int64"
53753 /// },
53754 /// "maxWithdrawAmount": {
53755 /// "examples": [
53756 /// "0.88308000"
53757 /// ],
53758 /// "type": "string"
53759 /// },
53760 /// "totalInitialMargin": {
53761 /// "examples": [
53762 /// "0.00000000"
53763 /// ],
53764 /// "type": "string"
53765 /// },
53766 /// "totalMaintenanceMargin": {
53767 /// "examples": [
53768 /// "0.00000000"
53769 /// ],
53770 /// "type": "string"
53771 /// },
53772 /// "totalMarginBalance": {
53773 /// "examples": [
53774 /// "0.88308000"
53775 /// ],
53776 /// "type": "string"
53777 /// },
53778 /// "totalOpenOrderInitialMargin": {
53779 /// "examples": [
53780 /// "0.00000000"
53781 /// ],
53782 /// "type": "string"
53783 /// },
53784 /// "totalPositionInitialMargin": {
53785 /// "examples": [
53786 /// "0.00000000"
53787 /// ],
53788 /// "type": "string"
53789 /// },
53790 /// "totalUnrealizedProfit": {
53791 /// "examples": [
53792 /// "0.00000000"
53793 /// ],
53794 /// "type": "string"
53795 /// },
53796 /// "totalWalletBalance": {
53797 /// "examples": [
53798 /// "0.88308000"
53799 /// ],
53800 /// "type": "string"
53801 /// },
53802 /// "updateTime": {
53803 /// "examples": [
53804 /// 1576756674610
53805 /// ],
53806 /// "type": "integer",
53807 /// "format": "int64"
53808 /// }
53809 /// }
53810 /// }
53811 /// }
53812 ///}
53813 /// ```
53814 /// </details>
53815 #[derive(Clone, Debug, Deserialize, Serialize)]
53816 pub struct SubAccountUsdtFuturesDetails {
53817 #[serde(rename = "futureAccountResp")]
53818 pub future_account_resp: SubAccountUsdtFuturesDetailsFutureAccountResp,
53819 }
53820 impl From<&SubAccountUsdtFuturesDetails> for SubAccountUsdtFuturesDetails {
53821 fn from(value: &SubAccountUsdtFuturesDetails) -> Self {
53822 value.clone()
53823 }
53824 }
53825 ///SubAccountUsdtFuturesDetailsFutureAccountResp
53826 ///
53827 /// <details><summary>JSON schema</summary>
53828 ///
53829 /// ```json
53830 ///{
53831 /// "type": "object",
53832 /// "required": [
53833 /// "assets",
53834 /// "canDeposit",
53835 /// "canTrade",
53836 /// "canWithdraw",
53837 /// "email",
53838 /// "feeTier",
53839 /// "maxWithdrawAmount",
53840 /// "totalInitialMargin",
53841 /// "totalMaintenanceMargin",
53842 /// "totalMarginBalance",
53843 /// "totalOpenOrderInitialMargin",
53844 /// "totalPositionInitialMargin",
53845 /// "totalUnrealizedProfit",
53846 /// "totalWalletBalance",
53847 /// "updateTime"
53848 /// ],
53849 /// "properties": {
53850 /// "assets": {
53851 /// "type": "array",
53852 /// "items": {
53853 /// "type": "object",
53854 /// "required": [
53855 /// "asset",
53856 /// "initialMargin",
53857 /// "maintenanceMargin",
53858 /// "marginBalance",
53859 /// "maxWithdrawAmount",
53860 /// "openOrderInitialMargin",
53861 /// "positionInitialMargin",
53862 /// "unrealizedProfit",
53863 /// "walletBalance"
53864 /// ],
53865 /// "properties": {
53866 /// "asset": {
53867 /// "examples": [
53868 /// "USDT"
53869 /// ],
53870 /// "type": "string"
53871 /// },
53872 /// "initialMargin": {
53873 /// "examples": [
53874 /// "0.00000000"
53875 /// ],
53876 /// "type": "string"
53877 /// },
53878 /// "maintenanceMargin": {
53879 /// "examples": [
53880 /// "0.00000000"
53881 /// ],
53882 /// "type": "string"
53883 /// },
53884 /// "marginBalance": {
53885 /// "examples": [
53886 /// "0.88308000"
53887 /// ],
53888 /// "type": "string"
53889 /// },
53890 /// "maxWithdrawAmount": {
53891 /// "examples": [
53892 /// "0.88308000"
53893 /// ],
53894 /// "type": "string"
53895 /// },
53896 /// "openOrderInitialMargin": {
53897 /// "examples": [
53898 /// "0.00000000"
53899 /// ],
53900 /// "type": "string"
53901 /// },
53902 /// "positionInitialMargin": {
53903 /// "examples": [
53904 /// "0.00000000"
53905 /// ],
53906 /// "type": "string"
53907 /// },
53908 /// "unrealizedProfit": {
53909 /// "examples": [
53910 /// "0.00000000"
53911 /// ],
53912 /// "type": "string"
53913 /// },
53914 /// "walletBalance": {
53915 /// "examples": [
53916 /// "0.88308000"
53917 /// ],
53918 /// "type": "string"
53919 /// }
53920 /// }
53921 /// }
53922 /// },
53923 /// "canDeposit": {
53924 /// "type": "boolean"
53925 /// },
53926 /// "canTrade": {
53927 /// "type": "boolean"
53928 /// },
53929 /// "canWithdraw": {
53930 /// "type": "boolean"
53931 /// },
53932 /// "email": {
53933 /// "examples": [
53934 /// "abc@test.com"
53935 /// ],
53936 /// "type": "string"
53937 /// },
53938 /// "feeTier": {
53939 /// "examples": [
53940 /// 2
53941 /// ],
53942 /// "type": "integer",
53943 /// "format": "int64"
53944 /// },
53945 /// "maxWithdrawAmount": {
53946 /// "examples": [
53947 /// "0.88308000"
53948 /// ],
53949 /// "type": "string"
53950 /// },
53951 /// "totalInitialMargin": {
53952 /// "examples": [
53953 /// "0.00000000"
53954 /// ],
53955 /// "type": "string"
53956 /// },
53957 /// "totalMaintenanceMargin": {
53958 /// "examples": [
53959 /// "0.00000000"
53960 /// ],
53961 /// "type": "string"
53962 /// },
53963 /// "totalMarginBalance": {
53964 /// "examples": [
53965 /// "0.88308000"
53966 /// ],
53967 /// "type": "string"
53968 /// },
53969 /// "totalOpenOrderInitialMargin": {
53970 /// "examples": [
53971 /// "0.00000000"
53972 /// ],
53973 /// "type": "string"
53974 /// },
53975 /// "totalPositionInitialMargin": {
53976 /// "examples": [
53977 /// "0.00000000"
53978 /// ],
53979 /// "type": "string"
53980 /// },
53981 /// "totalUnrealizedProfit": {
53982 /// "examples": [
53983 /// "0.00000000"
53984 /// ],
53985 /// "type": "string"
53986 /// },
53987 /// "totalWalletBalance": {
53988 /// "examples": [
53989 /// "0.88308000"
53990 /// ],
53991 /// "type": "string"
53992 /// },
53993 /// "updateTime": {
53994 /// "examples": [
53995 /// 1576756674610
53996 /// ],
53997 /// "type": "integer",
53998 /// "format": "int64"
53999 /// }
54000 /// }
54001 ///}
54002 /// ```
54003 /// </details>
54004 #[derive(Clone, Debug, Deserialize, Serialize)]
54005 pub struct SubAccountUsdtFuturesDetailsFutureAccountResp {
54006 pub assets: Vec<SubAccountUsdtFuturesDetailsFutureAccountRespAssetsItem>,
54007 #[serde(rename = "canDeposit")]
54008 pub can_deposit: bool,
54009 #[serde(rename = "canTrade")]
54010 pub can_trade: bool,
54011 #[serde(rename = "canWithdraw")]
54012 pub can_withdraw: bool,
54013 pub email: String,
54014 #[serde(rename = "feeTier")]
54015 pub fee_tier: i64,
54016 #[serde(rename = "maxWithdrawAmount")]
54017 pub max_withdraw_amount: String,
54018 #[serde(rename = "totalInitialMargin")]
54019 pub total_initial_margin: String,
54020 #[serde(rename = "totalMaintenanceMargin")]
54021 pub total_maintenance_margin: String,
54022 #[serde(rename = "totalMarginBalance")]
54023 pub total_margin_balance: String,
54024 #[serde(rename = "totalOpenOrderInitialMargin")]
54025 pub total_open_order_initial_margin: String,
54026 #[serde(rename = "totalPositionInitialMargin")]
54027 pub total_position_initial_margin: String,
54028 #[serde(rename = "totalUnrealizedProfit")]
54029 pub total_unrealized_profit: String,
54030 #[serde(rename = "totalWalletBalance")]
54031 pub total_wallet_balance: String,
54032 #[serde(rename = "updateTime")]
54033 pub update_time: i64,
54034 }
54035 impl From<&SubAccountUsdtFuturesDetailsFutureAccountResp>
54036 for SubAccountUsdtFuturesDetailsFutureAccountResp {
54037 fn from(value: &SubAccountUsdtFuturesDetailsFutureAccountResp) -> Self {
54038 value.clone()
54039 }
54040 }
54041 ///SubAccountUsdtFuturesDetailsFutureAccountRespAssetsItem
54042 ///
54043 /// <details><summary>JSON schema</summary>
54044 ///
54045 /// ```json
54046 ///{
54047 /// "type": "object",
54048 /// "required": [
54049 /// "asset",
54050 /// "initialMargin",
54051 /// "maintenanceMargin",
54052 /// "marginBalance",
54053 /// "maxWithdrawAmount",
54054 /// "openOrderInitialMargin",
54055 /// "positionInitialMargin",
54056 /// "unrealizedProfit",
54057 /// "walletBalance"
54058 /// ],
54059 /// "properties": {
54060 /// "asset": {
54061 /// "examples": [
54062 /// "USDT"
54063 /// ],
54064 /// "type": "string"
54065 /// },
54066 /// "initialMargin": {
54067 /// "examples": [
54068 /// "0.00000000"
54069 /// ],
54070 /// "type": "string"
54071 /// },
54072 /// "maintenanceMargin": {
54073 /// "examples": [
54074 /// "0.00000000"
54075 /// ],
54076 /// "type": "string"
54077 /// },
54078 /// "marginBalance": {
54079 /// "examples": [
54080 /// "0.88308000"
54081 /// ],
54082 /// "type": "string"
54083 /// },
54084 /// "maxWithdrawAmount": {
54085 /// "examples": [
54086 /// "0.88308000"
54087 /// ],
54088 /// "type": "string"
54089 /// },
54090 /// "openOrderInitialMargin": {
54091 /// "examples": [
54092 /// "0.00000000"
54093 /// ],
54094 /// "type": "string"
54095 /// },
54096 /// "positionInitialMargin": {
54097 /// "examples": [
54098 /// "0.00000000"
54099 /// ],
54100 /// "type": "string"
54101 /// },
54102 /// "unrealizedProfit": {
54103 /// "examples": [
54104 /// "0.00000000"
54105 /// ],
54106 /// "type": "string"
54107 /// },
54108 /// "walletBalance": {
54109 /// "examples": [
54110 /// "0.88308000"
54111 /// ],
54112 /// "type": "string"
54113 /// }
54114 /// }
54115 ///}
54116 /// ```
54117 /// </details>
54118 #[derive(Clone, Debug, Deserialize, Serialize)]
54119 pub struct SubAccountUsdtFuturesDetailsFutureAccountRespAssetsItem {
54120 pub asset: String,
54121 #[serde(rename = "initialMargin")]
54122 pub initial_margin: String,
54123 #[serde(rename = "maintenanceMargin")]
54124 pub maintenance_margin: String,
54125 #[serde(rename = "marginBalance")]
54126 pub margin_balance: String,
54127 #[serde(rename = "maxWithdrawAmount")]
54128 pub max_withdraw_amount: String,
54129 #[serde(rename = "openOrderInitialMargin")]
54130 pub open_order_initial_margin: String,
54131 #[serde(rename = "positionInitialMargin")]
54132 pub position_initial_margin: String,
54133 #[serde(rename = "unrealizedProfit")]
54134 pub unrealized_profit: String,
54135 #[serde(rename = "walletBalance")]
54136 pub wallet_balance: String,
54137 }
54138 impl From<&SubAccountUsdtFuturesDetailsFutureAccountRespAssetsItem>
54139 for SubAccountUsdtFuturesDetailsFutureAccountRespAssetsItem {
54140 fn from(
54141 value: &SubAccountUsdtFuturesDetailsFutureAccountRespAssetsItem,
54142 ) -> Self {
54143 value.clone()
54144 }
54145 }
54146 ///SubAccountUsdtFuturesPositionRisk
54147 ///
54148 /// <details><summary>JSON schema</summary>
54149 ///
54150 /// ```json
54151 ///{
54152 /// "type": "object",
54153 /// "required": [
54154 /// "futurePositionRiskVos"
54155 /// ],
54156 /// "properties": {
54157 /// "futurePositionRiskVos": {
54158 /// "type": "array",
54159 /// "items": {
54160 /// "type": "object",
54161 /// "required": [
54162 /// "entryPrice",
54163 /// "leverage",
54164 /// "liquidationPrice",
54165 /// "markPrice",
54166 /// "maxNotional",
54167 /// "positionAmount",
54168 /// "symbol",
54169 /// "unrealizedProfit"
54170 /// ],
54171 /// "properties": {
54172 /// "entryPrice": {
54173 /// "examples": [
54174 /// "9975.12000"
54175 /// ],
54176 /// "type": "string"
54177 /// },
54178 /// "leverage": {
54179 /// "description": "current initial leverage",
54180 /// "examples": [
54181 /// "50"
54182 /// ],
54183 /// "type": "string"
54184 /// },
54185 /// "liquidationPrice": {
54186 /// "examples": [
54187 /// "7963.54"
54188 /// ],
54189 /// "type": "string"
54190 /// },
54191 /// "markPrice": {
54192 /// "examples": [
54193 /// "9973.50770517"
54194 /// ],
54195 /// "type": "string"
54196 /// },
54197 /// "maxNotional": {
54198 /// "description": "notional value limit of current initial leverage",
54199 /// "examples": [
54200 /// "1000000"
54201 /// ],
54202 /// "type": "string"
54203 /// },
54204 /// "positionAmount": {
54205 /// "examples": [
54206 /// "0.010"
54207 /// ],
54208 /// "type": "string"
54209 /// },
54210 /// "symbol": {
54211 /// "examples": [
54212 /// "BTCUSDT"
54213 /// ],
54214 /// "type": "string"
54215 /// },
54216 /// "unrealizedProfit": {
54217 /// "examples": [
54218 /// "-0.01612295"
54219 /// ],
54220 /// "type": "string"
54221 /// }
54222 /// }
54223 /// }
54224 /// }
54225 /// }
54226 ///}
54227 /// ```
54228 /// </details>
54229 #[derive(Clone, Debug, Deserialize, Serialize)]
54230 pub struct SubAccountUsdtFuturesPositionRisk {
54231 #[serde(rename = "futurePositionRiskVos")]
54232 pub future_position_risk_vos: Vec<
54233 SubAccountUsdtFuturesPositionRiskFuturePositionRiskVosItem,
54234 >,
54235 }
54236 impl From<&SubAccountUsdtFuturesPositionRisk> for SubAccountUsdtFuturesPositionRisk {
54237 fn from(value: &SubAccountUsdtFuturesPositionRisk) -> Self {
54238 value.clone()
54239 }
54240 }
54241 ///SubAccountUsdtFuturesPositionRiskFuturePositionRiskVosItem
54242 ///
54243 /// <details><summary>JSON schema</summary>
54244 ///
54245 /// ```json
54246 ///{
54247 /// "type": "object",
54248 /// "required": [
54249 /// "entryPrice",
54250 /// "leverage",
54251 /// "liquidationPrice",
54252 /// "markPrice",
54253 /// "maxNotional",
54254 /// "positionAmount",
54255 /// "symbol",
54256 /// "unrealizedProfit"
54257 /// ],
54258 /// "properties": {
54259 /// "entryPrice": {
54260 /// "examples": [
54261 /// "9975.12000"
54262 /// ],
54263 /// "type": "string"
54264 /// },
54265 /// "leverage": {
54266 /// "description": "current initial leverage",
54267 /// "examples": [
54268 /// "50"
54269 /// ],
54270 /// "type": "string"
54271 /// },
54272 /// "liquidationPrice": {
54273 /// "examples": [
54274 /// "7963.54"
54275 /// ],
54276 /// "type": "string"
54277 /// },
54278 /// "markPrice": {
54279 /// "examples": [
54280 /// "9973.50770517"
54281 /// ],
54282 /// "type": "string"
54283 /// },
54284 /// "maxNotional": {
54285 /// "description": "notional value limit of current initial leverage",
54286 /// "examples": [
54287 /// "1000000"
54288 /// ],
54289 /// "type": "string"
54290 /// },
54291 /// "positionAmount": {
54292 /// "examples": [
54293 /// "0.010"
54294 /// ],
54295 /// "type": "string"
54296 /// },
54297 /// "symbol": {
54298 /// "examples": [
54299 /// "BTCUSDT"
54300 /// ],
54301 /// "type": "string"
54302 /// },
54303 /// "unrealizedProfit": {
54304 /// "examples": [
54305 /// "-0.01612295"
54306 /// ],
54307 /// "type": "string"
54308 /// }
54309 /// }
54310 ///}
54311 /// ```
54312 /// </details>
54313 #[derive(Clone, Debug, Deserialize, Serialize)]
54314 pub struct SubAccountUsdtFuturesPositionRiskFuturePositionRiskVosItem {
54315 #[serde(rename = "entryPrice")]
54316 pub entry_price: String,
54317 ///current initial leverage
54318 pub leverage: String,
54319 #[serde(rename = "liquidationPrice")]
54320 pub liquidation_price: String,
54321 #[serde(rename = "markPrice")]
54322 pub mark_price: String,
54323 ///notional value limit of current initial leverage
54324 #[serde(rename = "maxNotional")]
54325 pub max_notional: String,
54326 #[serde(rename = "positionAmount")]
54327 pub position_amount: String,
54328 pub symbol: String,
54329 #[serde(rename = "unrealizedProfit")]
54330 pub unrealized_profit: String,
54331 }
54332 impl From<&SubAccountUsdtFuturesPositionRiskFuturePositionRiskVosItem>
54333 for SubAccountUsdtFuturesPositionRiskFuturePositionRiskVosItem {
54334 fn from(
54335 value: &SubAccountUsdtFuturesPositionRiskFuturePositionRiskVosItem,
54336 ) -> Self {
54337 value.clone()
54338 }
54339 }
54340 ///SubAccountUsdtFuturesSummary
54341 ///
54342 /// <details><summary>JSON schema</summary>
54343 ///
54344 /// ```json
54345 ///{
54346 /// "type": "object",
54347 /// "required": [
54348 /// "futureAccountSummaryResp"
54349 /// ],
54350 /// "properties": {
54351 /// "futureAccountSummaryResp": {
54352 /// "type": "object",
54353 /// "required": [
54354 /// "asset",
54355 /// "subAccountList",
54356 /// "totalInitialMargin",
54357 /// "totalMaintenanceMargin",
54358 /// "totalMarginBalance",
54359 /// "totalOpenOrderInitialMargin",
54360 /// "totalPositionInitialMargin",
54361 /// "totalUnrealizedProfit",
54362 /// "totalWalletBalance"
54363 /// ],
54364 /// "properties": {
54365 /// "asset": {
54366 /// "description": "The sum of BUSD and USDT",
54367 /// "examples": [
54368 /// "USD"
54369 /// ],
54370 /// "type": "string"
54371 /// },
54372 /// "subAccountList": {
54373 /// "type": "array",
54374 /// "items": {
54375 /// "type": "object",
54376 /// "required": [
54377 /// "asset",
54378 /// "email",
54379 /// "totalInitialMargin",
54380 /// "totalMaintenanceMargin",
54381 /// "totalMarginBalance",
54382 /// "totalOpenOrderInitialMargin",
54383 /// "totalPositionInitialMargin",
54384 /// "totalUnrealizedProfit",
54385 /// "totalWalletBalance"
54386 /// ],
54387 /// "properties": {
54388 /// "asset": {
54389 /// "description": "The sum of BUSD and USDT",
54390 /// "examples": [
54391 /// "USD"
54392 /// ],
54393 /// "type": "string"
54394 /// },
54395 /// "email": {
54396 /// "examples": [
54397 /// "123@test.com"
54398 /// ],
54399 /// "type": "string"
54400 /// },
54401 /// "totalInitialMargin": {
54402 /// "examples": [
54403 /// "9.00000000"
54404 /// ],
54405 /// "type": "string"
54406 /// },
54407 /// "totalMaintenanceMargin": {
54408 /// "examples": [
54409 /// "0.00000000"
54410 /// ],
54411 /// "type": "string"
54412 /// },
54413 /// "totalMarginBalance": {
54414 /// "examples": [
54415 /// "22.12659734"
54416 /// ],
54417 /// "type": "string"
54418 /// },
54419 /// "totalOpenOrderInitialMargin": {
54420 /// "examples": [
54421 /// "9.00000000"
54422 /// ],
54423 /// "type": "string"
54424 /// },
54425 /// "totalPositionInitialMargin": {
54426 /// "examples": [
54427 /// "0.00000000"
54428 /// ],
54429 /// "type": "string"
54430 /// },
54431 /// "totalUnrealizedProfit": {
54432 /// "examples": [
54433 /// "0.00000000"
54434 /// ],
54435 /// "type": "string"
54436 /// },
54437 /// "totalWalletBalance": {
54438 /// "examples": [
54439 /// "22.12659734"
54440 /// ],
54441 /// "type": "string"
54442 /// }
54443 /// }
54444 /// }
54445 /// },
54446 /// "totalInitialMargin": {
54447 /// "examples": [
54448 /// "9.83137400"
54449 /// ],
54450 /// "type": "string"
54451 /// },
54452 /// "totalMaintenanceMargin": {
54453 /// "examples": [
54454 /// "0.41568700"
54455 /// ],
54456 /// "type": "string"
54457 /// },
54458 /// "totalMarginBalance": {
54459 /// "examples": [
54460 /// "23.03235621"
54461 /// ],
54462 /// "type": "string"
54463 /// },
54464 /// "totalOpenOrderInitialMargin": {
54465 /// "examples": [
54466 /// "9.00000000"
54467 /// ],
54468 /// "type": "string"
54469 /// },
54470 /// "totalPositionInitialMargin": {
54471 /// "examples": [
54472 /// "0.83137400"
54473 /// ],
54474 /// "type": "string"
54475 /// },
54476 /// "totalUnrealizedProfit": {
54477 /// "examples": [
54478 /// "0.03219710"
54479 /// ],
54480 /// "type": "string"
54481 /// },
54482 /// "totalWalletBalance": {
54483 /// "examples": [
54484 /// "22.15879444"
54485 /// ],
54486 /// "type": "string"
54487 /// }
54488 /// }
54489 /// }
54490 /// }
54491 ///}
54492 /// ```
54493 /// </details>
54494 #[derive(Clone, Debug, Deserialize, Serialize)]
54495 pub struct SubAccountUsdtFuturesSummary {
54496 #[serde(rename = "futureAccountSummaryResp")]
54497 pub future_account_summary_resp: SubAccountUsdtFuturesSummaryFutureAccountSummaryResp,
54498 }
54499 impl From<&SubAccountUsdtFuturesSummary> for SubAccountUsdtFuturesSummary {
54500 fn from(value: &SubAccountUsdtFuturesSummary) -> Self {
54501 value.clone()
54502 }
54503 }
54504 ///SubAccountUsdtFuturesSummaryFutureAccountSummaryResp
54505 ///
54506 /// <details><summary>JSON schema</summary>
54507 ///
54508 /// ```json
54509 ///{
54510 /// "type": "object",
54511 /// "required": [
54512 /// "asset",
54513 /// "subAccountList",
54514 /// "totalInitialMargin",
54515 /// "totalMaintenanceMargin",
54516 /// "totalMarginBalance",
54517 /// "totalOpenOrderInitialMargin",
54518 /// "totalPositionInitialMargin",
54519 /// "totalUnrealizedProfit",
54520 /// "totalWalletBalance"
54521 /// ],
54522 /// "properties": {
54523 /// "asset": {
54524 /// "description": "The sum of BUSD and USDT",
54525 /// "examples": [
54526 /// "USD"
54527 /// ],
54528 /// "type": "string"
54529 /// },
54530 /// "subAccountList": {
54531 /// "type": "array",
54532 /// "items": {
54533 /// "type": "object",
54534 /// "required": [
54535 /// "asset",
54536 /// "email",
54537 /// "totalInitialMargin",
54538 /// "totalMaintenanceMargin",
54539 /// "totalMarginBalance",
54540 /// "totalOpenOrderInitialMargin",
54541 /// "totalPositionInitialMargin",
54542 /// "totalUnrealizedProfit",
54543 /// "totalWalletBalance"
54544 /// ],
54545 /// "properties": {
54546 /// "asset": {
54547 /// "description": "The sum of BUSD and USDT",
54548 /// "examples": [
54549 /// "USD"
54550 /// ],
54551 /// "type": "string"
54552 /// },
54553 /// "email": {
54554 /// "examples": [
54555 /// "123@test.com"
54556 /// ],
54557 /// "type": "string"
54558 /// },
54559 /// "totalInitialMargin": {
54560 /// "examples": [
54561 /// "9.00000000"
54562 /// ],
54563 /// "type": "string"
54564 /// },
54565 /// "totalMaintenanceMargin": {
54566 /// "examples": [
54567 /// "0.00000000"
54568 /// ],
54569 /// "type": "string"
54570 /// },
54571 /// "totalMarginBalance": {
54572 /// "examples": [
54573 /// "22.12659734"
54574 /// ],
54575 /// "type": "string"
54576 /// },
54577 /// "totalOpenOrderInitialMargin": {
54578 /// "examples": [
54579 /// "9.00000000"
54580 /// ],
54581 /// "type": "string"
54582 /// },
54583 /// "totalPositionInitialMargin": {
54584 /// "examples": [
54585 /// "0.00000000"
54586 /// ],
54587 /// "type": "string"
54588 /// },
54589 /// "totalUnrealizedProfit": {
54590 /// "examples": [
54591 /// "0.00000000"
54592 /// ],
54593 /// "type": "string"
54594 /// },
54595 /// "totalWalletBalance": {
54596 /// "examples": [
54597 /// "22.12659734"
54598 /// ],
54599 /// "type": "string"
54600 /// }
54601 /// }
54602 /// }
54603 /// },
54604 /// "totalInitialMargin": {
54605 /// "examples": [
54606 /// "9.83137400"
54607 /// ],
54608 /// "type": "string"
54609 /// },
54610 /// "totalMaintenanceMargin": {
54611 /// "examples": [
54612 /// "0.41568700"
54613 /// ],
54614 /// "type": "string"
54615 /// },
54616 /// "totalMarginBalance": {
54617 /// "examples": [
54618 /// "23.03235621"
54619 /// ],
54620 /// "type": "string"
54621 /// },
54622 /// "totalOpenOrderInitialMargin": {
54623 /// "examples": [
54624 /// "9.00000000"
54625 /// ],
54626 /// "type": "string"
54627 /// },
54628 /// "totalPositionInitialMargin": {
54629 /// "examples": [
54630 /// "0.83137400"
54631 /// ],
54632 /// "type": "string"
54633 /// },
54634 /// "totalUnrealizedProfit": {
54635 /// "examples": [
54636 /// "0.03219710"
54637 /// ],
54638 /// "type": "string"
54639 /// },
54640 /// "totalWalletBalance": {
54641 /// "examples": [
54642 /// "22.15879444"
54643 /// ],
54644 /// "type": "string"
54645 /// }
54646 /// }
54647 ///}
54648 /// ```
54649 /// </details>
54650 #[derive(Clone, Debug, Deserialize, Serialize)]
54651 pub struct SubAccountUsdtFuturesSummaryFutureAccountSummaryResp {
54652 ///The sum of BUSD and USDT
54653 pub asset: String,
54654 #[serde(rename = "subAccountList")]
54655 pub sub_account_list: Vec<
54656 SubAccountUsdtFuturesSummaryFutureAccountSummaryRespSubAccountListItem,
54657 >,
54658 #[serde(rename = "totalInitialMargin")]
54659 pub total_initial_margin: String,
54660 #[serde(rename = "totalMaintenanceMargin")]
54661 pub total_maintenance_margin: String,
54662 #[serde(rename = "totalMarginBalance")]
54663 pub total_margin_balance: String,
54664 #[serde(rename = "totalOpenOrderInitialMargin")]
54665 pub total_open_order_initial_margin: String,
54666 #[serde(rename = "totalPositionInitialMargin")]
54667 pub total_position_initial_margin: String,
54668 #[serde(rename = "totalUnrealizedProfit")]
54669 pub total_unrealized_profit: String,
54670 #[serde(rename = "totalWalletBalance")]
54671 pub total_wallet_balance: String,
54672 }
54673 impl From<&SubAccountUsdtFuturesSummaryFutureAccountSummaryResp>
54674 for SubAccountUsdtFuturesSummaryFutureAccountSummaryResp {
54675 fn from(value: &SubAccountUsdtFuturesSummaryFutureAccountSummaryResp) -> Self {
54676 value.clone()
54677 }
54678 }
54679 ///SubAccountUsdtFuturesSummaryFutureAccountSummaryRespSubAccountListItem
54680 ///
54681 /// <details><summary>JSON schema</summary>
54682 ///
54683 /// ```json
54684 ///{
54685 /// "type": "object",
54686 /// "required": [
54687 /// "asset",
54688 /// "email",
54689 /// "totalInitialMargin",
54690 /// "totalMaintenanceMargin",
54691 /// "totalMarginBalance",
54692 /// "totalOpenOrderInitialMargin",
54693 /// "totalPositionInitialMargin",
54694 /// "totalUnrealizedProfit",
54695 /// "totalWalletBalance"
54696 /// ],
54697 /// "properties": {
54698 /// "asset": {
54699 /// "description": "The sum of BUSD and USDT",
54700 /// "examples": [
54701 /// "USD"
54702 /// ],
54703 /// "type": "string"
54704 /// },
54705 /// "email": {
54706 /// "examples": [
54707 /// "123@test.com"
54708 /// ],
54709 /// "type": "string"
54710 /// },
54711 /// "totalInitialMargin": {
54712 /// "examples": [
54713 /// "9.00000000"
54714 /// ],
54715 /// "type": "string"
54716 /// },
54717 /// "totalMaintenanceMargin": {
54718 /// "examples": [
54719 /// "0.00000000"
54720 /// ],
54721 /// "type": "string"
54722 /// },
54723 /// "totalMarginBalance": {
54724 /// "examples": [
54725 /// "22.12659734"
54726 /// ],
54727 /// "type": "string"
54728 /// },
54729 /// "totalOpenOrderInitialMargin": {
54730 /// "examples": [
54731 /// "9.00000000"
54732 /// ],
54733 /// "type": "string"
54734 /// },
54735 /// "totalPositionInitialMargin": {
54736 /// "examples": [
54737 /// "0.00000000"
54738 /// ],
54739 /// "type": "string"
54740 /// },
54741 /// "totalUnrealizedProfit": {
54742 /// "examples": [
54743 /// "0.00000000"
54744 /// ],
54745 /// "type": "string"
54746 /// },
54747 /// "totalWalletBalance": {
54748 /// "examples": [
54749 /// "22.12659734"
54750 /// ],
54751 /// "type": "string"
54752 /// }
54753 /// }
54754 ///}
54755 /// ```
54756 /// </details>
54757 #[derive(Clone, Debug, Deserialize, Serialize)]
54758 pub struct SubAccountUsdtFuturesSummaryFutureAccountSummaryRespSubAccountListItem {
54759 ///The sum of BUSD and USDT
54760 pub asset: String,
54761 pub email: String,
54762 #[serde(rename = "totalInitialMargin")]
54763 pub total_initial_margin: String,
54764 #[serde(rename = "totalMaintenanceMargin")]
54765 pub total_maintenance_margin: String,
54766 #[serde(rename = "totalMarginBalance")]
54767 pub total_margin_balance: String,
54768 #[serde(rename = "totalOpenOrderInitialMargin")]
54769 pub total_open_order_initial_margin: String,
54770 #[serde(rename = "totalPositionInitialMargin")]
54771 pub total_position_initial_margin: String,
54772 #[serde(rename = "totalUnrealizedProfit")]
54773 pub total_unrealized_profit: String,
54774 #[serde(rename = "totalWalletBalance")]
54775 pub total_wallet_balance: String,
54776 }
54777 impl From<&SubAccountUsdtFuturesSummaryFutureAccountSummaryRespSubAccountListItem>
54778 for SubAccountUsdtFuturesSummaryFutureAccountSummaryRespSubAccountListItem {
54779 fn from(
54780 value: &SubAccountUsdtFuturesSummaryFutureAccountSummaryRespSubAccountListItem,
54781 ) -> Self {
54782 value.clone()
54783 }
54784 }
54785 ///SubAccountVirtualSubAccountResponse
54786 ///
54787 /// <details><summary>JSON schema</summary>
54788 ///
54789 /// ```json
54790 ///{
54791 /// "type": "object",
54792 /// "required": [
54793 /// "email"
54794 /// ],
54795 /// "properties": {
54796 /// "email": {
54797 /// "examples": [
54798 /// "addsdd_virtual@aasaixwqnoemail.com"
54799 /// ],
54800 /// "type": "string"
54801 /// }
54802 /// }
54803 ///}
54804 /// ```
54805 /// </details>
54806 #[derive(Clone, Debug, Deserialize, Serialize)]
54807 pub struct SubAccountVirtualSubAccountResponse {
54808 pub email: String,
54809 }
54810 impl From<&SubAccountVirtualSubAccountResponse>
54811 for SubAccountVirtualSubAccountResponse {
54812 fn from(value: &SubAccountVirtualSubAccountResponse) -> Self {
54813 value.clone()
54814 }
54815 }
54816 ///SwapHistoryResponseItem
54817 ///
54818 /// <details><summary>JSON schema</summary>
54819 ///
54820 /// ```json
54821 ///{
54822 /// "type": "object",
54823 /// "required": [
54824 /// "baseAsset",
54825 /// "baseQty",
54826 /// "fee",
54827 /// "price",
54828 /// "quoteAsset",
54829 /// "quoteQty",
54830 /// "status",
54831 /// "swapId",
54832 /// "swapTime"
54833 /// ],
54834 /// "properties": {
54835 /// "baseAsset": {
54836 /// "examples": [
54837 /// "BUSD"
54838 /// ],
54839 /// "type": "string"
54840 /// },
54841 /// "baseQty": {
54842 /// "examples": [
54843 /// 299975
54844 /// ],
54845 /// "type": "number",
54846 /// "format": "double"
54847 /// },
54848 /// "fee": {
54849 /// "examples": [
54850 /// 120
54851 /// ],
54852 /// "type": "number",
54853 /// "format": "double"
54854 /// },
54855 /// "price": {
54856 /// "examples": [
54857 /// 1.00008334
54858 /// ],
54859 /// "type": "number",
54860 /// "format": "double"
54861 /// },
54862 /// "quoteAsset": {
54863 /// "examples": [
54864 /// "USDT"
54865 /// ],
54866 /// "type": "string"
54867 /// },
54868 /// "quoteQty": {
54869 /// "examples": [
54870 /// 300000
54871 /// ],
54872 /// "type": "number",
54873 /// "format": "double"
54874 /// },
54875 /// "status": {
54876 /// "description": "0: pending, 1: success, 2: failed",
54877 /// "examples": [
54878 /// 0
54879 /// ],
54880 /// "type": "integer",
54881 /// "format": "int32"
54882 /// },
54883 /// "swapId": {
54884 /// "examples": [
54885 /// 2314
54886 /// ],
54887 /// "type": "integer",
54888 /// "format": "int64"
54889 /// },
54890 /// "swapTime": {
54891 /// "examples": [
54892 /// 1565770342148
54893 /// ],
54894 /// "type": "integer",
54895 /// "format": "int64"
54896 /// }
54897 /// }
54898 ///}
54899 /// ```
54900 /// </details>
54901 #[derive(Clone, Debug, Deserialize, Serialize)]
54902 pub struct SwapHistoryResponseItem {
54903 #[serde(rename = "baseAsset")]
54904 pub base_asset: String,
54905 #[serde(rename = "baseQty")]
54906 pub base_qty: f64,
54907 pub fee: f64,
54908 pub price: f64,
54909 #[serde(rename = "quoteAsset")]
54910 pub quote_asset: String,
54911 #[serde(rename = "quoteQty")]
54912 pub quote_qty: f64,
54913 ///0: pending, 1: success, 2: failed
54914 pub status: i32,
54915 #[serde(rename = "swapId")]
54916 pub swap_id: i64,
54917 #[serde(rename = "swapTime")]
54918 pub swap_time: i64,
54919 }
54920 impl From<&SwapHistoryResponseItem> for SwapHistoryResponseItem {
54921 fn from(value: &SwapHistoryResponseItem) -> Self {
54922 value.clone()
54923 }
54924 }
54925 ///SystemStatusResponse
54926 ///
54927 /// <details><summary>JSON schema</summary>
54928 ///
54929 /// ```json
54930 ///{
54931 /// "type": "object",
54932 /// "required": [
54933 /// "msg",
54934 /// "status"
54935 /// ],
54936 /// "properties": {
54937 /// "msg": {
54938 /// "description": "\"normal\", \"system_maintenance\"",
54939 /// "examples": [
54940 /// "normal"
54941 /// ],
54942 /// "type": "string"
54943 /// },
54944 /// "status": {
54945 /// "description": "0: normal, 1:system maintenance",
54946 /// "examples": [
54947 /// 0
54948 /// ],
54949 /// "type": "integer",
54950 /// "format": "int32"
54951 /// }
54952 /// }
54953 ///}
54954 /// ```
54955 /// </details>
54956 #[derive(Clone, Debug, Deserialize, Serialize)]
54957 pub struct SystemStatusResponse {
54958 ///"normal", "system_maintenance"
54959 pub msg: String,
54960 ///0: normal, 1:system maintenance
54961 pub status: i32,
54962 }
54963 impl From<&SystemStatusResponse> for SystemStatusResponse {
54964 fn from(value: &SystemStatusResponse) -> Self {
54965 value.clone()
54966 }
54967 }
54968 ///Ticker
54969 ///
54970 /// <details><summary>JSON schema</summary>
54971 ///
54972 /// ```json
54973 ///{
54974 /// "type": "object",
54975 /// "required": [
54976 /// "askPrice",
54977 /// "askQty",
54978 /// "bidPrice",
54979 /// "bidQty",
54980 /// "closeTime",
54981 /// "count",
54982 /// "firstId",
54983 /// "highPrice",
54984 /// "lastId",
54985 /// "lastPrice",
54986 /// "lowPrice",
54987 /// "openPrice",
54988 /// "openTime",
54989 /// "prevClosePrice",
54990 /// "priceChange",
54991 /// "priceChangePercent",
54992 /// "quoteVolume",
54993 /// "symbol",
54994 /// "volume"
54995 /// ],
54996 /// "properties": {
54997 /// "askPrice": {
54998 /// "examples": [
54999 /// "16.35920000"
55000 /// ],
55001 /// "type": "string"
55002 /// },
55003 /// "askQty": {
55004 /// "examples": [
55005 /// "25.06000000"
55006 /// ],
55007 /// "type": "string"
55008 /// },
55009 /// "bidPrice": {
55010 /// "examples": [
55011 /// "16.34488284"
55012 /// ],
55013 /// "type": "string"
55014 /// },
55015 /// "bidQty": {
55016 /// "examples": [
55017 /// "16.34488284"
55018 /// ],
55019 /// "type": "string"
55020 /// },
55021 /// "closeTime": {
55022 /// "examples": [
55023 /// 1592895188637
55024 /// ],
55025 /// "type": "integer",
55026 /// "format": "int64"
55027 /// },
55028 /// "count": {
55029 /// "examples": [
55030 /// 55958
55031 /// ],
55032 /// "type": "integer",
55033 /// "format": "int64"
55034 /// },
55035 /// "firstId": {
55036 /// "examples": [
55037 /// 62683296
55038 /// ],
55039 /// "type": "integer",
55040 /// "format": "int64"
55041 /// },
55042 /// "highPrice": {
55043 /// "examples": [
55044 /// "16.55000000"
55045 /// ],
55046 /// "type": "string"
55047 /// },
55048 /// "lastId": {
55049 /// "examples": [
55050 /// 62739253
55051 /// ],
55052 /// "type": "integer",
55053 /// "format": "int64"
55054 /// },
55055 /// "lastPrice": {
55056 /// "examples": [
55057 /// "27.84000000"
55058 /// ],
55059 /// "type": "string"
55060 /// },
55061 /// "lowPrice": {
55062 /// "examples": [
55063 /// "16.16940000"
55064 /// ],
55065 /// "type": "string"
55066 /// },
55067 /// "openPrice": {
55068 /// "examples": [
55069 /// "16.18760000"
55070 /// ],
55071 /// "type": "string"
55072 /// },
55073 /// "openTime": {
55074 /// "examples": [
55075 /// 1592808788637
55076 /// ],
55077 /// "type": "integer",
55078 /// "format": "int64"
55079 /// },
55080 /// "prevClosePrice": {
55081 /// "examples": [
55082 /// "16.35920000"
55083 /// ],
55084 /// "type": "string"
55085 /// },
55086 /// "priceChange": {
55087 /// "examples": [
55088 /// "0.17160000"
55089 /// ],
55090 /// "type": "string"
55091 /// },
55092 /// "priceChangePercent": {
55093 /// "examples": [
55094 /// "1.060"
55095 /// ],
55096 /// "type": "string"
55097 /// },
55098 /// "quoteVolume": {
55099 /// "examples": [
55100 /// "27431289.14792300"
55101 /// ],
55102 /// "type": "string"
55103 /// },
55104 /// "symbol": {
55105 /// "examples": [
55106 /// "BNBBTC"
55107 /// ],
55108 /// "type": "string"
55109 /// },
55110 /// "volume": {
55111 /// "examples": [
55112 /// "1678279.95000000"
55113 /// ],
55114 /// "type": "string"
55115 /// }
55116 /// }
55117 ///}
55118 /// ```
55119 /// </details>
55120 #[derive(Clone, Debug, Deserialize, Serialize)]
55121 pub struct Ticker {
55122 #[serde(rename = "askPrice")]
55123 pub ask_price: String,
55124 #[serde(rename = "askQty")]
55125 pub ask_qty: String,
55126 #[serde(rename = "bidPrice")]
55127 pub bid_price: String,
55128 #[serde(rename = "bidQty")]
55129 pub bid_qty: String,
55130 #[serde(rename = "closeTime")]
55131 pub close_time: i64,
55132 pub count: i64,
55133 #[serde(rename = "firstId")]
55134 pub first_id: i64,
55135 #[serde(rename = "highPrice")]
55136 pub high_price: String,
55137 #[serde(rename = "lastId")]
55138 pub last_id: i64,
55139 #[serde(rename = "lastPrice")]
55140 pub last_price: String,
55141 #[serde(rename = "lowPrice")]
55142 pub low_price: String,
55143 #[serde(rename = "openPrice")]
55144 pub open_price: String,
55145 #[serde(rename = "openTime")]
55146 pub open_time: i64,
55147 #[serde(rename = "prevClosePrice")]
55148 pub prev_close_price: String,
55149 #[serde(rename = "priceChange")]
55150 pub price_change: String,
55151 #[serde(rename = "priceChangePercent")]
55152 pub price_change_percent: String,
55153 #[serde(rename = "quoteVolume")]
55154 pub quote_volume: String,
55155 pub symbol: String,
55156 pub volume: String,
55157 }
55158 impl From<&Ticker> for Ticker {
55159 fn from(value: &Ticker) -> Self {
55160 value.clone()
55161 }
55162 }
55163 ///Ticker24hrResponse
55164 ///
55165 /// <details><summary>JSON schema</summary>
55166 ///
55167 /// ```json
55168 ///{
55169 /// "oneOf": [
55170 /// {
55171 /// "$ref": "#/components/schemas/ticker"
55172 /// },
55173 /// {
55174 /// "$ref": "#/components/schemas/tickerList"
55175 /// }
55176 /// ]
55177 ///}
55178 /// ```
55179 /// </details>
55180 #[derive(Clone, Debug, Deserialize, Serialize)]
55181 #[serde(untagged)]
55182 pub enum Ticker24hrResponse {
55183 Variant0(Ticker),
55184 Variant1(TickerList),
55185 }
55186 impl From<&Ticker24hrResponse> for Ticker24hrResponse {
55187 fn from(value: &Ticker24hrResponse) -> Self {
55188 value.clone()
55189 }
55190 }
55191 impl From<Ticker> for Ticker24hrResponse {
55192 fn from(value: Ticker) -> Self {
55193 Self::Variant0(value)
55194 }
55195 }
55196 impl From<TickerList> for Ticker24hrResponse {
55197 fn from(value: TickerList) -> Self {
55198 Self::Variant1(value)
55199 }
55200 }
55201 ///TickerList
55202 ///
55203 /// <details><summary>JSON schema</summary>
55204 ///
55205 /// ```json
55206 ///{
55207 /// "type": "array",
55208 /// "items": {
55209 /// "$ref": "#/components/schemas/ticker"
55210 /// }
55211 ///}
55212 /// ```
55213 /// </details>
55214 #[derive(Clone, Debug, Deserialize, Serialize)]
55215 pub struct TickerList(pub Vec<Ticker>);
55216 impl std::ops::Deref for TickerList {
55217 type Target = Vec<Ticker>;
55218 fn deref(&self) -> &Vec<Ticker> {
55219 &self.0
55220 }
55221 }
55222 impl From<TickerList> for Vec<Ticker> {
55223 fn from(value: TickerList) -> Self {
55224 value.0
55225 }
55226 }
55227 impl From<&TickerList> for TickerList {
55228 fn from(value: &TickerList) -> Self {
55229 value.clone()
55230 }
55231 }
55232 impl From<Vec<Ticker>> for TickerList {
55233 fn from(value: Vec<Ticker>) -> Self {
55234 Self(value)
55235 }
55236 }
55237 ///TickerOrderBookResponse
55238 ///
55239 /// <details><summary>JSON schema</summary>
55240 ///
55241 /// ```json
55242 ///{
55243 /// "oneOf": [
55244 /// {
55245 /// "$ref": "#/components/schemas/bookTicker"
55246 /// },
55247 /// {
55248 /// "$ref": "#/components/schemas/bookTickerList"
55249 /// }
55250 /// ]
55251 ///}
55252 /// ```
55253 /// </details>
55254 #[derive(Clone, Debug, Deserialize, Serialize)]
55255 #[serde(untagged)]
55256 pub enum TickerOrderBookResponse {
55257 Variant0(BookTicker),
55258 Variant1(BookTickerList),
55259 }
55260 impl From<&TickerOrderBookResponse> for TickerOrderBookResponse {
55261 fn from(value: &TickerOrderBookResponse) -> Self {
55262 value.clone()
55263 }
55264 }
55265 impl From<BookTicker> for TickerOrderBookResponse {
55266 fn from(value: BookTicker) -> Self {
55267 Self::Variant0(value)
55268 }
55269 }
55270 impl From<BookTickerList> for TickerOrderBookResponse {
55271 fn from(value: BookTickerList) -> Self {
55272 Self::Variant1(value)
55273 }
55274 }
55275 ///TickerPriceResponse
55276 ///
55277 /// <details><summary>JSON schema</summary>
55278 ///
55279 /// ```json
55280 ///{
55281 /// "oneOf": [
55282 /// {
55283 /// "$ref": "#/components/schemas/priceTicker"
55284 /// },
55285 /// {
55286 /// "$ref": "#/components/schemas/priceTickerList"
55287 /// }
55288 /// ]
55289 ///}
55290 /// ```
55291 /// </details>
55292 #[derive(Clone, Debug, Deserialize, Serialize)]
55293 #[serde(untagged)]
55294 pub enum TickerPriceResponse {
55295 Variant0(PriceTicker),
55296 Variant1(PriceTickerList),
55297 }
55298 impl From<&TickerPriceResponse> for TickerPriceResponse {
55299 fn from(value: &TickerPriceResponse) -> Self {
55300 value.clone()
55301 }
55302 }
55303 impl From<PriceTicker> for TickerPriceResponse {
55304 fn from(value: PriceTicker) -> Self {
55305 Self::Variant0(value)
55306 }
55307 }
55308 impl From<PriceTickerList> for TickerPriceResponse {
55309 fn from(value: PriceTickerList) -> Self {
55310 Self::Variant1(value)
55311 }
55312 }
55313 ///TickerResponse
55314 ///
55315 /// <details><summary>JSON schema</summary>
55316 ///
55317 /// ```json
55318 ///{
55319 /// "type": "object",
55320 /// "required": [
55321 /// "closeTime",
55322 /// "count",
55323 /// "firstId",
55324 /// "highPrice",
55325 /// "lastId",
55326 /// "lastPrice",
55327 /// "lowPrice",
55328 /// "openPrice",
55329 /// "openTime",
55330 /// "priceChange",
55331 /// "priceChangePercent",
55332 /// "quoteVolume",
55333 /// "symbol",
55334 /// "volume",
55335 /// "weightedAvgPrice"
55336 /// ],
55337 /// "properties": {
55338 /// "closeTime": {
55339 /// "examples": [
55340 /// 1642031999999
55341 /// ],
55342 /// "type": "integer",
55343 /// "format": "int64"
55344 /// },
55345 /// "count": {
55346 /// "examples": [
55347 /// 61
55348 /// ],
55349 /// "type": "integer",
55350 /// "format": "int64"
55351 /// },
55352 /// "firstId": {
55353 /// "examples": [
55354 /// 0
55355 /// ],
55356 /// "type": "integer",
55357 /// "format": "int64"
55358 /// },
55359 /// "highPrice": {
55360 /// "examples": [
55361 /// "9.00000000"
55362 /// ],
55363 /// "type": "string"
55364 /// },
55365 /// "lastId": {
55366 /// "examples": [
55367 /// 60
55368 /// ],
55369 /// "type": "integer",
55370 /// "format": "int64"
55371 /// },
55372 /// "lastPrice": {
55373 /// "examples": [
55374 /// "1.00000000"
55375 /// ],
55376 /// "type": "string"
55377 /// },
55378 /// "lowPrice": {
55379 /// "examples": [
55380 /// "1.00000000"
55381 /// ],
55382 /// "type": "string"
55383 /// },
55384 /// "openPrice": {
55385 /// "examples": [
55386 /// "9.00000000"
55387 /// ],
55388 /// "type": "string"
55389 /// },
55390 /// "openTime": {
55391 /// "examples": [
55392 /// 1641859200000
55393 /// ],
55394 /// "type": "integer",
55395 /// "format": "int64"
55396 /// },
55397 /// "priceChange": {
55398 /// "examples": [
55399 /// "-8.00000000"
55400 /// ],
55401 /// "type": "string"
55402 /// },
55403 /// "priceChangePercent": {
55404 /// "examples": [
55405 /// "-88.889"
55406 /// ],
55407 /// "type": "string"
55408 /// },
55409 /// "quoteVolume": {
55410 /// "examples": [
55411 /// "487.00000000"
55412 /// ],
55413 /// "type": "string"
55414 /// },
55415 /// "symbol": {
55416 /// "examples": [
55417 /// "BNBBTC"
55418 /// ],
55419 /// "type": "string"
55420 /// },
55421 /// "volume": {
55422 /// "examples": [
55423 /// "187.00000000"
55424 /// ],
55425 /// "type": "string"
55426 /// },
55427 /// "weightedAvgPrice": {
55428 /// "examples": [
55429 /// "2.60427807"
55430 /// ],
55431 /// "type": "string"
55432 /// }
55433 /// }
55434 ///}
55435 /// ```
55436 /// </details>
55437 #[derive(Clone, Debug, Deserialize, Serialize)]
55438 pub struct TickerResponse {
55439 #[serde(rename = "closeTime")]
55440 pub close_time: i64,
55441 pub count: i64,
55442 #[serde(rename = "firstId")]
55443 pub first_id: i64,
55444 #[serde(rename = "highPrice")]
55445 pub high_price: String,
55446 #[serde(rename = "lastId")]
55447 pub last_id: i64,
55448 #[serde(rename = "lastPrice")]
55449 pub last_price: String,
55450 #[serde(rename = "lowPrice")]
55451 pub low_price: String,
55452 #[serde(rename = "openPrice")]
55453 pub open_price: String,
55454 #[serde(rename = "openTime")]
55455 pub open_time: i64,
55456 #[serde(rename = "priceChange")]
55457 pub price_change: String,
55458 #[serde(rename = "priceChangePercent")]
55459 pub price_change_percent: String,
55460 #[serde(rename = "quoteVolume")]
55461 pub quote_volume: String,
55462 pub symbol: String,
55463 pub volume: String,
55464 #[serde(rename = "weightedAvgPrice")]
55465 pub weighted_avg_price: String,
55466 }
55467 impl From<&TickerResponse> for TickerResponse {
55468 fn from(value: &TickerResponse) -> Self {
55469 value.clone()
55470 }
55471 }
55472 ///TimeResponse
55473 ///
55474 /// <details><summary>JSON schema</summary>
55475 ///
55476 /// ```json
55477 ///{
55478 /// "type": "object",
55479 /// "required": [
55480 /// "serverTime"
55481 /// ],
55482 /// "properties": {
55483 /// "serverTime": {
55484 /// "examples": [
55485 /// 1499827319559
55486 /// ],
55487 /// "type": "integer",
55488 /// "format": "int64"
55489 /// }
55490 /// }
55491 ///}
55492 /// ```
55493 /// </details>
55494 #[derive(Clone, Debug, Deserialize, Serialize)]
55495 pub struct TimeResponse {
55496 #[serde(rename = "serverTime")]
55497 pub server_time: i64,
55498 }
55499 impl From<&TimeResponse> for TimeResponse {
55500 fn from(value: &TimeResponse) -> Self {
55501 value.clone()
55502 }
55503 }
55504 ///ToggleBnbBurnInterestBnbBurn
55505 ///
55506 /// <details><summary>JSON schema</summary>
55507 ///
55508 /// ```json
55509 ///{
55510 /// "examples": [
55511 /// "false"
55512 /// ],
55513 /// "type": "string",
55514 /// "enum": [
55515 /// "true",
55516 /// "false"
55517 /// ]
55518 ///}
55519 /// ```
55520 /// </details>
55521 #[derive(
55522 Clone,
55523 Copy,
55524 Debug,
55525 Deserialize,
55526 Eq,
55527 Hash,
55528 Ord,
55529 PartialEq,
55530 PartialOrd,
55531 Serialize
55532 )]
55533 pub enum ToggleBnbBurnInterestBnbBurn {
55534 #[serde(rename = "true")]
55535 True,
55536 #[serde(rename = "false")]
55537 False,
55538 }
55539 impl From<&ToggleBnbBurnInterestBnbBurn> for ToggleBnbBurnInterestBnbBurn {
55540 fn from(value: &ToggleBnbBurnInterestBnbBurn) -> Self {
55541 value.clone()
55542 }
55543 }
55544 impl ToString for ToggleBnbBurnInterestBnbBurn {
55545 fn to_string(&self) -> String {
55546 match *self {
55547 Self::True => "true".to_string(),
55548 Self::False => "false".to_string(),
55549 }
55550 }
55551 }
55552 impl std::str::FromStr for ToggleBnbBurnInterestBnbBurn {
55553 type Err = self::error::ConversionError;
55554 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
55555 match value {
55556 "true" => Ok(Self::True),
55557 "false" => Ok(Self::False),
55558 _ => Err("invalid value".into()),
55559 }
55560 }
55561 }
55562 impl std::convert::TryFrom<&str> for ToggleBnbBurnInterestBnbBurn {
55563 type Error = self::error::ConversionError;
55564 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
55565 value.parse()
55566 }
55567 }
55568 impl std::convert::TryFrom<&String> for ToggleBnbBurnInterestBnbBurn {
55569 type Error = self::error::ConversionError;
55570 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
55571 value.parse()
55572 }
55573 }
55574 impl std::convert::TryFrom<String> for ToggleBnbBurnInterestBnbBurn {
55575 type Error = self::error::ConversionError;
55576 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
55577 value.parse()
55578 }
55579 }
55580 ///ToggleBnbBurnSpotBnbBurn
55581 ///
55582 /// <details><summary>JSON schema</summary>
55583 ///
55584 /// ```json
55585 ///{
55586 /// "examples": [
55587 /// "true"
55588 /// ],
55589 /// "type": "string",
55590 /// "enum": [
55591 /// "true",
55592 /// "false"
55593 /// ]
55594 ///}
55595 /// ```
55596 /// </details>
55597 #[derive(
55598 Clone,
55599 Copy,
55600 Debug,
55601 Deserialize,
55602 Eq,
55603 Hash,
55604 Ord,
55605 PartialEq,
55606 PartialOrd,
55607 Serialize
55608 )]
55609 pub enum ToggleBnbBurnSpotBnbBurn {
55610 #[serde(rename = "true")]
55611 True,
55612 #[serde(rename = "false")]
55613 False,
55614 }
55615 impl From<&ToggleBnbBurnSpotBnbBurn> for ToggleBnbBurnSpotBnbBurn {
55616 fn from(value: &ToggleBnbBurnSpotBnbBurn) -> Self {
55617 value.clone()
55618 }
55619 }
55620 impl ToString for ToggleBnbBurnSpotBnbBurn {
55621 fn to_string(&self) -> String {
55622 match *self {
55623 Self::True => "true".to_string(),
55624 Self::False => "false".to_string(),
55625 }
55626 }
55627 }
55628 impl std::str::FromStr for ToggleBnbBurnSpotBnbBurn {
55629 type Err = self::error::ConversionError;
55630 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
55631 match value {
55632 "true" => Ok(Self::True),
55633 "false" => Ok(Self::False),
55634 _ => Err("invalid value".into()),
55635 }
55636 }
55637 }
55638 impl std::convert::TryFrom<&str> for ToggleBnbBurnSpotBnbBurn {
55639 type Error = self::error::ConversionError;
55640 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
55641 value.parse()
55642 }
55643 }
55644 impl std::convert::TryFrom<&String> for ToggleBnbBurnSpotBnbBurn {
55645 type Error = self::error::ConversionError;
55646 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
55647 value.parse()
55648 }
55649 }
55650 impl std::convert::TryFrom<String> for ToggleBnbBurnSpotBnbBurn {
55651 type Error = self::error::ConversionError;
55652 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
55653 value.parse()
55654 }
55655 }
55656 ///Trade
55657 ///
55658 /// <details><summary>JSON schema</summary>
55659 ///
55660 /// ```json
55661 ///{
55662 /// "type": "object",
55663 /// "required": [
55664 /// "id",
55665 /// "isBestMatch",
55666 /// "isBuyerMaker",
55667 /// "price",
55668 /// "qty",
55669 /// "quoteQty",
55670 /// "time"
55671 /// ],
55672 /// "properties": {
55673 /// "id": {
55674 /// "description": "trade id",
55675 /// "examples": [
55676 /// 345196462
55677 /// ],
55678 /// "type": "integer",
55679 /// "format": "int64"
55680 /// },
55681 /// "isBestMatch": {
55682 /// "type": "boolean"
55683 /// },
55684 /// "isBuyerMaker": {
55685 /// "type": "boolean"
55686 /// },
55687 /// "price": {
55688 /// "description": "price",
55689 /// "examples": [
55690 /// "9638.99000000"
55691 /// ],
55692 /// "type": "string"
55693 /// },
55694 /// "qty": {
55695 /// "description": "amount of base asset",
55696 /// "examples": [
55697 /// "0.02077200"
55698 /// ],
55699 /// "type": "string"
55700 /// },
55701 /// "quoteQty": {
55702 /// "description": "amount of quote asset",
55703 /// "examples": [
55704 /// "0.02077200"
55705 /// ],
55706 /// "type": "string"
55707 /// },
55708 /// "time": {
55709 /// "description": "Trade executed timestamp, as same as `T` in the stream",
55710 /// "examples": [
55711 /// 1592887772684
55712 /// ],
55713 /// "type": "integer",
55714 /// "format": "int64"
55715 /// }
55716 /// }
55717 ///}
55718 /// ```
55719 /// </details>
55720 #[derive(Clone, Debug, Deserialize, Serialize)]
55721 pub struct Trade {
55722 ///trade id
55723 pub id: i64,
55724 #[serde(rename = "isBestMatch")]
55725 pub is_best_match: bool,
55726 #[serde(rename = "isBuyerMaker")]
55727 pub is_buyer_maker: bool,
55728 ///price
55729 pub price: String,
55730 ///amount of base asset
55731 pub qty: String,
55732 ///amount of quote asset
55733 #[serde(rename = "quoteQty")]
55734 pub quote_qty: String,
55735 ///Trade executed timestamp, as same as `T` in the stream
55736 pub time: i64,
55737 }
55738 impl From<&Trade> for Trade {
55739 fn from(value: &Trade) -> Self {
55740 value.clone()
55741 }
55742 }
55743 ///Transaction
55744 ///
55745 /// <details><summary>JSON schema</summary>
55746 ///
55747 /// ```json
55748 ///{
55749 /// "type": "object",
55750 /// "required": [
55751 /// "tranId"
55752 /// ],
55753 /// "properties": {
55754 /// "tranId": {
55755 /// "description": "transaction id",
55756 /// "examples": [
55757 /// 345196462
55758 /// ],
55759 /// "type": "integer",
55760 /// "format": "int64"
55761 /// }
55762 /// }
55763 ///}
55764 /// ```
55765 /// </details>
55766 #[derive(Clone, Debug, Deserialize, Serialize)]
55767 pub struct Transaction {
55768 ///transaction id
55769 #[serde(rename = "tranId")]
55770 pub tran_id: i64,
55771 }
55772 impl From<&Transaction> for Transaction {
55773 fn from(value: &Transaction) -> Self {
55774 value.clone()
55775 }
55776 }
55777 ///UiKlinesInterval
55778 ///
55779 /// <details><summary>JSON schema</summary>
55780 ///
55781 /// ```json
55782 ///{
55783 /// "examples": [
55784 /// "\"1m\""
55785 /// ],
55786 /// "type": "string",
55787 /// "enum": [
55788 /// "1s",
55789 /// "1m",
55790 /// "3m",
55791 /// "5m",
55792 /// "15m",
55793 /// "30m",
55794 /// "1h",
55795 /// "2h",
55796 /// "4h",
55797 /// "6h",
55798 /// "8h",
55799 /// "12h",
55800 /// "1d",
55801 /// "3d",
55802 /// "1w"
55803 /// ]
55804 ///}
55805 /// ```
55806 /// </details>
55807 #[derive(
55808 Clone,
55809 Copy,
55810 Debug,
55811 Deserialize,
55812 Eq,
55813 Hash,
55814 Ord,
55815 PartialEq,
55816 PartialOrd,
55817 Serialize
55818 )]
55819 pub enum UiKlinesInterval {
55820 #[serde(rename = "1s")]
55821 _1s,
55822 #[serde(rename = "1m")]
55823 _1m,
55824 #[serde(rename = "3m")]
55825 _3m,
55826 #[serde(rename = "5m")]
55827 _5m,
55828 #[serde(rename = "15m")]
55829 _15m,
55830 #[serde(rename = "30m")]
55831 _30m,
55832 #[serde(rename = "1h")]
55833 _1h,
55834 #[serde(rename = "2h")]
55835 _2h,
55836 #[serde(rename = "4h")]
55837 _4h,
55838 #[serde(rename = "6h")]
55839 _6h,
55840 #[serde(rename = "8h")]
55841 _8h,
55842 #[serde(rename = "12h")]
55843 _12h,
55844 #[serde(rename = "1d")]
55845 _1d,
55846 #[serde(rename = "3d")]
55847 _3d,
55848 #[serde(rename = "1w")]
55849 _1w,
55850 }
55851 impl From<&UiKlinesInterval> for UiKlinesInterval {
55852 fn from(value: &UiKlinesInterval) -> Self {
55853 value.clone()
55854 }
55855 }
55856 impl ToString for UiKlinesInterval {
55857 fn to_string(&self) -> String {
55858 match *self {
55859 Self::_1s => "1s".to_string(),
55860 Self::_1m => "1m".to_string(),
55861 Self::_3m => "3m".to_string(),
55862 Self::_5m => "5m".to_string(),
55863 Self::_15m => "15m".to_string(),
55864 Self::_30m => "30m".to_string(),
55865 Self::_1h => "1h".to_string(),
55866 Self::_2h => "2h".to_string(),
55867 Self::_4h => "4h".to_string(),
55868 Self::_6h => "6h".to_string(),
55869 Self::_8h => "8h".to_string(),
55870 Self::_12h => "12h".to_string(),
55871 Self::_1d => "1d".to_string(),
55872 Self::_3d => "3d".to_string(),
55873 Self::_1w => "1w".to_string(),
55874 }
55875 }
55876 }
55877 impl std::str::FromStr for UiKlinesInterval {
55878 type Err = self::error::ConversionError;
55879 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
55880 match value {
55881 "1s" => Ok(Self::_1s),
55882 "1m" => Ok(Self::_1m),
55883 "3m" => Ok(Self::_3m),
55884 "5m" => Ok(Self::_5m),
55885 "15m" => Ok(Self::_15m),
55886 "30m" => Ok(Self::_30m),
55887 "1h" => Ok(Self::_1h),
55888 "2h" => Ok(Self::_2h),
55889 "4h" => Ok(Self::_4h),
55890 "6h" => Ok(Self::_6h),
55891 "8h" => Ok(Self::_8h),
55892 "12h" => Ok(Self::_12h),
55893 "1d" => Ok(Self::_1d),
55894 "3d" => Ok(Self::_3d),
55895 "1w" => Ok(Self::_1w),
55896 _ => Err("invalid value".into()),
55897 }
55898 }
55899 }
55900 impl std::convert::TryFrom<&str> for UiKlinesInterval {
55901 type Error = self::error::ConversionError;
55902 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
55903 value.parse()
55904 }
55905 }
55906 impl std::convert::TryFrom<&String> for UiKlinesInterval {
55907 type Error = self::error::ConversionError;
55908 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
55909 value.parse()
55910 }
55911 }
55912 impl std::convert::TryFrom<String> for UiKlinesInterval {
55913 type Error = self::error::ConversionError;
55914 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
55915 value.parse()
55916 }
55917 }
55918 ///UiKlinesResponseItemItem
55919 ///
55920 /// <details><summary>JSON schema</summary>
55921 ///
55922 /// ```json
55923 ///{
55924 /// "oneOf": [
55925 /// {
55926 /// "type": "integer",
55927 /// "format": "int64"
55928 /// },
55929 /// {
55930 /// "type": "string"
55931 /// }
55932 /// ],
55933 /// "maxItems": 12,
55934 /// "minItems": 12
55935 ///}
55936 /// ```
55937 /// </details>
55938 #[derive(Clone, Debug, Deserialize, Serialize)]
55939 #[serde(untagged)]
55940 pub enum UiKlinesResponseItemItem {
55941 Variant0(i64),
55942 Variant1(String),
55943 }
55944 impl From<&UiKlinesResponseItemItem> for UiKlinesResponseItemItem {
55945 fn from(value: &UiKlinesResponseItemItem) -> Self {
55946 value.clone()
55947 }
55948 }
55949 impl std::str::FromStr for UiKlinesResponseItemItem {
55950 type Err = self::error::ConversionError;
55951 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
55952 if let Ok(v) = value.parse() {
55953 Ok(Self::Variant0(v))
55954 } else if let Ok(v) = value.parse() {
55955 Ok(Self::Variant1(v))
55956 } else {
55957 Err("string conversion failed for all variants".into())
55958 }
55959 }
55960 }
55961 impl std::convert::TryFrom<&str> for UiKlinesResponseItemItem {
55962 type Error = self::error::ConversionError;
55963 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
55964 value.parse()
55965 }
55966 }
55967 impl std::convert::TryFrom<&String> for UiKlinesResponseItemItem {
55968 type Error = self::error::ConversionError;
55969 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
55970 value.parse()
55971 }
55972 }
55973 impl std::convert::TryFrom<String> for UiKlinesResponseItemItem {
55974 type Error = self::error::ConversionError;
55975 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
55976 value.parse()
55977 }
55978 }
55979 impl ToString for UiKlinesResponseItemItem {
55980 fn to_string(&self) -> String {
55981 match self {
55982 Self::Variant0(x) => x.to_string(),
55983 Self::Variant1(x) => x.to_string(),
55984 }
55985 }
55986 }
55987 impl From<i64> for UiKlinesResponseItemItem {
55988 fn from(value: i64) -> Self {
55989 Self::Variant0(value)
55990 }
55991 }
55992 ///UniversalTransferMasterAccountFromAccountType
55993 ///
55994 /// <details><summary>JSON schema</summary>
55995 ///
55996 /// ```json
55997 ///{
55998 /// "type": "string",
55999 /// "enum": [
56000 /// "SPOT",
56001 /// "USDT_FUTURE",
56002 /// "COIN_FUTURE",
56003 /// "MARGIN",
56004 /// "ISOLATED_MARGIN"
56005 /// ]
56006 ///}
56007 /// ```
56008 /// </details>
56009 #[derive(
56010 Clone,
56011 Copy,
56012 Debug,
56013 Deserialize,
56014 Eq,
56015 Hash,
56016 Ord,
56017 PartialEq,
56018 PartialOrd,
56019 Serialize
56020 )]
56021 pub enum UniversalTransferMasterAccountFromAccountType {
56022 #[serde(rename = "SPOT")]
56023 Spot,
56024 #[serde(rename = "USDT_FUTURE")]
56025 UsdtFuture,
56026 #[serde(rename = "COIN_FUTURE")]
56027 CoinFuture,
56028 #[serde(rename = "MARGIN")]
56029 Margin,
56030 #[serde(rename = "ISOLATED_MARGIN")]
56031 IsolatedMargin,
56032 }
56033 impl From<&UniversalTransferMasterAccountFromAccountType>
56034 for UniversalTransferMasterAccountFromAccountType {
56035 fn from(value: &UniversalTransferMasterAccountFromAccountType) -> Self {
56036 value.clone()
56037 }
56038 }
56039 impl ToString for UniversalTransferMasterAccountFromAccountType {
56040 fn to_string(&self) -> String {
56041 match *self {
56042 Self::Spot => "SPOT".to_string(),
56043 Self::UsdtFuture => "USDT_FUTURE".to_string(),
56044 Self::CoinFuture => "COIN_FUTURE".to_string(),
56045 Self::Margin => "MARGIN".to_string(),
56046 Self::IsolatedMargin => "ISOLATED_MARGIN".to_string(),
56047 }
56048 }
56049 }
56050 impl std::str::FromStr for UniversalTransferMasterAccountFromAccountType {
56051 type Err = self::error::ConversionError;
56052 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
56053 match value {
56054 "SPOT" => Ok(Self::Spot),
56055 "USDT_FUTURE" => Ok(Self::UsdtFuture),
56056 "COIN_FUTURE" => Ok(Self::CoinFuture),
56057 "MARGIN" => Ok(Self::Margin),
56058 "ISOLATED_MARGIN" => Ok(Self::IsolatedMargin),
56059 _ => Err("invalid value".into()),
56060 }
56061 }
56062 }
56063 impl std::convert::TryFrom<&str> for UniversalTransferMasterAccountFromAccountType {
56064 type Error = self::error::ConversionError;
56065 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
56066 value.parse()
56067 }
56068 }
56069 impl std::convert::TryFrom<&String>
56070 for UniversalTransferMasterAccountFromAccountType {
56071 type Error = self::error::ConversionError;
56072 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
56073 value.parse()
56074 }
56075 }
56076 impl std::convert::TryFrom<String>
56077 for UniversalTransferMasterAccountFromAccountType {
56078 type Error = self::error::ConversionError;
56079 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
56080 value.parse()
56081 }
56082 }
56083 ///UniversalTransferMasterAccountResponse
56084 ///
56085 /// <details><summary>JSON schema</summary>
56086 ///
56087 /// ```json
56088 ///{
56089 /// "type": "object",
56090 /// "required": [
56091 /// "clientTranId",
56092 /// "tranId"
56093 /// ],
56094 /// "properties": {
56095 /// "clientTranId": {
56096 /// "examples": [
56097 /// "11945860694"
56098 /// ],
56099 /// "type": "string"
56100 /// },
56101 /// "tranId": {
56102 /// "examples": [
56103 /// 11945860693
56104 /// ],
56105 /// "type": "integer",
56106 /// "format": "int64"
56107 /// }
56108 /// }
56109 ///}
56110 /// ```
56111 /// </details>
56112 #[derive(Clone, Debug, Deserialize, Serialize)]
56113 pub struct UniversalTransferMasterAccountResponse {
56114 #[serde(rename = "clientTranId")]
56115 pub client_tran_id: String,
56116 #[serde(rename = "tranId")]
56117 pub tran_id: i64,
56118 }
56119 impl From<&UniversalTransferMasterAccountResponse>
56120 for UniversalTransferMasterAccountResponse {
56121 fn from(value: &UniversalTransferMasterAccountResponse) -> Self {
56122 value.clone()
56123 }
56124 }
56125 ///UniversalTransferMasterAccountToAccountType
56126 ///
56127 /// <details><summary>JSON schema</summary>
56128 ///
56129 /// ```json
56130 ///{
56131 /// "type": "string",
56132 /// "enum": [
56133 /// "SPOT",
56134 /// "USDT_FUTURE",
56135 /// "COIN_FUTURE",
56136 /// "MARGIN",
56137 /// "ISOLATED_MARGIN"
56138 /// ]
56139 ///}
56140 /// ```
56141 /// </details>
56142 #[derive(
56143 Clone,
56144 Copy,
56145 Debug,
56146 Deserialize,
56147 Eq,
56148 Hash,
56149 Ord,
56150 PartialEq,
56151 PartialOrd,
56152 Serialize
56153 )]
56154 pub enum UniversalTransferMasterAccountToAccountType {
56155 #[serde(rename = "SPOT")]
56156 Spot,
56157 #[serde(rename = "USDT_FUTURE")]
56158 UsdtFuture,
56159 #[serde(rename = "COIN_FUTURE")]
56160 CoinFuture,
56161 #[serde(rename = "MARGIN")]
56162 Margin,
56163 #[serde(rename = "ISOLATED_MARGIN")]
56164 IsolatedMargin,
56165 }
56166 impl From<&UniversalTransferMasterAccountToAccountType>
56167 for UniversalTransferMasterAccountToAccountType {
56168 fn from(value: &UniversalTransferMasterAccountToAccountType) -> Self {
56169 value.clone()
56170 }
56171 }
56172 impl ToString for UniversalTransferMasterAccountToAccountType {
56173 fn to_string(&self) -> String {
56174 match *self {
56175 Self::Spot => "SPOT".to_string(),
56176 Self::UsdtFuture => "USDT_FUTURE".to_string(),
56177 Self::CoinFuture => "COIN_FUTURE".to_string(),
56178 Self::Margin => "MARGIN".to_string(),
56179 Self::IsolatedMargin => "ISOLATED_MARGIN".to_string(),
56180 }
56181 }
56182 }
56183 impl std::str::FromStr for UniversalTransferMasterAccountToAccountType {
56184 type Err = self::error::ConversionError;
56185 fn from_str(value: &str) -> Result<Self, self::error::ConversionError> {
56186 match value {
56187 "SPOT" => Ok(Self::Spot),
56188 "USDT_FUTURE" => Ok(Self::UsdtFuture),
56189 "COIN_FUTURE" => Ok(Self::CoinFuture),
56190 "MARGIN" => Ok(Self::Margin),
56191 "ISOLATED_MARGIN" => Ok(Self::IsolatedMargin),
56192 _ => Err("invalid value".into()),
56193 }
56194 }
56195 }
56196 impl std::convert::TryFrom<&str> for UniversalTransferMasterAccountToAccountType {
56197 type Error = self::error::ConversionError;
56198 fn try_from(value: &str) -> Result<Self, self::error::ConversionError> {
56199 value.parse()
56200 }
56201 }
56202 impl std::convert::TryFrom<&String> for UniversalTransferMasterAccountToAccountType {
56203 type Error = self::error::ConversionError;
56204 fn try_from(value: &String) -> Result<Self, self::error::ConversionError> {
56205 value.parse()
56206 }
56207 }
56208 impl std::convert::TryFrom<String> for UniversalTransferMasterAccountToAccountType {
56209 type Error = self::error::ConversionError;
56210 fn try_from(value: String) -> Result<Self, self::error::ConversionError> {
56211 value.parse()
56212 }
56213 }
56214 ///UserDataStreamIsolatedResponse
56215 ///
56216 /// <details><summary>JSON schema</summary>
56217 ///
56218 /// ```json
56219 ///{
56220 /// "type": "object",
56221 /// "required": [
56222 /// "listenKey"
56223 /// ],
56224 /// "properties": {
56225 /// "listenKey": {
56226 /// "examples": [
56227 /// "T3ee22BIYuWqmvne0HNq2A2WsFlEtLhvWCtItw6ffhhdmjifQ2tRbuKkTHhr"
56228 /// ],
56229 /// "type": "string"
56230 /// }
56231 /// }
56232 ///}
56233 /// ```
56234 /// </details>
56235 #[derive(Clone, Debug, Deserialize, Serialize)]
56236 pub struct UserDataStreamIsolatedResponse {
56237 #[serde(rename = "listenKey")]
56238 pub listen_key: String,
56239 }
56240 impl From<&UserDataStreamIsolatedResponse> for UserDataStreamIsolatedResponse {
56241 fn from(value: &UserDataStreamIsolatedResponse) -> Self {
56242 value.clone()
56243 }
56244 }
56245}
56246#[derive(Clone, Debug)]
56247/**Client for Binance Public Spot API
56248
56249OpenAPI Specifications for the Binance Public Spot API
56250
56251API documents:
56252 - [https://github.com/binance/binance-spot-api-docs](https://github.com/binance/binance-spot-api-docs)
56253 - [https://binance-docs.github.io/apidocs/spot/en](https://binance-docs.github.io/apidocs/spot/en)
56254
56255Version: 1.0*/
56256pub struct Client {
56257 pub(crate) baseurl: String,
56258 pub(crate) client: reqwest::Client,
56259 pub(crate) inner: crate::AuthProvider,
56260}
56261impl Client {
56262 /// Create a new client.
56263 ///
56264 /// `baseurl` is the base URL provided to the internal
56265 /// `reqwest::Client`, and should include a scheme and hostname,
56266 /// as well as port and a path stem if applicable.
56267 pub fn new(baseurl: &str, inner: crate::AuthProvider) -> Self {
56268 #[cfg(not(target_arch = "wasm32"))]
56269 let client = {
56270 let dur = std::time::Duration::from_secs(15);
56271 reqwest::ClientBuilder::new().connect_timeout(dur).timeout(dur)
56272 };
56273 #[cfg(target_arch = "wasm32")]
56274 let client = reqwest::ClientBuilder::new();
56275 Self::new_with_client(baseurl, client.build().unwrap(), inner)
56276 }
56277 /// Construct a new client with an existing `reqwest::Client`,
56278 /// allowing more control over its configuration.
56279 ///
56280 /// `baseurl` is the base URL provided to the internal
56281 /// `reqwest::Client`, and should include a scheme and hostname,
56282 /// as well as port and a path stem if applicable.
56283 pub fn new_with_client(
56284 baseurl: &str,
56285 client: reqwest::Client,
56286 inner: crate::AuthProvider,
56287 ) -> Self {
56288 Self {
56289 baseurl: baseurl.to_string(),
56290 client,
56291 inner,
56292 }
56293 }
56294 /// Get the base URL to which requests are made.
56295 pub fn baseurl(&self) -> &String {
56296 &self.baseurl
56297 }
56298 /// Get the internal `reqwest::Client` used to make requests.
56299 pub fn client(&self) -> &reqwest::Client {
56300 &self.client
56301 }
56302 /// Get the version of this API.
56303 ///
56304 /// This string is pulled directly from the source OpenAPI
56305 /// document and may be in any format the API selects.
56306 pub fn api_version(&self) -> &'static str {
56307 "1.0"
56308 }
56309 /// Return a reference to the inner type stored in `self`.
56310 pub fn inner(&self) -> &crate::AuthProvider {
56311 &self.inner
56312 }
56313}
56314#[allow(clippy::all)]
56315impl Client {
56316 /**Test Connectivity
56317
56318Test connectivity to the Rest API.
56319
56320Weight(IP): 1
56321
56322Sends a `GET` request to `/api/v3/ping`
56323
56324*/
56325 pub async fn ping<'a>(
56326 &'a self,
56327 ) -> Result<ResponseValue<serde_json::Map<String, serde_json::Value>>, Error<()>> {
56328 let url = format!("{}/api/v3/ping", self.baseurl,);
56329 #[allow(unused_mut)]
56330 let mut request = self
56331 .client
56332 .get(url)
56333 .header(
56334 reqwest::header::ACCEPT,
56335 reqwest::header::HeaderValue::from_static("application/json"),
56336 )
56337 .build()?;
56338 (crate::pre_hook)(&self.inner, &request);
56339 let result = self.client.execute(request).await;
56340 (crate::post_hook)(&self.inner, &result);
56341 let response = result?;
56342 match response.status().as_u16() {
56343 200u16 => ResponseValue::from_response(response).await,
56344 _ => Err(Error::UnexpectedResponse(response)),
56345 }
56346 }
56347 /**Check Server Time
56348
56349Test connectivity to the Rest API and get the current server time.
56350
56351Weight(IP): 1
56352
56353Sends a `GET` request to `/api/v3/time`
56354
56355*/
56356 pub async fn time<'a>(
56357 &'a self,
56358 ) -> Result<ResponseValue<types::TimeResponse>, Error<()>> {
56359 let url = format!("{}/api/v3/time", self.baseurl,);
56360 #[allow(unused_mut)]
56361 let mut request = self
56362 .client
56363 .get(url)
56364 .header(
56365 reqwest::header::ACCEPT,
56366 reqwest::header::HeaderValue::from_static("application/json"),
56367 )
56368 .build()?;
56369 (crate::pre_hook)(&self.inner, &request);
56370 let result = self.client.execute(request).await;
56371 (crate::post_hook)(&self.inner, &result);
56372 let response = result?;
56373 match response.status().as_u16() {
56374 200u16 => ResponseValue::from_response(response).await,
56375 _ => Err(Error::UnexpectedResponse(response)),
56376 }
56377 }
56378 /**Exchange Information
56379
56380Current exchange trading rules and symbol information
56381
56382- If any symbol provided in either symbol or symbols do not exist, the endpoint will throw an error.
56383
56384Weight(IP): 10
56385
56386Sends a `GET` request to `/api/v3/exchangeInfo`
56387
56388Arguments:
56389- `permissions`
56390- `symbol`: Trading symbol, e.g. BNBUSDT
56391- `symbols`
56392*/
56393 pub async fn exchange_info<'a>(
56394 &'a self,
56395 permissions: Option<&'a str>,
56396 symbol: Option<&'a str>,
56397 symbols: Option<&'a str>,
56398 ) -> Result<ResponseValue<types::ExchangeInfoResponse>, Error<types::Error>> {
56399 let url = format!("{}/api/v3/exchangeInfo", self.baseurl,);
56400 let mut query = Vec::with_capacity(3usize);
56401 if let Some(v) = &permissions {
56402 query.push(("permissions", v.to_string()));
56403 }
56404 if let Some(v) = &symbol {
56405 query.push(("symbol", v.to_string()));
56406 }
56407 if let Some(v) = &symbols {
56408 query.push(("symbols", v.to_string()));
56409 }
56410 #[allow(unused_mut)]
56411 let mut request = self
56412 .client
56413 .get(url)
56414 .header(
56415 reqwest::header::ACCEPT,
56416 reqwest::header::HeaderValue::from_static("application/json"),
56417 )
56418 .query(&query)
56419 .build()?;
56420 (crate::pre_hook)(&self.inner, &request);
56421 let result = self.client.execute(request).await;
56422 (crate::post_hook)(&self.inner, &result);
56423 let response = result?;
56424 match response.status().as_u16() {
56425 200u16 => ResponseValue::from_response(response).await,
56426 400u16 => {
56427 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
56428 }
56429 _ => Err(Error::UnexpectedResponse(response)),
56430 }
56431 }
56432 /**Order Book
56433
56434| Limit | Weight(IP) |
56435|---------------------|-------------|
56436| 1-100 | 5 |
56437| 101-500 | 25 |
56438| 501-1000 | 50 |
56439| 1001-5000 | 250 |
56440
56441Sends a `GET` request to `/api/v3/depth`
56442
56443Arguments:
56444- `limit`: If limit > 5000, then the response will truncate to 5000
56445- `symbol`: Trading symbol, e.g. BNBUSDT
56446*/
56447 pub async fn depth<'a>(
56448 &'a self,
56449 limit: Option<i64>,
56450 symbol: &'a str,
56451 ) -> Result<ResponseValue<types::DepthResponse>, Error<types::Error>> {
56452 let url = format!("{}/api/v3/depth", self.baseurl,);
56453 let mut query = Vec::with_capacity(2usize);
56454 if let Some(v) = &limit {
56455 query.push(("limit", v.to_string()));
56456 }
56457 query.push(("symbol", symbol.to_string()));
56458 #[allow(unused_mut)]
56459 let mut request = self
56460 .client
56461 .get(url)
56462 .header(
56463 reqwest::header::ACCEPT,
56464 reqwest::header::HeaderValue::from_static("application/json"),
56465 )
56466 .query(&query)
56467 .build()?;
56468 (crate::pre_hook)(&self.inner, &request);
56469 let result = self.client.execute(request).await;
56470 (crate::post_hook)(&self.inner, &result);
56471 let response = result?;
56472 match response.status().as_u16() {
56473 200u16 => ResponseValue::from_response(response).await,
56474 400u16 => {
56475 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
56476 }
56477 _ => Err(Error::UnexpectedResponse(response)),
56478 }
56479 }
56480 /**Recent Trades List
56481
56482Get recent trades.
56483
56484Weight(IP): 10
56485
56486Sends a `GET` request to `/api/v3/trades`
56487
56488Arguments:
56489- `limit`: Default 500; max 1000.
56490- `symbol`: Trading symbol, e.g. BNBUSDT
56491*/
56492 pub async fn trades<'a>(
56493 &'a self,
56494 limit: Option<i32>,
56495 symbol: &'a str,
56496 ) -> Result<ResponseValue<Vec<types::Trade>>, Error<types::Error>> {
56497 let url = format!("{}/api/v3/trades", self.baseurl,);
56498 let mut query = Vec::with_capacity(2usize);
56499 if let Some(v) = &limit {
56500 query.push(("limit", v.to_string()));
56501 }
56502 query.push(("symbol", symbol.to_string()));
56503 #[allow(unused_mut)]
56504 let mut request = self
56505 .client
56506 .get(url)
56507 .header(
56508 reqwest::header::ACCEPT,
56509 reqwest::header::HeaderValue::from_static("application/json"),
56510 )
56511 .query(&query)
56512 .build()?;
56513 (crate::pre_hook)(&self.inner, &request);
56514 let result = self.client.execute(request).await;
56515 (crate::post_hook)(&self.inner, &result);
56516 let response = result?;
56517 match response.status().as_u16() {
56518 200u16 => ResponseValue::from_response(response).await,
56519 400u16 => {
56520 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
56521 }
56522 _ => Err(Error::UnexpectedResponse(response)),
56523 }
56524 }
56525 /**Old Trade Lookup
56526
56527Get older market trades.
56528
56529Weight(IP): 10
56530
56531Sends a `GET` request to `/api/v3/historicalTrades`
56532
56533Arguments:
56534- `from_id`: Trade id to fetch from. Default gets most recent trades.
56535- `limit`: Default 500; max 1000.
56536- `symbol`: Trading symbol, e.g. BNBUSDT
56537*/
56538 pub async fn historical_trades<'a>(
56539 &'a self,
56540 from_id: Option<i64>,
56541 limit: Option<i32>,
56542 symbol: &'a str,
56543 ) -> Result<ResponseValue<Vec<types::Trade>>, Error<()>> {
56544 let url = format!("{}/api/v3/historicalTrades", self.baseurl,);
56545 let mut query = Vec::with_capacity(3usize);
56546 if let Some(v) = &from_id {
56547 query.push(("fromId", v.to_string()));
56548 }
56549 if let Some(v) = &limit {
56550 query.push(("limit", v.to_string()));
56551 }
56552 query.push(("symbol", symbol.to_string()));
56553 #[allow(unused_mut)]
56554 let mut request = self
56555 .client
56556 .get(url)
56557 .header(
56558 reqwest::header::ACCEPT,
56559 reqwest::header::HeaderValue::from_static("application/json"),
56560 )
56561 .query(&query)
56562 .build()?;
56563 (crate::pre_hook)(&self.inner, &request);
56564 let result = self.client.execute(request).await;
56565 (crate::post_hook)(&self.inner, &result);
56566 let response = result?;
56567 match response.status().as_u16() {
56568 200u16 => ResponseValue::from_response(response).await,
56569 _ => Err(Error::UnexpectedResponse(response)),
56570 }
56571 }
56572 /**Compressed/Aggregate Trades List
56573
56574Get compressed, aggregate trades. Trades that fill at the time, from the same order, with the same price will have the quantity aggregated.
56575- If `fromId`, `startTime`, and `endTime` are not sent, the most recent aggregate trades will be returned.
56576- Note that if a trade has the following values, this was a duplicate aggregate trade and marked as invalid:
56577
56578 p = '0' // price
56579
56580 q = '0' // qty
56581
56582 f = -1 // first_trade_id
56583
56584 l = -1 // last_trade_id
56585
56586Weight(IP): 2
56587
56588Sends a `GET` request to `/api/v3/aggTrades`
56589
56590Arguments:
56591- `end_time`: UTC timestamp in ms
56592- `from_id`: Trade id to fetch from. Default gets most recent trades.
56593- `limit`: Default 500; max 1000.
56594- `start_time`: UTC timestamp in ms
56595- `symbol`: Trading symbol, e.g. BNBUSDT
56596*/
56597 pub async fn agg_trades<'a>(
56598 &'a self,
56599 end_time: Option<i64>,
56600 from_id: Option<i64>,
56601 limit: Option<i32>,
56602 start_time: Option<i64>,
56603 symbol: &'a str,
56604 ) -> Result<ResponseValue<Vec<types::AggTrade>>, Error<types::Error>> {
56605 let url = format!("{}/api/v3/aggTrades", self.baseurl,);
56606 let mut query = Vec::with_capacity(5usize);
56607 if let Some(v) = &end_time {
56608 query.push(("endTime", v.to_string()));
56609 }
56610 if let Some(v) = &from_id {
56611 query.push(("fromId", v.to_string()));
56612 }
56613 if let Some(v) = &limit {
56614 query.push(("limit", v.to_string()));
56615 }
56616 if let Some(v) = &start_time {
56617 query.push(("startTime", v.to_string()));
56618 }
56619 query.push(("symbol", symbol.to_string()));
56620 #[allow(unused_mut)]
56621 let mut request = self
56622 .client
56623 .get(url)
56624 .header(
56625 reqwest::header::ACCEPT,
56626 reqwest::header::HeaderValue::from_static("application/json"),
56627 )
56628 .query(&query)
56629 .build()?;
56630 (crate::pre_hook)(&self.inner, &request);
56631 let result = self.client.execute(request).await;
56632 (crate::post_hook)(&self.inner, &result);
56633 let response = result?;
56634 match response.status().as_u16() {
56635 200u16 => ResponseValue::from_response(response).await,
56636 400u16 => {
56637 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
56638 }
56639 _ => Err(Error::UnexpectedResponse(response)),
56640 }
56641 }
56642 /**Kline/Candlestick Data
56643
56644Kline/candlestick bars for a symbol.
56645Klines are uniquely identified by their open time.
56646
56647- If `startTime` and `endTime` are not sent, the most recent klines are returned.
56648
56649Weight(IP): 2
56650
56651Sends a `GET` request to `/api/v3/klines`
56652
56653Arguments:
56654- `end_time`: UTC timestamp in ms
56655- `interval`: kline intervals
56656- `limit`: Default 500; max 1000.
56657- `start_time`: UTC timestamp in ms
56658- `symbol`: Trading symbol, e.g. BNBUSDT
56659*/
56660 pub async fn kline_candlestick_data<'a>(
56661 &'a self,
56662 end_time: Option<i64>,
56663 interval: types::KlineCandlestickDataInterval,
56664 limit: Option<i32>,
56665 start_time: Option<i64>,
56666 symbol: &'a str,
56667 ) -> Result<
56668 ResponseValue<Vec<Vec<types::KlineCandlestickDataResponseItemItem>>>,
56669 Error<types::Error>,
56670 > {
56671 let url = format!("{}/api/v3/klines", self.baseurl,);
56672 let mut query = Vec::with_capacity(5usize);
56673 if let Some(v) = &end_time {
56674 query.push(("endTime", v.to_string()));
56675 }
56676 query.push(("interval", interval.to_string()));
56677 if let Some(v) = &limit {
56678 query.push(("limit", v.to_string()));
56679 }
56680 if let Some(v) = &start_time {
56681 query.push(("startTime", v.to_string()));
56682 }
56683 query.push(("symbol", symbol.to_string()));
56684 #[allow(unused_mut)]
56685 let mut request = self
56686 .client
56687 .get(url)
56688 .header(
56689 reqwest::header::ACCEPT,
56690 reqwest::header::HeaderValue::from_static("application/json"),
56691 )
56692 .query(&query)
56693 .build()?;
56694 (crate::pre_hook)(&self.inner, &request);
56695 let result = self.client.execute(request).await;
56696 (crate::post_hook)(&self.inner, &result);
56697 let response = result?;
56698 match response.status().as_u16() {
56699 200u16 => ResponseValue::from_response(response).await,
56700 400u16 => {
56701 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
56702 }
56703 _ => Err(Error::UnexpectedResponse(response)),
56704 }
56705 }
56706 /**UIKlines
56707
56708The request is similar to klines having the same parameters and response.
56709
56710uiKlines return modified kline data, optimized for presentation of candlestick charts.
56711
56712Weight(IP): 2
56713
56714Sends a `GET` request to `/api/v3/uiKlines`
56715
56716Arguments:
56717- `end_time`: UTC timestamp in ms
56718- `interval`: kline intervals
56719- `limit`: Default 500; max 1000.
56720- `start_time`: UTC timestamp in ms
56721- `symbol`: Trading symbol, e.g. BNBUSDT
56722*/
56723 pub async fn ui_klines<'a>(
56724 &'a self,
56725 end_time: Option<i64>,
56726 interval: types::UiKlinesInterval,
56727 limit: Option<i32>,
56728 start_time: Option<i64>,
56729 symbol: &'a str,
56730 ) -> Result<
56731 ResponseValue<Vec<Vec<types::UiKlinesResponseItemItem>>>,
56732 Error<types::Error>,
56733 > {
56734 let url = format!("{}/api/v3/uiKlines", self.baseurl,);
56735 let mut query = Vec::with_capacity(5usize);
56736 if let Some(v) = &end_time {
56737 query.push(("endTime", v.to_string()));
56738 }
56739 query.push(("interval", interval.to_string()));
56740 if let Some(v) = &limit {
56741 query.push(("limit", v.to_string()));
56742 }
56743 if let Some(v) = &start_time {
56744 query.push(("startTime", v.to_string()));
56745 }
56746 query.push(("symbol", symbol.to_string()));
56747 #[allow(unused_mut)]
56748 let mut request = self
56749 .client
56750 .get(url)
56751 .header(
56752 reqwest::header::ACCEPT,
56753 reqwest::header::HeaderValue::from_static("application/json"),
56754 )
56755 .query(&query)
56756 .build()?;
56757 (crate::pre_hook)(&self.inner, &request);
56758 let result = self.client.execute(request).await;
56759 (crate::post_hook)(&self.inner, &result);
56760 let response = result?;
56761 match response.status().as_u16() {
56762 200u16 => ResponseValue::from_response(response).await,
56763 400u16 => {
56764 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
56765 }
56766 _ => Err(Error::UnexpectedResponse(response)),
56767 }
56768 }
56769 /**Current Average Price
56770
56771Current average price for a symbol.
56772
56773Weight(IP): 2
56774
56775Sends a `GET` request to `/api/v3/avgPrice`
56776
56777Arguments:
56778- `symbol`: Trading symbol, e.g. BNBUSDT
56779*/
56780 pub async fn avg_price<'a>(
56781 &'a self,
56782 symbol: &'a str,
56783 ) -> Result<ResponseValue<types::AvgPriceResponse>, Error<types::Error>> {
56784 let url = format!("{}/api/v3/avgPrice", self.baseurl,);
56785 let mut query = Vec::with_capacity(1usize);
56786 query.push(("symbol", symbol.to_string()));
56787 #[allow(unused_mut)]
56788 let mut request = self
56789 .client
56790 .get(url)
56791 .header(
56792 reqwest::header::ACCEPT,
56793 reqwest::header::HeaderValue::from_static("application/json"),
56794 )
56795 .query(&query)
56796 .build()?;
56797 (crate::pre_hook)(&self.inner, &request);
56798 let result = self.client.execute(request).await;
56799 (crate::post_hook)(&self.inner, &result);
56800 let response = result?;
56801 match response.status().as_u16() {
56802 200u16 => ResponseValue::from_response(response).await,
56803 400u16 => {
56804 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
56805 }
56806 _ => Err(Error::UnexpectedResponse(response)),
56807 }
56808 }
56809 /**24hr Ticker Price Change Statistics
56810
5681124 hour rolling window price change statistics. Careful when accessing this with no symbol.
56812
56813- If the symbol is not sent, tickers for all symbols will be returned in an array.
56814
56815Weight(IP):
56816- `2` for a single symbol;
56817- `80` when the symbol parameter is omitted;
56818
56819Sends a `GET` request to `/api/v3/ticker/24hr`
56820
56821Arguments:
56822- `symbol`: Trading symbol, e.g. BNBUSDT
56823- `symbols`
56824- `type_`: Supported values: FULL or MINI.
56825If none provided, the default is FULL
56826*/
56827 pub async fn ticker_24hr<'a>(
56828 &'a self,
56829 symbol: Option<&'a str>,
56830 symbols: Option<&'a str>,
56831 type_: Option<&'a str>,
56832 ) -> Result<ResponseValue<types::Ticker24hrResponse>, Error<types::Error>> {
56833 let url = format!("{}/api/v3/ticker/24hr", self.baseurl,);
56834 let mut query = Vec::with_capacity(3usize);
56835 if let Some(v) = &symbol {
56836 query.push(("symbol", v.to_string()));
56837 }
56838 if let Some(v) = &symbols {
56839 query.push(("symbols", v.to_string()));
56840 }
56841 if let Some(v) = &type_ {
56842 query.push(("type", v.to_string()));
56843 }
56844 #[allow(unused_mut)]
56845 let mut request = self
56846 .client
56847 .get(url)
56848 .header(
56849 reqwest::header::ACCEPT,
56850 reqwest::header::HeaderValue::from_static("application/json"),
56851 )
56852 .query(&query)
56853 .build()?;
56854 (crate::pre_hook)(&self.inner, &request);
56855 let result = self.client.execute(request).await;
56856 (crate::post_hook)(&self.inner, &result);
56857 let response = result?;
56858 match response.status().as_u16() {
56859 200u16 => ResponseValue::from_response(response).await,
56860 400u16 => {
56861 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
56862 }
56863 _ => Err(Error::UnexpectedResponse(response)),
56864 }
56865 }
56866 /**Symbol Price Ticker
56867
56868Latest price for a symbol or symbols.
56869
56870- If the symbol is not sent, prices for all symbols will be returned in an array.
56871
56872Weight(IP):
56873- `2` for a single symbol;
56874- `4` when the symbol parameter is omitted;
56875
56876Sends a `GET` request to `/api/v3/ticker/price`
56877
56878Arguments:
56879- `symbol`: Trading symbol, e.g. BNBUSDT
56880- `symbols`
56881*/
56882 pub async fn ticker_price<'a>(
56883 &'a self,
56884 symbol: Option<&'a str>,
56885 symbols: Option<&'a str>,
56886 ) -> Result<ResponseValue<types::TickerPriceResponse>, Error<types::Error>> {
56887 let url = format!("{}/api/v3/ticker/price", self.baseurl,);
56888 let mut query = Vec::with_capacity(2usize);
56889 if let Some(v) = &symbol {
56890 query.push(("symbol", v.to_string()));
56891 }
56892 if let Some(v) = &symbols {
56893 query.push(("symbols", v.to_string()));
56894 }
56895 #[allow(unused_mut)]
56896 let mut request = self
56897 .client
56898 .get(url)
56899 .header(
56900 reqwest::header::ACCEPT,
56901 reqwest::header::HeaderValue::from_static("application/json"),
56902 )
56903 .query(&query)
56904 .build()?;
56905 (crate::pre_hook)(&self.inner, &request);
56906 let result = self.client.execute(request).await;
56907 (crate::post_hook)(&self.inner, &result);
56908 let response = result?;
56909 match response.status().as_u16() {
56910 200u16 => ResponseValue::from_response(response).await,
56911 400u16 => {
56912 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
56913 }
56914 _ => Err(Error::UnexpectedResponse(response)),
56915 }
56916 }
56917 /**Symbol Order Book Ticker
56918
56919Best price/qty on the order book for a symbol or symbols.
56920
56921- If the symbol is not sent, bookTickers for all symbols will be returned in an array.
56922
56923Weight(IP):
56924- `2` for a single symbol;
56925- `4` when the symbol parameter is omitted;
56926
56927Sends a `GET` request to `/api/v3/ticker/bookTicker`
56928
56929Arguments:
56930- `symbol`: Trading symbol, e.g. BNBUSDT
56931- `symbols`
56932*/
56933 pub async fn ticker_order_book<'a>(
56934 &'a self,
56935 symbol: Option<&'a str>,
56936 symbols: Option<&'a str>,
56937 ) -> Result<ResponseValue<types::TickerOrderBookResponse>, Error<types::Error>> {
56938 let url = format!("{}/api/v3/ticker/bookTicker", self.baseurl,);
56939 let mut query = Vec::with_capacity(2usize);
56940 if let Some(v) = &symbol {
56941 query.push(("symbol", v.to_string()));
56942 }
56943 if let Some(v) = &symbols {
56944 query.push(("symbols", v.to_string()));
56945 }
56946 #[allow(unused_mut)]
56947 let mut request = self
56948 .client
56949 .get(url)
56950 .header(
56951 reqwest::header::ACCEPT,
56952 reqwest::header::HeaderValue::from_static("application/json"),
56953 )
56954 .query(&query)
56955 .build()?;
56956 (crate::pre_hook)(&self.inner, &request);
56957 let result = self.client.execute(request).await;
56958 (crate::post_hook)(&self.inner, &result);
56959 let response = result?;
56960 match response.status().as_u16() {
56961 200u16 => ResponseValue::from_response(response).await,
56962 400u16 => {
56963 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
56964 }
56965 _ => Err(Error::UnexpectedResponse(response)),
56966 }
56967 }
56968 /**Rolling window price change statistics
56969
56970The window used to compute statistics is typically slightly wider than requested windowSize.
56971
56972openTime for /api/v3/ticker always starts on a minute, while the closeTime is the current time of the request. As such, the effective window might be up to 1 minute wider than requested.
56973
56974E.g. If the closeTime is 1641287867099 (January 04, 2022 09:17:47:099 UTC) , and the windowSize is 1d. the openTime will be: 1641201420000 (January 3, 2022, 09:17:00 UTC)
56975
56976Weight(IP): 4 for each requested symbol regardless of windowSize.
56977
56978The weight for this request will cap at 200 once the number of symbols in the request is more than 50.
56979
56980Sends a `GET` request to `/api/v3/ticker`
56981
56982Arguments:
56983- `symbol`: Trading symbol, e.g. BNBUSDT
56984- `symbols`
56985- `type_`: Supported values: FULL or MINI.
56986If none provided, the default is FULL
56987- `window_size`: Defaults to 1d if no parameter provided.
56988Supported windowSize values:
569891m,2m....59m for minutes
569901h, 2h....23h - for hours
569911d...7d - for days.
56992
56993Units cannot be combined (e.g. 1d2h is not allowed)
56994*/
56995 pub async fn ticker<'a>(
56996 &'a self,
56997 symbol: Option<&'a str>,
56998 symbols: Option<&'a str>,
56999 type_: Option<&'a str>,
57000 window_size: Option<&'a str>,
57001 ) -> Result<ResponseValue<types::TickerResponse>, Error<types::Error>> {
57002 let url = format!("{}/api/v3/ticker", self.baseurl,);
57003 let mut query = Vec::with_capacity(4usize);
57004 if let Some(v) = &symbol {
57005 query.push(("symbol", v.to_string()));
57006 }
57007 if let Some(v) = &symbols {
57008 query.push(("symbols", v.to_string()));
57009 }
57010 if let Some(v) = &type_ {
57011 query.push(("type", v.to_string()));
57012 }
57013 if let Some(v) = &window_size {
57014 query.push(("windowSize", v.to_string()));
57015 }
57016 #[allow(unused_mut)]
57017 let mut request = self
57018 .client
57019 .get(url)
57020 .header(
57021 reqwest::header::ACCEPT,
57022 reqwest::header::HeaderValue::from_static("application/json"),
57023 )
57024 .query(&query)
57025 .build()?;
57026 (crate::pre_hook)(&self.inner, &request);
57027 let result = self.client.execute(request).await;
57028 (crate::post_hook)(&self.inner, &result);
57029 let response = result?;
57030 match response.status().as_u16() {
57031 200u16 => ResponseValue::from_response(response).await,
57032 400u16 => {
57033 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
57034 }
57035 _ => Err(Error::UnexpectedResponse(response)),
57036 }
57037 }
57038 /**Test New Order (TRADE)
57039
57040Test new order creation and signature/recvWindow long.
57041Creates and validates a new order but does not send it into the matching engine.
57042
57043Weight(IP): 1
57044
57045Sends a `POST` request to `/api/v3/order/test`
57046
57047Arguments:
57048- `iceberg_qty`: Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order.
57049- `new_client_order_id`: Used to uniquely identify this cancel. Automatically generated by default
57050- `new_order_resp_type`: Set the response JSON. MARKET and LIMIT order types default to FULL, all other orders default to ACK.
57051- `price`: Order price
57052- `quantity`: Order quantity
57053- `quote_order_qty`: Quote quantity
57054- `recv_window`: The value cannot be greater than 60000
57055- `side`
57056- `signature`: Signature
57057- `stop_price`: Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
57058- `strategy_id`
57059- `strategy_type`: The value cannot be less than 1000000.
57060- `symbol`: Trading symbol, e.g. BNBUSDT
57061- `time_in_force`: Order time in force
57062- `timestamp`: UTC timestamp in ms
57063- `trailing_delta`: Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
57064- `type_`: Order type
57065*/
57066 pub async fn order_test<'a>(
57067 &'a self,
57068 iceberg_qty: Option<f64>,
57069 new_client_order_id: Option<&'a str>,
57070 new_order_resp_type: Option<types::OrderTestNewOrderRespType>,
57071 price: Option<f64>,
57072 quantity: Option<f64>,
57073 quote_order_qty: Option<f64>,
57074 recv_window: Option<i64>,
57075 side: types::OrderTestSide,
57076 signature: &'a str,
57077 stop_price: Option<f64>,
57078 strategy_id: Option<i64>,
57079 strategy_type: Option<i64>,
57080 symbol: &'a str,
57081 time_in_force: Option<types::OrderTestTimeInForce>,
57082 timestamp: i64,
57083 trailing_delta: Option<f64>,
57084 type_: types::OrderTestType,
57085 ) -> Result<
57086 ResponseValue<serde_json::Map<String, serde_json::Value>>,
57087 Error<types::Error>,
57088 > {
57089 let url = format!("{}/api/v3/order/test", self.baseurl,);
57090 let mut query = Vec::with_capacity(17usize);
57091 if let Some(v) = &iceberg_qty {
57092 query.push(("icebergQty", v.to_string()));
57093 }
57094 if let Some(v) = &new_client_order_id {
57095 query.push(("newClientOrderId", v.to_string()));
57096 }
57097 if let Some(v) = &new_order_resp_type {
57098 query.push(("newOrderRespType", v.to_string()));
57099 }
57100 if let Some(v) = &price {
57101 query.push(("price", v.to_string()));
57102 }
57103 if let Some(v) = &quantity {
57104 query.push(("quantity", v.to_string()));
57105 }
57106 if let Some(v) = "e_order_qty {
57107 query.push(("quoteOrderQty", v.to_string()));
57108 }
57109 if let Some(v) = &recv_window {
57110 query.push(("recvWindow", v.to_string()));
57111 }
57112 query.push(("side", side.to_string()));
57113 query.push(("signature", signature.to_string()));
57114 if let Some(v) = &stop_price {
57115 query.push(("stopPrice", v.to_string()));
57116 }
57117 if let Some(v) = &strategy_id {
57118 query.push(("strategyId", v.to_string()));
57119 }
57120 if let Some(v) = &strategy_type {
57121 query.push(("strategyType", v.to_string()));
57122 }
57123 query.push(("symbol", symbol.to_string()));
57124 if let Some(v) = &time_in_force {
57125 query.push(("timeInForce", v.to_string()));
57126 }
57127 query.push(("timestamp", timestamp.to_string()));
57128 if let Some(v) = &trailing_delta {
57129 query.push(("trailingDelta", v.to_string()));
57130 }
57131 query.push(("type", type_.to_string()));
57132 #[allow(unused_mut)]
57133 let mut request = self
57134 .client
57135 .post(url)
57136 .header(
57137 reqwest::header::ACCEPT,
57138 reqwest::header::HeaderValue::from_static("application/json"),
57139 )
57140 .query(&query)
57141 .build()?;
57142 (crate::pre_hook)(&self.inner, &request);
57143 let result = self.client.execute(request).await;
57144 (crate::post_hook)(&self.inner, &result);
57145 let response = result?;
57146 match response.status().as_u16() {
57147 200u16 => ResponseValue::from_response(response).await,
57148 400u16 => {
57149 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
57150 }
57151 401u16 => {
57152 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
57153 }
57154 _ => Err(Error::UnexpectedResponse(response)),
57155 }
57156 }
57157 /**Query Order (USER_DATA)
57158
57159Check an order's status.
57160
57161- Either `orderId` or `origClientOrderId` must be sent.
57162- For some historical orders `cummulativeQuoteQty` will be < 0, meaning the data is not available at this time.
57163
57164Weight(IP): 4
57165
57166Sends a `GET` request to `/api/v3/order`
57167
57168Arguments:
57169- `order_id`: Order id
57170- `orig_client_order_id`: Order id from client
57171- `recv_window`: The value cannot be greater than 60000
57172- `signature`: Signature
57173- `symbol`: Trading symbol, e.g. BNBUSDT
57174- `timestamp`: UTC timestamp in ms
57175*/
57176 pub async fn query_order<'a>(
57177 &'a self,
57178 order_id: Option<i64>,
57179 orig_client_order_id: Option<&'a str>,
57180 recv_window: Option<i64>,
57181 signature: &'a str,
57182 symbol: &'a str,
57183 timestamp: i64,
57184 ) -> Result<ResponseValue<types::OrderDetails>, Error<types::Error>> {
57185 let url = format!("{}/api/v3/order", self.baseurl,);
57186 let mut query = Vec::with_capacity(6usize);
57187 if let Some(v) = &order_id {
57188 query.push(("orderId", v.to_string()));
57189 }
57190 if let Some(v) = &orig_client_order_id {
57191 query.push(("origClientOrderId", v.to_string()));
57192 }
57193 if let Some(v) = &recv_window {
57194 query.push(("recvWindow", v.to_string()));
57195 }
57196 query.push(("signature", signature.to_string()));
57197 query.push(("symbol", symbol.to_string()));
57198 query.push(("timestamp", timestamp.to_string()));
57199 #[allow(unused_mut)]
57200 let mut request = self
57201 .client
57202 .get(url)
57203 .header(
57204 reqwest::header::ACCEPT,
57205 reqwest::header::HeaderValue::from_static("application/json"),
57206 )
57207 .query(&query)
57208 .build()?;
57209 (crate::pre_hook)(&self.inner, &request);
57210 let result = self.client.execute(request).await;
57211 (crate::post_hook)(&self.inner, &result);
57212 let response = result?;
57213 match response.status().as_u16() {
57214 200u16 => ResponseValue::from_response(response).await,
57215 400u16 => {
57216 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
57217 }
57218 401u16 => {
57219 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
57220 }
57221 _ => Err(Error::UnexpectedResponse(response)),
57222 }
57223 }
57224 /**New Order (TRADE)
57225
57226Send in a new order.
57227
57228- `LIMIT_MAKER` are `LIMIT` orders that will be rejected if they would immediately match and trade as a taker.
57229- `STOP_LOSS` and `TAKE_PROFIT` will execute a `MARKET` order when the `stopPrice` is reached.
57230- Any `LIMIT` or `LIMIT_MAKER` type order can be made an iceberg order by sending an `icebergQty`.
57231- Any order with an `icebergQty` MUST have `timeInForce` set to `GTC`.
57232- `MARKET` orders using `quantity` specifies how much a user wants to buy or sell based on the market price.
57233- `MARKET` orders using `quoteOrderQty` specifies the amount the user wants to spend (when buying) or receive (when selling) of the quote asset; the correct quantity will be determined based on the market liquidity and `quoteOrderQty`.
57234- `MARKET` orders using `quoteOrderQty` will not break `LOT_SIZE` filter rules; the order will execute a quantity that will have the notional value as close as possible to `quoteOrderQty`.
57235- same `newClientOrderId` can be accepted only when the previous one is filled, otherwise the order will be rejected.
57236
57237Trigger order price rules against market price for both `MARKET` and `LIMIT` versions:
57238
57239- Price above market price: `STOP_LOSS` `BUY`, `TAKE_PROFIT` `SELL`
57240- Price below market price: `STOP_LOSS` `SELL`, `TAKE_PROFIT` `BUY`
57241
57242
57243Weight(IP): 1
57244
57245Sends a `POST` request to `/api/v3/order`
57246
57247Arguments:
57248- `iceberg_qty`: Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order.
57249- `new_client_order_id`: Used to uniquely identify this cancel. Automatically generated by default
57250- `new_order_resp_type`: Set the response JSON. MARKET and LIMIT order types default to FULL, all other orders default to ACK.
57251- `price`: Order price
57252- `quantity`: Order quantity
57253- `quote_order_qty`: Quote quantity
57254- `recv_window`: The value cannot be greater than 60000
57255- `self_trade_prevention_mode`: The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
57256- `side`
57257- `signature`: Signature
57258- `stop_price`: Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
57259- `strategy_id`
57260- `strategy_type`: The value cannot be less than 1000000.
57261- `symbol`: Trading symbol, e.g. BNBUSDT
57262- `time_in_force`: Order time in force
57263- `timestamp`: UTC timestamp in ms
57264- `trailing_delta`: Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
57265- `type_`: Order type
57266*/
57267 pub async fn place_new_order<'a>(
57268 &'a self,
57269 iceberg_qty: Option<f64>,
57270 new_client_order_id: Option<&'a str>,
57271 new_order_resp_type: Option<types::PlaceNewOrderNewOrderRespType>,
57272 price: Option<f64>,
57273 quantity: Option<f64>,
57274 quote_order_qty: Option<f64>,
57275 recv_window: Option<i64>,
57276 self_trade_prevention_mode: Option<types::PlaceNewOrderSelfTradePreventionMode>,
57277 side: types::PlaceNewOrderSide,
57278 signature: &'a str,
57279 stop_price: Option<f64>,
57280 strategy_id: Option<i64>,
57281 strategy_type: Option<i64>,
57282 symbol: &'a str,
57283 time_in_force: Option<types::PlaceNewOrderTimeInForce>,
57284 timestamp: i64,
57285 trailing_delta: Option<f64>,
57286 type_: types::PlaceNewOrderType,
57287 ) -> Result<ResponseValue<types::PlaceNewOrderResponse>, Error<types::Error>> {
57288 let url = format!("{}/api/v3/order", self.baseurl,);
57289 let mut query = Vec::with_capacity(18usize);
57290 if let Some(v) = &iceberg_qty {
57291 query.push(("icebergQty", v.to_string()));
57292 }
57293 if let Some(v) = &new_client_order_id {
57294 query.push(("newClientOrderId", v.to_string()));
57295 }
57296 if let Some(v) = &new_order_resp_type {
57297 query.push(("newOrderRespType", v.to_string()));
57298 }
57299 if let Some(v) = &price {
57300 query.push(("price", v.to_string()));
57301 }
57302 if let Some(v) = &quantity {
57303 query.push(("quantity", v.to_string()));
57304 }
57305 if let Some(v) = "e_order_qty {
57306 query.push(("quoteOrderQty", v.to_string()));
57307 }
57308 if let Some(v) = &recv_window {
57309 query.push(("recvWindow", v.to_string()));
57310 }
57311 if let Some(v) = &self_trade_prevention_mode {
57312 query.push(("selfTradePreventionMode", v.to_string()));
57313 }
57314 query.push(("side", side.to_string()));
57315 query.push(("signature", signature.to_string()));
57316 if let Some(v) = &stop_price {
57317 query.push(("stopPrice", v.to_string()));
57318 }
57319 if let Some(v) = &strategy_id {
57320 query.push(("strategyId", v.to_string()));
57321 }
57322 if let Some(v) = &strategy_type {
57323 query.push(("strategyType", v.to_string()));
57324 }
57325 query.push(("symbol", symbol.to_string()));
57326 if let Some(v) = &time_in_force {
57327 query.push(("timeInForce", v.to_string()));
57328 }
57329 query.push(("timestamp", timestamp.to_string()));
57330 if let Some(v) = &trailing_delta {
57331 query.push(("trailingDelta", v.to_string()));
57332 }
57333 query.push(("type", type_.to_string()));
57334 #[allow(unused_mut)]
57335 let mut request = self
57336 .client
57337 .post(url)
57338 .header(
57339 reqwest::header::ACCEPT,
57340 reqwest::header::HeaderValue::from_static("application/json"),
57341 )
57342 .query(&query)
57343 .build()?;
57344 (crate::pre_hook)(&self.inner, &request);
57345 let result = self.client.execute(request).await;
57346 (crate::post_hook)(&self.inner, &result);
57347 let response = result?;
57348 match response.status().as_u16() {
57349 200u16 => ResponseValue::from_response(response).await,
57350 400u16 => {
57351 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
57352 }
57353 401u16 => {
57354 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
57355 }
57356 _ => Err(Error::UnexpectedResponse(response)),
57357 }
57358 }
57359 /**Cancel Order (TRADE)
57360
57361Cancel an active order.
57362
57363Either `orderId` or `origClientOrderId` must be sent.
57364
57365Weight(IP): 1
57366
57367Sends a `DELETE` request to `/api/v3/order`
57368
57369Arguments:
57370- `cancel_restrictions`
57371- `new_client_order_id`: Used to uniquely identify this cancel. Automatically generated by default
57372- `order_id`: Order id
57373- `orig_client_order_id`: Order id from client
57374- `recv_window`: The value cannot be greater than 60000
57375- `signature`: Signature
57376- `symbol`: Trading symbol, e.g. BNBUSDT
57377- `timestamp`: UTC timestamp in ms
57378*/
57379 pub async fn cancel_order<'a>(
57380 &'a self,
57381 cancel_restrictions: Option<types::CancelOrderCancelRestrictions>,
57382 new_client_order_id: Option<&'a str>,
57383 order_id: Option<i64>,
57384 orig_client_order_id: Option<&'a str>,
57385 recv_window: Option<i64>,
57386 signature: &'a str,
57387 symbol: &'a str,
57388 timestamp: i64,
57389 ) -> Result<ResponseValue<types::Order>, Error<types::Error>> {
57390 let url = format!("{}/api/v3/order", self.baseurl,);
57391 let mut query = Vec::with_capacity(8usize);
57392 if let Some(v) = &cancel_restrictions {
57393 query.push(("cancelRestrictions", v.to_string()));
57394 }
57395 if let Some(v) = &new_client_order_id {
57396 query.push(("newClientOrderId", v.to_string()));
57397 }
57398 if let Some(v) = &order_id {
57399 query.push(("orderId", v.to_string()));
57400 }
57401 if let Some(v) = &orig_client_order_id {
57402 query.push(("origClientOrderId", v.to_string()));
57403 }
57404 if let Some(v) = &recv_window {
57405 query.push(("recvWindow", v.to_string()));
57406 }
57407 query.push(("signature", signature.to_string()));
57408 query.push(("symbol", symbol.to_string()));
57409 query.push(("timestamp", timestamp.to_string()));
57410 #[allow(unused_mut)]
57411 let mut request = self
57412 .client
57413 .delete(url)
57414 .header(
57415 reqwest::header::ACCEPT,
57416 reqwest::header::HeaderValue::from_static("application/json"),
57417 )
57418 .query(&query)
57419 .build()?;
57420 (crate::pre_hook)(&self.inner, &request);
57421 let result = self.client.execute(request).await;
57422 (crate::post_hook)(&self.inner, &result);
57423 let response = result?;
57424 match response.status().as_u16() {
57425 200u16 => ResponseValue::from_response(response).await,
57426 400u16 => {
57427 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
57428 }
57429 401u16 => {
57430 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
57431 }
57432 _ => Err(Error::UnexpectedResponse(response)),
57433 }
57434 }
57435 /**Cancel an Existing Order and Send a New Order (Trade)
57436
57437Cancels an existing order and places a new order on the same symbol.
57438
57439Filters and Order Count are evaluated before the processing of the cancellation and order placement occurs.
57440
57441A new order that was not attempted (i.e. when newOrderResult: NOT_ATTEMPTED), will still increase the order count by 1.
57442
57443Weight(IP): 1
57444
57445Sends a `POST` request to `/api/v3/order/cancelReplace`
57446
57447Arguments:
57448- `cancel_new_client_order_id`: Used to uniquely identify this cancel. Automatically generated by default
57449- `cancel_order_id`: Either the cancelOrigClientOrderId or cancelOrderId must be provided. If both are provided, cancelOrderId takes precedence.
57450- `cancel_orig_client_order_id`: Either the cancelOrigClientOrderId or cancelOrderId must be provided. If both are provided, cancelOrderId takes precedence.
57451- `cancel_replace_mode`: - `STOP_ON_FAILURE` If the cancel request fails, the new order placement will not be attempted.
57452- `ALLOW_FAILURES` If new order placement will be attempted even if cancel request fails.
57453- `cancel_restrictions`
57454- `iceberg_qty`: Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order.
57455- `new_client_order_id`: Used to uniquely identify this cancel. Automatically generated by default
57456- `new_order_resp_type`: Set the response JSON. MARKET and LIMIT order types default to FULL, all other orders default to ACK.
57457- `price`: Order price
57458- `quantity`: Order quantity
57459- `quote_order_qty`: Quote quantity
57460- `recv_window`: The value cannot be greater than 60000
57461- `self_trade_prevention_mode`: The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
57462- `side`
57463- `signature`: Signature
57464- `stop_price`: Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
57465- `strategy_id`
57466- `strategy_type`: The value cannot be less than 1000000.
57467- `symbol`: Trading symbol, e.g. BNBUSDT
57468- `time_in_force`: Order time in force
57469- `timestamp`: UTC timestamp in ms
57470- `trailing_delta`: Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
57471- `type_`: Order type
57472*/
57473 pub async fn replace_order<'a>(
57474 &'a self,
57475 cancel_new_client_order_id: Option<&'a str>,
57476 cancel_order_id: Option<i64>,
57477 cancel_orig_client_order_id: Option<&'a str>,
57478 cancel_replace_mode: &'a str,
57479 cancel_restrictions: Option<types::ReplaceOrderCancelRestrictions>,
57480 iceberg_qty: Option<f64>,
57481 new_client_order_id: Option<&'a str>,
57482 new_order_resp_type: Option<types::ReplaceOrderNewOrderRespType>,
57483 price: Option<f64>,
57484 quantity: Option<f64>,
57485 quote_order_qty: Option<f64>,
57486 recv_window: Option<i64>,
57487 self_trade_prevention_mode: Option<types::ReplaceOrderSelfTradePreventionMode>,
57488 side: types::ReplaceOrderSide,
57489 signature: &'a str,
57490 stop_price: Option<f64>,
57491 strategy_id: Option<i64>,
57492 strategy_type: Option<i64>,
57493 symbol: &'a str,
57494 time_in_force: Option<types::ReplaceOrderTimeInForce>,
57495 timestamp: i64,
57496 trailing_delta: Option<f64>,
57497 type_: types::ReplaceOrderType,
57498 ) -> Result<ResponseValue<types::ReplaceOrderResponse>, Error<types::Error>> {
57499 let url = format!("{}/api/v3/order/cancelReplace", self.baseurl,);
57500 let mut query = Vec::with_capacity(23usize);
57501 if let Some(v) = &cancel_new_client_order_id {
57502 query.push(("cancelNewClientOrderId", v.to_string()));
57503 }
57504 if let Some(v) = &cancel_order_id {
57505 query.push(("cancelOrderId", v.to_string()));
57506 }
57507 if let Some(v) = &cancel_orig_client_order_id {
57508 query.push(("cancelOrigClientOrderId", v.to_string()));
57509 }
57510 query.push(("cancelReplaceMode", cancel_replace_mode.to_string()));
57511 if let Some(v) = &cancel_restrictions {
57512 query.push(("cancelRestrictions", v.to_string()));
57513 }
57514 if let Some(v) = &iceberg_qty {
57515 query.push(("icebergQty", v.to_string()));
57516 }
57517 if let Some(v) = &new_client_order_id {
57518 query.push(("newClientOrderId", v.to_string()));
57519 }
57520 if let Some(v) = &new_order_resp_type {
57521 query.push(("newOrderRespType", v.to_string()));
57522 }
57523 if let Some(v) = &price {
57524 query.push(("price", v.to_string()));
57525 }
57526 if let Some(v) = &quantity {
57527 query.push(("quantity", v.to_string()));
57528 }
57529 if let Some(v) = "e_order_qty {
57530 query.push(("quoteOrderQty", v.to_string()));
57531 }
57532 if let Some(v) = &recv_window {
57533 query.push(("recvWindow", v.to_string()));
57534 }
57535 if let Some(v) = &self_trade_prevention_mode {
57536 query.push(("selfTradePreventionMode", v.to_string()));
57537 }
57538 query.push(("side", side.to_string()));
57539 query.push(("signature", signature.to_string()));
57540 if let Some(v) = &stop_price {
57541 query.push(("stopPrice", v.to_string()));
57542 }
57543 if let Some(v) = &strategy_id {
57544 query.push(("strategyId", v.to_string()));
57545 }
57546 if let Some(v) = &strategy_type {
57547 query.push(("strategyType", v.to_string()));
57548 }
57549 query.push(("symbol", symbol.to_string()));
57550 if let Some(v) = &time_in_force {
57551 query.push(("timeInForce", v.to_string()));
57552 }
57553 query.push(("timestamp", timestamp.to_string()));
57554 if let Some(v) = &trailing_delta {
57555 query.push(("trailingDelta", v.to_string()));
57556 }
57557 query.push(("type", type_.to_string()));
57558 #[allow(unused_mut)]
57559 let mut request = self
57560 .client
57561 .post(url)
57562 .header(
57563 reqwest::header::ACCEPT,
57564 reqwest::header::HeaderValue::from_static("application/json"),
57565 )
57566 .query(&query)
57567 .build()?;
57568 (crate::pre_hook)(&self.inner, &request);
57569 let result = self.client.execute(request).await;
57570 (crate::post_hook)(&self.inner, &result);
57571 let response = result?;
57572 match response.status().as_u16() {
57573 200u16 => ResponseValue::from_response(response).await,
57574 400u16 => {
57575 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
57576 }
57577 401u16 => {
57578 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
57579 }
57580 _ => Err(Error::UnexpectedResponse(response)),
57581 }
57582 }
57583 /**Current Open Orders (USER_DATA)
57584
57585Get all open orders on a symbol. Careful when accessing this with no symbol.
57586
57587Weight(IP):
57588- `6` for a single symbol;
57589- `80` when the symbol parameter is omitted;
57590
57591Sends a `GET` request to `/api/v3/openOrders`
57592
57593Arguments:
57594- `recv_window`: The value cannot be greater than 60000
57595- `signature`: Signature
57596- `symbol`: Trading symbol, e.g. BNBUSDT
57597- `timestamp`: UTC timestamp in ms
57598*/
57599 pub async fn list_open_orders<'a>(
57600 &'a self,
57601 recv_window: Option<i64>,
57602 signature: &'a str,
57603 symbol: Option<&'a str>,
57604 timestamp: i64,
57605 ) -> Result<ResponseValue<Vec<types::OrderDetails>>, Error<types::Error>> {
57606 let url = format!("{}/api/v3/openOrders", self.baseurl,);
57607 let mut query = Vec::with_capacity(4usize);
57608 if let Some(v) = &recv_window {
57609 query.push(("recvWindow", v.to_string()));
57610 }
57611 query.push(("signature", signature.to_string()));
57612 if let Some(v) = &symbol {
57613 query.push(("symbol", v.to_string()));
57614 }
57615 query.push(("timestamp", timestamp.to_string()));
57616 #[allow(unused_mut)]
57617 let mut request = self
57618 .client
57619 .get(url)
57620 .header(
57621 reqwest::header::ACCEPT,
57622 reqwest::header::HeaderValue::from_static("application/json"),
57623 )
57624 .query(&query)
57625 .build()?;
57626 (crate::pre_hook)(&self.inner, &request);
57627 let result = self.client.execute(request).await;
57628 (crate::post_hook)(&self.inner, &result);
57629 let response = result?;
57630 match response.status().as_u16() {
57631 200u16 => ResponseValue::from_response(response).await,
57632 400u16 => {
57633 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
57634 }
57635 401u16 => {
57636 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
57637 }
57638 _ => Err(Error::UnexpectedResponse(response)),
57639 }
57640 }
57641 /**Cancel all Open Orders on a Symbol (TRADE)
57642
57643Cancels all active orders on a symbol.
57644This includes OCO orders.
57645
57646Weight(IP): 1
57647
57648Sends a `DELETE` request to `/api/v3/openOrders`
57649
57650Arguments:
57651- `recv_window`: The value cannot be greater than 60000
57652- `signature`: Signature
57653- `symbol`: Trading symbol, e.g. BNBUSDT
57654- `timestamp`: UTC timestamp in ms
57655*/
57656 pub async fn cancel_open_orders<'a>(
57657 &'a self,
57658 recv_window: Option<i64>,
57659 signature: &'a str,
57660 symbol: &'a str,
57661 timestamp: i64,
57662 ) -> Result<
57663 ResponseValue<Vec<types::CancelOpenOrdersResponseItem>>,
57664 Error<types::Error>,
57665 > {
57666 let url = format!("{}/api/v3/openOrders", self.baseurl,);
57667 let mut query = Vec::with_capacity(4usize);
57668 if let Some(v) = &recv_window {
57669 query.push(("recvWindow", v.to_string()));
57670 }
57671 query.push(("signature", signature.to_string()));
57672 query.push(("symbol", symbol.to_string()));
57673 query.push(("timestamp", timestamp.to_string()));
57674 #[allow(unused_mut)]
57675 let mut request = self
57676 .client
57677 .delete(url)
57678 .header(
57679 reqwest::header::ACCEPT,
57680 reqwest::header::HeaderValue::from_static("application/json"),
57681 )
57682 .query(&query)
57683 .build()?;
57684 (crate::pre_hook)(&self.inner, &request);
57685 let result = self.client.execute(request).await;
57686 (crate::post_hook)(&self.inner, &result);
57687 let response = result?;
57688 match response.status().as_u16() {
57689 200u16 => ResponseValue::from_response(response).await,
57690 400u16 => {
57691 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
57692 }
57693 401u16 => {
57694 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
57695 }
57696 _ => Err(Error::UnexpectedResponse(response)),
57697 }
57698 }
57699 /**All Orders (USER_DATA)
57700
57701Get all account orders; active, canceled, or filled..
57702
57703- If `orderId` is set, it will get orders >= that `orderId`. Otherwise most recent orders are returned.
57704- For some historical orders `cummulativeQuoteQty` will be < 0, meaning the data is not available at this time.
57705- If `startTime` and/or `endTime` provided, `orderId` is not required
57706
57707Weight(IP): 20
57708
57709Sends a `GET` request to `/api/v3/allOrders`
57710
57711Arguments:
57712- `end_time`: UTC timestamp in ms
57713- `limit`: Default 500; max 1000.
57714- `order_id`: Order id
57715- `recv_window`: The value cannot be greater than 60000
57716- `signature`: Signature
57717- `start_time`: UTC timestamp in ms
57718- `symbol`: Trading symbol, e.g. BNBUSDT
57719- `timestamp`: UTC timestamp in ms
57720*/
57721 pub async fn all_orders<'a>(
57722 &'a self,
57723 end_time: Option<i64>,
57724 limit: Option<i32>,
57725 order_id: Option<i64>,
57726 recv_window: Option<i64>,
57727 signature: &'a str,
57728 start_time: Option<i64>,
57729 symbol: &'a str,
57730 timestamp: i64,
57731 ) -> Result<ResponseValue<Vec<types::OrderDetails>>, Error<types::Error>> {
57732 let url = format!("{}/api/v3/allOrders", self.baseurl,);
57733 let mut query = Vec::with_capacity(8usize);
57734 if let Some(v) = &end_time {
57735 query.push(("endTime", v.to_string()));
57736 }
57737 if let Some(v) = &limit {
57738 query.push(("limit", v.to_string()));
57739 }
57740 if let Some(v) = &order_id {
57741 query.push(("orderId", v.to_string()));
57742 }
57743 if let Some(v) = &recv_window {
57744 query.push(("recvWindow", v.to_string()));
57745 }
57746 query.push(("signature", signature.to_string()));
57747 if let Some(v) = &start_time {
57748 query.push(("startTime", v.to_string()));
57749 }
57750 query.push(("symbol", symbol.to_string()));
57751 query.push(("timestamp", timestamp.to_string()));
57752 #[allow(unused_mut)]
57753 let mut request = self
57754 .client
57755 .get(url)
57756 .header(
57757 reqwest::header::ACCEPT,
57758 reqwest::header::HeaderValue::from_static("application/json"),
57759 )
57760 .query(&query)
57761 .build()?;
57762 (crate::pre_hook)(&self.inner, &request);
57763 let result = self.client.execute(request).await;
57764 (crate::post_hook)(&self.inner, &result);
57765 let response = result?;
57766 match response.status().as_u16() {
57767 200u16 => ResponseValue::from_response(response).await,
57768 400u16 => {
57769 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
57770 }
57771 401u16 => {
57772 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
57773 }
57774 _ => Err(Error::UnexpectedResponse(response)),
57775 }
57776 }
57777 /**New OCO (TRADE)
57778
57779Send in a new OCO
57780
57781- Price Restrictions:
57782 - `SELL`: Limit Price > Last Price > Stop Price
57783 - `BUY`: Limit Price < Last Price < Stop Price
57784- Quantity Restrictions:
57785 - Both legs must have the same quantity
57786 - `ICEBERG` quantities however do not have to be the same
57787- Order Rate Limit
57788 - `OCO` counts as 2 orders against the order rate limit.
57789
57790Weight(IP): 1
57791
57792Sends a `POST` request to `/api/v3/order/oco`
57793
57794Arguments:
57795- `limit_client_order_id`: A unique Id for the limit order
57796- `limit_iceberg_qty`
57797- `limit_strategy_id`
57798- `limit_strategy_type`: The value cannot be less than 1000000.
57799- `list_client_order_id`: A unique Id for the entire orderList
57800- `new_order_resp_type`: Set the response JSON.
57801- `price`: Order price
57802- `quantity`
57803- `recv_window`: The value cannot be greater than 60000
57804- `self_trade_prevention_mode`: The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
57805- `side`
57806- `signature`: Signature
57807- `stop_client_order_id`: A unique Id for the stop loss/stop loss limit leg
57808- `stop_iceberg_qty`
57809- `stop_limit_price`: If provided, stopLimitTimeInForce is required.
57810- `stop_limit_time_in_force`
57811- `stop_price`
57812- `stop_strategy_id`
57813- `stop_strategy_type`
57814- `symbol`: Trading symbol, e.g. BNBUSDT
57815- `timestamp`: UTC timestamp in ms
57816- `trailing_delta`
57817*/
57818 pub async fn place_order_oco<'a>(
57819 &'a self,
57820 limit_client_order_id: Option<&'a str>,
57821 limit_iceberg_qty: Option<f64>,
57822 limit_strategy_id: Option<i64>,
57823 limit_strategy_type: Option<i64>,
57824 list_client_order_id: Option<&'a str>,
57825 new_order_resp_type: Option<types::PlaceOrderOcoNewOrderRespType>,
57826 price: f64,
57827 quantity: f64,
57828 recv_window: Option<i64>,
57829 self_trade_prevention_mode: Option<types::PlaceOrderOcoSelfTradePreventionMode>,
57830 side: types::PlaceOrderOcoSide,
57831 signature: &'a str,
57832 stop_client_order_id: Option<&'a str>,
57833 stop_iceberg_qty: Option<f64>,
57834 stop_limit_price: Option<f64>,
57835 stop_limit_time_in_force: Option<types::PlaceOrderOcoStopLimitTimeInForce>,
57836 stop_price: f64,
57837 stop_strategy_id: Option<i64>,
57838 stop_strategy_type: Option<i64>,
57839 symbol: &'a str,
57840 timestamp: i64,
57841 trailing_delta: Option<f64>,
57842 ) -> Result<ResponseValue<types::PlaceOrderOcoResponse>, Error<types::Error>> {
57843 let url = format!("{}/api/v3/order/oco", self.baseurl,);
57844 let mut query = Vec::with_capacity(22usize);
57845 if let Some(v) = &limit_client_order_id {
57846 query.push(("limitClientOrderId", v.to_string()));
57847 }
57848 if let Some(v) = &limit_iceberg_qty {
57849 query.push(("limitIcebergQty", v.to_string()));
57850 }
57851 if let Some(v) = &limit_strategy_id {
57852 query.push(("limitStrategyId", v.to_string()));
57853 }
57854 if let Some(v) = &limit_strategy_type {
57855 query.push(("limitStrategyType", v.to_string()));
57856 }
57857 if let Some(v) = &list_client_order_id {
57858 query.push(("listClientOrderId", v.to_string()));
57859 }
57860 if let Some(v) = &new_order_resp_type {
57861 query.push(("newOrderRespType", v.to_string()));
57862 }
57863 query.push(("price", price.to_string()));
57864 query.push(("quantity", quantity.to_string()));
57865 if let Some(v) = &recv_window {
57866 query.push(("recvWindow", v.to_string()));
57867 }
57868 if let Some(v) = &self_trade_prevention_mode {
57869 query.push(("selfTradePreventionMode", v.to_string()));
57870 }
57871 query.push(("side", side.to_string()));
57872 query.push(("signature", signature.to_string()));
57873 if let Some(v) = &stop_client_order_id {
57874 query.push(("stopClientOrderId", v.to_string()));
57875 }
57876 if let Some(v) = &stop_iceberg_qty {
57877 query.push(("stopIcebergQty", v.to_string()));
57878 }
57879 if let Some(v) = &stop_limit_price {
57880 query.push(("stopLimitPrice", v.to_string()));
57881 }
57882 if let Some(v) = &stop_limit_time_in_force {
57883 query.push(("stopLimitTimeInForce", v.to_string()));
57884 }
57885 query.push(("stopPrice", stop_price.to_string()));
57886 if let Some(v) = &stop_strategy_id {
57887 query.push(("stopStrategyId", v.to_string()));
57888 }
57889 if let Some(v) = &stop_strategy_type {
57890 query.push(("stopStrategyType", v.to_string()));
57891 }
57892 query.push(("symbol", symbol.to_string()));
57893 query.push(("timestamp", timestamp.to_string()));
57894 if let Some(v) = &trailing_delta {
57895 query.push(("trailingDelta", v.to_string()));
57896 }
57897 #[allow(unused_mut)]
57898 let mut request = self
57899 .client
57900 .post(url)
57901 .header(
57902 reqwest::header::ACCEPT,
57903 reqwest::header::HeaderValue::from_static("application/json"),
57904 )
57905 .query(&query)
57906 .build()?;
57907 (crate::pre_hook)(&self.inner, &request);
57908 let result = self.client.execute(request).await;
57909 (crate::post_hook)(&self.inner, &result);
57910 let response = result?;
57911 match response.status().as_u16() {
57912 200u16 => ResponseValue::from_response(response).await,
57913 400u16 => {
57914 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
57915 }
57916 401u16 => {
57917 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
57918 }
57919 _ => Err(Error::UnexpectedResponse(response)),
57920 }
57921 }
57922 /**Query OCO (USER_DATA)
57923
57924Retrieves a specific OCO based on provided optional parameters
57925
57926Weight(IP): 4
57927
57928Sends a `GET` request to `/api/v3/orderList`
57929
57930Arguments:
57931- `order_list_id`: Order list id
57932- `orig_client_order_id`: Order id from client
57933- `recv_window`: The value cannot be greater than 60000
57934- `signature`: Signature
57935- `timestamp`: UTC timestamp in ms
57936*/
57937 pub async fn order_list<'a>(
57938 &'a self,
57939 order_list_id: Option<i64>,
57940 orig_client_order_id: Option<&'a str>,
57941 recv_window: Option<i64>,
57942 signature: &'a str,
57943 timestamp: i64,
57944 ) -> Result<ResponseValue<types::OrderListResponse>, Error<types::Error>> {
57945 let url = format!("{}/api/v3/orderList", self.baseurl,);
57946 let mut query = Vec::with_capacity(5usize);
57947 if let Some(v) = &order_list_id {
57948 query.push(("orderListId", v.to_string()));
57949 }
57950 if let Some(v) = &orig_client_order_id {
57951 query.push(("origClientOrderId", v.to_string()));
57952 }
57953 if let Some(v) = &recv_window {
57954 query.push(("recvWindow", v.to_string()));
57955 }
57956 query.push(("signature", signature.to_string()));
57957 query.push(("timestamp", timestamp.to_string()));
57958 #[allow(unused_mut)]
57959 let mut request = self
57960 .client
57961 .get(url)
57962 .header(
57963 reqwest::header::ACCEPT,
57964 reqwest::header::HeaderValue::from_static("application/json"),
57965 )
57966 .query(&query)
57967 .build()?;
57968 (crate::pre_hook)(&self.inner, &request);
57969 let result = self.client.execute(request).await;
57970 (crate::post_hook)(&self.inner, &result);
57971 let response = result?;
57972 match response.status().as_u16() {
57973 200u16 => ResponseValue::from_response(response).await,
57974 400u16 => {
57975 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
57976 }
57977 401u16 => {
57978 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
57979 }
57980 _ => Err(Error::UnexpectedResponse(response)),
57981 }
57982 }
57983 /**Cancel OCO (TRADE)
57984
57985Cancel an entire Order List
57986
57987Canceling an individual leg will cancel the entire OCO
57988
57989Weight(IP): 1
57990
57991Sends a `DELETE` request to `/api/v3/orderList`
57992
57993Arguments:
57994- `list_client_order_id`: A unique Id for the entire orderList
57995- `new_client_order_id`: Used to uniquely identify this cancel. Automatically generated by default
57996- `order_list_id`: Order list id
57997- `recv_window`: The value cannot be greater than 60000
57998- `signature`: Signature
57999- `symbol`: Trading symbol, e.g. BNBUSDT
58000- `timestamp`: UTC timestamp in ms
58001*/
58002 pub async fn delete_order_list<'a>(
58003 &'a self,
58004 list_client_order_id: Option<&'a str>,
58005 new_client_order_id: Option<&'a str>,
58006 order_list_id: Option<i64>,
58007 recv_window: Option<i64>,
58008 signature: &'a str,
58009 symbol: &'a str,
58010 timestamp: i64,
58011 ) -> Result<ResponseValue<types::OcoOrder>, Error<types::Error>> {
58012 let url = format!("{}/api/v3/orderList", self.baseurl,);
58013 let mut query = Vec::with_capacity(7usize);
58014 if let Some(v) = &list_client_order_id {
58015 query.push(("listClientOrderId", v.to_string()));
58016 }
58017 if let Some(v) = &new_client_order_id {
58018 query.push(("newClientOrderId", v.to_string()));
58019 }
58020 if let Some(v) = &order_list_id {
58021 query.push(("orderListId", v.to_string()));
58022 }
58023 if let Some(v) = &recv_window {
58024 query.push(("recvWindow", v.to_string()));
58025 }
58026 query.push(("signature", signature.to_string()));
58027 query.push(("symbol", symbol.to_string()));
58028 query.push(("timestamp", timestamp.to_string()));
58029 #[allow(unused_mut)]
58030 let mut request = self
58031 .client
58032 .delete(url)
58033 .header(
58034 reqwest::header::ACCEPT,
58035 reqwest::header::HeaderValue::from_static("application/json"),
58036 )
58037 .query(&query)
58038 .build()?;
58039 (crate::pre_hook)(&self.inner, &request);
58040 let result = self.client.execute(request).await;
58041 (crate::post_hook)(&self.inner, &result);
58042 let response = result?;
58043 match response.status().as_u16() {
58044 200u16 => ResponseValue::from_response(response).await,
58045 400u16 => {
58046 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58047 }
58048 401u16 => {
58049 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58050 }
58051 _ => Err(Error::UnexpectedResponse(response)),
58052 }
58053 }
58054 /**Query all OCO (USER_DATA)
58055
58056Retrieves all OCO based on provided optional parameters
58057
58058Weight(IP): 20
58059
58060Sends a `GET` request to `/api/v3/allOrderList`
58061
58062Arguments:
58063- `end_time`: UTC timestamp in ms
58064- `from_id`: Trade id to fetch from. Default gets most recent trades.
58065- `limit`: Default 500; max 1000.
58066- `recv_window`: The value cannot be greater than 60000
58067- `signature`: Signature
58068- `start_time`: UTC timestamp in ms
58069- `timestamp`: UTC timestamp in ms
58070*/
58071 pub async fn all_order_list<'a>(
58072 &'a self,
58073 end_time: Option<i64>,
58074 from_id: Option<i64>,
58075 limit: Option<i32>,
58076 recv_window: Option<i64>,
58077 signature: &'a str,
58078 start_time: Option<i64>,
58079 timestamp: i64,
58080 ) -> Result<
58081 ResponseValue<Vec<types::AllOrderListResponseItem>>,
58082 Error<types::Error>,
58083 > {
58084 let url = format!("{}/api/v3/allOrderList", self.baseurl,);
58085 let mut query = Vec::with_capacity(7usize);
58086 if let Some(v) = &end_time {
58087 query.push(("endTime", v.to_string()));
58088 }
58089 if let Some(v) = &from_id {
58090 query.push(("fromId", v.to_string()));
58091 }
58092 if let Some(v) = &limit {
58093 query.push(("limit", v.to_string()));
58094 }
58095 if let Some(v) = &recv_window {
58096 query.push(("recvWindow", v.to_string()));
58097 }
58098 query.push(("signature", signature.to_string()));
58099 if let Some(v) = &start_time {
58100 query.push(("startTime", v.to_string()));
58101 }
58102 query.push(("timestamp", timestamp.to_string()));
58103 #[allow(unused_mut)]
58104 let mut request = self
58105 .client
58106 .get(url)
58107 .header(
58108 reqwest::header::ACCEPT,
58109 reqwest::header::HeaderValue::from_static("application/json"),
58110 )
58111 .query(&query)
58112 .build()?;
58113 (crate::pre_hook)(&self.inner, &request);
58114 let result = self.client.execute(request).await;
58115 (crate::post_hook)(&self.inner, &result);
58116 let response = result?;
58117 match response.status().as_u16() {
58118 200u16 => ResponseValue::from_response(response).await,
58119 400u16 => {
58120 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58121 }
58122 401u16 => {
58123 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58124 }
58125 _ => Err(Error::UnexpectedResponse(response)),
58126 }
58127 }
58128 /**Query Open OCO (USER_DATA)
58129
58130Weight(IP): 6
58131
58132Sends a `GET` request to `/api/v3/openOrderList`
58133
58134Arguments:
58135- `recv_window`: The value cannot be greater than 60000
58136- `signature`: Signature
58137- `timestamp`: UTC timestamp in ms
58138*/
58139 pub async fn open_order_list<'a>(
58140 &'a self,
58141 recv_window: Option<i64>,
58142 signature: &'a str,
58143 timestamp: i64,
58144 ) -> Result<
58145 ResponseValue<Vec<types::OpenOrderListResponseItem>>,
58146 Error<types::Error>,
58147 > {
58148 let url = format!("{}/api/v3/openOrderList", self.baseurl,);
58149 let mut query = Vec::with_capacity(3usize);
58150 if let Some(v) = &recv_window {
58151 query.push(("recvWindow", v.to_string()));
58152 }
58153 query.push(("signature", signature.to_string()));
58154 query.push(("timestamp", timestamp.to_string()));
58155 #[allow(unused_mut)]
58156 let mut request = self
58157 .client
58158 .get(url)
58159 .header(
58160 reqwest::header::ACCEPT,
58161 reqwest::header::HeaderValue::from_static("application/json"),
58162 )
58163 .query(&query)
58164 .build()?;
58165 (crate::pre_hook)(&self.inner, &request);
58166 let result = self.client.execute(request).await;
58167 (crate::post_hook)(&self.inner, &result);
58168 let response = result?;
58169 match response.status().as_u16() {
58170 200u16 => ResponseValue::from_response(response).await,
58171 400u16 => {
58172 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58173 }
58174 401u16 => {
58175 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58176 }
58177 _ => Err(Error::UnexpectedResponse(response)),
58178 }
58179 }
58180 /**New order using SOR (TRADE)
58181
58182Weight(IP): 6
58183
58184Sends a `POST` request to `/api/v3/sor/order`
58185
58186Arguments:
58187- `iceberg_qty`: Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order.
58188- `new_client_order_id`: Used to uniquely identify this cancel. Automatically generated by default
58189- `new_order_resp_type`: Set the response JSON. MARKET and LIMIT order types default to FULL, all other orders default to ACK.
58190- `price`
58191- `quantity`
58192- `recv_window`: The value cannot be greater than 60000
58193- `self_trade_prevention_mode`: The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
58194- `side`
58195- `signature`: Signature
58196- `strategy_id`
58197- `strategy_type`: The value cannot be less than 1000000.
58198- `symbol`: Trading symbol, e.g. BNBUSDT
58199- `time_in_force`: Order time in force
58200- `timestamp`: UTC timestamp in ms
58201- `type_`: Order type
58202*/
58203 pub async fn sor_order<'a>(
58204 &'a self,
58205 iceberg_qty: Option<f64>,
58206 new_client_order_id: Option<&'a str>,
58207 new_order_resp_type: Option<types::SorOrderNewOrderRespType>,
58208 price: Option<f64>,
58209 quantity: f64,
58210 recv_window: Option<i64>,
58211 self_trade_prevention_mode: Option<types::SorOrderSelfTradePreventionMode>,
58212 side: types::SorOrderSide,
58213 signature: &'a str,
58214 strategy_id: Option<i64>,
58215 strategy_type: Option<i64>,
58216 symbol: &'a str,
58217 time_in_force: Option<types::SorOrderTimeInForce>,
58218 timestamp: i64,
58219 type_: types::SorOrderType,
58220 ) -> Result<ResponseValue<types::SorOrderResponse>, Error<types::Error>> {
58221 let url = format!("{}/api/v3/sor/order", self.baseurl,);
58222 let mut query = Vec::with_capacity(15usize);
58223 if let Some(v) = &iceberg_qty {
58224 query.push(("icebergQty", v.to_string()));
58225 }
58226 if let Some(v) = &new_client_order_id {
58227 query.push(("newClientOrderId", v.to_string()));
58228 }
58229 if let Some(v) = &new_order_resp_type {
58230 query.push(("newOrderRespType", v.to_string()));
58231 }
58232 if let Some(v) = &price {
58233 query.push(("price", v.to_string()));
58234 }
58235 query.push(("quantity", quantity.to_string()));
58236 if let Some(v) = &recv_window {
58237 query.push(("recvWindow", v.to_string()));
58238 }
58239 if let Some(v) = &self_trade_prevention_mode {
58240 query.push(("selfTradePreventionMode", v.to_string()));
58241 }
58242 query.push(("side", side.to_string()));
58243 query.push(("signature", signature.to_string()));
58244 if let Some(v) = &strategy_id {
58245 query.push(("strategyId", v.to_string()));
58246 }
58247 if let Some(v) = &strategy_type {
58248 query.push(("strategyType", v.to_string()));
58249 }
58250 query.push(("symbol", symbol.to_string()));
58251 if let Some(v) = &time_in_force {
58252 query.push(("timeInForce", v.to_string()));
58253 }
58254 query.push(("timestamp", timestamp.to_string()));
58255 query.push(("type", type_.to_string()));
58256 #[allow(unused_mut)]
58257 let mut request = self
58258 .client
58259 .post(url)
58260 .header(
58261 reqwest::header::ACCEPT,
58262 reqwest::header::HeaderValue::from_static("application/json"),
58263 )
58264 .query(&query)
58265 .build()?;
58266 (crate::pre_hook)(&self.inner, &request);
58267 let result = self.client.execute(request).await;
58268 (crate::post_hook)(&self.inner, &result);
58269 let response = result?;
58270 match response.status().as_u16() {
58271 200u16 => ResponseValue::from_response(response).await,
58272 400u16 => {
58273 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58274 }
58275 401u16 => {
58276 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58277 }
58278 _ => Err(Error::UnexpectedResponse(response)),
58279 }
58280 }
58281 /**Test new order using SOR (TRADE)
58282
58283Test new order creation and signature/recvWindow using smart order routing (SOR).
58284Creates and validates a new order but does not send it into the matching engine.
58285
58286Sends a `POST` request to `/api/v3/sor/order/test`
58287
58288Arguments:
58289- `iceberg_qty`: Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order.
58290- `new_client_order_id`: Used to uniquely identify this cancel. Automatically generated by default
58291- `new_order_resp_type`: Set the response JSON. MARKET and LIMIT order types default to FULL, all other orders default to ACK.
58292- `price`
58293- `quantity`
58294- `recv_window`: The value cannot be greater than 60000
58295- `self_trade_prevention_mode`: The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
58296- `side`
58297- `signature`: Signature
58298- `strategy_id`
58299- `strategy_type`: The value cannot be less than 1000000.
58300- `symbol`: Trading symbol, e.g. BNBUSDT
58301- `time_in_force`: Order time in force
58302- `timestamp`: UTC timestamp in ms
58303- `type_`: Order type
58304*/
58305 pub async fn sor_order_test<'a>(
58306 &'a self,
58307 iceberg_qty: Option<f64>,
58308 new_client_order_id: Option<&'a str>,
58309 new_order_resp_type: Option<types::SorOrderTestNewOrderRespType>,
58310 price: Option<f64>,
58311 quantity: f64,
58312 recv_window: Option<i64>,
58313 self_trade_prevention_mode: Option<types::SorOrderTestSelfTradePreventionMode>,
58314 side: types::SorOrderTestSide,
58315 signature: &'a str,
58316 strategy_id: Option<i64>,
58317 strategy_type: Option<i64>,
58318 symbol: &'a str,
58319 time_in_force: Option<types::SorOrderTestTimeInForce>,
58320 timestamp: i64,
58321 type_: types::SorOrderTestType,
58322 ) -> Result<
58323 ResponseValue<serde_json::Map<String, serde_json::Value>>,
58324 Error<types::Error>,
58325 > {
58326 let url = format!("{}/api/v3/sor/order/test", self.baseurl,);
58327 let mut query = Vec::with_capacity(15usize);
58328 if let Some(v) = &iceberg_qty {
58329 query.push(("icebergQty", v.to_string()));
58330 }
58331 if let Some(v) = &new_client_order_id {
58332 query.push(("newClientOrderId", v.to_string()));
58333 }
58334 if let Some(v) = &new_order_resp_type {
58335 query.push(("newOrderRespType", v.to_string()));
58336 }
58337 if let Some(v) = &price {
58338 query.push(("price", v.to_string()));
58339 }
58340 query.push(("quantity", quantity.to_string()));
58341 if let Some(v) = &recv_window {
58342 query.push(("recvWindow", v.to_string()));
58343 }
58344 if let Some(v) = &self_trade_prevention_mode {
58345 query.push(("selfTradePreventionMode", v.to_string()));
58346 }
58347 query.push(("side", side.to_string()));
58348 query.push(("signature", signature.to_string()));
58349 if let Some(v) = &strategy_id {
58350 query.push(("strategyId", v.to_string()));
58351 }
58352 if let Some(v) = &strategy_type {
58353 query.push(("strategyType", v.to_string()));
58354 }
58355 query.push(("symbol", symbol.to_string()));
58356 if let Some(v) = &time_in_force {
58357 query.push(("timeInForce", v.to_string()));
58358 }
58359 query.push(("timestamp", timestamp.to_string()));
58360 query.push(("type", type_.to_string()));
58361 #[allow(unused_mut)]
58362 let mut request = self
58363 .client
58364 .post(url)
58365 .header(
58366 reqwest::header::ACCEPT,
58367 reqwest::header::HeaderValue::from_static("application/json"),
58368 )
58369 .query(&query)
58370 .build()?;
58371 (crate::pre_hook)(&self.inner, &request);
58372 let result = self.client.execute(request).await;
58373 (crate::post_hook)(&self.inner, &result);
58374 let response = result?;
58375 match response.status().as_u16() {
58376 200u16 => ResponseValue::from_response(response).await,
58377 400u16 => {
58378 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58379 }
58380 401u16 => {
58381 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58382 }
58383 _ => Err(Error::UnexpectedResponse(response)),
58384 }
58385 }
58386 /**Account Information (USER_DATA)
58387
58388Get current account information.
58389
58390Weight(IP): 20
58391
58392Sends a `GET` request to `/api/v3/account`
58393
58394Arguments:
58395- `recv_window`: The value cannot be greater than 60000
58396- `signature`: Signature
58397- `timestamp`: UTC timestamp in ms
58398*/
58399 pub async fn account<'a>(
58400 &'a self,
58401 recv_window: Option<i64>,
58402 signature: &'a str,
58403 timestamp: i64,
58404 ) -> Result<ResponseValue<types::Account>, Error<types::Error>> {
58405 let url = format!("{}/api/v3/account", self.baseurl,);
58406 let mut query = Vec::with_capacity(3usize);
58407 if let Some(v) = &recv_window {
58408 query.push(("recvWindow", v.to_string()));
58409 }
58410 query.push(("signature", signature.to_string()));
58411 query.push(("timestamp", timestamp.to_string()));
58412 #[allow(unused_mut)]
58413 let mut request = self
58414 .client
58415 .get(url)
58416 .header(
58417 reqwest::header::ACCEPT,
58418 reqwest::header::HeaderValue::from_static("application/json"),
58419 )
58420 .query(&query)
58421 .build()?;
58422 (crate::pre_hook)(&self.inner, &request);
58423 let result = self.client.execute(request).await;
58424 (crate::post_hook)(&self.inner, &result);
58425 let response = result?;
58426 match response.status().as_u16() {
58427 200u16 => ResponseValue::from_response(response).await,
58428 400u16 => {
58429 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58430 }
58431 401u16 => {
58432 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58433 }
58434 _ => Err(Error::UnexpectedResponse(response)),
58435 }
58436 }
58437 /**Account Trade List (USER_DATA)
58438
58439Get trades for a specific account and symbol.
58440
58441If `fromId` is set, it will get id >= that `fromId`. Otherwise most recent orders are returned.
58442
58443The time between startTime and endTime can't be longer than 24 hours.
58444These are the supported combinations of all parameters:
58445
58446 symbol
58447
58448 symbol + orderId
58449
58450 symbol + startTime
58451
58452 symbol + endTime
58453
58454 symbol + fromId
58455
58456 symbol + startTime + endTime
58457
58458 symbol+ orderId + fromId
58459
58460Weight(IP): 20
58461
58462Sends a `GET` request to `/api/v3/myTrades`
58463
58464Arguments:
58465- `end_time`: UTC timestamp in ms
58466- `from_id`: Trade id to fetch from. Default gets most recent trades.
58467- `limit`: Default 500; max 1000.
58468- `order_id`: This can only be used in combination with symbol.
58469- `recv_window`: The value cannot be greater than 60000
58470- `signature`: Signature
58471- `start_time`: UTC timestamp in ms
58472- `symbol`: Trading symbol, e.g. BNBUSDT
58473- `timestamp`: UTC timestamp in ms
58474*/
58475 pub async fn my_trades<'a>(
58476 &'a self,
58477 end_time: Option<i64>,
58478 from_id: Option<i64>,
58479 limit: Option<i32>,
58480 order_id: Option<i64>,
58481 recv_window: Option<i64>,
58482 signature: &'a str,
58483 start_time: Option<i64>,
58484 symbol: &'a str,
58485 timestamp: i64,
58486 ) -> Result<ResponseValue<Vec<types::MyTrade>>, Error<types::Error>> {
58487 let url = format!("{}/api/v3/myTrades", self.baseurl,);
58488 let mut query = Vec::with_capacity(9usize);
58489 if let Some(v) = &end_time {
58490 query.push(("endTime", v.to_string()));
58491 }
58492 if let Some(v) = &from_id {
58493 query.push(("fromId", v.to_string()));
58494 }
58495 if let Some(v) = &limit {
58496 query.push(("limit", v.to_string()));
58497 }
58498 if let Some(v) = &order_id {
58499 query.push(("orderId", v.to_string()));
58500 }
58501 if let Some(v) = &recv_window {
58502 query.push(("recvWindow", v.to_string()));
58503 }
58504 query.push(("signature", signature.to_string()));
58505 if let Some(v) = &start_time {
58506 query.push(("startTime", v.to_string()));
58507 }
58508 query.push(("symbol", symbol.to_string()));
58509 query.push(("timestamp", timestamp.to_string()));
58510 #[allow(unused_mut)]
58511 let mut request = self
58512 .client
58513 .get(url)
58514 .header(
58515 reqwest::header::ACCEPT,
58516 reqwest::header::HeaderValue::from_static("application/json"),
58517 )
58518 .query(&query)
58519 .build()?;
58520 (crate::pre_hook)(&self.inner, &request);
58521 let result = self.client.execute(request).await;
58522 (crate::post_hook)(&self.inner, &result);
58523 let response = result?;
58524 match response.status().as_u16() {
58525 200u16 => ResponseValue::from_response(response).await,
58526 400u16 => {
58527 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58528 }
58529 401u16 => {
58530 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58531 }
58532 _ => Err(Error::UnexpectedResponse(response)),
58533 }
58534 }
58535 /**Query Current Order Count Usage (TRADE)
58536
58537Displays the user's current order count usage for all intervals.
58538
58539Weight(IP): 40
58540
58541Sends a `GET` request to `/api/v3/rateLimit/order`
58542
58543Arguments:
58544- `recv_window`: The value cannot be greater than 60000
58545- `signature`: Signature
58546- `timestamp`: UTC timestamp in ms
58547*/
58548 pub async fn rate_limit_order<'a>(
58549 &'a self,
58550 recv_window: Option<i64>,
58551 signature: &'a str,
58552 timestamp: i64,
58553 ) -> Result<
58554 ResponseValue<Vec<types::RateLimitOrderResponseItem>>,
58555 Error<types::Error>,
58556 > {
58557 let url = format!("{}/api/v3/rateLimit/order", self.baseurl,);
58558 let mut query = Vec::with_capacity(3usize);
58559 if let Some(v) = &recv_window {
58560 query.push(("recvWindow", v.to_string()));
58561 }
58562 query.push(("signature", signature.to_string()));
58563 query.push(("timestamp", timestamp.to_string()));
58564 #[allow(unused_mut)]
58565 let mut request = self
58566 .client
58567 .get(url)
58568 .header(
58569 reqwest::header::ACCEPT,
58570 reqwest::header::HeaderValue::from_static("application/json"),
58571 )
58572 .query(&query)
58573 .build()?;
58574 (crate::pre_hook)(&self.inner, &request);
58575 let result = self.client.execute(request).await;
58576 (crate::post_hook)(&self.inner, &result);
58577 let response = result?;
58578 match response.status().as_u16() {
58579 200u16 => ResponseValue::from_response(response).await,
58580 400u16 => {
58581 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58582 }
58583 401u16 => {
58584 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58585 }
58586 _ => Err(Error::UnexpectedResponse(response)),
58587 }
58588 }
58589 /**Query Prevented Matches
58590
58591Displays the list of orders that were expired because of STP.
58592
58593For additional information on what a Prevented match is, as well as Self Trade Prevention (STP), please refer to our STP FAQ page.
58594
58595These are the combinations supported:
58596
58597* symbol + preventedMatchId
58598* symbol + orderId
58599* symbol + orderId + fromPreventedMatchId (limit will default to 500)
58600* symbol + orderId + fromPreventedMatchId + limit
58601
58602Weight(IP):
58603
58604Case Weight
58605If symbol is invalid: 2
58606Querying by preventedMatchId: 2
58607Querying by orderId: 20
58608
58609Sends a `GET` request to `/api/v3/myPreventedMatches`
58610
58611Arguments:
58612- `from_prevented_match_id`
58613- `limit`: Default 500; max 1000.
58614- `order_id`: Order id
58615- `prevented_match_id`
58616- `recv_window`: The value cannot be greater than 60000
58617- `signature`: Signature
58618- `symbol`: Trading symbol, e.g. BNBUSDT
58619- `timestamp`: UTC timestamp in ms
58620*/
58621 pub async fn my_prevented_matches<'a>(
58622 &'a self,
58623 from_prevented_match_id: Option<i64>,
58624 limit: Option<i32>,
58625 order_id: Option<i64>,
58626 prevented_match_id: Option<i64>,
58627 recv_window: Option<i64>,
58628 signature: &'a str,
58629 symbol: &'a str,
58630 timestamp: i64,
58631 ) -> Result<
58632 ResponseValue<Vec<types::MyPreventedMatchesResponseItem>>,
58633 Error<types::Error>,
58634 > {
58635 let url = format!("{}/api/v3/myPreventedMatches", self.baseurl,);
58636 let mut query = Vec::with_capacity(8usize);
58637 if let Some(v) = &from_prevented_match_id {
58638 query.push(("fromPreventedMatchId", v.to_string()));
58639 }
58640 if let Some(v) = &limit {
58641 query.push(("limit", v.to_string()));
58642 }
58643 if let Some(v) = &order_id {
58644 query.push(("orderId", v.to_string()));
58645 }
58646 if let Some(v) = &prevented_match_id {
58647 query.push(("preventedMatchId", v.to_string()));
58648 }
58649 if let Some(v) = &recv_window {
58650 query.push(("recvWindow", v.to_string()));
58651 }
58652 query.push(("signature", signature.to_string()));
58653 query.push(("symbol", symbol.to_string()));
58654 query.push(("timestamp", timestamp.to_string()));
58655 #[allow(unused_mut)]
58656 let mut request = self
58657 .client
58658 .get(url)
58659 .header(
58660 reqwest::header::ACCEPT,
58661 reqwest::header::HeaderValue::from_static("application/json"),
58662 )
58663 .query(&query)
58664 .build()?;
58665 (crate::pre_hook)(&self.inner, &request);
58666 let result = self.client.execute(request).await;
58667 (crate::post_hook)(&self.inner, &result);
58668 let response = result?;
58669 match response.status().as_u16() {
58670 200u16 => ResponseValue::from_response(response).await,
58671 400u16 => {
58672 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58673 }
58674 401u16 => {
58675 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58676 }
58677 _ => Err(Error::UnexpectedResponse(response)),
58678 }
58679 }
58680 /**Query Allocations (USER_DATA)
58681
58682Retrieves allocations resulting from SOR order placement.
58683
58684Weight: 20
58685
58686Supported parameter combinations:
58687Parameters Response
58688symbol allocations from oldest to newest
58689symbol + startTime oldest allocations since startTime
58690symbol + endTime newest allocations until endTime
58691symbol + startTime + endTime allocations within the time range
58692symbol + fromAllocationId allocations by allocation ID
58693symbol + orderId allocations related to an order starting with oldest
58694symbol + orderId + fromAllocationId allocations related to an order by allocation ID
58695
58696Note: The time between startTime and endTime can't be longer than 24 hours.
58697
58698Sends a `GET` request to `/api/v3/myAllocations`
58699
58700Arguments:
58701- `end_time`: UTC timestamp in ms
58702- `from_allocation_id`
58703- `limit`: Default 500; max 1000.
58704- `order_id`: Order id
58705- `recv_window`: The value cannot be greater than 60000
58706- `signature`: Signature
58707- `start_time`: UTC timestamp in ms
58708- `symbol`: Trading symbol, e.g. BNBUSDT
58709- `timestamp`: UTC timestamp in ms
58710*/
58711 pub async fn my_allocations<'a>(
58712 &'a self,
58713 end_time: Option<i64>,
58714 from_allocation_id: Option<i64>,
58715 limit: Option<i32>,
58716 order_id: Option<i64>,
58717 recv_window: Option<i64>,
58718 signature: &'a str,
58719 start_time: Option<i64>,
58720 symbol: &'a str,
58721 timestamp: i64,
58722 ) -> Result<
58723 ResponseValue<Vec<types::MyAllocationsResponseItem>>,
58724 Error<types::Error>,
58725 > {
58726 let url = format!("{}/api/v3/myAllocations", self.baseurl,);
58727 let mut query = Vec::with_capacity(9usize);
58728 if let Some(v) = &end_time {
58729 query.push(("endTime", v.to_string()));
58730 }
58731 if let Some(v) = &from_allocation_id {
58732 query.push(("fromAllocationId", v.to_string()));
58733 }
58734 if let Some(v) = &limit {
58735 query.push(("limit", v.to_string()));
58736 }
58737 if let Some(v) = &order_id {
58738 query.push(("orderId", v.to_string()));
58739 }
58740 if let Some(v) = &recv_window {
58741 query.push(("recvWindow", v.to_string()));
58742 }
58743 query.push(("signature", signature.to_string()));
58744 if let Some(v) = &start_time {
58745 query.push(("startTime", v.to_string()));
58746 }
58747 query.push(("symbol", symbol.to_string()));
58748 query.push(("timestamp", timestamp.to_string()));
58749 #[allow(unused_mut)]
58750 let mut request = self
58751 .client
58752 .get(url)
58753 .header(
58754 reqwest::header::ACCEPT,
58755 reqwest::header::HeaderValue::from_static("application/json"),
58756 )
58757 .query(&query)
58758 .build()?;
58759 (crate::pre_hook)(&self.inner, &request);
58760 let result = self.client.execute(request).await;
58761 (crate::post_hook)(&self.inner, &result);
58762 let response = result?;
58763 match response.status().as_u16() {
58764 200u16 => ResponseValue::from_response(response).await,
58765 400u16 => {
58766 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58767 }
58768 401u16 => {
58769 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58770 }
58771 _ => Err(Error::UnexpectedResponse(response)),
58772 }
58773 }
58774 /**Get Cross Margin Transfer History (USER_DATA)
58775
58776- Response in descending order
58777- Returns data for last 7 days by default
58778- Set `archived` to `true` to query data from 6 months ago
58779
58780Weight(IP): 1
58781
58782Sends a `GET` request to `/sapi/v1/margin/transfer`
58783
58784Arguments:
58785- `archived`: Default: false. Set to true for archived data from 6 months ago
58786- `asset`
58787- `current`: Current querying page. Start from 1. Default:1
58788- `end_time`: UTC timestamp in ms
58789- `recv_window`: The value cannot be greater than 60000
58790- `signature`: Signature
58791- `size`: Default:10 Max:100
58792- `start_time`: UTC timestamp in ms
58793- `timestamp`: UTC timestamp in ms
58794- `type_`
58795*/
58796 pub async fn get_margin_transfer<'a>(
58797 &'a self,
58798 archived: Option<&'a str>,
58799 asset: Option<&'a str>,
58800 current: Option<i32>,
58801 end_time: Option<i64>,
58802 recv_window: Option<i64>,
58803 signature: &'a str,
58804 size: Option<i32>,
58805 start_time: Option<i64>,
58806 timestamp: i64,
58807 type_: Option<types::GetMarginTransferType>,
58808 ) -> Result<ResponseValue<types::GetMarginTransferResponse>, Error<types::Error>> {
58809 let url = format!("{}/sapi/v1/margin/transfer", self.baseurl,);
58810 let mut query = Vec::with_capacity(10usize);
58811 if let Some(v) = &archived {
58812 query.push(("archived", v.to_string()));
58813 }
58814 if let Some(v) = &asset {
58815 query.push(("asset", v.to_string()));
58816 }
58817 if let Some(v) = ¤t {
58818 query.push(("current", v.to_string()));
58819 }
58820 if let Some(v) = &end_time {
58821 query.push(("endTime", v.to_string()));
58822 }
58823 if let Some(v) = &recv_window {
58824 query.push(("recvWindow", v.to_string()));
58825 }
58826 query.push(("signature", signature.to_string()));
58827 if let Some(v) = &size {
58828 query.push(("size", v.to_string()));
58829 }
58830 if let Some(v) = &start_time {
58831 query.push(("startTime", v.to_string()));
58832 }
58833 query.push(("timestamp", timestamp.to_string()));
58834 if let Some(v) = &type_ {
58835 query.push(("type", v.to_string()));
58836 }
58837 #[allow(unused_mut)]
58838 let mut request = self
58839 .client
58840 .get(url)
58841 .header(
58842 reqwest::header::ACCEPT,
58843 reqwest::header::HeaderValue::from_static("application/json"),
58844 )
58845 .query(&query)
58846 .build()?;
58847 (crate::pre_hook)(&self.inner, &request);
58848 let result = self.client.execute(request).await;
58849 (crate::post_hook)(&self.inner, &result);
58850 let response = result?;
58851 match response.status().as_u16() {
58852 200u16 => ResponseValue::from_response(response).await,
58853 400u16 => {
58854 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58855 }
58856 401u16 => {
58857 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58858 }
58859 _ => Err(Error::UnexpectedResponse(response)),
58860 }
58861 }
58862 /**Cross Margin Account Transfer (MARGIN)
58863
58864Execute transfer between spot account and cross margin account.
58865
58866Weight(IP): 600
58867
58868Sends a `POST` request to `/sapi/v1/margin/transfer`
58869
58870Arguments:
58871- `amount`
58872- `asset`
58873- `recv_window`: The value cannot be greater than 60000
58874- `signature`: Signature
58875- `timestamp`: UTC timestamp in ms
58876- `type_`: * `1` - transfer from main account to margin account
58877* `2` - transfer from margin account to main account
58878*/
58879 pub async fn execute_margin_transfer<'a>(
58880 &'a self,
58881 amount: f64,
58882 asset: &'a str,
58883 recv_window: Option<i64>,
58884 signature: &'a str,
58885 timestamp: i64,
58886 type_: i64,
58887 ) -> Result<ResponseValue<types::Transaction>, Error<types::Error>> {
58888 let url = format!("{}/sapi/v1/margin/transfer", self.baseurl,);
58889 let mut query = Vec::with_capacity(6usize);
58890 query.push(("amount", amount.to_string()));
58891 query.push(("asset", asset.to_string()));
58892 if let Some(v) = &recv_window {
58893 query.push(("recvWindow", v.to_string()));
58894 }
58895 query.push(("signature", signature.to_string()));
58896 query.push(("timestamp", timestamp.to_string()));
58897 query.push(("type", type_.to_string()));
58898 #[allow(unused_mut)]
58899 let mut request = self
58900 .client
58901 .post(url)
58902 .header(
58903 reqwest::header::ACCEPT,
58904 reqwest::header::HeaderValue::from_static("application/json"),
58905 )
58906 .query(&query)
58907 .build()?;
58908 (crate::pre_hook)(&self.inner, &request);
58909 let result = self.client.execute(request).await;
58910 (crate::post_hook)(&self.inner, &result);
58911 let response = result?;
58912 match response.status().as_u16() {
58913 200u16 => ResponseValue::from_response(response).await,
58914 400u16 => {
58915 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58916 }
58917 401u16 => {
58918 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
58919 }
58920 _ => Err(Error::UnexpectedResponse(response)),
58921 }
58922 }
58923 /**Query Loan Record (USER_DATA)
58924
58925- `txId` or `startTime` must be sent. `txId` takes precedence.
58926- Response in descending order
58927- If `isolatedSymbol` is not sent, crossed margin data will be returned
58928- Set `archived` to `true` to query data from 6 months ago
58929
58930Weight(IP): 10
58931
58932Sends a `GET` request to `/sapi/v1/margin/loan`
58933
58934Arguments:
58935- `archived`: Default: false. Set to true for archived data from 6 months ago
58936- `asset`
58937- `current`: Current querying page. Start from 1. Default:1
58938- `end_time`: UTC timestamp in ms
58939- `isolated_symbol`: Isolated symbol
58940- `recv_window`: The value cannot be greater than 60000
58941- `signature`: Signature
58942- `size`: Default:10 Max:100
58943- `start_time`: UTC timestamp in ms
58944- `timestamp`: UTC timestamp in ms
58945- `tx_id`: the tranId in `POST /sapi/v1/margin/loan`
58946*/
58947 pub async fn query_margin_loan_record<'a>(
58948 &'a self,
58949 archived: Option<&'a str>,
58950 asset: &'a str,
58951 current: Option<i32>,
58952 end_time: Option<i64>,
58953 isolated_symbol: Option<&'a str>,
58954 recv_window: Option<i64>,
58955 signature: &'a str,
58956 size: Option<i32>,
58957 start_time: Option<i64>,
58958 timestamp: i64,
58959 tx_id: Option<i64>,
58960 ) -> Result<
58961 ResponseValue<types::QueryMarginLoanRecordResponse>,
58962 Error<types::Error>,
58963 > {
58964 let url = format!("{}/sapi/v1/margin/loan", self.baseurl,);
58965 let mut query = Vec::with_capacity(11usize);
58966 if let Some(v) = &archived {
58967 query.push(("archived", v.to_string()));
58968 }
58969 query.push(("asset", asset.to_string()));
58970 if let Some(v) = ¤t {
58971 query.push(("current", v.to_string()));
58972 }
58973 if let Some(v) = &end_time {
58974 query.push(("endTime", v.to_string()));
58975 }
58976 if let Some(v) = &isolated_symbol {
58977 query.push(("isolatedSymbol", v.to_string()));
58978 }
58979 if let Some(v) = &recv_window {
58980 query.push(("recvWindow", v.to_string()));
58981 }
58982 query.push(("signature", signature.to_string()));
58983 if let Some(v) = &size {
58984 query.push(("size", v.to_string()));
58985 }
58986 if let Some(v) = &start_time {
58987 query.push(("startTime", v.to_string()));
58988 }
58989 query.push(("timestamp", timestamp.to_string()));
58990 if let Some(v) = &tx_id {
58991 query.push(("txId", v.to_string()));
58992 }
58993 #[allow(unused_mut)]
58994 let mut request = self
58995 .client
58996 .get(url)
58997 .header(
58998 reqwest::header::ACCEPT,
58999 reqwest::header::HeaderValue::from_static("application/json"),
59000 )
59001 .query(&query)
59002 .build()?;
59003 (crate::pre_hook)(&self.inner, &request);
59004 let result = self.client.execute(request).await;
59005 (crate::post_hook)(&self.inner, &result);
59006 let response = result?;
59007 match response.status().as_u16() {
59008 200u16 => ResponseValue::from_response(response).await,
59009 400u16 => {
59010 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59011 }
59012 401u16 => {
59013 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59014 }
59015 _ => Err(Error::UnexpectedResponse(response)),
59016 }
59017 }
59018 /**Margin Account Borrow (MARGIN)
59019
59020Apply for a loan.
59021
59022- If "isIsolated" = "TRUE", "symbol" must be sent
59023- "isIsolated" = "FALSE" for crossed margin loan
59024
59025Weight(UID): 3000
59026
59027Sends a `POST` request to `/sapi/v1/margin/loan`
59028
59029Arguments:
59030- `amount`
59031- `asset`
59032- `is_isolated`: * `TRUE` - For isolated margin
59033* `FALSE` - Default, not for isolated margin
59034- `recv_window`: The value cannot be greater than 60000
59035- `signature`: Signature
59036- `symbol`: Trading symbol, e.g. BNBUSDT
59037- `timestamp`: UTC timestamp in ms
59038*/
59039 pub async fn apply_for_margin_loan<'a>(
59040 &'a self,
59041 amount: f64,
59042 asset: &'a str,
59043 is_isolated: Option<types::ApplyForMarginLoanIsIsolated>,
59044 recv_window: Option<i64>,
59045 signature: &'a str,
59046 symbol: Option<&'a str>,
59047 timestamp: i64,
59048 ) -> Result<ResponseValue<types::Transaction>, Error<types::Error>> {
59049 let url = format!("{}/sapi/v1/margin/loan", self.baseurl,);
59050 let mut query = Vec::with_capacity(7usize);
59051 query.push(("amount", amount.to_string()));
59052 query.push(("asset", asset.to_string()));
59053 if let Some(v) = &is_isolated {
59054 query.push(("isIsolated", v.to_string()));
59055 }
59056 if let Some(v) = &recv_window {
59057 query.push(("recvWindow", v.to_string()));
59058 }
59059 query.push(("signature", signature.to_string()));
59060 if let Some(v) = &symbol {
59061 query.push(("symbol", v.to_string()));
59062 }
59063 query.push(("timestamp", timestamp.to_string()));
59064 #[allow(unused_mut)]
59065 let mut request = self
59066 .client
59067 .post(url)
59068 .header(
59069 reqwest::header::ACCEPT,
59070 reqwest::header::HeaderValue::from_static("application/json"),
59071 )
59072 .query(&query)
59073 .build()?;
59074 (crate::pre_hook)(&self.inner, &request);
59075 let result = self.client.execute(request).await;
59076 (crate::post_hook)(&self.inner, &result);
59077 let response = result?;
59078 match response.status().as_u16() {
59079 200u16 => ResponseValue::from_response(response).await,
59080 400u16 => {
59081 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59082 }
59083 401u16 => {
59084 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59085 }
59086 _ => Err(Error::UnexpectedResponse(response)),
59087 }
59088 }
59089 /**Query Repay Record (USER_DATA)
59090
59091- `txId` or `startTime` must be sent. `txId` takes precedence.
59092- Response in descending order
59093- If `isolatedSymbol` is not sent, crossed margin data will be returned
59094- Set `archived` to `true` to query data from 6 months ago
59095
59096Weight(IP): 10
59097
59098Sends a `GET` request to `/sapi/v1/margin/repay`
59099
59100Arguments:
59101- `archived`: Default: false. Set to true for archived data from 6 months ago
59102- `asset`
59103- `current`: Current querying page. Start from 1. Default:1
59104- `end_time`: UTC timestamp in ms
59105- `isolated_symbol`: Isolated symbol
59106- `recv_window`: The value cannot be greater than 60000
59107- `signature`: Signature
59108- `size`: Default:10 Max:100
59109- `start_time`: UTC timestamp in ms
59110- `timestamp`: UTC timestamp in ms
59111- `tx_id`: the tranId in `POST /sapi/v1/margin/repay`
59112*/
59113 pub async fn query_margin_repay<'a>(
59114 &'a self,
59115 archived: Option<&'a str>,
59116 asset: &'a str,
59117 current: Option<i32>,
59118 end_time: Option<i64>,
59119 isolated_symbol: Option<&'a str>,
59120 recv_window: Option<i64>,
59121 signature: &'a str,
59122 size: Option<i32>,
59123 start_time: Option<i64>,
59124 timestamp: i64,
59125 tx_id: Option<i64>,
59126 ) -> Result<ResponseValue<types::QueryMarginRepayResponse>, Error<types::Error>> {
59127 let url = format!("{}/sapi/v1/margin/repay", self.baseurl,);
59128 let mut query = Vec::with_capacity(11usize);
59129 if let Some(v) = &archived {
59130 query.push(("archived", v.to_string()));
59131 }
59132 query.push(("asset", asset.to_string()));
59133 if let Some(v) = ¤t {
59134 query.push(("current", v.to_string()));
59135 }
59136 if let Some(v) = &end_time {
59137 query.push(("endTime", v.to_string()));
59138 }
59139 if let Some(v) = &isolated_symbol {
59140 query.push(("isolatedSymbol", v.to_string()));
59141 }
59142 if let Some(v) = &recv_window {
59143 query.push(("recvWindow", v.to_string()));
59144 }
59145 query.push(("signature", signature.to_string()));
59146 if let Some(v) = &size {
59147 query.push(("size", v.to_string()));
59148 }
59149 if let Some(v) = &start_time {
59150 query.push(("startTime", v.to_string()));
59151 }
59152 query.push(("timestamp", timestamp.to_string()));
59153 if let Some(v) = &tx_id {
59154 query.push(("txId", v.to_string()));
59155 }
59156 #[allow(unused_mut)]
59157 let mut request = self
59158 .client
59159 .get(url)
59160 .header(
59161 reqwest::header::ACCEPT,
59162 reqwest::header::HeaderValue::from_static("application/json"),
59163 )
59164 .query(&query)
59165 .build()?;
59166 (crate::pre_hook)(&self.inner, &request);
59167 let result = self.client.execute(request).await;
59168 (crate::post_hook)(&self.inner, &result);
59169 let response = result?;
59170 match response.status().as_u16() {
59171 200u16 => ResponseValue::from_response(response).await,
59172 400u16 => {
59173 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59174 }
59175 401u16 => {
59176 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59177 }
59178 _ => Err(Error::UnexpectedResponse(response)),
59179 }
59180 }
59181 /**Margin Account Repay (MARGIN)
59182
59183Repay loan for margin account.
59184
59185- If "isIsolated" = "TRUE", "symbol" must be sent
59186- "isIsolated" = "FALSE" for crossed margin repay
59187
59188Weight(IP): 3000
59189
59190Sends a `POST` request to `/sapi/v1/margin/repay`
59191
59192Arguments:
59193- `amount`
59194- `asset`
59195- `is_isolated`: * `TRUE` - For isolated margin
59196* `FALSE` - Default, not for isolated margin
59197- `recv_window`: The value cannot be greater than 60000
59198- `signature`: Signature
59199- `symbol`: Trading symbol, e.g. BNBUSDT
59200- `timestamp`: UTC timestamp in ms
59201*/
59202 pub async fn margin_repay<'a>(
59203 &'a self,
59204 amount: f64,
59205 asset: &'a str,
59206 is_isolated: Option<types::MarginRepayIsIsolated>,
59207 recv_window: Option<i64>,
59208 signature: &'a str,
59209 symbol: Option<&'a str>,
59210 timestamp: i64,
59211 ) -> Result<ResponseValue<types::Transaction>, Error<types::Error>> {
59212 let url = format!("{}/sapi/v1/margin/repay", self.baseurl,);
59213 let mut query = Vec::with_capacity(7usize);
59214 query.push(("amount", amount.to_string()));
59215 query.push(("asset", asset.to_string()));
59216 if let Some(v) = &is_isolated {
59217 query.push(("isIsolated", v.to_string()));
59218 }
59219 if let Some(v) = &recv_window {
59220 query.push(("recvWindow", v.to_string()));
59221 }
59222 query.push(("signature", signature.to_string()));
59223 if let Some(v) = &symbol {
59224 query.push(("symbol", v.to_string()));
59225 }
59226 query.push(("timestamp", timestamp.to_string()));
59227 #[allow(unused_mut)]
59228 let mut request = self
59229 .client
59230 .post(url)
59231 .header(
59232 reqwest::header::ACCEPT,
59233 reqwest::header::HeaderValue::from_static("application/json"),
59234 )
59235 .query(&query)
59236 .build()?;
59237 (crate::pre_hook)(&self.inner, &request);
59238 let result = self.client.execute(request).await;
59239 (crate::post_hook)(&self.inner, &result);
59240 let response = result?;
59241 match response.status().as_u16() {
59242 200u16 => ResponseValue::from_response(response).await,
59243 400u16 => {
59244 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59245 }
59246 401u16 => {
59247 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59248 }
59249 _ => Err(Error::UnexpectedResponse(response)),
59250 }
59251 }
59252 /**Query Margin Asset (MARKET_DATA)
59253
59254Weight(IP): 10
59255
59256Sends a `GET` request to `/sapi/v1/margin/asset`
59257
59258*/
59259 pub async fn margin_asset<'a>(
59260 &'a self,
59261 asset: &'a str,
59262 ) -> Result<ResponseValue<types::MarginAssetResponse>, Error<types::Error>> {
59263 let url = format!("{}/sapi/v1/margin/asset", self.baseurl,);
59264 let mut query = Vec::with_capacity(1usize);
59265 query.push(("asset", asset.to_string()));
59266 #[allow(unused_mut)]
59267 let mut request = self
59268 .client
59269 .get(url)
59270 .header(
59271 reqwest::header::ACCEPT,
59272 reqwest::header::HeaderValue::from_static("application/json"),
59273 )
59274 .query(&query)
59275 .build()?;
59276 (crate::pre_hook)(&self.inner, &request);
59277 let result = self.client.execute(request).await;
59278 (crate::post_hook)(&self.inner, &result);
59279 let response = result?;
59280 match response.status().as_u16() {
59281 200u16 => ResponseValue::from_response(response).await,
59282 400u16 => {
59283 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59284 }
59285 _ => Err(Error::UnexpectedResponse(response)),
59286 }
59287 }
59288 /**Query Cross Margin Pair (MARKET_DATA)
59289
59290Weight(IP): 10
59291
59292Sends a `GET` request to `/sapi/v1/margin/pair`
59293
59294Arguments:
59295- `symbol`: Trading symbol, e.g. BNBUSDT
59296*/
59297 pub async fn margin_pair<'a>(
59298 &'a self,
59299 symbol: &'a str,
59300 ) -> Result<ResponseValue<types::MarginPairResponse>, Error<types::Error>> {
59301 let url = format!("{}/sapi/v1/margin/pair", self.baseurl,);
59302 let mut query = Vec::with_capacity(1usize);
59303 query.push(("symbol", symbol.to_string()));
59304 #[allow(unused_mut)]
59305 let mut request = self
59306 .client
59307 .get(url)
59308 .header(
59309 reqwest::header::ACCEPT,
59310 reqwest::header::HeaderValue::from_static("application/json"),
59311 )
59312 .query(&query)
59313 .build()?;
59314 (crate::pre_hook)(&self.inner, &request);
59315 let result = self.client.execute(request).await;
59316 (crate::post_hook)(&self.inner, &result);
59317 let response = result?;
59318 match response.status().as_u16() {
59319 200u16 => ResponseValue::from_response(response).await,
59320 400u16 => {
59321 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59322 }
59323 _ => Err(Error::UnexpectedResponse(response)),
59324 }
59325 }
59326 /**Get All Margin Assets (MARKET_DATA)
59327
59328Weight(IP): 1
59329
59330Sends a `GET` request to `/sapi/v1/margin/allAssets`
59331
59332*/
59333 pub async fn margin_all_assets<'a>(
59334 &'a self,
59335 ) -> Result<
59336 ResponseValue<Vec<types::MarginAllAssetsResponseItem>>,
59337 Error<types::Error>,
59338 > {
59339 let url = format!("{}/sapi/v1/margin/allAssets", self.baseurl,);
59340 #[allow(unused_mut)]
59341 let mut request = self
59342 .client
59343 .get(url)
59344 .header(
59345 reqwest::header::ACCEPT,
59346 reqwest::header::HeaderValue::from_static("application/json"),
59347 )
59348 .build()?;
59349 (crate::pre_hook)(&self.inner, &request);
59350 let result = self.client.execute(request).await;
59351 (crate::post_hook)(&self.inner, &result);
59352 let response = result?;
59353 match response.status().as_u16() {
59354 200u16 => ResponseValue::from_response(response).await,
59355 400u16 => {
59356 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59357 }
59358 _ => Err(Error::UnexpectedResponse(response)),
59359 }
59360 }
59361 /**Get All Cross Margin Pairs (MARKET_DATA)
59362
59363Weight(IP): 1
59364
59365Sends a `GET` request to `/sapi/v1/margin/allPairs`
59366
59367*/
59368 pub async fn margin_all_pairs<'a>(
59369 &'a self,
59370 ) -> Result<
59371 ResponseValue<Vec<types::MarginAllPairsResponseItem>>,
59372 Error<types::Error>,
59373 > {
59374 let url = format!("{}/sapi/v1/margin/allPairs", self.baseurl,);
59375 #[allow(unused_mut)]
59376 let mut request = self
59377 .client
59378 .get(url)
59379 .header(
59380 reqwest::header::ACCEPT,
59381 reqwest::header::HeaderValue::from_static("application/json"),
59382 )
59383 .build()?;
59384 (crate::pre_hook)(&self.inner, &request);
59385 let result = self.client.execute(request).await;
59386 (crate::post_hook)(&self.inner, &result);
59387 let response = result?;
59388 match response.status().as_u16() {
59389 200u16 => ResponseValue::from_response(response).await,
59390 400u16 => {
59391 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59392 }
59393 _ => Err(Error::UnexpectedResponse(response)),
59394 }
59395 }
59396 /**Query Margin PriceIndex (MARKET_DATA)
59397
59398Weight(IP): 10
59399
59400Sends a `GET` request to `/sapi/v1/margin/priceIndex`
59401
59402Arguments:
59403- `symbol`: Trading symbol, e.g. BNBUSDT
59404*/
59405 pub async fn margin_price_index<'a>(
59406 &'a self,
59407 symbol: &'a str,
59408 ) -> Result<ResponseValue<types::MarginPriceIndexResponse>, Error<types::Error>> {
59409 let url = format!("{}/sapi/v1/margin/priceIndex", self.baseurl,);
59410 let mut query = Vec::with_capacity(1usize);
59411 query.push(("symbol", symbol.to_string()));
59412 #[allow(unused_mut)]
59413 let mut request = self
59414 .client
59415 .get(url)
59416 .header(
59417 reqwest::header::ACCEPT,
59418 reqwest::header::HeaderValue::from_static("application/json"),
59419 )
59420 .query(&query)
59421 .build()?;
59422 (crate::pre_hook)(&self.inner, &request);
59423 let result = self.client.execute(request).await;
59424 (crate::post_hook)(&self.inner, &result);
59425 let response = result?;
59426 match response.status().as_u16() {
59427 200u16 => ResponseValue::from_response(response).await,
59428 400u16 => {
59429 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59430 }
59431 _ => Err(Error::UnexpectedResponse(response)),
59432 }
59433 }
59434 /**Query Margin Account's Order (USER_DATA)
59435
59436- Either `orderId` or `origClientOrderId` must be sent.
59437- For some historical orders `cummulativeQuoteQty` will be < 0, meaning the data is not available at this time.
59438
59439Weight(IP): 10
59440
59441Sends a `GET` request to `/sapi/v1/margin/order`
59442
59443Arguments:
59444- `is_isolated`: * `TRUE` - For isolated margin
59445* `FALSE` - Default, not for isolated margin
59446- `order_id`: Order id
59447- `orig_client_order_id`: Order id from client
59448- `recv_window`: The value cannot be greater than 60000
59449- `signature`: Signature
59450- `symbol`: Trading symbol, e.g. BNBUSDT
59451- `timestamp`: UTC timestamp in ms
59452*/
59453 pub async fn margin_order<'a>(
59454 &'a self,
59455 is_isolated: Option<types::MarginOrderIsIsolated>,
59456 order_id: Option<i64>,
59457 orig_client_order_id: Option<&'a str>,
59458 recv_window: Option<i64>,
59459 signature: &'a str,
59460 symbol: &'a str,
59461 timestamp: i64,
59462 ) -> Result<ResponseValue<types::MarginOrderDetail>, Error<types::Error>> {
59463 let url = format!("{}/sapi/v1/margin/order", self.baseurl,);
59464 let mut query = Vec::with_capacity(7usize);
59465 if let Some(v) = &is_isolated {
59466 query.push(("isIsolated", v.to_string()));
59467 }
59468 if let Some(v) = &order_id {
59469 query.push(("orderId", v.to_string()));
59470 }
59471 if let Some(v) = &orig_client_order_id {
59472 query.push(("origClientOrderId", v.to_string()));
59473 }
59474 if let Some(v) = &recv_window {
59475 query.push(("recvWindow", v.to_string()));
59476 }
59477 query.push(("signature", signature.to_string()));
59478 query.push(("symbol", symbol.to_string()));
59479 query.push(("timestamp", timestamp.to_string()));
59480 #[allow(unused_mut)]
59481 let mut request = self
59482 .client
59483 .get(url)
59484 .header(
59485 reqwest::header::ACCEPT,
59486 reqwest::header::HeaderValue::from_static("application/json"),
59487 )
59488 .query(&query)
59489 .build()?;
59490 (crate::pre_hook)(&self.inner, &request);
59491 let result = self.client.execute(request).await;
59492 (crate::post_hook)(&self.inner, &result);
59493 let response = result?;
59494 match response.status().as_u16() {
59495 200u16 => ResponseValue::from_response(response).await,
59496 400u16 => {
59497 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59498 }
59499 401u16 => {
59500 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59501 }
59502 _ => Err(Error::UnexpectedResponse(response)),
59503 }
59504 }
59505 /**Margin Account New Order (TRADE)
59506
59507Post a new order for margin account.
59508
59509Weight(UID): 6
59510
59511Sends a `POST` request to `/sapi/v1/margin/order`
59512
59513Arguments:
59514- `auto_repay_at_cancel`
59515- `iceberg_qty`: Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order.
59516- `is_isolated`: * `TRUE` - For isolated margin
59517* `FALSE` - Default, not for isolated margin
59518- `new_client_order_id`: Used to uniquely identify this cancel. Automatically generated by default
59519- `new_order_resp_type`: Set the response JSON.
59520- `price`: Order price
59521- `quantity`
59522- `quote_order_qty`: Quote quantity
59523- `recv_window`: The value cannot be greater than 60000
59524- `self_trade_prevention_mode`: The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
59525- `side`
59526- `side_effect_type`: Default `NO_SIDE_EFFECT`
59527- `signature`: Signature
59528- `stop_price`: Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
59529- `symbol`: Trading symbol, e.g. BNBUSDT
59530- `time_in_force`: Order time in force
59531- `timestamp`: UTC timestamp in ms
59532- `type_`: Order type
59533*/
59534 pub async fn post_margin_order<'a>(
59535 &'a self,
59536 auto_repay_at_cancel: bool,
59537 iceberg_qty: Option<f64>,
59538 is_isolated: Option<types::PostMarginOrderIsIsolated>,
59539 new_client_order_id: Option<&'a str>,
59540 new_order_resp_type: Option<types::PostMarginOrderNewOrderRespType>,
59541 price: Option<f64>,
59542 quantity: f64,
59543 quote_order_qty: Option<f64>,
59544 recv_window: Option<i64>,
59545 self_trade_prevention_mode: Option<
59546 types::PostMarginOrderSelfTradePreventionMode,
59547 >,
59548 side: types::PostMarginOrderSide,
59549 side_effect_type: Option<types::PostMarginOrderSideEffectType>,
59550 signature: &'a str,
59551 stop_price: Option<f64>,
59552 symbol: &'a str,
59553 time_in_force: Option<types::PostMarginOrderTimeInForce>,
59554 timestamp: i64,
59555 type_: types::PostMarginOrderType,
59556 ) -> Result<ResponseValue<types::PostMarginOrderResponse>, Error<types::Error>> {
59557 let url = format!("{}/sapi/v1/margin/order", self.baseurl,);
59558 let mut query = Vec::with_capacity(18usize);
59559 query.push(("autoRepayAtCancel", auto_repay_at_cancel.to_string()));
59560 if let Some(v) = &iceberg_qty {
59561 query.push(("icebergQty", v.to_string()));
59562 }
59563 if let Some(v) = &is_isolated {
59564 query.push(("isIsolated", v.to_string()));
59565 }
59566 if let Some(v) = &new_client_order_id {
59567 query.push(("newClientOrderId", v.to_string()));
59568 }
59569 if let Some(v) = &new_order_resp_type {
59570 query.push(("newOrderRespType", v.to_string()));
59571 }
59572 if let Some(v) = &price {
59573 query.push(("price", v.to_string()));
59574 }
59575 query.push(("quantity", quantity.to_string()));
59576 if let Some(v) = "e_order_qty {
59577 query.push(("quoteOrderQty", v.to_string()));
59578 }
59579 if let Some(v) = &recv_window {
59580 query.push(("recvWindow", v.to_string()));
59581 }
59582 if let Some(v) = &self_trade_prevention_mode {
59583 query.push(("selfTradePreventionMode", v.to_string()));
59584 }
59585 query.push(("side", side.to_string()));
59586 if let Some(v) = &side_effect_type {
59587 query.push(("sideEffectType", v.to_string()));
59588 }
59589 query.push(("signature", signature.to_string()));
59590 if let Some(v) = &stop_price {
59591 query.push(("stopPrice", v.to_string()));
59592 }
59593 query.push(("symbol", symbol.to_string()));
59594 if let Some(v) = &time_in_force {
59595 query.push(("timeInForce", v.to_string()));
59596 }
59597 query.push(("timestamp", timestamp.to_string()));
59598 query.push(("type", type_.to_string()));
59599 #[allow(unused_mut)]
59600 let mut request = self
59601 .client
59602 .post(url)
59603 .header(
59604 reqwest::header::ACCEPT,
59605 reqwest::header::HeaderValue::from_static("application/json"),
59606 )
59607 .query(&query)
59608 .build()?;
59609 (crate::pre_hook)(&self.inner, &request);
59610 let result = self.client.execute(request).await;
59611 (crate::post_hook)(&self.inner, &result);
59612 let response = result?;
59613 match response.status().as_u16() {
59614 200u16 => ResponseValue::from_response(response).await,
59615 400u16 => {
59616 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59617 }
59618 401u16 => {
59619 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59620 }
59621 _ => Err(Error::UnexpectedResponse(response)),
59622 }
59623 }
59624 /**Margin Account Cancel Order (TRADE)
59625
59626Cancel an active order for margin account.
59627
59628Either `orderId` or `origClientOrderId` must be sent.
59629
59630Weight(IP): 10
59631
59632Sends a `DELETE` request to `/sapi/v1/margin/order`
59633
59634Arguments:
59635- `is_isolated`: * `TRUE` - For isolated margin
59636* `FALSE` - Default, not for isolated margin
59637- `new_client_order_id`: Used to uniquely identify this cancel. Automatically generated by default
59638- `order_id`: Order id
59639- `orig_client_order_id`: Order id from client
59640- `recv_window`: The value cannot be greater than 60000
59641- `signature`: Signature
59642- `symbol`: Trading symbol, e.g. BNBUSDT
59643- `timestamp`: UTC timestamp in ms
59644*/
59645 pub async fn cancel_margin_order<'a>(
59646 &'a self,
59647 is_isolated: Option<types::CancelMarginOrderIsIsolated>,
59648 new_client_order_id: Option<&'a str>,
59649 order_id: Option<i64>,
59650 orig_client_order_id: Option<&'a str>,
59651 recv_window: Option<i64>,
59652 signature: &'a str,
59653 symbol: &'a str,
59654 timestamp: i64,
59655 ) -> Result<ResponseValue<types::MarginOrder>, Error<types::Error>> {
59656 let url = format!("{}/sapi/v1/margin/order", self.baseurl,);
59657 let mut query = Vec::with_capacity(8usize);
59658 if let Some(v) = &is_isolated {
59659 query.push(("isIsolated", v.to_string()));
59660 }
59661 if let Some(v) = &new_client_order_id {
59662 query.push(("newClientOrderId", v.to_string()));
59663 }
59664 if let Some(v) = &order_id {
59665 query.push(("orderId", v.to_string()));
59666 }
59667 if let Some(v) = &orig_client_order_id {
59668 query.push(("origClientOrderId", v.to_string()));
59669 }
59670 if let Some(v) = &recv_window {
59671 query.push(("recvWindow", v.to_string()));
59672 }
59673 query.push(("signature", signature.to_string()));
59674 query.push(("symbol", symbol.to_string()));
59675 query.push(("timestamp", timestamp.to_string()));
59676 #[allow(unused_mut)]
59677 let mut request = self
59678 .client
59679 .delete(url)
59680 .header(
59681 reqwest::header::ACCEPT,
59682 reqwest::header::HeaderValue::from_static("application/json"),
59683 )
59684 .query(&query)
59685 .build()?;
59686 (crate::pre_hook)(&self.inner, &request);
59687 let result = self.client.execute(request).await;
59688 (crate::post_hook)(&self.inner, &result);
59689 let response = result?;
59690 match response.status().as_u16() {
59691 200u16 => ResponseValue::from_response(response).await,
59692 400u16 => {
59693 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59694 }
59695 401u16 => {
59696 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59697 }
59698 _ => Err(Error::UnexpectedResponse(response)),
59699 }
59700 }
59701 /**Get Interest History (USER_DATA)
59702
59703- Response in descending order
59704- If `isolatedSymbol` is not sent, crossed margin data will be returned
59705- Set `archived` to `true` to query data from 6 months ago
59706- `type` in response has 4 enums:
59707 - `PERIODIC` interest charged per hour
59708 - `ON_BORROW` first interest charged on borrow
59709 - `PERIODIC_CONVERTED` interest charged per hour converted into BNB
59710 - `ON_BORROW_CONVERTED` first interest charged on borrow converted into BNB
59711
59712Weight(IP): 1
59713
59714Sends a `GET` request to `/sapi/v1/margin/interestHistory`
59715
59716Arguments:
59717- `archived`: Default: false. Set to true for archived data from 6 months ago
59718- `asset`
59719- `current`: Current querying page. Start from 1. Default:1
59720- `end_time`: UTC timestamp in ms
59721- `isolated_symbol`: Isolated symbol
59722- `recv_window`: The value cannot be greater than 60000
59723- `signature`: Signature
59724- `size`: Default:10 Max:100
59725- `start_time`: UTC timestamp in ms
59726- `timestamp`: UTC timestamp in ms
59727*/
59728 pub async fn margin_interest_history<'a>(
59729 &'a self,
59730 archived: Option<&'a str>,
59731 asset: Option<&'a str>,
59732 current: Option<i32>,
59733 end_time: Option<i64>,
59734 isolated_symbol: Option<&'a str>,
59735 recv_window: Option<i64>,
59736 signature: &'a str,
59737 size: Option<i32>,
59738 start_time: Option<i64>,
59739 timestamp: i64,
59740 ) -> Result<
59741 ResponseValue<types::MarginInterestHistoryResponse>,
59742 Error<types::Error>,
59743 > {
59744 let url = format!("{}/sapi/v1/margin/interestHistory", self.baseurl,);
59745 let mut query = Vec::with_capacity(10usize);
59746 if let Some(v) = &archived {
59747 query.push(("archived", v.to_string()));
59748 }
59749 if let Some(v) = &asset {
59750 query.push(("asset", v.to_string()));
59751 }
59752 if let Some(v) = ¤t {
59753 query.push(("current", v.to_string()));
59754 }
59755 if let Some(v) = &end_time {
59756 query.push(("endTime", v.to_string()));
59757 }
59758 if let Some(v) = &isolated_symbol {
59759 query.push(("isolatedSymbol", v.to_string()));
59760 }
59761 if let Some(v) = &recv_window {
59762 query.push(("recvWindow", v.to_string()));
59763 }
59764 query.push(("signature", signature.to_string()));
59765 if let Some(v) = &size {
59766 query.push(("size", v.to_string()));
59767 }
59768 if let Some(v) = &start_time {
59769 query.push(("startTime", v.to_string()));
59770 }
59771 query.push(("timestamp", timestamp.to_string()));
59772 #[allow(unused_mut)]
59773 let mut request = self
59774 .client
59775 .get(url)
59776 .header(
59777 reqwest::header::ACCEPT,
59778 reqwest::header::HeaderValue::from_static("application/json"),
59779 )
59780 .query(&query)
59781 .build()?;
59782 (crate::pre_hook)(&self.inner, &request);
59783 let result = self.client.execute(request).await;
59784 (crate::post_hook)(&self.inner, &result);
59785 let response = result?;
59786 match response.status().as_u16() {
59787 200u16 => ResponseValue::from_response(response).await,
59788 400u16 => {
59789 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59790 }
59791 401u16 => {
59792 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59793 }
59794 _ => Err(Error::UnexpectedResponse(response)),
59795 }
59796 }
59797 /**Get Force Liquidation Record (USER_DATA)
59798
59799- Response in descending order
59800
59801Weight(IP): 1
59802
59803Sends a `GET` request to `/sapi/v1/margin/forceLiquidationRec`
59804
59805Arguments:
59806- `current`: Current querying page. Start from 1. Default:1
59807- `end_time`: UTC timestamp in ms
59808- `isolated_symbol`: Isolated symbol
59809- `recv_window`: The value cannot be greater than 60000
59810- `signature`: Signature
59811- `size`: Default:10 Max:100
59812- `start_time`: UTC timestamp in ms
59813- `timestamp`: UTC timestamp in ms
59814*/
59815 pub async fn margin_force_liquidation_rec<'a>(
59816 &'a self,
59817 current: Option<i32>,
59818 end_time: Option<i64>,
59819 isolated_symbol: Option<&'a str>,
59820 recv_window: Option<i64>,
59821 signature: &'a str,
59822 size: Option<i32>,
59823 start_time: Option<i64>,
59824 timestamp: i64,
59825 ) -> Result<
59826 ResponseValue<types::MarginForceLiquidationRecResponse>,
59827 Error<types::Error>,
59828 > {
59829 let url = format!("{}/sapi/v1/margin/forceLiquidationRec", self.baseurl,);
59830 let mut query = Vec::with_capacity(8usize);
59831 if let Some(v) = ¤t {
59832 query.push(("current", v.to_string()));
59833 }
59834 if let Some(v) = &end_time {
59835 query.push(("endTime", v.to_string()));
59836 }
59837 if let Some(v) = &isolated_symbol {
59838 query.push(("isolatedSymbol", v.to_string()));
59839 }
59840 if let Some(v) = &recv_window {
59841 query.push(("recvWindow", v.to_string()));
59842 }
59843 query.push(("signature", signature.to_string()));
59844 if let Some(v) = &size {
59845 query.push(("size", v.to_string()));
59846 }
59847 if let Some(v) = &start_time {
59848 query.push(("startTime", v.to_string()));
59849 }
59850 query.push(("timestamp", timestamp.to_string()));
59851 #[allow(unused_mut)]
59852 let mut request = self
59853 .client
59854 .get(url)
59855 .header(
59856 reqwest::header::ACCEPT,
59857 reqwest::header::HeaderValue::from_static("application/json"),
59858 )
59859 .query(&query)
59860 .build()?;
59861 (crate::pre_hook)(&self.inner, &request);
59862 let result = self.client.execute(request).await;
59863 (crate::post_hook)(&self.inner, &result);
59864 let response = result?;
59865 match response.status().as_u16() {
59866 200u16 => ResponseValue::from_response(response).await,
59867 400u16 => {
59868 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59869 }
59870 401u16 => {
59871 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59872 }
59873 _ => Err(Error::UnexpectedResponse(response)),
59874 }
59875 }
59876 /**Query Cross Margin Account Details (USER_DATA)
59877
59878Weight(IP): 10
59879
59880Sends a `GET` request to `/sapi/v1/margin/account`
59881
59882Arguments:
59883- `recv_window`: The value cannot be greater than 60000
59884- `signature`: Signature
59885- `timestamp`: UTC timestamp in ms
59886*/
59887 pub async fn margin_account<'a>(
59888 &'a self,
59889 recv_window: Option<i64>,
59890 signature: &'a str,
59891 timestamp: i64,
59892 ) -> Result<ResponseValue<types::MarginAccountResponse>, Error<types::Error>> {
59893 let url = format!("{}/sapi/v1/margin/account", self.baseurl,);
59894 let mut query = Vec::with_capacity(3usize);
59895 if let Some(v) = &recv_window {
59896 query.push(("recvWindow", v.to_string()));
59897 }
59898 query.push(("signature", signature.to_string()));
59899 query.push(("timestamp", timestamp.to_string()));
59900 #[allow(unused_mut)]
59901 let mut request = self
59902 .client
59903 .get(url)
59904 .header(
59905 reqwest::header::ACCEPT,
59906 reqwest::header::HeaderValue::from_static("application/json"),
59907 )
59908 .query(&query)
59909 .build()?;
59910 (crate::pre_hook)(&self.inner, &request);
59911 let result = self.client.execute(request).await;
59912 (crate::post_hook)(&self.inner, &result);
59913 let response = result?;
59914 match response.status().as_u16() {
59915 200u16 => ResponseValue::from_response(response).await,
59916 400u16 => {
59917 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59918 }
59919 401u16 => {
59920 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59921 }
59922 _ => Err(Error::UnexpectedResponse(response)),
59923 }
59924 }
59925 /**Query Margin Account's Open Orders (USER_DATA)
59926
59927- If the `symbol` is not sent, orders for all symbols will be returned in an array.
59928- When all symbols are returned, the number of requests counted against the rate limiter is equal to the number of symbols currently trading on the exchange
59929- If isIsolated ="TRUE", symbol must be sent.
59930
59931Weight(IP): 10
59932
59933Sends a `GET` request to `/sapi/v1/margin/openOrders`
59934
59935Arguments:
59936- `is_isolated`: * `TRUE` - For isolated margin
59937* `FALSE` - Default, not for isolated margin
59938- `recv_window`: The value cannot be greater than 60000
59939- `signature`: Signature
59940- `symbol`: Trading symbol, e.g. BNBUSDT
59941- `timestamp`: UTC timestamp in ms
59942*/
59943 pub async fn margin_open_orders<'a>(
59944 &'a self,
59945 is_isolated: Option<types::MarginOpenOrdersIsIsolated>,
59946 recv_window: Option<i64>,
59947 signature: &'a str,
59948 symbol: Option<&'a str>,
59949 timestamp: i64,
59950 ) -> Result<ResponseValue<Vec<types::MarginOrderDetail>>, Error<types::Error>> {
59951 let url = format!("{}/sapi/v1/margin/openOrders", self.baseurl,);
59952 let mut query = Vec::with_capacity(5usize);
59953 if let Some(v) = &is_isolated {
59954 query.push(("isIsolated", v.to_string()));
59955 }
59956 if let Some(v) = &recv_window {
59957 query.push(("recvWindow", v.to_string()));
59958 }
59959 query.push(("signature", signature.to_string()));
59960 if let Some(v) = &symbol {
59961 query.push(("symbol", v.to_string()));
59962 }
59963 query.push(("timestamp", timestamp.to_string()));
59964 #[allow(unused_mut)]
59965 let mut request = self
59966 .client
59967 .get(url)
59968 .header(
59969 reqwest::header::ACCEPT,
59970 reqwest::header::HeaderValue::from_static("application/json"),
59971 )
59972 .query(&query)
59973 .build()?;
59974 (crate::pre_hook)(&self.inner, &request);
59975 let result = self.client.execute(request).await;
59976 (crate::post_hook)(&self.inner, &result);
59977 let response = result?;
59978 match response.status().as_u16() {
59979 200u16 => ResponseValue::from_response(response).await,
59980 400u16 => {
59981 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59982 }
59983 401u16 => {
59984 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
59985 }
59986 _ => Err(Error::UnexpectedResponse(response)),
59987 }
59988 }
59989 /**Margin Account Cancel all Open Orders on a Symbol (TRADE)
59990
59991- Cancels all active orders on a symbol for margin account.
59992- This includes OCO orders.
59993
59994Weight(IP): 1
59995
59996
59997Sends a `DELETE` request to `/sapi/v1/margin/openOrders`
59998
59999Arguments:
60000- `is_isolated`: * `TRUE` - For isolated margin
60001* `FALSE` - Default, not for isolated margin
60002- `recv_window`: The value cannot be greater than 60000
60003- `signature`: Signature
60004- `symbol`: Trading symbol, e.g. BNBUSDT
60005- `timestamp`: UTC timestamp in ms
60006*/
60007 pub async fn margin_cancel_orders<'a>(
60008 &'a self,
60009 is_isolated: Option<types::MarginCancelOrdersIsIsolated>,
60010 recv_window: Option<i64>,
60011 signature: &'a str,
60012 symbol: &'a str,
60013 timestamp: i64,
60014 ) -> Result<
60015 ResponseValue<Vec<types::MarginCancelOrdersResponseItem>>,
60016 Error<types::Error>,
60017 > {
60018 let url = format!("{}/sapi/v1/margin/openOrders", self.baseurl,);
60019 let mut query = Vec::with_capacity(5usize);
60020 if let Some(v) = &is_isolated {
60021 query.push(("isIsolated", v.to_string()));
60022 }
60023 if let Some(v) = &recv_window {
60024 query.push(("recvWindow", v.to_string()));
60025 }
60026 query.push(("signature", signature.to_string()));
60027 query.push(("symbol", symbol.to_string()));
60028 query.push(("timestamp", timestamp.to_string()));
60029 #[allow(unused_mut)]
60030 let mut request = self
60031 .client
60032 .delete(url)
60033 .header(
60034 reqwest::header::ACCEPT,
60035 reqwest::header::HeaderValue::from_static("application/json"),
60036 )
60037 .query(&query)
60038 .build()?;
60039 (crate::pre_hook)(&self.inner, &request);
60040 let result = self.client.execute(request).await;
60041 (crate::post_hook)(&self.inner, &result);
60042 let response = result?;
60043 match response.status().as_u16() {
60044 200u16 => ResponseValue::from_response(response).await,
60045 400u16 => {
60046 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60047 }
60048 401u16 => {
60049 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60050 }
60051 _ => Err(Error::UnexpectedResponse(response)),
60052 }
60053 }
60054 /**Query Margin Account's All Orders (USER_DATA)
60055
60056- If `orderId` is set, it will get orders >= that orderId. Otherwise most recent orders are returned.
60057- For some historical orders `cummulativeQuoteQty` will be < 0, meaning the data is not available at this time.
60058
60059Weight(IP): 200
60060
60061Request Limit: 60 times/min per IP
60062
60063Sends a `GET` request to `/sapi/v1/margin/allOrders`
60064
60065Arguments:
60066- `end_time`: UTC timestamp in ms
60067- `is_isolated`: * `TRUE` - For isolated margin
60068* `FALSE` - Default, not for isolated margin
60069- `limit`: Default 500; max 1000.
60070- `order_id`: Order id
60071- `recv_window`: The value cannot be greater than 60000
60072- `signature`: Signature
60073- `start_time`: UTC timestamp in ms
60074- `symbol`: Trading symbol, e.g. BNBUSDT
60075- `timestamp`: UTC timestamp in ms
60076*/
60077 pub async fn margin_query_all_orders<'a>(
60078 &'a self,
60079 end_time: Option<i64>,
60080 is_isolated: Option<types::MarginQueryAllOrdersIsIsolated>,
60081 limit: Option<i32>,
60082 order_id: Option<i64>,
60083 recv_window: Option<i64>,
60084 signature: &'a str,
60085 start_time: Option<i64>,
60086 symbol: &'a str,
60087 timestamp: i64,
60088 ) -> Result<ResponseValue<Vec<types::MarginOrderDetail>>, Error<types::Error>> {
60089 let url = format!("{}/sapi/v1/margin/allOrders", self.baseurl,);
60090 let mut query = Vec::with_capacity(9usize);
60091 if let Some(v) = &end_time {
60092 query.push(("endTime", v.to_string()));
60093 }
60094 if let Some(v) = &is_isolated {
60095 query.push(("isIsolated", v.to_string()));
60096 }
60097 if let Some(v) = &limit {
60098 query.push(("limit", v.to_string()));
60099 }
60100 if let Some(v) = &order_id {
60101 query.push(("orderId", v.to_string()));
60102 }
60103 if let Some(v) = &recv_window {
60104 query.push(("recvWindow", v.to_string()));
60105 }
60106 query.push(("signature", signature.to_string()));
60107 if let Some(v) = &start_time {
60108 query.push(("startTime", v.to_string()));
60109 }
60110 query.push(("symbol", symbol.to_string()));
60111 query.push(("timestamp", timestamp.to_string()));
60112 #[allow(unused_mut)]
60113 let mut request = self
60114 .client
60115 .get(url)
60116 .header(
60117 reqwest::header::ACCEPT,
60118 reqwest::header::HeaderValue::from_static("application/json"),
60119 )
60120 .query(&query)
60121 .build()?;
60122 (crate::pre_hook)(&self.inner, &request);
60123 let result = self.client.execute(request).await;
60124 (crate::post_hook)(&self.inner, &result);
60125 let response = result?;
60126 match response.status().as_u16() {
60127 200u16 => ResponseValue::from_response(response).await,
60128 400u16 => {
60129 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60130 }
60131 401u16 => {
60132 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60133 }
60134 _ => Err(Error::UnexpectedResponse(response)),
60135 }
60136 }
60137 /**Margin Account New OCO (TRADE)
60138
60139Send in a new OCO for a margin account
60140
60141- Price Restrictions:
60142 - SELL: Limit Price > Last Price > Stop Price
60143 - BUY: Limit Price < Last Price < Stop Price
60144- Quantity Restrictions:
60145 - Both legs must have the same quantity
60146 - ICEBERG quantities however do not have to be the same.
60147- Order Rate Limit
60148 - OCO counts as 2 orders against the order rate limit.
60149
60150Weight(UID): 6
60151
60152Sends a `POST` request to `/sapi/v1/margin/order/oco`
60153
60154Arguments:
60155- `is_isolated`: * `TRUE` - For isolated margin
60156* `FALSE` - Default, not for isolated margin
60157- `limit_client_order_id`: A unique Id for the limit order
60158- `limit_iceberg_qty`
60159- `list_client_order_id`: A unique Id for the entire orderList
60160- `new_order_resp_type`: Set the response JSON.
60161- `price`: Order price
60162- `quantity`
60163- `recv_window`: The value cannot be greater than 60000
60164- `self_trade_prevention_mode`: The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
60165- `side`
60166- `side_effect_type`: Default `NO_SIDE_EFFECT`
60167- `signature`: Signature
60168- `stop_client_order_id`: A unique Id for the stop loss/stop loss limit leg
60169- `stop_iceberg_qty`
60170- `stop_limit_price`: If provided, stopLimitTimeInForce is required.
60171- `stop_limit_time_in_force`
60172- `stop_price`
60173- `symbol`: Trading symbol, e.g. BNBUSDT
60174- `timestamp`: UTC timestamp in ms
60175*/
60176 pub async fn send_margin_query_oco<'a>(
60177 &'a self,
60178 is_isolated: Option<types::SendMarginQueryOcoIsIsolated>,
60179 limit_client_order_id: Option<&'a str>,
60180 limit_iceberg_qty: Option<f64>,
60181 list_client_order_id: Option<&'a str>,
60182 new_order_resp_type: Option<types::SendMarginQueryOcoNewOrderRespType>,
60183 price: f64,
60184 quantity: f64,
60185 recv_window: Option<i64>,
60186 self_trade_prevention_mode: Option<
60187 types::SendMarginQueryOcoSelfTradePreventionMode,
60188 >,
60189 side: types::SendMarginQueryOcoSide,
60190 side_effect_type: Option<types::SendMarginQueryOcoSideEffectType>,
60191 signature: &'a str,
60192 stop_client_order_id: Option<&'a str>,
60193 stop_iceberg_qty: Option<f64>,
60194 stop_limit_price: Option<f64>,
60195 stop_limit_time_in_force: Option<types::SendMarginQueryOcoStopLimitTimeInForce>,
60196 stop_price: f64,
60197 symbol: &'a str,
60198 timestamp: i64,
60199 ) -> Result<ResponseValue<types::SendMarginQueryOcoResponse>, Error<types::Error>> {
60200 let url = format!("{}/sapi/v1/margin/order/oco", self.baseurl,);
60201 let mut query = Vec::with_capacity(19usize);
60202 if let Some(v) = &is_isolated {
60203 query.push(("isIsolated", v.to_string()));
60204 }
60205 if let Some(v) = &limit_client_order_id {
60206 query.push(("limitClientOrderId", v.to_string()));
60207 }
60208 if let Some(v) = &limit_iceberg_qty {
60209 query.push(("limitIcebergQty", v.to_string()));
60210 }
60211 if let Some(v) = &list_client_order_id {
60212 query.push(("listClientOrderId", v.to_string()));
60213 }
60214 if let Some(v) = &new_order_resp_type {
60215 query.push(("newOrderRespType", v.to_string()));
60216 }
60217 query.push(("price", price.to_string()));
60218 query.push(("quantity", quantity.to_string()));
60219 if let Some(v) = &recv_window {
60220 query.push(("recvWindow", v.to_string()));
60221 }
60222 if let Some(v) = &self_trade_prevention_mode {
60223 query.push(("selfTradePreventionMode", v.to_string()));
60224 }
60225 query.push(("side", side.to_string()));
60226 if let Some(v) = &side_effect_type {
60227 query.push(("sideEffectType", v.to_string()));
60228 }
60229 query.push(("signature", signature.to_string()));
60230 if let Some(v) = &stop_client_order_id {
60231 query.push(("stopClientOrderId", v.to_string()));
60232 }
60233 if let Some(v) = &stop_iceberg_qty {
60234 query.push(("stopIcebergQty", v.to_string()));
60235 }
60236 if let Some(v) = &stop_limit_price {
60237 query.push(("stopLimitPrice", v.to_string()));
60238 }
60239 if let Some(v) = &stop_limit_time_in_force {
60240 query.push(("stopLimitTimeInForce", v.to_string()));
60241 }
60242 query.push(("stopPrice", stop_price.to_string()));
60243 query.push(("symbol", symbol.to_string()));
60244 query.push(("timestamp", timestamp.to_string()));
60245 #[allow(unused_mut)]
60246 let mut request = self
60247 .client
60248 .post(url)
60249 .header(
60250 reqwest::header::ACCEPT,
60251 reqwest::header::HeaderValue::from_static("application/json"),
60252 )
60253 .query(&query)
60254 .build()?;
60255 (crate::pre_hook)(&self.inner, &request);
60256 let result = self.client.execute(request).await;
60257 (crate::post_hook)(&self.inner, &result);
60258 let response = result?;
60259 match response.status().as_u16() {
60260 200u16 => ResponseValue::from_response(response).await,
60261 400u16 => {
60262 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60263 }
60264 401u16 => {
60265 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60266 }
60267 _ => Err(Error::UnexpectedResponse(response)),
60268 }
60269 }
60270 /**Query Margin Account's OCO (USER_DATA)
60271
60272Retrieves a specific OCO based on provided optional parameters
60273
60274- Either `orderListId` or `origClientOrderId` must be provided
60275
60276Weight(IP): 10
60277
60278Sends a `GET` request to `/sapi/v1/margin/orderList`
60279
60280Arguments:
60281- `is_isolated`: * `TRUE` - For isolated margin
60282* `FALSE` - Default, not for isolated margin
60283- `order_list_id`: Order list id
60284- `orig_client_order_id`: Order id from client
60285- `recv_window`: The value cannot be greater than 60000
60286- `signature`: Signature
60287- `symbol`: Mandatory for isolated margin, not supported for cross margin
60288- `timestamp`: UTC timestamp in ms
60289*/
60290 pub async fn margin_order_list<'a>(
60291 &'a self,
60292 is_isolated: Option<types::MarginOrderListIsIsolated>,
60293 order_list_id: Option<i64>,
60294 orig_client_order_id: Option<&'a str>,
60295 recv_window: Option<i64>,
60296 signature: &'a str,
60297 symbol: Option<&'a str>,
60298 timestamp: i64,
60299 ) -> Result<ResponseValue<types::MarginOrderListResponse>, Error<types::Error>> {
60300 let url = format!("{}/sapi/v1/margin/orderList", self.baseurl,);
60301 let mut query = Vec::with_capacity(7usize);
60302 if let Some(v) = &is_isolated {
60303 query.push(("isIsolated", v.to_string()));
60304 }
60305 if let Some(v) = &order_list_id {
60306 query.push(("orderListId", v.to_string()));
60307 }
60308 if let Some(v) = &orig_client_order_id {
60309 query.push(("origClientOrderId", v.to_string()));
60310 }
60311 if let Some(v) = &recv_window {
60312 query.push(("recvWindow", v.to_string()));
60313 }
60314 query.push(("signature", signature.to_string()));
60315 if let Some(v) = &symbol {
60316 query.push(("symbol", v.to_string()));
60317 }
60318 query.push(("timestamp", timestamp.to_string()));
60319 #[allow(unused_mut)]
60320 let mut request = self
60321 .client
60322 .get(url)
60323 .header(
60324 reqwest::header::ACCEPT,
60325 reqwest::header::HeaderValue::from_static("application/json"),
60326 )
60327 .query(&query)
60328 .build()?;
60329 (crate::pre_hook)(&self.inner, &request);
60330 let result = self.client.execute(request).await;
60331 (crate::post_hook)(&self.inner, &result);
60332 let response = result?;
60333 match response.status().as_u16() {
60334 200u16 => ResponseValue::from_response(response).await,
60335 400u16 => {
60336 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60337 }
60338 401u16 => {
60339 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60340 }
60341 _ => Err(Error::UnexpectedResponse(response)),
60342 }
60343 }
60344 /**Margin Account Cancel OCO (TRADE)
60345
60346Cancel an entire Order List for a margin account
60347
60348- Canceling an individual leg will cancel the entire OCO
60349- Either `orderListId` or `listClientOrderId` must be provided
60350
60351Weight(UID): 1
60352
60353Sends a `DELETE` request to `/sapi/v1/margin/orderList`
60354
60355Arguments:
60356- `is_isolated`: * `TRUE` - For isolated margin
60357* `FALSE` - Default, not for isolated margin
60358- `list_client_order_id`: A unique Id for the entire orderList
60359- `new_client_order_id`: Used to uniquely identify this cancel. Automatically generated by default
60360- `order_list_id`: Order list id
60361- `recv_window`: The value cannot be greater than 60000
60362- `signature`: Signature
60363- `symbol`: Trading symbol, e.g. BNBUSDT
60364- `timestamp`: UTC timestamp in ms
60365*/
60366 pub async fn cancel_margin_order_oco<'a>(
60367 &'a self,
60368 is_isolated: Option<types::CancelMarginOrderOcoIsIsolated>,
60369 list_client_order_id: Option<&'a str>,
60370 new_client_order_id: Option<&'a str>,
60371 order_list_id: Option<i64>,
60372 recv_window: Option<i64>,
60373 signature: &'a str,
60374 symbol: &'a str,
60375 timestamp: i64,
60376 ) -> Result<ResponseValue<types::MarginOcoOrder>, Error<types::Error>> {
60377 let url = format!("{}/sapi/v1/margin/orderList", self.baseurl,);
60378 let mut query = Vec::with_capacity(8usize);
60379 if let Some(v) = &is_isolated {
60380 query.push(("isIsolated", v.to_string()));
60381 }
60382 if let Some(v) = &list_client_order_id {
60383 query.push(("listClientOrderId", v.to_string()));
60384 }
60385 if let Some(v) = &new_client_order_id {
60386 query.push(("newClientOrderId", v.to_string()));
60387 }
60388 if let Some(v) = &order_list_id {
60389 query.push(("orderListId", v.to_string()));
60390 }
60391 if let Some(v) = &recv_window {
60392 query.push(("recvWindow", v.to_string()));
60393 }
60394 query.push(("signature", signature.to_string()));
60395 query.push(("symbol", symbol.to_string()));
60396 query.push(("timestamp", timestamp.to_string()));
60397 #[allow(unused_mut)]
60398 let mut request = self
60399 .client
60400 .delete(url)
60401 .header(
60402 reqwest::header::ACCEPT,
60403 reqwest::header::HeaderValue::from_static("application/json"),
60404 )
60405 .query(&query)
60406 .build()?;
60407 (crate::pre_hook)(&self.inner, &request);
60408 let result = self.client.execute(request).await;
60409 (crate::post_hook)(&self.inner, &result);
60410 let response = result?;
60411 match response.status().as_u16() {
60412 200u16 => ResponseValue::from_response(response).await,
60413 400u16 => {
60414 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60415 }
60416 401u16 => {
60417 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60418 }
60419 _ => Err(Error::UnexpectedResponse(response)),
60420 }
60421 }
60422 /**Query Margin Account's all OCO (USER_DATA)
60423
60424Retrieves all OCO for a specific margin account based on provided optional parameters
60425
60426Weight(IP): 200
60427
60428Sends a `GET` request to `/sapi/v1/margin/allOrderList`
60429
60430Arguments:
60431- `end_time`: UTC timestamp in ms
60432- `from_id`: If supplied, neither `startTime` or `endTime` can be provided
60433- `is_isolated`: * `TRUE` - For isolated margin
60434* `FALSE` - Default, not for isolated margin
60435- `limit`: Default Value: 500; Max Value: 1000
60436- `recv_window`: The value cannot be greater than 60000
60437- `signature`: Signature
60438- `start_time`: UTC timestamp in ms
60439- `symbol`: Mandatory for isolated margin, not supported for cross margin
60440- `timestamp`: UTC timestamp in ms
60441*/
60442 pub async fn margin_all_order_list<'a>(
60443 &'a self,
60444 end_time: Option<i64>,
60445 from_id: Option<&'a str>,
60446 is_isolated: Option<types::MarginAllOrderListIsIsolated>,
60447 limit: Option<i32>,
60448 recv_window: Option<i64>,
60449 signature: &'a str,
60450 start_time: Option<i64>,
60451 symbol: Option<&'a str>,
60452 timestamp: i64,
60453 ) -> Result<
60454 ResponseValue<Vec<types::MarginAllOrderListResponseItem>>,
60455 Error<types::Error>,
60456 > {
60457 let url = format!("{}/sapi/v1/margin/allOrderList", self.baseurl,);
60458 let mut query = Vec::with_capacity(9usize);
60459 if let Some(v) = &end_time {
60460 query.push(("endTime", v.to_string()));
60461 }
60462 if let Some(v) = &from_id {
60463 query.push(("fromId", v.to_string()));
60464 }
60465 if let Some(v) = &is_isolated {
60466 query.push(("isIsolated", v.to_string()));
60467 }
60468 if let Some(v) = &limit {
60469 query.push(("limit", v.to_string()));
60470 }
60471 if let Some(v) = &recv_window {
60472 query.push(("recvWindow", v.to_string()));
60473 }
60474 query.push(("signature", signature.to_string()));
60475 if let Some(v) = &start_time {
60476 query.push(("startTime", v.to_string()));
60477 }
60478 if let Some(v) = &symbol {
60479 query.push(("symbol", v.to_string()));
60480 }
60481 query.push(("timestamp", timestamp.to_string()));
60482 #[allow(unused_mut)]
60483 let mut request = self
60484 .client
60485 .get(url)
60486 .header(
60487 reqwest::header::ACCEPT,
60488 reqwest::header::HeaderValue::from_static("application/json"),
60489 )
60490 .query(&query)
60491 .build()?;
60492 (crate::pre_hook)(&self.inner, &request);
60493 let result = self.client.execute(request).await;
60494 (crate::post_hook)(&self.inner, &result);
60495 let response = result?;
60496 match response.status().as_u16() {
60497 200u16 => ResponseValue::from_response(response).await,
60498 400u16 => {
60499 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60500 }
60501 401u16 => {
60502 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60503 }
60504 _ => Err(Error::UnexpectedResponse(response)),
60505 }
60506 }
60507 /**Query Margin Account's Open OCO (USER_DATA)
60508
60509Weight(IP): 10
60510
60511Sends a `GET` request to `/sapi/v1/margin/openOrderList`
60512
60513Arguments:
60514- `is_isolated`: * `TRUE` - For isolated margin
60515* `FALSE` - Default, not for isolated margin
60516- `recv_window`: The value cannot be greater than 60000
60517- `signature`: Signature
60518- `symbol`: Mandatory for isolated margin, not supported for cross margin
60519- `timestamp`: UTC timestamp in ms
60520*/
60521 pub async fn margin_open_order_list<'a>(
60522 &'a self,
60523 is_isolated: Option<types::MarginOpenOrderListIsIsolated>,
60524 recv_window: Option<i64>,
60525 signature: &'a str,
60526 symbol: Option<&'a str>,
60527 timestamp: i64,
60528 ) -> Result<
60529 ResponseValue<Vec<types::MarginOpenOrderListResponseItem>>,
60530 Error<types::Error>,
60531 > {
60532 let url = format!("{}/sapi/v1/margin/openOrderList", self.baseurl,);
60533 let mut query = Vec::with_capacity(5usize);
60534 if let Some(v) = &is_isolated {
60535 query.push(("isIsolated", v.to_string()));
60536 }
60537 if let Some(v) = &recv_window {
60538 query.push(("recvWindow", v.to_string()));
60539 }
60540 query.push(("signature", signature.to_string()));
60541 if let Some(v) = &symbol {
60542 query.push(("symbol", v.to_string()));
60543 }
60544 query.push(("timestamp", timestamp.to_string()));
60545 #[allow(unused_mut)]
60546 let mut request = self
60547 .client
60548 .get(url)
60549 .header(
60550 reqwest::header::ACCEPT,
60551 reqwest::header::HeaderValue::from_static("application/json"),
60552 )
60553 .query(&query)
60554 .build()?;
60555 (crate::pre_hook)(&self.inner, &request);
60556 let result = self.client.execute(request).await;
60557 (crate::post_hook)(&self.inner, &result);
60558 let response = result?;
60559 match response.status().as_u16() {
60560 200u16 => ResponseValue::from_response(response).await,
60561 400u16 => {
60562 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60563 }
60564 401u16 => {
60565 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60566 }
60567 _ => Err(Error::UnexpectedResponse(response)),
60568 }
60569 }
60570 /**Query Margin Account's Trade List (USER_DATA)
60571
60572- If `fromId` is set, it will get orders >= that `fromId`. Otherwise most recent trades are returned.
60573
60574Weight(IP): 10
60575
60576Sends a `GET` request to `/sapi/v1/margin/myTrades`
60577
60578Arguments:
60579- `end_time`: UTC timestamp in ms
60580- `from_id`: Trade id to fetch from. Default gets most recent trades.
60581- `is_isolated`: * `TRUE` - For isolated margin
60582* `FALSE` - Default, not for isolated margin
60583- `limit`: Default 500; max 1000.
60584- `recv_window`: The value cannot be greater than 60000
60585- `signature`: Signature
60586- `start_time`: UTC timestamp in ms
60587- `symbol`: Trading symbol, e.g. BNBUSDT
60588- `timestamp`: UTC timestamp in ms
60589*/
60590 pub async fn margin_my_trades<'a>(
60591 &'a self,
60592 end_time: Option<i64>,
60593 from_id: Option<i64>,
60594 is_isolated: Option<types::MarginMyTradesIsIsolated>,
60595 limit: Option<i32>,
60596 recv_window: Option<i64>,
60597 signature: &'a str,
60598 start_time: Option<i64>,
60599 symbol: &'a str,
60600 timestamp: i64,
60601 ) -> Result<ResponseValue<Vec<types::MarginTrade>>, Error<types::Error>> {
60602 let url = format!("{}/sapi/v1/margin/myTrades", self.baseurl,);
60603 let mut query = Vec::with_capacity(9usize);
60604 if let Some(v) = &end_time {
60605 query.push(("endTime", v.to_string()));
60606 }
60607 if let Some(v) = &from_id {
60608 query.push(("fromId", v.to_string()));
60609 }
60610 if let Some(v) = &is_isolated {
60611 query.push(("isIsolated", v.to_string()));
60612 }
60613 if let Some(v) = &limit {
60614 query.push(("limit", v.to_string()));
60615 }
60616 if let Some(v) = &recv_window {
60617 query.push(("recvWindow", v.to_string()));
60618 }
60619 query.push(("signature", signature.to_string()));
60620 if let Some(v) = &start_time {
60621 query.push(("startTime", v.to_string()));
60622 }
60623 query.push(("symbol", symbol.to_string()));
60624 query.push(("timestamp", timestamp.to_string()));
60625 #[allow(unused_mut)]
60626 let mut request = self
60627 .client
60628 .get(url)
60629 .header(
60630 reqwest::header::ACCEPT,
60631 reqwest::header::HeaderValue::from_static("application/json"),
60632 )
60633 .query(&query)
60634 .build()?;
60635 (crate::pre_hook)(&self.inner, &request);
60636 let result = self.client.execute(request).await;
60637 (crate::post_hook)(&self.inner, &result);
60638 let response = result?;
60639 match response.status().as_u16() {
60640 200u16 => ResponseValue::from_response(response).await,
60641 400u16 => {
60642 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60643 }
60644 401u16 => {
60645 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60646 }
60647 _ => Err(Error::UnexpectedResponse(response)),
60648 }
60649 }
60650 /**Query Max Borrow (USER_DATA)
60651
60652- If `isolatedSymbol` is not sent, crossed margin data will be sent.
60653- `borrowLimit` is also available from https://www.binance.com/en/margin-fee
60654
60655Weight(IP): 50
60656
60657Sends a `GET` request to `/sapi/v1/margin/maxBorrowable`
60658
60659Arguments:
60660- `asset`
60661- `isolated_symbol`: Isolated symbol
60662- `recv_window`: The value cannot be greater than 60000
60663- `signature`: Signature
60664- `timestamp`: UTC timestamp in ms
60665*/
60666 pub async fn margin_max_borrowable<'a>(
60667 &'a self,
60668 asset: &'a str,
60669 isolated_symbol: Option<&'a str>,
60670 recv_window: Option<i64>,
60671 signature: &'a str,
60672 timestamp: i64,
60673 ) -> Result<ResponseValue<types::MarginMaxBorrowableResponse>, Error<types::Error>> {
60674 let url = format!("{}/sapi/v1/margin/maxBorrowable", self.baseurl,);
60675 let mut query = Vec::with_capacity(5usize);
60676 query.push(("asset", asset.to_string()));
60677 if let Some(v) = &isolated_symbol {
60678 query.push(("isolatedSymbol", v.to_string()));
60679 }
60680 if let Some(v) = &recv_window {
60681 query.push(("recvWindow", v.to_string()));
60682 }
60683 query.push(("signature", signature.to_string()));
60684 query.push(("timestamp", timestamp.to_string()));
60685 #[allow(unused_mut)]
60686 let mut request = self
60687 .client
60688 .get(url)
60689 .header(
60690 reqwest::header::ACCEPT,
60691 reqwest::header::HeaderValue::from_static("application/json"),
60692 )
60693 .query(&query)
60694 .build()?;
60695 (crate::pre_hook)(&self.inner, &request);
60696 let result = self.client.execute(request).await;
60697 (crate::post_hook)(&self.inner, &result);
60698 let response = result?;
60699 match response.status().as_u16() {
60700 200u16 => ResponseValue::from_response(response).await,
60701 400u16 => {
60702 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60703 }
60704 401u16 => {
60705 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60706 }
60707 _ => Err(Error::UnexpectedResponse(response)),
60708 }
60709 }
60710 /**Query Max Transfer-Out Amount (USER_DATA)
60711
60712- If `isolatedSymbol` is not sent, crossed margin data will be sent.
60713
60714Weight(IP): 50
60715
60716Sends a `GET` request to `/sapi/v1/margin/maxTransferable`
60717
60718Arguments:
60719- `asset`
60720- `isolated_symbol`: Isolated symbol
60721- `recv_window`: The value cannot be greater than 60000
60722- `signature`: Signature
60723- `timestamp`: UTC timestamp in ms
60724*/
60725 pub async fn margin_max_transferable<'a>(
60726 &'a self,
60727 asset: &'a str,
60728 isolated_symbol: Option<&'a str>,
60729 recv_window: Option<i64>,
60730 signature: &'a str,
60731 timestamp: i64,
60732 ) -> Result<
60733 ResponseValue<types::MarginMaxTransferableResponse>,
60734 Error<types::Error>,
60735 > {
60736 let url = format!("{}/sapi/v1/margin/maxTransferable", self.baseurl,);
60737 let mut query = Vec::with_capacity(5usize);
60738 query.push(("asset", asset.to_string()));
60739 if let Some(v) = &isolated_symbol {
60740 query.push(("isolatedSymbol", v.to_string()));
60741 }
60742 if let Some(v) = &recv_window {
60743 query.push(("recvWindow", v.to_string()));
60744 }
60745 query.push(("signature", signature.to_string()));
60746 query.push(("timestamp", timestamp.to_string()));
60747 #[allow(unused_mut)]
60748 let mut request = self
60749 .client
60750 .get(url)
60751 .header(
60752 reqwest::header::ACCEPT,
60753 reqwest::header::HeaderValue::from_static("application/json"),
60754 )
60755 .query(&query)
60756 .build()?;
60757 (crate::pre_hook)(&self.inner, &request);
60758 let result = self.client.execute(request).await;
60759 (crate::post_hook)(&self.inner, &result);
60760 let response = result?;
60761 match response.status().as_u16() {
60762 200u16 => ResponseValue::from_response(response).await,
60763 400u16 => {
60764 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60765 }
60766 401u16 => {
60767 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60768 }
60769 _ => Err(Error::UnexpectedResponse(response)),
60770 }
60771 }
60772 /**Get Summary of Margin account (USER_DATA)
60773
60774Get personal margin level information
60775
60776Weight(IP): 10
60777
60778Sends a `GET` request to `/sapi/v1/margin/tradeCoeff`
60779
60780Arguments:
60781- `email`: Email Address
60782- `recv_window`: The value cannot be greater than 60000
60783- `signature`: Signature
60784- `timestamp`: UTC timestamp in ms
60785*/
60786 pub async fn margin_trade_coeff<'a>(
60787 &'a self,
60788 email: &'a str,
60789 recv_window: Option<i64>,
60790 signature: &'a str,
60791 timestamp: i64,
60792 ) -> Result<ResponseValue<types::MarginTradeCoeffResponse>, Error<types::Error>> {
60793 let url = format!("{}/sapi/v1/margin/tradeCoeff", self.baseurl,);
60794 let mut query = Vec::with_capacity(4usize);
60795 query.push(("email", email.to_string()));
60796 if let Some(v) = &recv_window {
60797 query.push(("recvWindow", v.to_string()));
60798 }
60799 query.push(("signature", signature.to_string()));
60800 query.push(("timestamp", timestamp.to_string()));
60801 #[allow(unused_mut)]
60802 let mut request = self
60803 .client
60804 .get(url)
60805 .header(
60806 reqwest::header::ACCEPT,
60807 reqwest::header::HeaderValue::from_static("application/json"),
60808 )
60809 .query(&query)
60810 .build()?;
60811 (crate::pre_hook)(&self.inner, &request);
60812 let result = self.client.execute(request).await;
60813 (crate::post_hook)(&self.inner, &result);
60814 let response = result?;
60815 match response.status().as_u16() {
60816 200u16 => ResponseValue::from_response(response).await,
60817 400u16 => {
60818 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60819 }
60820 401u16 => {
60821 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60822 }
60823 _ => Err(Error::UnexpectedResponse(response)),
60824 }
60825 }
60826 /**Get Isolated Margin Transfer History (USER_DATA)
60827
60828Weight(IP): 1
60829
60830Sends a `GET` request to `/sapi/v1/margin/isolated/transfer`
60831
60832Arguments:
60833- `asset`
60834- `current`: Current querying page. Start from 1. Default:1
60835- `end_time`: UTC timestamp in ms
60836- `recv_window`: The value cannot be greater than 60000
60837- `signature`: Signature
60838- `size`: Default:10 Max:100
60839- `start_time`: UTC timestamp in ms
60840- `symbol`: Trading symbol, e.g. BNBUSDT
60841- `timestamp`: UTC timestamp in ms
60842- `type_`
60843*/
60844 pub async fn query_margin_isolated_transfer<'a>(
60845 &'a self,
60846 asset: Option<&'a str>,
60847 current: Option<i32>,
60848 end_time: Option<i64>,
60849 recv_window: Option<i64>,
60850 signature: &'a str,
60851 size: Option<i32>,
60852 start_time: Option<i64>,
60853 symbol: &'a str,
60854 timestamp: i64,
60855 type_: Option<types::QueryMarginIsolatedTransferType>,
60856 ) -> Result<ResponseValue<types::MarginTransferDetails>, Error<types::Error>> {
60857 let url = format!("{}/sapi/v1/margin/isolated/transfer", self.baseurl,);
60858 let mut query = Vec::with_capacity(10usize);
60859 if let Some(v) = &asset {
60860 query.push(("asset", v.to_string()));
60861 }
60862 if let Some(v) = ¤t {
60863 query.push(("current", v.to_string()));
60864 }
60865 if let Some(v) = &end_time {
60866 query.push(("endTime", v.to_string()));
60867 }
60868 if let Some(v) = &recv_window {
60869 query.push(("recvWindow", v.to_string()));
60870 }
60871 query.push(("signature", signature.to_string()));
60872 if let Some(v) = &size {
60873 query.push(("size", v.to_string()));
60874 }
60875 if let Some(v) = &start_time {
60876 query.push(("startTime", v.to_string()));
60877 }
60878 query.push(("symbol", symbol.to_string()));
60879 query.push(("timestamp", timestamp.to_string()));
60880 if let Some(v) = &type_ {
60881 query.push(("type", v.to_string()));
60882 }
60883 #[allow(unused_mut)]
60884 let mut request = self
60885 .client
60886 .get(url)
60887 .header(
60888 reqwest::header::ACCEPT,
60889 reqwest::header::HeaderValue::from_static("application/json"),
60890 )
60891 .query(&query)
60892 .build()?;
60893 (crate::pre_hook)(&self.inner, &request);
60894 let result = self.client.execute(request).await;
60895 (crate::post_hook)(&self.inner, &result);
60896 let response = result?;
60897 match response.status().as_u16() {
60898 200u16 => ResponseValue::from_response(response).await,
60899 400u16 => {
60900 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60901 }
60902 401u16 => {
60903 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60904 }
60905 _ => Err(Error::UnexpectedResponse(response)),
60906 }
60907 }
60908 /**Isolated Margin Account Transfer (MARGIN)
60909
60910Weight(UID): 600
60911
60912Sends a `POST` request to `/sapi/v1/margin/isolated/transfer`
60913
60914Arguments:
60915- `amount`
60916- `asset`
60917- `recv_window`: The value cannot be greater than 60000
60918- `signature`: Signature
60919- `symbol`: Trading symbol, e.g. BNBUSDT
60920- `timestamp`: UTC timestamp in ms
60921- `trans_from`
60922- `trans_to`
60923*/
60924 pub async fn post_margin_isolated_transfer<'a>(
60925 &'a self,
60926 amount: f64,
60927 asset: &'a str,
60928 recv_window: Option<i64>,
60929 signature: &'a str,
60930 symbol: &'a str,
60931 timestamp: i64,
60932 trans_from: types::PostMarginIsolatedTransferTransFrom,
60933 trans_to: types::PostMarginIsolatedTransferTransTo,
60934 ) -> Result<
60935 ResponseValue<serde_json::Map<String, serde_json::Value>>,
60936 Error<types::Error>,
60937 > {
60938 let url = format!("{}/sapi/v1/margin/isolated/transfer", self.baseurl,);
60939 let mut query = Vec::with_capacity(8usize);
60940 query.push(("amount", amount.to_string()));
60941 query.push(("asset", asset.to_string()));
60942 if let Some(v) = &recv_window {
60943 query.push(("recvWindow", v.to_string()));
60944 }
60945 query.push(("signature", signature.to_string()));
60946 query.push(("symbol", symbol.to_string()));
60947 query.push(("timestamp", timestamp.to_string()));
60948 query.push(("transFrom", trans_from.to_string()));
60949 query.push(("transTo", trans_to.to_string()));
60950 #[allow(unused_mut)]
60951 let mut request = self
60952 .client
60953 .post(url)
60954 .header(
60955 reqwest::header::ACCEPT,
60956 reqwest::header::HeaderValue::from_static("application/json"),
60957 )
60958 .query(&query)
60959 .build()?;
60960 (crate::pre_hook)(&self.inner, &request);
60961 let result = self.client.execute(request).await;
60962 (crate::post_hook)(&self.inner, &result);
60963 let response = result?;
60964 match response.status().as_u16() {
60965 200u16 => ResponseValue::from_response(response).await,
60966 400u16 => {
60967 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60968 }
60969 401u16 => {
60970 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
60971 }
60972 _ => Err(Error::UnexpectedResponse(response)),
60973 }
60974 }
60975 /**Query Isolated Margin Account Info (USER_DATA)
60976
60977- If "symbols" is not sent, all isolated assets will be returned.
60978- If "symbols" is sent, only the isolated assets of the sent symbols will be returned.
60979
60980Weight(IP): 10
60981
60982Sends a `GET` request to `/sapi/v1/margin/isolated/account`
60983
60984Arguments:
60985- `recv_window`: The value cannot be greater than 60000
60986- `signature`: Signature
60987- `symbols`: Max 5 symbols can be sent; separated by ','
60988- `timestamp`: UTC timestamp in ms
60989*/
60990 pub async fn query_margin_isolated_account<'a>(
60991 &'a self,
60992 recv_window: Option<i64>,
60993 signature: &'a str,
60994 symbols: Option<&'a str>,
60995 timestamp: i64,
60996 ) -> Result<ResponseValue<types::IsolatedMarginAccountInfo>, Error<types::Error>> {
60997 let url = format!("{}/sapi/v1/margin/isolated/account", self.baseurl,);
60998 let mut query = Vec::with_capacity(4usize);
60999 if let Some(v) = &recv_window {
61000 query.push(("recvWindow", v.to_string()));
61001 }
61002 query.push(("signature", signature.to_string()));
61003 if let Some(v) = &symbols {
61004 query.push(("symbols", v.to_string()));
61005 }
61006 query.push(("timestamp", timestamp.to_string()));
61007 #[allow(unused_mut)]
61008 let mut request = self
61009 .client
61010 .get(url)
61011 .header(
61012 reqwest::header::ACCEPT,
61013 reqwest::header::HeaderValue::from_static("application/json"),
61014 )
61015 .query(&query)
61016 .build()?;
61017 (crate::pre_hook)(&self.inner, &request);
61018 let result = self.client.execute(request).await;
61019 (crate::post_hook)(&self.inner, &result);
61020 let response = result?;
61021 match response.status().as_u16() {
61022 200u16 => ResponseValue::from_response(response).await,
61023 400u16 => {
61024 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61025 }
61026 401u16 => {
61027 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61028 }
61029 _ => Err(Error::UnexpectedResponse(response)),
61030 }
61031 }
61032 /**Enable Isolated Margin Account (TRADE)
61033
61034Enable isolated margin account for a specific symbol.
61035
61036Weight(UID): 300
61037
61038Sends a `POST` request to `/sapi/v1/margin/isolated/account`
61039
61040Arguments:
61041- `recv_window`: The value cannot be greater than 60000
61042- `signature`: Signature
61043- `symbol`: Trading symbol, e.g. BNBUSDT
61044- `timestamp`: UTC timestamp in ms
61045*/
61046 pub async fn post_margin_isolated_account<'a>(
61047 &'a self,
61048 recv_window: Option<i64>,
61049 signature: &'a str,
61050 symbol: &'a str,
61051 timestamp: i64,
61052 ) -> Result<
61053 ResponseValue<types::PostMarginIsolatedAccountResponse>,
61054 Error<types::Error>,
61055 > {
61056 let url = format!("{}/sapi/v1/margin/isolated/account", self.baseurl,);
61057 let mut query = Vec::with_capacity(4usize);
61058 if let Some(v) = &recv_window {
61059 query.push(("recvWindow", v.to_string()));
61060 }
61061 query.push(("signature", signature.to_string()));
61062 query.push(("symbol", symbol.to_string()));
61063 query.push(("timestamp", timestamp.to_string()));
61064 #[allow(unused_mut)]
61065 let mut request = self
61066 .client
61067 .post(url)
61068 .header(
61069 reqwest::header::ACCEPT,
61070 reqwest::header::HeaderValue::from_static("application/json"),
61071 )
61072 .query(&query)
61073 .build()?;
61074 (crate::pre_hook)(&self.inner, &request);
61075 let result = self.client.execute(request).await;
61076 (crate::post_hook)(&self.inner, &result);
61077 let response = result?;
61078 match response.status().as_u16() {
61079 200u16 => ResponseValue::from_response(response).await,
61080 400u16 => {
61081 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61082 }
61083 401u16 => {
61084 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61085 }
61086 _ => Err(Error::UnexpectedResponse(response)),
61087 }
61088 }
61089 /**Disable Isolated Margin Account (TRADE)
61090
61091Disable isolated margin account for a specific symbol. Each trading pair can only be deactivated once every 24 hours .
61092
61093Weight(UID): 300
61094
61095Sends a `DELETE` request to `/sapi/v1/margin/isolated/account`
61096
61097Arguments:
61098- `recv_window`: The value cannot be greater than 60000
61099- `signature`: Signature
61100- `symbol`: Trading symbol, e.g. BNBUSDT
61101- `timestamp`: UTC timestamp in ms
61102*/
61103 pub async fn disable_isolated_margin_account<'a>(
61104 &'a self,
61105 recv_window: Option<i64>,
61106 signature: &'a str,
61107 symbol: &'a str,
61108 timestamp: i64,
61109 ) -> Result<
61110 ResponseValue<types::DisableIsolatedMarginAccountResponse>,
61111 Error<types::Error>,
61112 > {
61113 let url = format!("{}/sapi/v1/margin/isolated/account", self.baseurl,);
61114 let mut query = Vec::with_capacity(4usize);
61115 if let Some(v) = &recv_window {
61116 query.push(("recvWindow", v.to_string()));
61117 }
61118 query.push(("signature", signature.to_string()));
61119 query.push(("symbol", symbol.to_string()));
61120 query.push(("timestamp", timestamp.to_string()));
61121 #[allow(unused_mut)]
61122 let mut request = self
61123 .client
61124 .delete(url)
61125 .header(
61126 reqwest::header::ACCEPT,
61127 reqwest::header::HeaderValue::from_static("application/json"),
61128 )
61129 .query(&query)
61130 .build()?;
61131 (crate::pre_hook)(&self.inner, &request);
61132 let result = self.client.execute(request).await;
61133 (crate::post_hook)(&self.inner, &result);
61134 let response = result?;
61135 match response.status().as_u16() {
61136 200u16 => ResponseValue::from_response(response).await,
61137 400u16 => {
61138 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61139 }
61140 401u16 => {
61141 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61142 }
61143 _ => Err(Error::UnexpectedResponse(response)),
61144 }
61145 }
61146 /**Query Enabled Isolated Margin Account Limit (USER_DATA)
61147
61148Query enabled isolated margin account limit.
61149
61150Weight(IP): 1
61151
61152Sends a `GET` request to `/sapi/v1/margin/isolated/accountLimit`
61153
61154Arguments:
61155- `recv_window`: The value cannot be greater than 60000
61156- `signature`: Signature
61157- `timestamp`: UTC timestamp in ms
61158*/
61159 pub async fn margin_isolated_account_limit<'a>(
61160 &'a self,
61161 recv_window: Option<i64>,
61162 signature: &'a str,
61163 timestamp: i64,
61164 ) -> Result<
61165 ResponseValue<types::MarginIsolatedAccountLimitResponse>,
61166 Error<types::Error>,
61167 > {
61168 let url = format!("{}/sapi/v1/margin/isolated/accountLimit", self.baseurl,);
61169 let mut query = Vec::with_capacity(3usize);
61170 if let Some(v) = &recv_window {
61171 query.push(("recvWindow", v.to_string()));
61172 }
61173 query.push(("signature", signature.to_string()));
61174 query.push(("timestamp", timestamp.to_string()));
61175 #[allow(unused_mut)]
61176 let mut request = self
61177 .client
61178 .get(url)
61179 .header(
61180 reqwest::header::ACCEPT,
61181 reqwest::header::HeaderValue::from_static("application/json"),
61182 )
61183 .query(&query)
61184 .build()?;
61185 (crate::pre_hook)(&self.inner, &request);
61186 let result = self.client.execute(request).await;
61187 (crate::post_hook)(&self.inner, &result);
61188 let response = result?;
61189 match response.status().as_u16() {
61190 200u16 => ResponseValue::from_response(response).await,
61191 400u16 => {
61192 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61193 }
61194 401u16 => {
61195 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61196 }
61197 _ => Err(Error::UnexpectedResponse(response)),
61198 }
61199 }
61200 /**Query Isolated Margin Symbol (USER_DATA)
61201
61202Weight(IP): 10
61203
61204Sends a `GET` request to `/sapi/v1/margin/isolated/pair`
61205
61206Arguments:
61207- `recv_window`: The value cannot be greater than 60000
61208- `signature`: Signature
61209- `symbol`: Trading symbol, e.g. BNBUSDT
61210- `timestamp`: UTC timestamp in ms
61211*/
61212 pub async fn margin_isolated_pair<'a>(
61213 &'a self,
61214 recv_window: Option<i64>,
61215 signature: &'a str,
61216 symbol: &'a str,
61217 timestamp: i64,
61218 ) -> Result<ResponseValue<types::MarginIsolatedPairResponse>, Error<types::Error>> {
61219 let url = format!("{}/sapi/v1/margin/isolated/pair", self.baseurl,);
61220 let mut query = Vec::with_capacity(4usize);
61221 if let Some(v) = &recv_window {
61222 query.push(("recvWindow", v.to_string()));
61223 }
61224 query.push(("signature", signature.to_string()));
61225 query.push(("symbol", symbol.to_string()));
61226 query.push(("timestamp", timestamp.to_string()));
61227 #[allow(unused_mut)]
61228 let mut request = self
61229 .client
61230 .get(url)
61231 .header(
61232 reqwest::header::ACCEPT,
61233 reqwest::header::HeaderValue::from_static("application/json"),
61234 )
61235 .query(&query)
61236 .build()?;
61237 (crate::pre_hook)(&self.inner, &request);
61238 let result = self.client.execute(request).await;
61239 (crate::post_hook)(&self.inner, &result);
61240 let response = result?;
61241 match response.status().as_u16() {
61242 200u16 => ResponseValue::from_response(response).await,
61243 400u16 => {
61244 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61245 }
61246 401u16 => {
61247 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61248 }
61249 _ => Err(Error::UnexpectedResponse(response)),
61250 }
61251 }
61252 /**Get All Isolated Margin Symbol(USER_DATA)
61253
61254Weight(IP): 10
61255
61256Sends a `GET` request to `/sapi/v1/margin/isolated/allPairs`
61257
61258Arguments:
61259- `recv_window`: The value cannot be greater than 60000
61260- `signature`: Signature
61261- `timestamp`: UTC timestamp in ms
61262*/
61263 pub async fn margin_isolated_all_pairs<'a>(
61264 &'a self,
61265 recv_window: Option<i64>,
61266 signature: &'a str,
61267 timestamp: i64,
61268 ) -> Result<
61269 ResponseValue<Vec<types::MarginIsolatedAllPairsResponseItem>>,
61270 Error<types::Error>,
61271 > {
61272 let url = format!("{}/sapi/v1/margin/isolated/allPairs", self.baseurl,);
61273 let mut query = Vec::with_capacity(3usize);
61274 if let Some(v) = &recv_window {
61275 query.push(("recvWindow", v.to_string()));
61276 }
61277 query.push(("signature", signature.to_string()));
61278 query.push(("timestamp", timestamp.to_string()));
61279 #[allow(unused_mut)]
61280 let mut request = self
61281 .client
61282 .get(url)
61283 .header(
61284 reqwest::header::ACCEPT,
61285 reqwest::header::HeaderValue::from_static("application/json"),
61286 )
61287 .query(&query)
61288 .build()?;
61289 (crate::pre_hook)(&self.inner, &request);
61290 let result = self.client.execute(request).await;
61291 (crate::post_hook)(&self.inner, &result);
61292 let response = result?;
61293 match response.status().as_u16() {
61294 200u16 => ResponseValue::from_response(response).await,
61295 400u16 => {
61296 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61297 }
61298 401u16 => {
61299 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61300 }
61301 _ => Err(Error::UnexpectedResponse(response)),
61302 }
61303 }
61304 /**Get BNB Burn Status(USER_DATA)
61305
61306Weight(IP): 1
61307
61308Sends a `GET` request to `/sapi/v1/bnbBurn`
61309
61310Arguments:
61311- `recv_window`: The value cannot be greater than 60000
61312- `signature`: Signature
61313- `timestamp`: UTC timestamp in ms
61314*/
61315 pub async fn query_toggle_bnb_burn_status<'a>(
61316 &'a self,
61317 recv_window: Option<i64>,
61318 signature: &'a str,
61319 timestamp: i64,
61320 ) -> Result<ResponseValue<types::BnbBurnStatus>, Error<types::Error>> {
61321 let url = format!("{}/sapi/v1/bnbBurn", self.baseurl,);
61322 let mut query = Vec::with_capacity(3usize);
61323 if let Some(v) = &recv_window {
61324 query.push(("recvWindow", v.to_string()));
61325 }
61326 query.push(("signature", signature.to_string()));
61327 query.push(("timestamp", timestamp.to_string()));
61328 #[allow(unused_mut)]
61329 let mut request = self
61330 .client
61331 .get(url)
61332 .header(
61333 reqwest::header::ACCEPT,
61334 reqwest::header::HeaderValue::from_static("application/json"),
61335 )
61336 .query(&query)
61337 .build()?;
61338 (crate::pre_hook)(&self.inner, &request);
61339 let result = self.client.execute(request).await;
61340 (crate::post_hook)(&self.inner, &result);
61341 let response = result?;
61342 match response.status().as_u16() {
61343 200u16 => ResponseValue::from_response(response).await,
61344 400u16 => {
61345 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61346 }
61347 401u16 => {
61348 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61349 }
61350 _ => Err(Error::UnexpectedResponse(response)),
61351 }
61352 }
61353 /**Toggle BNB Burn On Spot Trade And Margin Interest (USER_DATA)
61354
61355- "spotBNBBurn" and "interestBNBBurn" should be sent at least one.
61356
61357Weight(IP): 1
61358
61359Sends a `POST` request to `/sapi/v1/bnbBurn`
61360
61361Arguments:
61362- `interest_bnb_burn`: Determines whether to use BNB to pay for margin loan's interest
61363- `recv_window`: The value cannot be greater than 60000
61364- `signature`: Signature
61365- `spot_bnb_burn`: Determines whether to use BNB to pay for trading fees on SPOT
61366- `timestamp`: UTC timestamp in ms
61367*/
61368 pub async fn toggle_bnb_burn<'a>(
61369 &'a self,
61370 interest_bnb_burn: Option<types::ToggleBnbBurnInterestBnbBurn>,
61371 recv_window: Option<i64>,
61372 signature: &'a str,
61373 spot_bnb_burn: Option<types::ToggleBnbBurnSpotBnbBurn>,
61374 timestamp: i64,
61375 ) -> Result<ResponseValue<types::BnbBurnStatus>, Error<types::Error>> {
61376 let url = format!("{}/sapi/v1/bnbBurn", self.baseurl,);
61377 let mut query = Vec::with_capacity(5usize);
61378 if let Some(v) = &interest_bnb_burn {
61379 query.push(("interestBNBBurn", v.to_string()));
61380 }
61381 if let Some(v) = &recv_window {
61382 query.push(("recvWindow", v.to_string()));
61383 }
61384 query.push(("signature", signature.to_string()));
61385 if let Some(v) = &spot_bnb_burn {
61386 query.push(("spotBNBBurn", v.to_string()));
61387 }
61388 query.push(("timestamp", timestamp.to_string()));
61389 #[allow(unused_mut)]
61390 let mut request = self
61391 .client
61392 .post(url)
61393 .header(
61394 reqwest::header::ACCEPT,
61395 reqwest::header::HeaderValue::from_static("application/json"),
61396 )
61397 .query(&query)
61398 .build()?;
61399 (crate::pre_hook)(&self.inner, &request);
61400 let result = self.client.execute(request).await;
61401 (crate::post_hook)(&self.inner, &result);
61402 let response = result?;
61403 match response.status().as_u16() {
61404 200u16 => ResponseValue::from_response(response).await,
61405 400u16 => {
61406 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61407 }
61408 401u16 => {
61409 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61410 }
61411 _ => Err(Error::UnexpectedResponse(response)),
61412 }
61413 }
61414 /**Margin Interest Rate History (USER_DATA)
61415
61416The max interval between startTime and endTime is 30 days.
61417
61418Weight(IP): 1
61419
61420Sends a `GET` request to `/sapi/v1/margin/interestRateHistory`
61421
61422Arguments:
61423- `asset`
61424- `end_time`: UTC timestamp in ms
61425- `recv_window`: The value cannot be greater than 60000
61426- `signature`: Signature
61427- `start_time`: UTC timestamp in ms
61428- `timestamp`: UTC timestamp in ms
61429- `vip_level`: Defaults to user's vip level
61430*/
61431 pub async fn margin_interest_rate_history<'a>(
61432 &'a self,
61433 asset: &'a str,
61434 end_time: Option<i64>,
61435 recv_window: Option<i64>,
61436 signature: &'a str,
61437 start_time: Option<i64>,
61438 timestamp: i64,
61439 vip_level: Option<i32>,
61440 ) -> Result<
61441 ResponseValue<Vec<types::MarginInterestRateHistoryResponseItem>>,
61442 Error<types::Error>,
61443 > {
61444 let url = format!("{}/sapi/v1/margin/interestRateHistory", self.baseurl,);
61445 let mut query = Vec::with_capacity(7usize);
61446 query.push(("asset", asset.to_string()));
61447 if let Some(v) = &end_time {
61448 query.push(("endTime", v.to_string()));
61449 }
61450 if let Some(v) = &recv_window {
61451 query.push(("recvWindow", v.to_string()));
61452 }
61453 query.push(("signature", signature.to_string()));
61454 if let Some(v) = &start_time {
61455 query.push(("startTime", v.to_string()));
61456 }
61457 query.push(("timestamp", timestamp.to_string()));
61458 if let Some(v) = &vip_level {
61459 query.push(("vipLevel", v.to_string()));
61460 }
61461 #[allow(unused_mut)]
61462 let mut request = self
61463 .client
61464 .get(url)
61465 .header(
61466 reqwest::header::ACCEPT,
61467 reqwest::header::HeaderValue::from_static("application/json"),
61468 )
61469 .query(&query)
61470 .build()?;
61471 (crate::pre_hook)(&self.inner, &request);
61472 let result = self.client.execute(request).await;
61473 (crate::post_hook)(&self.inner, &result);
61474 let response = result?;
61475 match response.status().as_u16() {
61476 200u16 => ResponseValue::from_response(response).await,
61477 400u16 => {
61478 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61479 }
61480 401u16 => {
61481 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61482 }
61483 _ => Err(Error::UnexpectedResponse(response)),
61484 }
61485 }
61486 /**Query Cross Margin Fee Data (USER_DATA)
61487
61488Get cross margin fee data collection with any vip level or user's current specific data as https://www.binance.com/en/margin-fee
61489
61490Weight(IP): 1 when coin is specified; 5 when the coin parameter is omitted
61491
61492Sends a `GET` request to `/sapi/v1/margin/crossMarginData`
61493
61494Arguments:
61495- `coin`: Coin name
61496- `recv_window`: The value cannot be greater than 60000
61497- `signature`: Signature
61498- `timestamp`: UTC timestamp in ms
61499- `vip_level`: Defaults to user's vip level
61500*/
61501 pub async fn margin_cross_margin_data<'a>(
61502 &'a self,
61503 coin: Option<&'a str>,
61504 recv_window: Option<i64>,
61505 signature: &'a str,
61506 timestamp: i64,
61507 vip_level: Option<i32>,
61508 ) -> Result<
61509 ResponseValue<Vec<types::MarginCrossMarginDataResponseItem>>,
61510 Error<types::Error>,
61511 > {
61512 let url = format!("{}/sapi/v1/margin/crossMarginData", self.baseurl,);
61513 let mut query = Vec::with_capacity(5usize);
61514 if let Some(v) = &coin {
61515 query.push(("coin", v.to_string()));
61516 }
61517 if let Some(v) = &recv_window {
61518 query.push(("recvWindow", v.to_string()));
61519 }
61520 query.push(("signature", signature.to_string()));
61521 query.push(("timestamp", timestamp.to_string()));
61522 if let Some(v) = &vip_level {
61523 query.push(("vipLevel", v.to_string()));
61524 }
61525 #[allow(unused_mut)]
61526 let mut request = self
61527 .client
61528 .get(url)
61529 .header(
61530 reqwest::header::ACCEPT,
61531 reqwest::header::HeaderValue::from_static("application/json"),
61532 )
61533 .query(&query)
61534 .build()?;
61535 (crate::pre_hook)(&self.inner, &request);
61536 let result = self.client.execute(request).await;
61537 (crate::post_hook)(&self.inner, &result);
61538 let response = result?;
61539 match response.status().as_u16() {
61540 200u16 => ResponseValue::from_response(response).await,
61541 400u16 => {
61542 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61543 }
61544 401u16 => {
61545 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61546 }
61547 _ => Err(Error::UnexpectedResponse(response)),
61548 }
61549 }
61550 /**Query Isolated Margin Fee Data (USER_DATA)
61551
61552Get isolated margin fee data collection with any vip level or user's current specific data as https://www.binance.com/en/margin-fee
61553
61554Weight(IP): 1 when a single is specified; 10 when the symbol parameter is omitted
61555
61556Sends a `GET` request to `/sapi/v1/margin/isolatedMarginData`
61557
61558Arguments:
61559- `recv_window`: The value cannot be greater than 60000
61560- `signature`: Signature
61561- `symbol`: Trading symbol, e.g. BNBUSDT
61562- `timestamp`: UTC timestamp in ms
61563- `vip_level`: Defaults to user's vip level
61564*/
61565 pub async fn margin_isolated_margin_data<'a>(
61566 &'a self,
61567 recv_window: Option<i64>,
61568 signature: &'a str,
61569 symbol: Option<&'a str>,
61570 timestamp: i64,
61571 vip_level: Option<i32>,
61572 ) -> Result<
61573 ResponseValue<Vec<types::MarginIsolatedMarginDataResponseItem>>,
61574 Error<types::Error>,
61575 > {
61576 let url = format!("{}/sapi/v1/margin/isolatedMarginData", self.baseurl,);
61577 let mut query = Vec::with_capacity(5usize);
61578 if let Some(v) = &recv_window {
61579 query.push(("recvWindow", v.to_string()));
61580 }
61581 query.push(("signature", signature.to_string()));
61582 if let Some(v) = &symbol {
61583 query.push(("symbol", v.to_string()));
61584 }
61585 query.push(("timestamp", timestamp.to_string()));
61586 if let Some(v) = &vip_level {
61587 query.push(("vipLevel", v.to_string()));
61588 }
61589 #[allow(unused_mut)]
61590 let mut request = self
61591 .client
61592 .get(url)
61593 .header(
61594 reqwest::header::ACCEPT,
61595 reqwest::header::HeaderValue::from_static("application/json"),
61596 )
61597 .query(&query)
61598 .build()?;
61599 (crate::pre_hook)(&self.inner, &request);
61600 let result = self.client.execute(request).await;
61601 (crate::post_hook)(&self.inner, &result);
61602 let response = result?;
61603 match response.status().as_u16() {
61604 200u16 => ResponseValue::from_response(response).await,
61605 400u16 => {
61606 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61607 }
61608 401u16 => {
61609 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61610 }
61611 _ => Err(Error::UnexpectedResponse(response)),
61612 }
61613 }
61614 /**Query Isolated Margin Tier Data (USER_DATA)
61615
61616Get isolated margin tier data collection with any tier as https://www.binance.com/en/margin-data
61617
61618Weight(IP): 1
61619
61620Sends a `GET` request to `/sapi/v1/margin/isolatedMarginTier`
61621
61622Arguments:
61623- `recv_window`: The value cannot be greater than 60000
61624- `signature`: Signature
61625- `symbol`: Trading symbol, e.g. BNBUSDT
61626- `tier`: All margin tier data will be returned if tier is omitted
61627- `timestamp`: UTC timestamp in ms
61628*/
61629 pub async fn margin_isolated_margin_tier<'a>(
61630 &'a self,
61631 recv_window: Option<i64>,
61632 signature: &'a str,
61633 symbol: &'a str,
61634 tier: Option<&'a str>,
61635 timestamp: i64,
61636 ) -> Result<
61637 ResponseValue<Vec<types::MarginIsolatedMarginTierResponseItem>>,
61638 Error<types::Error>,
61639 > {
61640 let url = format!("{}/sapi/v1/margin/isolatedMarginTier", self.baseurl,);
61641 let mut query = Vec::with_capacity(5usize);
61642 if let Some(v) = &recv_window {
61643 query.push(("recvWindow", v.to_string()));
61644 }
61645 query.push(("signature", signature.to_string()));
61646 query.push(("symbol", symbol.to_string()));
61647 if let Some(v) = &tier {
61648 query.push(("tier", v.to_string()));
61649 }
61650 query.push(("timestamp", timestamp.to_string()));
61651 #[allow(unused_mut)]
61652 let mut request = self
61653 .client
61654 .get(url)
61655 .header(
61656 reqwest::header::ACCEPT,
61657 reqwest::header::HeaderValue::from_static("application/json"),
61658 )
61659 .query(&query)
61660 .build()?;
61661 (crate::pre_hook)(&self.inner, &request);
61662 let result = self.client.execute(request).await;
61663 (crate::post_hook)(&self.inner, &result);
61664 let response = result?;
61665 match response.status().as_u16() {
61666 200u16 => ResponseValue::from_response(response).await,
61667 400u16 => {
61668 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61669 }
61670 401u16 => {
61671 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61672 }
61673 _ => Err(Error::UnexpectedResponse(response)),
61674 }
61675 }
61676 /**Query Current Margin Order Count Usage (TRADE)
61677
61678Displays the user's current margin order count usage for all intervals.
61679
61680Weight(IP): 20
61681
61682Sends a `GET` request to `/sapi/v1/margin/rateLimit/order`
61683
61684Arguments:
61685- `is_isolated`: * `TRUE` - For isolated margin
61686* `FALSE` - Default, not for isolated margin
61687- `recv_window`: The value cannot be greater than 60000
61688- `signature`: Signature
61689- `symbol`: isolated symbol, mandatory for isolated margin
61690- `timestamp`: UTC timestamp in ms
61691*/
61692 pub async fn margin_rate_limit_order<'a>(
61693 &'a self,
61694 is_isolated: Option<&'a str>,
61695 recv_window: Option<i64>,
61696 signature: &'a str,
61697 symbol: Option<&'a str>,
61698 timestamp: i64,
61699 ) -> Result<
61700 ResponseValue<Vec<types::MarginRateLimitOrderResponseItem>>,
61701 Error<types::Error>,
61702 > {
61703 let url = format!("{}/sapi/v1/margin/rateLimit/order", self.baseurl,);
61704 let mut query = Vec::with_capacity(5usize);
61705 if let Some(v) = &is_isolated {
61706 query.push(("isIsolated", v.to_string()));
61707 }
61708 if let Some(v) = &recv_window {
61709 query.push(("recvWindow", v.to_string()));
61710 }
61711 query.push(("signature", signature.to_string()));
61712 if let Some(v) = &symbol {
61713 query.push(("symbol", v.to_string()));
61714 }
61715 query.push(("timestamp", timestamp.to_string()));
61716 #[allow(unused_mut)]
61717 let mut request = self
61718 .client
61719 .get(url)
61720 .header(
61721 reqwest::header::ACCEPT,
61722 reqwest::header::HeaderValue::from_static("application/json"),
61723 )
61724 .query(&query)
61725 .build()?;
61726 (crate::pre_hook)(&self.inner, &request);
61727 let result = self.client.execute(request).await;
61728 (crate::post_hook)(&self.inner, &result);
61729 let response = result?;
61730 match response.status().as_u16() {
61731 200u16 => ResponseValue::from_response(response).await,
61732 400u16 => {
61733 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61734 }
61735 401u16 => {
61736 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61737 }
61738 _ => Err(Error::UnexpectedResponse(response)),
61739 }
61740 }
61741 /**Margin Dustlog (USER_DATA)
61742
61743Query the historical information of user margin account small-value asset conversion BNB.
61744
61745Weight(IP): 1
61746
61747Sends a `GET` request to `/sapi/v1/margin/dribblet`
61748
61749Arguments:
61750- `end_time`: UTC timestamp in ms
61751- `recv_window`: The value cannot be greater than 60000
61752- `signature`: Signature
61753- `start_time`: UTC timestamp in ms
61754- `timestamp`: UTC timestamp in ms
61755*/
61756 pub async fn margin_dribblet<'a>(
61757 &'a self,
61758 end_time: Option<i64>,
61759 recv_window: Option<i64>,
61760 signature: &'a str,
61761 start_time: Option<i64>,
61762 timestamp: i64,
61763 ) -> Result<ResponseValue<types::MarginDribbletResponse>, Error<types::Error>> {
61764 let url = format!("{}/sapi/v1/margin/dribblet", self.baseurl,);
61765 let mut query = Vec::with_capacity(5usize);
61766 if let Some(v) = &end_time {
61767 query.push(("endTime", v.to_string()));
61768 }
61769 if let Some(v) = &recv_window {
61770 query.push(("recvWindow", v.to_string()));
61771 }
61772 query.push(("signature", signature.to_string()));
61773 if let Some(v) = &start_time {
61774 query.push(("startTime", v.to_string()));
61775 }
61776 query.push(("timestamp", timestamp.to_string()));
61777 #[allow(unused_mut)]
61778 let mut request = self
61779 .client
61780 .get(url)
61781 .header(
61782 reqwest::header::ACCEPT,
61783 reqwest::header::HeaderValue::from_static("application/json"),
61784 )
61785 .query(&query)
61786 .build()?;
61787 (crate::pre_hook)(&self.inner, &request);
61788 let result = self.client.execute(request).await;
61789 (crate::post_hook)(&self.inner, &result);
61790 let response = result?;
61791 match response.status().as_u16() {
61792 200u16 => ResponseValue::from_response(response).await,
61793 400u16 => {
61794 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61795 }
61796 401u16 => {
61797 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61798 }
61799 _ => Err(Error::UnexpectedResponse(response)),
61800 }
61801 }
61802 /**Cross margin collateral ratio (MARKET_DATA)
61803
61804
61805Weight(IP): 100
61806
61807Sends a `GET` request to `/sapi/v1/margin/crossMarginCollateralRatio`
61808
61809*/
61810 pub async fn margin_cross_margin_collateral_ratio<'a>(
61811 &'a self,
61812 ) -> Result<
61813 ResponseValue<Vec<types::MarginCrossMarginCollateralRatioResponseItem>>,
61814 Error<types::Error>,
61815 > {
61816 let url = format!("{}/sapi/v1/margin/crossMarginCollateralRatio", self.baseurl,);
61817 #[allow(unused_mut)]
61818 let mut request = self
61819 .client
61820 .get(url)
61821 .header(
61822 reqwest::header::ACCEPT,
61823 reqwest::header::HeaderValue::from_static("application/json"),
61824 )
61825 .build()?;
61826 (crate::pre_hook)(&self.inner, &request);
61827 let result = self.client.execute(request).await;
61828 (crate::post_hook)(&self.inner, &result);
61829 let response = result?;
61830 match response.status().as_u16() {
61831 200u16 => ResponseValue::from_response(response).await,
61832 400u16 => {
61833 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61834 }
61835 _ => Err(Error::UnexpectedResponse(response)),
61836 }
61837 }
61838 /**Get Small Liability Exchange Coin List (USER_DATA)
61839
61840Query the coins which can be small liability exchange
61841
61842Weight(UID): 100
61843
61844Sends a `GET` request to `/sapi/v1/margin/exchange-small-liability`
61845
61846Arguments:
61847- `recv_window`: The value cannot be greater than 60000
61848- `signature`: Signature
61849- `timestamp`: UTC timestamp in ms
61850*/
61851 pub async fn margin_exchange_small_liability<'a>(
61852 &'a self,
61853 recv_window: Option<i64>,
61854 signature: &'a str,
61855 timestamp: i64,
61856 ) -> Result<
61857 ResponseValue<Vec<types::MarginExchangeSmallLiabilityResponseItem>>,
61858 Error<types::Error>,
61859 > {
61860 let url = format!("{}/sapi/v1/margin/exchange-small-liability", self.baseurl,);
61861 let mut query = Vec::with_capacity(3usize);
61862 if let Some(v) = &recv_window {
61863 query.push(("recvWindow", v.to_string()));
61864 }
61865 query.push(("signature", signature.to_string()));
61866 query.push(("timestamp", timestamp.to_string()));
61867 #[allow(unused_mut)]
61868 let mut request = self
61869 .client
61870 .get(url)
61871 .header(
61872 reqwest::header::ACCEPT,
61873 reqwest::header::HeaderValue::from_static("application/json"),
61874 )
61875 .query(&query)
61876 .build()?;
61877 (crate::pre_hook)(&self.inner, &request);
61878 let result = self.client.execute(request).await;
61879 (crate::post_hook)(&self.inner, &result);
61880 let response = result?;
61881 match response.status().as_u16() {
61882 200u16 => ResponseValue::from_response(response).await,
61883 400u16 => {
61884 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61885 }
61886 401u16 => {
61887 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61888 }
61889 _ => Err(Error::UnexpectedResponse(response)),
61890 }
61891 }
61892 /**Get Small Liability Exchange History (USER_DATA)
61893
61894Get Small liability Exchange History
61895
61896Weight(UID): 100
61897
61898Sends a `GET` request to `/sapi/v1/margin/exchange-small-liability-history`
61899
61900Arguments:
61901- `current`: Current querying page. Start from 1. Default:1
61902- `end_time`: UTC timestamp in ms
61903- `recv_window`: The value cannot be greater than 60000
61904- `signature`: Signature
61905- `size`: Default:10 Max:100
61906- `start_time`: UTC timestamp in ms
61907- `timestamp`: UTC timestamp in ms
61908*/
61909 pub async fn margin_exchange_small_liability_history<'a>(
61910 &'a self,
61911 current: Option<i32>,
61912 end_time: Option<i64>,
61913 recv_window: Option<i64>,
61914 signature: &'a str,
61915 size: Option<i32>,
61916 start_time: Option<i64>,
61917 timestamp: i64,
61918 ) -> Result<
61919 ResponseValue<types::MarginExchangeSmallLiabilityHistoryResponse>,
61920 Error<types::Error>,
61921 > {
61922 let url = format!(
61923 "{}/sapi/v1/margin/exchange-small-liability-history", self.baseurl,
61924 );
61925 let mut query = Vec::with_capacity(7usize);
61926 if let Some(v) = ¤t {
61927 query.push(("current", v.to_string()));
61928 }
61929 if let Some(v) = &end_time {
61930 query.push(("endTime", v.to_string()));
61931 }
61932 if let Some(v) = &recv_window {
61933 query.push(("recvWindow", v.to_string()));
61934 }
61935 query.push(("signature", signature.to_string()));
61936 if let Some(v) = &size {
61937 query.push(("size", v.to_string()));
61938 }
61939 if let Some(v) = &start_time {
61940 query.push(("startTime", v.to_string()));
61941 }
61942 query.push(("timestamp", timestamp.to_string()));
61943 #[allow(unused_mut)]
61944 let mut request = self
61945 .client
61946 .get(url)
61947 .header(
61948 reqwest::header::ACCEPT,
61949 reqwest::header::HeaderValue::from_static("application/json"),
61950 )
61951 .query(&query)
61952 .build()?;
61953 (crate::pre_hook)(&self.inner, &request);
61954 let result = self.client.execute(request).await;
61955 (crate::post_hook)(&self.inner, &result);
61956 let response = result?;
61957 match response.status().as_u16() {
61958 200u16 => ResponseValue::from_response(response).await,
61959 400u16 => {
61960 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61961 }
61962 401u16 => {
61963 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
61964 }
61965 _ => Err(Error::UnexpectedResponse(response)),
61966 }
61967 }
61968 /**Get a future hourly interest rate (USER_DATA)
61969
61970Get user the next hourly estimate interest
61971
61972Weight(UID): 100
61973
61974Sends a `GET` request to `/sapi/v1/margin/next-hourly-interest-rate`
61975
61976Arguments:
61977- `assets`: List of assets, separated by commas, up to 20
61978- `is_isolated`: for isolated margin or not, "TRUE", "FALSE"
61979- `recv_window`: The value cannot be greater than 60000
61980- `signature`: Signature
61981- `timestamp`: UTC timestamp in ms
61982*/
61983 pub async fn margin_next_hourly_interest_rate<'a>(
61984 &'a self,
61985 assets: Option<&'a str>,
61986 is_isolated: Option<types::MarginNextHourlyInterestRateIsIsolated>,
61987 recv_window: Option<i64>,
61988 signature: &'a str,
61989 timestamp: i64,
61990 ) -> Result<
61991 ResponseValue<Vec<types::MarginNextHourlyInterestRateResponseItem>>,
61992 Error<types::Error>,
61993 > {
61994 let url = format!("{}/sapi/v1/margin/next-hourly-interest-rate", self.baseurl,);
61995 let mut query = Vec::with_capacity(5usize);
61996 if let Some(v) = &assets {
61997 query.push(("assets", v.to_string()));
61998 }
61999 if let Some(v) = &is_isolated {
62000 query.push(("isIsolated", v.to_string()));
62001 }
62002 if let Some(v) = &recv_window {
62003 query.push(("recvWindow", v.to_string()));
62004 }
62005 query.push(("signature", signature.to_string()));
62006 query.push(("timestamp", timestamp.to_string()));
62007 #[allow(unused_mut)]
62008 let mut request = self
62009 .client
62010 .get(url)
62011 .header(
62012 reqwest::header::ACCEPT,
62013 reqwest::header::HeaderValue::from_static("application/json"),
62014 )
62015 .query(&query)
62016 .build()?;
62017 (crate::pre_hook)(&self.inner, &request);
62018 let result = self.client.execute(request).await;
62019 (crate::post_hook)(&self.inner, &result);
62020 let response = result?;
62021 match response.status().as_u16() {
62022 200u16 => ResponseValue::from_response(response).await,
62023 400u16 => {
62024 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62025 }
62026 401u16 => {
62027 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62028 }
62029 _ => Err(Error::UnexpectedResponse(response)),
62030 }
62031 }
62032 /**Get cross or isolated margin capital flow(USER_DATA)
62033
62034Get cross or isolated margin capital flow
62035
62036Weight(IP): 100
62037
62038Sends a `GET` request to `/sapi/v1/margin/capital-flow`
62039
62040Arguments:
62041- `asset`
62042- `end_time`: UTC timestamp in ms
62043- `from_id`: If fromId is set, the data with id > fromId will be returned. Otherwise the latest data will be returned
62044- `limit`: The number of data items returned each time is limited. Default 500; Max 1000.
62045- `recv_window`: The value cannot be greater than 60000
62046- `signature`: Signature
62047- `start_time`: Only supports querying the data of the last 90 days
62048- `symbol`: Required when querying isolated data
62049- `timestamp`: UTC timestamp in ms
62050- `type_`
62051*/
62052 pub async fn margin_capital_flow<'a>(
62053 &'a self,
62054 asset: Option<&'a str>,
62055 end_time: Option<i64>,
62056 from_id: Option<i64>,
62057 limit: Option<i64>,
62058 recv_window: Option<i64>,
62059 signature: &'a str,
62060 start_time: Option<i64>,
62061 symbol: Option<&'a str>,
62062 timestamp: i64,
62063 type_: Option<types::MarginCapitalFlowType>,
62064 ) -> Result<
62065 ResponseValue<Vec<types::MarginCapitalFlowResponseItem>>,
62066 Error<types::Error>,
62067 > {
62068 let url = format!("{}/sapi/v1/margin/capital-flow", self.baseurl,);
62069 let mut query = Vec::with_capacity(10usize);
62070 if let Some(v) = &asset {
62071 query.push(("asset", v.to_string()));
62072 }
62073 if let Some(v) = &end_time {
62074 query.push(("endTime", v.to_string()));
62075 }
62076 if let Some(v) = &from_id {
62077 query.push(("fromId", v.to_string()));
62078 }
62079 if let Some(v) = &limit {
62080 query.push(("limit", v.to_string()));
62081 }
62082 if let Some(v) = &recv_window {
62083 query.push(("recvWindow", v.to_string()));
62084 }
62085 query.push(("signature", signature.to_string()));
62086 if let Some(v) = &start_time {
62087 query.push(("startTime", v.to_string()));
62088 }
62089 if let Some(v) = &symbol {
62090 query.push(("symbol", v.to_string()));
62091 }
62092 query.push(("timestamp", timestamp.to_string()));
62093 if let Some(v) = &type_ {
62094 query.push(("type", v.to_string()));
62095 }
62096 #[allow(unused_mut)]
62097 let mut request = self
62098 .client
62099 .get(url)
62100 .header(
62101 reqwest::header::ACCEPT,
62102 reqwest::header::HeaderValue::from_static("application/json"),
62103 )
62104 .query(&query)
62105 .build()?;
62106 (crate::pre_hook)(&self.inner, &request);
62107 let result = self.client.execute(request).await;
62108 (crate::post_hook)(&self.inner, &result);
62109 let response = result?;
62110 match response.status().as_u16() {
62111 200u16 => ResponseValue::from_response(response).await,
62112 400u16 => {
62113 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62114 }
62115 401u16 => {
62116 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62117 }
62118 _ => Err(Error::UnexpectedResponse(response)),
62119 }
62120 }
62121 /**Get tokens or symbols delist schedule for cross margin and isolated margin (MARKET_DATA)
62122
62123Get tokens or symbols delist schedule for cross margin and isolated margin
62124
62125Weight(IP): 100
62126
62127Sends a `GET` request to `/sapi/v1/margin/delist-schedule`
62128
62129Arguments:
62130- `recv_window`: The value cannot be greater than 60000
62131- `signature`: Signature
62132- `timestamp`: UTC timestamp in ms
62133*/
62134 pub async fn margin_delist_schedule<'a>(
62135 &'a self,
62136 recv_window: Option<i64>,
62137 signature: &'a str,
62138 timestamp: i64,
62139 ) -> Result<
62140 ResponseValue<Vec<types::MarginDelistScheduleResponseItem>>,
62141 Error<types::Error>,
62142 > {
62143 let url = format!("{}/sapi/v1/margin/delist-schedule", self.baseurl,);
62144 let mut query = Vec::with_capacity(3usize);
62145 if let Some(v) = &recv_window {
62146 query.push(("recvWindow", v.to_string()));
62147 }
62148 query.push(("signature", signature.to_string()));
62149 query.push(("timestamp", timestamp.to_string()));
62150 #[allow(unused_mut)]
62151 let mut request = self
62152 .client
62153 .get(url)
62154 .header(
62155 reqwest::header::ACCEPT,
62156 reqwest::header::HeaderValue::from_static("application/json"),
62157 )
62158 .query(&query)
62159 .build()?;
62160 (crate::pre_hook)(&self.inner, &request);
62161 let result = self.client.execute(request).await;
62162 (crate::post_hook)(&self.inner, &result);
62163 let response = result?;
62164 match response.status().as_u16() {
62165 200u16 => ResponseValue::from_response(response).await,
62166 400u16 => {
62167 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62168 }
62169 401u16 => {
62170 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62171 }
62172 _ => Err(Error::UnexpectedResponse(response)),
62173 }
62174 }
62175 /**Query Margin Available Inventory (USER_DATA)
62176
62177Margin available Inventory query
62178
62179Weight(UID): 50
62180
62181Sends a `GET` request to `/sapi/v1/margin/available-inventory`
62182
62183Arguments:
62184- `signature`: Signature
62185- `timestamp`: UTC timestamp in ms
62186- `type_`
62187*/
62188 pub async fn margin_available_inventory<'a>(
62189 &'a self,
62190 signature: &'a str,
62191 timestamp: i64,
62192 type_: types::MarginAvailableInventoryType,
62193 ) -> Result<
62194 ResponseValue<types::MarginAvailableInventoryResponse>,
62195 Error<types::Error>,
62196 > {
62197 let url = format!("{}/sapi/v1/margin/available-inventory", self.baseurl,);
62198 let mut query = Vec::with_capacity(3usize);
62199 query.push(("signature", signature.to_string()));
62200 query.push(("timestamp", timestamp.to_string()));
62201 query.push(("type", type_.to_string()));
62202 #[allow(unused_mut)]
62203 let mut request = self
62204 .client
62205 .get(url)
62206 .header(
62207 reqwest::header::ACCEPT,
62208 reqwest::header::HeaderValue::from_static("application/json"),
62209 )
62210 .query(&query)
62211 .build()?;
62212 (crate::pre_hook)(&self.inner, &request);
62213 let result = self.client.execute(request).await;
62214 (crate::post_hook)(&self.inner, &result);
62215 let response = result?;
62216 match response.status().as_u16() {
62217 200u16 => ResponseValue::from_response(response).await,
62218 400u16 => {
62219 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62220 }
62221 401u16 => {
62222 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62223 }
62224 _ => Err(Error::UnexpectedResponse(response)),
62225 }
62226 }
62227 /**Margin manual liquidation(MARGIN)
62228
62229Margin manual liquidation
62230
62231Weight(UID): 3000
62232
62233Sends a `POST` request to `/sapi/v1/margin/manual-liquidation`
62234
62235Arguments:
62236- `signature`: Signature
62237- `symbol`
62238- `timestamp`: UTC timestamp in ms
62239- `type_`
62240*/
62241 pub async fn margin_manual_liquidation<'a>(
62242 &'a self,
62243 signature: &'a str,
62244 symbol: Option<&'a str>,
62245 timestamp: i64,
62246 type_: types::MarginManualLiquidationType,
62247 ) -> Result<
62248 ResponseValue<Vec<types::MarginManualLiquidationResponseItem>>,
62249 Error<types::Error>,
62250 > {
62251 let url = format!("{}/sapi/v1/margin/manual-liquidation", self.baseurl,);
62252 let mut query = Vec::with_capacity(4usize);
62253 query.push(("signature", signature.to_string()));
62254 if let Some(v) = &symbol {
62255 query.push(("symbol", v.to_string()));
62256 }
62257 query.push(("timestamp", timestamp.to_string()));
62258 query.push(("type", type_.to_string()));
62259 #[allow(unused_mut)]
62260 let mut request = self
62261 .client
62262 .post(url)
62263 .header(
62264 reqwest::header::ACCEPT,
62265 reqwest::header::HeaderValue::from_static("application/json"),
62266 )
62267 .query(&query)
62268 .build()?;
62269 (crate::pre_hook)(&self.inner, &request);
62270 let result = self.client.execute(request).await;
62271 (crate::post_hook)(&self.inner, &result);
62272 let response = result?;
62273 match response.status().as_u16() {
62274 200u16 => ResponseValue::from_response(response).await,
62275 400u16 => {
62276 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62277 }
62278 401u16 => {
62279 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62280 }
62281 _ => Err(Error::UnexpectedResponse(response)),
62282 }
62283 }
62284 /**Get Assets That Can Be Converted Into BNB (USER_DATA)
62285
62286Get assets that can be converted into BNB.
62287
62288Weight(IP): 100
62289
62290Sends a `GET` request to `/sapi/v1/margin/dust`
62291
62292Arguments:
62293- `recv_window`: The value cannot be greater than 60000
62294- `signature`: Signature
62295- `timestamp`: UTC timestamp in ms
62296*/
62297 pub async fn margin_dust<'a>(
62298 &'a self,
62299 recv_window: Option<i64>,
62300 signature: &'a str,
62301 timestamp: i64,
62302 ) -> Result<ResponseValue<types::MarginDustResponse>, Error<types::Error>> {
62303 let url = format!("{}/sapi/v1/margin/dust", self.baseurl,);
62304 let mut query = Vec::with_capacity(3usize);
62305 if let Some(v) = &recv_window {
62306 query.push(("recvWindow", v.to_string()));
62307 }
62308 query.push(("signature", signature.to_string()));
62309 query.push(("timestamp", timestamp.to_string()));
62310 #[allow(unused_mut)]
62311 let mut request = self
62312 .client
62313 .get(url)
62314 .header(
62315 reqwest::header::ACCEPT,
62316 reqwest::header::HeaderValue::from_static("application/json"),
62317 )
62318 .query(&query)
62319 .build()?;
62320 (crate::pre_hook)(&self.inner, &request);
62321 let result = self.client.execute(request).await;
62322 (crate::post_hook)(&self.inner, &result);
62323 let response = result?;
62324 match response.status().as_u16() {
62325 200u16 => ResponseValue::from_response(response).await,
62326 400u16 => {
62327 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62328 }
62329 401u16 => {
62330 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62331 }
62332 _ => Err(Error::UnexpectedResponse(response)),
62333 }
62334 }
62335 /**Dust Transfer (TRADE)
62336
62337Convert dust assets to BNB
62338
62339Weight(UID): 3000
62340
62341Sends a `POST` request to `/sapi/v1/margin/dust`
62342
62343Arguments:
62344- `asset`
62345- `recv_window`: The value cannot be greater than 60000
62346- `signature`: Signature
62347- `timestamp`: UTC timestamp in ms
62348*/
62349 pub async fn convert_dust_assets_to_bnb<'a>(
62350 &'a self,
62351 asset: &'a str,
62352 recv_window: Option<i64>,
62353 signature: &'a str,
62354 timestamp: i64,
62355 ) -> Result<
62356 ResponseValue<types::ConvertDustAssetsToBnbResponse>,
62357 Error<types::Error>,
62358 > {
62359 let url = format!("{}/sapi/v1/margin/dust", self.baseurl,);
62360 let mut query = Vec::with_capacity(4usize);
62361 query.push(("asset", asset.to_string()));
62362 if let Some(v) = &recv_window {
62363 query.push(("recvWindow", v.to_string()));
62364 }
62365 query.push(("signature", signature.to_string()));
62366 query.push(("timestamp", timestamp.to_string()));
62367 #[allow(unused_mut)]
62368 let mut request = self
62369 .client
62370 .post(url)
62371 .header(
62372 reqwest::header::ACCEPT,
62373 reqwest::header::HeaderValue::from_static("application/json"),
62374 )
62375 .query(&query)
62376 .build()?;
62377 (crate::pre_hook)(&self.inner, &request);
62378 let result = self.client.execute(request).await;
62379 (crate::post_hook)(&self.inner, &result);
62380 let response = result?;
62381 match response.status().as_u16() {
62382 200u16 => ResponseValue::from_response(response).await,
62383 400u16 => {
62384 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62385 }
62386 401u16 => {
62387 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62388 }
62389 _ => Err(Error::UnexpectedResponse(response)),
62390 }
62391 }
62392 /**Adjust cross margin max leverage (USER_DATA)
62393
62394Adjust cross margin max leverage
62395
62396Weight(UID): 3000
62397
62398Sends a `POST` request to `/sapi/v1/margin/max-leverage`
62399
62400Arguments:
62401- `max_leverage`: Can only adjust 3 or 5
62402- `recv_window`: The value cannot be greater than 60000
62403- `signature`: Signature
62404- `timestamp`: UTC timestamp in ms
62405*/
62406 pub async fn margin_max_leverage<'a>(
62407 &'a self,
62408 max_leverage: i64,
62409 recv_window: Option<i64>,
62410 signature: &'a str,
62411 timestamp: i64,
62412 ) -> Result<ResponseValue<types::MarginMaxLeverageResponse>, Error<types::Error>> {
62413 let url = format!("{}/sapi/v1/margin/max-leverage", self.baseurl,);
62414 let mut query = Vec::with_capacity(4usize);
62415 query.push(("maxLeverage", max_leverage.to_string()));
62416 if let Some(v) = &recv_window {
62417 query.push(("recvWindow", v.to_string()));
62418 }
62419 query.push(("signature", signature.to_string()));
62420 query.push(("timestamp", timestamp.to_string()));
62421 #[allow(unused_mut)]
62422 let mut request = self
62423 .client
62424 .post(url)
62425 .header(
62426 reqwest::header::ACCEPT,
62427 reqwest::header::HeaderValue::from_static("application/json"),
62428 )
62429 .query(&query)
62430 .build()?;
62431 (crate::pre_hook)(&self.inner, &request);
62432 let result = self.client.execute(request).await;
62433 (crate::post_hook)(&self.inner, &result);
62434 let response = result?;
62435 match response.status().as_u16() {
62436 200u16 => ResponseValue::from_response(response).await,
62437 400u16 => {
62438 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62439 }
62440 401u16 => {
62441 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62442 }
62443 _ => Err(Error::UnexpectedResponse(response)),
62444 }
62445 }
62446 /**Query Liability Coin Leverage Bracket in Cross Margin Pro Mode (MARKET_DATA)
62447
62448Liability Coin Leverage Bracket in Cross Margin Pro Mode
62449
62450Weight(IP): 1
62451
62452Sends a `GET` request to `/sapi/v1/margin/leverageBracket`
62453
62454*/
62455 pub async fn margin_leverage_bracket<'a>(
62456 &'a self,
62457 ) -> Result<
62458 ResponseValue<Vec<types::MarginLeverageBracketResponseItem>>,
62459 Error<types::Error>,
62460 > {
62461 let url = format!("{}/sapi/v1/margin/leverageBracket", self.baseurl,);
62462 #[allow(unused_mut)]
62463 let mut request = self
62464 .client
62465 .get(url)
62466 .header(
62467 reqwest::header::ACCEPT,
62468 reqwest::header::HeaderValue::from_static("application/json"),
62469 )
62470 .build()?;
62471 (crate::pre_hook)(&self.inner, &request);
62472 let result = self.client.execute(request).await;
62473 (crate::post_hook)(&self.inner, &result);
62474 let response = result?;
62475 match response.status().as_u16() {
62476 200u16 => ResponseValue::from_response(response).await,
62477 400u16 => {
62478 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62479 }
62480 _ => Err(Error::UnexpectedResponse(response)),
62481 }
62482 }
62483 /**System Status (System)
62484
62485Fetch system status.
62486
62487Weight(IP): 1
62488
62489Sends a `GET` request to `/sapi/v1/system/status`
62490
62491*/
62492 pub async fn system_status<'a>(
62493 &'a self,
62494 ) -> Result<ResponseValue<types::SystemStatusResponse>, Error<()>> {
62495 let url = format!("{}/sapi/v1/system/status", self.baseurl,);
62496 #[allow(unused_mut)]
62497 let mut request = self
62498 .client
62499 .get(url)
62500 .header(
62501 reqwest::header::ACCEPT,
62502 reqwest::header::HeaderValue::from_static("application/json"),
62503 )
62504 .build()?;
62505 (crate::pre_hook)(&self.inner, &request);
62506 let result = self.client.execute(request).await;
62507 (crate::post_hook)(&self.inner, &result);
62508 let response = result?;
62509 match response.status().as_u16() {
62510 200u16 => ResponseValue::from_response(response).await,
62511 _ => Err(Error::UnexpectedResponse(response)),
62512 }
62513 }
62514 /**All Coins' Information (USER_DATA)
62515
62516Get information of coins (available for deposit and withdraw) for user.
62517
62518Weight(IP): 10
62519
62520Sends a `GET` request to `/sapi/v1/capital/config/getall`
62521
62522Arguments:
62523- `recv_window`: The value cannot be greater than 60000
62524- `signature`: Signature
62525- `timestamp`: UTC timestamp in ms
62526*/
62527 pub async fn capital_config_getall<'a>(
62528 &'a self,
62529 recv_window: Option<i64>,
62530 signature: &'a str,
62531 timestamp: i64,
62532 ) -> Result<
62533 ResponseValue<Vec<types::CapitalConfigGetallResponseItem>>,
62534 Error<types::Error>,
62535 > {
62536 let url = format!("{}/sapi/v1/capital/config/getall", self.baseurl,);
62537 let mut query = Vec::with_capacity(3usize);
62538 if let Some(v) = &recv_window {
62539 query.push(("recvWindow", v.to_string()));
62540 }
62541 query.push(("signature", signature.to_string()));
62542 query.push(("timestamp", timestamp.to_string()));
62543 #[allow(unused_mut)]
62544 let mut request = self
62545 .client
62546 .get(url)
62547 .header(
62548 reqwest::header::ACCEPT,
62549 reqwest::header::HeaderValue::from_static("application/json"),
62550 )
62551 .query(&query)
62552 .build()?;
62553 (crate::pre_hook)(&self.inner, &request);
62554 let result = self.client.execute(request).await;
62555 (crate::post_hook)(&self.inner, &result);
62556 let response = result?;
62557 match response.status().as_u16() {
62558 200u16 => ResponseValue::from_response(response).await,
62559 400u16 => {
62560 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62561 }
62562 401u16 => {
62563 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62564 }
62565 _ => Err(Error::UnexpectedResponse(response)),
62566 }
62567 }
62568 /**Daily Account Snapshot (USER_DATA)
62569
62570- The query time period must be less than 30 days
62571- Support query within the last one month only
62572- If startTimeand endTime not sent, return records of the last 7 days by default
62573
62574Weight(IP): 2400
62575
62576Sends a `GET` request to `/sapi/v1/accountSnapshot`
62577
62578Arguments:
62579- `end_time`: UTC timestamp in ms
62580- `limit`
62581- `recv_window`: The value cannot be greater than 60000
62582- `signature`: Signature
62583- `start_time`: UTC timestamp in ms
62584- `timestamp`: UTC timestamp in ms
62585- `type_`
62586*/
62587 pub async fn account_snapshot<'a>(
62588 &'a self,
62589 end_time: Option<i64>,
62590 limit: Option<i64>,
62591 recv_window: Option<i64>,
62592 signature: &'a str,
62593 start_time: Option<i64>,
62594 timestamp: i64,
62595 type_: types::AccountSnapshotType,
62596 ) -> Result<ResponseValue<types::AccountSnapshotResponse>, Error<types::Error>> {
62597 let url = format!("{}/sapi/v1/accountSnapshot", self.baseurl,);
62598 let mut query = Vec::with_capacity(7usize);
62599 if let Some(v) = &end_time {
62600 query.push(("endTime", v.to_string()));
62601 }
62602 if let Some(v) = &limit {
62603 query.push(("limit", v.to_string()));
62604 }
62605 if let Some(v) = &recv_window {
62606 query.push(("recvWindow", v.to_string()));
62607 }
62608 query.push(("signature", signature.to_string()));
62609 if let Some(v) = &start_time {
62610 query.push(("startTime", v.to_string()));
62611 }
62612 query.push(("timestamp", timestamp.to_string()));
62613 query.push(("type", type_.to_string()));
62614 #[allow(unused_mut)]
62615 let mut request = self
62616 .client
62617 .get(url)
62618 .header(
62619 reqwest::header::ACCEPT,
62620 reqwest::header::HeaderValue::from_static("application/json"),
62621 )
62622 .query(&query)
62623 .build()?;
62624 (crate::pre_hook)(&self.inner, &request);
62625 let result = self.client.execute(request).await;
62626 (crate::post_hook)(&self.inner, &result);
62627 let response = result?;
62628 match response.status().as_u16() {
62629 200u16 => ResponseValue::from_response(response).await,
62630 400u16 => {
62631 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62632 }
62633 401u16 => {
62634 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62635 }
62636 _ => Err(Error::UnexpectedResponse(response)),
62637 }
62638 }
62639 /**Disable Fast Withdraw Switch (USER_DATA)
62640
62641- This request will disable fastwithdraw switch under your account.
62642- You need to enable "trade" option for the api key which requests this endpoint.
62643
62644Weight(IP): 1
62645
62646Sends a `POST` request to `/sapi/v1/account/disableFastWithdrawSwitch`
62647
62648Arguments:
62649- `recv_window`: The value cannot be greater than 60000
62650- `signature`: Signature
62651- `timestamp`: UTC timestamp in ms
62652*/
62653 pub async fn account_disable_fast_withdraw_switch<'a>(
62654 &'a self,
62655 recv_window: Option<i64>,
62656 signature: &'a str,
62657 timestamp: i64,
62658 ) -> Result<
62659 ResponseValue<serde_json::Map<String, serde_json::Value>>,
62660 Error<types::Error>,
62661 > {
62662 let url = format!("{}/sapi/v1/account/disableFastWithdrawSwitch", self.baseurl,);
62663 let mut query = Vec::with_capacity(3usize);
62664 if let Some(v) = &recv_window {
62665 query.push(("recvWindow", v.to_string()));
62666 }
62667 query.push(("signature", signature.to_string()));
62668 query.push(("timestamp", timestamp.to_string()));
62669 #[allow(unused_mut)]
62670 let mut request = self
62671 .client
62672 .post(url)
62673 .header(
62674 reqwest::header::ACCEPT,
62675 reqwest::header::HeaderValue::from_static("application/json"),
62676 )
62677 .query(&query)
62678 .build()?;
62679 (crate::pre_hook)(&self.inner, &request);
62680 let result = self.client.execute(request).await;
62681 (crate::post_hook)(&self.inner, &result);
62682 let response = result?;
62683 match response.status().as_u16() {
62684 200u16 => ResponseValue::from_response(response).await,
62685 400u16 => {
62686 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62687 }
62688 401u16 => {
62689 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62690 }
62691 _ => Err(Error::UnexpectedResponse(response)),
62692 }
62693 }
62694 /**Enable Fast Withdraw Switch (USER_DATA)
62695
62696- This request will enable fastwithdraw switch under your account. You need to enable "trade" option for the api key which requests this endpoint.
62697- When Fast Withdraw Switch is on, transferring funds to a Binance account will be done instantly. There is no on-chain transaction, no transaction ID and no withdrawal fee.
62698
62699Weight(IP): 1
62700
62701Sends a `POST` request to `/sapi/v1/account/enableFastWithdrawSwitch`
62702
62703Arguments:
62704- `recv_window`: The value cannot be greater than 60000
62705- `signature`: Signature
62706- `timestamp`: UTC timestamp in ms
62707*/
62708 pub async fn account_enable_fast_withdraw_switch<'a>(
62709 &'a self,
62710 recv_window: Option<i64>,
62711 signature: &'a str,
62712 timestamp: i64,
62713 ) -> Result<
62714 ResponseValue<serde_json::Map<String, serde_json::Value>>,
62715 Error<types::Error>,
62716 > {
62717 let url = format!("{}/sapi/v1/account/enableFastWithdrawSwitch", self.baseurl,);
62718 let mut query = Vec::with_capacity(3usize);
62719 if let Some(v) = &recv_window {
62720 query.push(("recvWindow", v.to_string()));
62721 }
62722 query.push(("signature", signature.to_string()));
62723 query.push(("timestamp", timestamp.to_string()));
62724 #[allow(unused_mut)]
62725 let mut request = self
62726 .client
62727 .post(url)
62728 .header(
62729 reqwest::header::ACCEPT,
62730 reqwest::header::HeaderValue::from_static("application/json"),
62731 )
62732 .query(&query)
62733 .build()?;
62734 (crate::pre_hook)(&self.inner, &request);
62735 let result = self.client.execute(request).await;
62736 (crate::post_hook)(&self.inner, &result);
62737 let response = result?;
62738 match response.status().as_u16() {
62739 200u16 => ResponseValue::from_response(response).await,
62740 400u16 => {
62741 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62742 }
62743 401u16 => {
62744 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62745 }
62746 _ => Err(Error::UnexpectedResponse(response)),
62747 }
62748 }
62749 /**Withdraw (USER_DATA)
62750
62751Submit a withdraw request.
62752
62753- If `network` not send, return with default network of the coin.
62754- You can get `network` and `isDefault` in `networkList` of a coin in the response of `Get /sapi/v1/capital/config/getall (HMAC SHA256)`.
62755
62756Weight(IP): 1
62757
62758Sends a `POST` request to `/sapi/v1/capital/withdraw/apply`
62759
62760Arguments:
62761- `address`
62762- `address_tag`: Secondary address identifier for coins like XRP,XMR etc.
62763- `amount`
62764- `coin`: Coin name
62765- `name`
62766- `network`
62767- `recv_window`: The value cannot be greater than 60000
62768- `signature`: Signature
62769- `timestamp`: UTC timestamp in ms
62770- `transaction_fee_flag`: When making internal transfer
62771- `true` -> returning the fee to the destination account;
62772- `false` -> returning the fee back to the departure account.
62773- `wallet_type`: The wallet type for withdraw,0-Spot wallet, 1- Funding wallet. Default is Spot wallet
62774- `withdraw_order_id`: Client id for withdraw
62775*/
62776 pub async fn capital_withdraw_apply<'a>(
62777 &'a self,
62778 address: &'a str,
62779 address_tag: Option<&'a str>,
62780 amount: f64,
62781 coin: &'a str,
62782 name: Option<&'a str>,
62783 network: Option<&'a str>,
62784 recv_window: Option<i64>,
62785 signature: &'a str,
62786 timestamp: i64,
62787 transaction_fee_flag: Option<bool>,
62788 wallet_type: Option<i32>,
62789 withdraw_order_id: Option<&'a str>,
62790 ) -> Result<
62791 ResponseValue<types::CapitalWithdrawApplyResponse>,
62792 Error<types::Error>,
62793 > {
62794 let url = format!("{}/sapi/v1/capital/withdraw/apply", self.baseurl,);
62795 let mut query = Vec::with_capacity(12usize);
62796 query.push(("address", address.to_string()));
62797 if let Some(v) = &address_tag {
62798 query.push(("addressTag", v.to_string()));
62799 }
62800 query.push(("amount", amount.to_string()));
62801 query.push(("coin", coin.to_string()));
62802 if let Some(v) = &name {
62803 query.push(("name", v.to_string()));
62804 }
62805 if let Some(v) = &network {
62806 query.push(("network", v.to_string()));
62807 }
62808 if let Some(v) = &recv_window {
62809 query.push(("recvWindow", v.to_string()));
62810 }
62811 query.push(("signature", signature.to_string()));
62812 query.push(("timestamp", timestamp.to_string()));
62813 if let Some(v) = &transaction_fee_flag {
62814 query.push(("transactionFeeFlag", v.to_string()));
62815 }
62816 if let Some(v) = &wallet_type {
62817 query.push(("walletType", v.to_string()));
62818 }
62819 if let Some(v) = &withdraw_order_id {
62820 query.push(("withdrawOrderId", v.to_string()));
62821 }
62822 #[allow(unused_mut)]
62823 let mut request = self
62824 .client
62825 .post(url)
62826 .header(
62827 reqwest::header::ACCEPT,
62828 reqwest::header::HeaderValue::from_static("application/json"),
62829 )
62830 .query(&query)
62831 .build()?;
62832 (crate::pre_hook)(&self.inner, &request);
62833 let result = self.client.execute(request).await;
62834 (crate::post_hook)(&self.inner, &result);
62835 let response = result?;
62836 match response.status().as_u16() {
62837 200u16 => ResponseValue::from_response(response).await,
62838 400u16 => {
62839 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62840 }
62841 401u16 => {
62842 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62843 }
62844 _ => Err(Error::UnexpectedResponse(response)),
62845 }
62846 }
62847 /**Deposit History(supporting network) (USER_DATA)
62848
62849Fetch deposit history.
62850
62851- Please notice the default `startTime` and `endTime` to make sure that time interval is within 0-90 days.
62852- If both `startTime` and `endTime` are sent, time between `startTime` and `endTime` must be less than 90 days.
62853
62854Weight(IP): 1
62855
62856Sends a `GET` request to `/sapi/v1/capital/deposit/hisrec`
62857
62858Arguments:
62859- `coin`: Coin name
62860- `end_time`: UTC timestamp in ms
62861- `limit`: Default 500; max 1000.
62862- `offset`
62863- `recv_window`: The value cannot be greater than 60000
62864- `signature`: Signature
62865- `start_time`: UTC timestamp in ms
62866- `status`: * `0` - pending
62867* `6` - credited but cannot withdraw
62868* `1` - success
62869- `timestamp`: UTC timestamp in ms
62870*/
62871 pub async fn capital_deposit_hisrec<'a>(
62872 &'a self,
62873 coin: Option<&'a str>,
62874 end_time: Option<i64>,
62875 limit: Option<i32>,
62876 offset: Option<i32>,
62877 recv_window: Option<i64>,
62878 signature: &'a str,
62879 start_time: Option<i64>,
62880 status: Option<i32>,
62881 timestamp: i64,
62882 ) -> Result<
62883 ResponseValue<Vec<types::CapitalDepositHisrecResponseItem>>,
62884 Error<types::Error>,
62885 > {
62886 let url = format!("{}/sapi/v1/capital/deposit/hisrec", self.baseurl,);
62887 let mut query = Vec::with_capacity(9usize);
62888 if let Some(v) = &coin {
62889 query.push(("coin", v.to_string()));
62890 }
62891 if let Some(v) = &end_time {
62892 query.push(("endTime", v.to_string()));
62893 }
62894 if let Some(v) = &limit {
62895 query.push(("limit", v.to_string()));
62896 }
62897 if let Some(v) = &offset {
62898 query.push(("offset", v.to_string()));
62899 }
62900 if let Some(v) = &recv_window {
62901 query.push(("recvWindow", v.to_string()));
62902 }
62903 query.push(("signature", signature.to_string()));
62904 if let Some(v) = &start_time {
62905 query.push(("startTime", v.to_string()));
62906 }
62907 if let Some(v) = &status {
62908 query.push(("status", v.to_string()));
62909 }
62910 query.push(("timestamp", timestamp.to_string()));
62911 #[allow(unused_mut)]
62912 let mut request = self
62913 .client
62914 .get(url)
62915 .header(
62916 reqwest::header::ACCEPT,
62917 reqwest::header::HeaderValue::from_static("application/json"),
62918 )
62919 .query(&query)
62920 .build()?;
62921 (crate::pre_hook)(&self.inner, &request);
62922 let result = self.client.execute(request).await;
62923 (crate::post_hook)(&self.inner, &result);
62924 let response = result?;
62925 match response.status().as_u16() {
62926 200u16 => ResponseValue::from_response(response).await,
62927 400u16 => {
62928 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62929 }
62930 401u16 => {
62931 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
62932 }
62933 _ => Err(Error::UnexpectedResponse(response)),
62934 }
62935 }
62936 /**Withdraw History (supporting network) (USER_DATA)
62937
62938Fetch withdraw history.
62939
62940This endpoint specifically uses per second UID rate limit, user's total second level IP rate limit is 180000/second. Response from the endpoint contains header key X-SAPI-USED-UID-WEIGHT-1S, which defines weight used by the current IP.
62941
62942- `network` may not be in the response for old withdraw.
62943- Please notice the default `startTime` and `endTime` to make sure that time interval is within 0-90 days.
62944- If both `startTime` and `endTime` are sent, time between `startTime` and `endTime` must be less than 90 days
62945- If withdrawOrderId is sent, time between startTime and endTime must be less than 7 days.
62946- If withdrawOrderId is sent, startTime and endTime are not sent, will return last 7 days records by default.
62947
62948Weight(UID): 18000
62949Request Limit: 10 requests per second
62950
62951Sends a `GET` request to `/sapi/v1/capital/withdraw/history`
62952
62953Arguments:
62954- `coin`: Coin name
62955- `end_time`: UTC timestamp in ms
62956- `limit`: Default 500; max 1000.
62957- `offset`
62958- `recv_window`: The value cannot be greater than 60000
62959- `signature`: Signature
62960- `start_time`: UTC timestamp in ms
62961- `status`: * `0` - Email Sent
62962* `1` - Cancelled
62963* `2` - Awaiting Approval
62964* `3` - Rejected
62965* `4` - Processing
62966* `5` - Failure
62967* `6` - Completed
62968- `timestamp`: UTC timestamp in ms
62969- `withdraw_order_id`
62970*/
62971 pub async fn capital_withdraw_history<'a>(
62972 &'a self,
62973 coin: Option<&'a str>,
62974 end_time: Option<i64>,
62975 limit: Option<i32>,
62976 offset: Option<i32>,
62977 recv_window: Option<i64>,
62978 signature: &'a str,
62979 start_time: Option<i64>,
62980 status: Option<i64>,
62981 timestamp: i64,
62982 withdraw_order_id: Option<&'a str>,
62983 ) -> Result<
62984 ResponseValue<Vec<types::CapitalWithdrawHistoryResponseItem>>,
62985 Error<types::Error>,
62986 > {
62987 let url = format!("{}/sapi/v1/capital/withdraw/history", self.baseurl,);
62988 let mut query = Vec::with_capacity(10usize);
62989 if let Some(v) = &coin {
62990 query.push(("coin", v.to_string()));
62991 }
62992 if let Some(v) = &end_time {
62993 query.push(("endTime", v.to_string()));
62994 }
62995 if let Some(v) = &limit {
62996 query.push(("limit", v.to_string()));
62997 }
62998 if let Some(v) = &offset {
62999 query.push(("offset", v.to_string()));
63000 }
63001 if let Some(v) = &recv_window {
63002 query.push(("recvWindow", v.to_string()));
63003 }
63004 query.push(("signature", signature.to_string()));
63005 if let Some(v) = &start_time {
63006 query.push(("startTime", v.to_string()));
63007 }
63008 if let Some(v) = &status {
63009 query.push(("status", v.to_string()));
63010 }
63011 query.push(("timestamp", timestamp.to_string()));
63012 if let Some(v) = &withdraw_order_id {
63013 query.push(("withdrawOrderId", v.to_string()));
63014 }
63015 #[allow(unused_mut)]
63016 let mut request = self
63017 .client
63018 .get(url)
63019 .header(
63020 reqwest::header::ACCEPT,
63021 reqwest::header::HeaderValue::from_static("application/json"),
63022 )
63023 .query(&query)
63024 .build()?;
63025 (crate::pre_hook)(&self.inner, &request);
63026 let result = self.client.execute(request).await;
63027 (crate::post_hook)(&self.inner, &result);
63028 let response = result?;
63029 match response.status().as_u16() {
63030 200u16 => ResponseValue::from_response(response).await,
63031 400u16 => {
63032 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63033 }
63034 401u16 => {
63035 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63036 }
63037 _ => Err(Error::UnexpectedResponse(response)),
63038 }
63039 }
63040 /**Deposit Address (supporting network) (USER_DATA)
63041
63042Fetch deposit address with network.
63043
63044- If network is not send, return with default network of the coin.
63045- You can get network and isDefault in networkList in the response of Get /sapi/v1/capital/config/getall (HMAC SHA256).
63046
63047Weight(IP): 10
63048
63049Sends a `GET` request to `/sapi/v1/capital/deposit/address`
63050
63051Arguments:
63052- `coin`: Coin name
63053- `network`
63054- `recv_window`: The value cannot be greater than 60000
63055- `signature`: Signature
63056- `timestamp`: UTC timestamp in ms
63057*/
63058 pub async fn capital_deposit_address<'a>(
63059 &'a self,
63060 coin: &'a str,
63061 network: Option<&'a str>,
63062 recv_window: Option<i64>,
63063 signature: &'a str,
63064 timestamp: i64,
63065 ) -> Result<
63066 ResponseValue<types::CapitalDepositAddressResponse>,
63067 Error<types::Error>,
63068 > {
63069 let url = format!("{}/sapi/v1/capital/deposit/address", self.baseurl,);
63070 let mut query = Vec::with_capacity(5usize);
63071 query.push(("coin", coin.to_string()));
63072 if let Some(v) = &network {
63073 query.push(("network", v.to_string()));
63074 }
63075 if let Some(v) = &recv_window {
63076 query.push(("recvWindow", v.to_string()));
63077 }
63078 query.push(("signature", signature.to_string()));
63079 query.push(("timestamp", timestamp.to_string()));
63080 #[allow(unused_mut)]
63081 let mut request = self
63082 .client
63083 .get(url)
63084 .header(
63085 reqwest::header::ACCEPT,
63086 reqwest::header::HeaderValue::from_static("application/json"),
63087 )
63088 .query(&query)
63089 .build()?;
63090 (crate::pre_hook)(&self.inner, &request);
63091 let result = self.client.execute(request).await;
63092 (crate::post_hook)(&self.inner, &result);
63093 let response = result?;
63094 match response.status().as_u16() {
63095 200u16 => ResponseValue::from_response(response).await,
63096 400u16 => {
63097 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63098 }
63099 401u16 => {
63100 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63101 }
63102 _ => Err(Error::UnexpectedResponse(response)),
63103 }
63104 }
63105 /**Account Status (USER_DATA)
63106
63107Fetch account status detail.
63108
63109Weight(IP): 1
63110
63111Sends a `GET` request to `/sapi/v1/account/status`
63112
63113Arguments:
63114- `recv_window`: The value cannot be greater than 60000
63115- `signature`: Signature
63116- `timestamp`: UTC timestamp in ms
63117*/
63118 pub async fn account_status<'a>(
63119 &'a self,
63120 recv_window: Option<i64>,
63121 signature: &'a str,
63122 timestamp: i64,
63123 ) -> Result<ResponseValue<types::AccountStatusResponse>, Error<types::Error>> {
63124 let url = format!("{}/sapi/v1/account/status", self.baseurl,);
63125 let mut query = Vec::with_capacity(3usize);
63126 if let Some(v) = &recv_window {
63127 query.push(("recvWindow", v.to_string()));
63128 }
63129 query.push(("signature", signature.to_string()));
63130 query.push(("timestamp", timestamp.to_string()));
63131 #[allow(unused_mut)]
63132 let mut request = self
63133 .client
63134 .get(url)
63135 .header(
63136 reqwest::header::ACCEPT,
63137 reqwest::header::HeaderValue::from_static("application/json"),
63138 )
63139 .query(&query)
63140 .build()?;
63141 (crate::pre_hook)(&self.inner, &request);
63142 let result = self.client.execute(request).await;
63143 (crate::post_hook)(&self.inner, &result);
63144 let response = result?;
63145 match response.status().as_u16() {
63146 200u16 => ResponseValue::from_response(response).await,
63147 400u16 => {
63148 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63149 }
63150 401u16 => {
63151 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63152 }
63153 _ => Err(Error::UnexpectedResponse(response)),
63154 }
63155 }
63156 /**Account API Trading Status (USER_DATA)
63157
63158Fetch account API trading status with details.
63159
63160Weight(IP): 1
63161
63162Sends a `GET` request to `/sapi/v1/account/apiTradingStatus`
63163
63164Arguments:
63165- `recv_window`: The value cannot be greater than 60000
63166- `signature`: Signature
63167- `timestamp`: UTC timestamp in ms
63168*/
63169 pub async fn account_api_trading_status<'a>(
63170 &'a self,
63171 recv_window: Option<i64>,
63172 signature: &'a str,
63173 timestamp: i64,
63174 ) -> Result<
63175 ResponseValue<types::AccountApiTradingStatusResponse>,
63176 Error<types::Error>,
63177 > {
63178 let url = format!("{}/sapi/v1/account/apiTradingStatus", self.baseurl,);
63179 let mut query = Vec::with_capacity(3usize);
63180 if let Some(v) = &recv_window {
63181 query.push(("recvWindow", v.to_string()));
63182 }
63183 query.push(("signature", signature.to_string()));
63184 query.push(("timestamp", timestamp.to_string()));
63185 #[allow(unused_mut)]
63186 let mut request = self
63187 .client
63188 .get(url)
63189 .header(
63190 reqwest::header::ACCEPT,
63191 reqwest::header::HeaderValue::from_static("application/json"),
63192 )
63193 .query(&query)
63194 .build()?;
63195 (crate::pre_hook)(&self.inner, &request);
63196 let result = self.client.execute(request).await;
63197 (crate::post_hook)(&self.inner, &result);
63198 let response = result?;
63199 match response.status().as_u16() {
63200 200u16 => ResponseValue::from_response(response).await,
63201 400u16 => {
63202 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63203 }
63204 401u16 => {
63205 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63206 }
63207 _ => Err(Error::UnexpectedResponse(response)),
63208 }
63209 }
63210 /**DustLog(USER_DATA)
63211
63212Weight(IP): 1
63213
63214Sends a `GET` request to `/sapi/v1/asset/dribblet`
63215
63216Arguments:
63217- `end_time`: UTC timestamp in ms
63218- `recv_window`: The value cannot be greater than 60000
63219- `signature`: Signature
63220- `start_time`: UTC timestamp in ms
63221- `timestamp`: UTC timestamp in ms
63222*/
63223 pub async fn asset_dribblet<'a>(
63224 &'a self,
63225 end_time: Option<i64>,
63226 recv_window: Option<i64>,
63227 signature: &'a str,
63228 start_time: Option<i64>,
63229 timestamp: i64,
63230 ) -> Result<ResponseValue<types::AssetDribbletResponse>, Error<types::Error>> {
63231 let url = format!("{}/sapi/v1/asset/dribblet", self.baseurl,);
63232 let mut query = Vec::with_capacity(5usize);
63233 if let Some(v) = &end_time {
63234 query.push(("endTime", v.to_string()));
63235 }
63236 if let Some(v) = &recv_window {
63237 query.push(("recvWindow", v.to_string()));
63238 }
63239 query.push(("signature", signature.to_string()));
63240 if let Some(v) = &start_time {
63241 query.push(("startTime", v.to_string()));
63242 }
63243 query.push(("timestamp", timestamp.to_string()));
63244 #[allow(unused_mut)]
63245 let mut request = self
63246 .client
63247 .get(url)
63248 .header(
63249 reqwest::header::ACCEPT,
63250 reqwest::header::HeaderValue::from_static("application/json"),
63251 )
63252 .query(&query)
63253 .build()?;
63254 (crate::pre_hook)(&self.inner, &request);
63255 let result = self.client.execute(request).await;
63256 (crate::post_hook)(&self.inner, &result);
63257 let response = result?;
63258 match response.status().as_u16() {
63259 200u16 => ResponseValue::from_response(response).await,
63260 400u16 => {
63261 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63262 }
63263 401u16 => {
63264 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63265 }
63266 _ => Err(Error::UnexpectedResponse(response)),
63267 }
63268 }
63269 /**Get Assets That Can Be Converted Into BNB (USER_DATA)
63270
63271Weight(IP): 1
63272
63273Sends a `POST` request to `/sapi/v1/asset/dust-btc`
63274
63275Arguments:
63276- `recv_window`: The value cannot be greater than 60000
63277- `signature`: Signature
63278- `timestamp`: UTC timestamp in ms
63279*/
63280 pub async fn asset_dust_btc<'a>(
63281 &'a self,
63282 recv_window: Option<i64>,
63283 signature: &'a str,
63284 timestamp: i64,
63285 ) -> Result<ResponseValue<types::AssetDustBtcResponse>, Error<types::Error>> {
63286 let url = format!("{}/sapi/v1/asset/dust-btc", self.baseurl,);
63287 let mut query = Vec::with_capacity(3usize);
63288 if let Some(v) = &recv_window {
63289 query.push(("recvWindow", v.to_string()));
63290 }
63291 query.push(("signature", signature.to_string()));
63292 query.push(("timestamp", timestamp.to_string()));
63293 #[allow(unused_mut)]
63294 let mut request = self
63295 .client
63296 .post(url)
63297 .header(
63298 reqwest::header::ACCEPT,
63299 reqwest::header::HeaderValue::from_static("application/json"),
63300 )
63301 .query(&query)
63302 .build()?;
63303 (crate::pre_hook)(&self.inner, &request);
63304 let result = self.client.execute(request).await;
63305 (crate::post_hook)(&self.inner, &result);
63306 let response = result?;
63307 match response.status().as_u16() {
63308 200u16 => ResponseValue::from_response(response).await,
63309 400u16 => {
63310 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63311 }
63312 401u16 => {
63313 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63314 }
63315 _ => Err(Error::UnexpectedResponse(response)),
63316 }
63317 }
63318 /**Asset Dividend Record (USER_DATA)
63319
63320Query asset Dividend Record
63321
63322Weight(IP): 10
63323
63324Sends a `GET` request to `/sapi/v1/asset/assetDividend`
63325
63326Arguments:
63327- `asset`
63328- `end_time`: UTC timestamp in ms
63329- `limit`
63330- `recv_window`: The value cannot be greater than 60000
63331- `signature`: Signature
63332- `start_time`: UTC timestamp in ms
63333- `timestamp`: UTC timestamp in ms
63334*/
63335 pub async fn asset_asset_dividend<'a>(
63336 &'a self,
63337 asset: Option<&'a str>,
63338 end_time: Option<i64>,
63339 limit: Option<i64>,
63340 recv_window: Option<i64>,
63341 signature: &'a str,
63342 start_time: Option<i64>,
63343 timestamp: i64,
63344 ) -> Result<ResponseValue<types::AssetAssetDividendResponse>, Error<types::Error>> {
63345 let url = format!("{}/sapi/v1/asset/assetDividend", self.baseurl,);
63346 let mut query = Vec::with_capacity(7usize);
63347 if let Some(v) = &asset {
63348 query.push(("asset", v.to_string()));
63349 }
63350 if let Some(v) = &end_time {
63351 query.push(("endTime", v.to_string()));
63352 }
63353 if let Some(v) = &limit {
63354 query.push(("limit", v.to_string()));
63355 }
63356 if let Some(v) = &recv_window {
63357 query.push(("recvWindow", v.to_string()));
63358 }
63359 query.push(("signature", signature.to_string()));
63360 if let Some(v) = &start_time {
63361 query.push(("startTime", v.to_string()));
63362 }
63363 query.push(("timestamp", timestamp.to_string()));
63364 #[allow(unused_mut)]
63365 let mut request = self
63366 .client
63367 .get(url)
63368 .header(
63369 reqwest::header::ACCEPT,
63370 reqwest::header::HeaderValue::from_static("application/json"),
63371 )
63372 .query(&query)
63373 .build()?;
63374 (crate::pre_hook)(&self.inner, &request);
63375 let result = self.client.execute(request).await;
63376 (crate::post_hook)(&self.inner, &result);
63377 let response = result?;
63378 match response.status().as_u16() {
63379 200u16 => ResponseValue::from_response(response).await,
63380 400u16 => {
63381 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63382 }
63383 401u16 => {
63384 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63385 }
63386 _ => Err(Error::UnexpectedResponse(response)),
63387 }
63388 }
63389 /**Asset Detail (USER_DATA)
63390
63391Fetch details of assets supported on Binance.
63392
63393- Please get network and other deposit or withdraw details from `GET /sapi/v1/capital/config/getall`.
63394
63395Weight(IP): 1
63396
63397Sends a `GET` request to `/sapi/v1/asset/assetDetail`
63398
63399Arguments:
63400- `asset`
63401- `recv_window`: The value cannot be greater than 60000
63402- `signature`: Signature
63403- `timestamp`: UTC timestamp in ms
63404*/
63405 pub async fn asset_asset_detail<'a>(
63406 &'a self,
63407 asset: Option<&'a str>,
63408 recv_window: Option<i64>,
63409 signature: &'a str,
63410 timestamp: i64,
63411 ) -> Result<ResponseValue<types::AssetAssetDetailResponse>, Error<types::Error>> {
63412 let url = format!("{}/sapi/v1/asset/assetDetail", self.baseurl,);
63413 let mut query = Vec::with_capacity(4usize);
63414 if let Some(v) = &asset {
63415 query.push(("asset", v.to_string()));
63416 }
63417 if let Some(v) = &recv_window {
63418 query.push(("recvWindow", v.to_string()));
63419 }
63420 query.push(("signature", signature.to_string()));
63421 query.push(("timestamp", timestamp.to_string()));
63422 #[allow(unused_mut)]
63423 let mut request = self
63424 .client
63425 .get(url)
63426 .header(
63427 reqwest::header::ACCEPT,
63428 reqwest::header::HeaderValue::from_static("application/json"),
63429 )
63430 .query(&query)
63431 .build()?;
63432 (crate::pre_hook)(&self.inner, &request);
63433 let result = self.client.execute(request).await;
63434 (crate::post_hook)(&self.inner, &result);
63435 let response = result?;
63436 match response.status().as_u16() {
63437 200u16 => ResponseValue::from_response(response).await,
63438 400u16 => {
63439 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63440 }
63441 401u16 => {
63442 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63443 }
63444 _ => Err(Error::UnexpectedResponse(response)),
63445 }
63446 }
63447 /**Trade Fee (USER_DATA)
63448
63449Fetch trade fee
63450
63451Weight(IP): 1
63452
63453Sends a `GET` request to `/sapi/v1/asset/tradeFee`
63454
63455Arguments:
63456- `recv_window`: The value cannot be greater than 60000
63457- `signature`: Signature
63458- `symbol`: Trading symbol, e.g. BNBUSDT
63459- `timestamp`: UTC timestamp in ms
63460*/
63461 pub async fn asset_trade_fee<'a>(
63462 &'a self,
63463 recv_window: Option<i64>,
63464 signature: &'a str,
63465 symbol: Option<&'a str>,
63466 timestamp: i64,
63467 ) -> Result<
63468 ResponseValue<Vec<types::AssetTradeFeeResponseItem>>,
63469 Error<types::Error>,
63470 > {
63471 let url = format!("{}/sapi/v1/asset/tradeFee", self.baseurl,);
63472 let mut query = Vec::with_capacity(4usize);
63473 if let Some(v) = &recv_window {
63474 query.push(("recvWindow", v.to_string()));
63475 }
63476 query.push(("signature", signature.to_string()));
63477 if let Some(v) = &symbol {
63478 query.push(("symbol", v.to_string()));
63479 }
63480 query.push(("timestamp", timestamp.to_string()));
63481 #[allow(unused_mut)]
63482 let mut request = self
63483 .client
63484 .get(url)
63485 .header(
63486 reqwest::header::ACCEPT,
63487 reqwest::header::HeaderValue::from_static("application/json"),
63488 )
63489 .query(&query)
63490 .build()?;
63491 (crate::pre_hook)(&self.inner, &request);
63492 let result = self.client.execute(request).await;
63493 (crate::post_hook)(&self.inner, &result);
63494 let response = result?;
63495 match response.status().as_u16() {
63496 200u16 => ResponseValue::from_response(response).await,
63497 400u16 => {
63498 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63499 }
63500 401u16 => {
63501 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63502 }
63503 _ => Err(Error::UnexpectedResponse(response)),
63504 }
63505 }
63506 /**Query User Universal Transfer History (USER_DATA)
63507
63508- `fromSymbol` must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
63509- `toSymbol` must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
63510- Support query within the last 6 months only
63511- If `startTime` and `endTime` not sent, return records of the last 7 days by default
63512
63513Weight(IP): 1
63514
63515Sends a `GET` request to `/sapi/v1/asset/transfer`
63516
63517Arguments:
63518- `current`: Current querying page. Start from 1. Default:1
63519- `end_time`: UTC timestamp in ms
63520- `from_symbol`: Must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
63521- `recv_window`: The value cannot be greater than 60000
63522- `signature`: Signature
63523- `size`: Default:10 Max:100
63524- `start_time`: UTC timestamp in ms
63525- `timestamp`: UTC timestamp in ms
63526- `to_symbol`: Must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
63527- `type_`: Universal transfer type
63528*/
63529 pub async fn asset_transfer<'a>(
63530 &'a self,
63531 current: Option<i32>,
63532 end_time: Option<i64>,
63533 from_symbol: Option<&'a str>,
63534 recv_window: Option<i64>,
63535 signature: &'a str,
63536 size: Option<i32>,
63537 start_time: Option<i64>,
63538 timestamp: i64,
63539 to_symbol: Option<&'a str>,
63540 type_: types::AssetTransferType,
63541 ) -> Result<ResponseValue<types::AssetTransferResponse>, Error<types::Error>> {
63542 let url = format!("{}/sapi/v1/asset/transfer", self.baseurl,);
63543 let mut query = Vec::with_capacity(10usize);
63544 if let Some(v) = ¤t {
63545 query.push(("current", v.to_string()));
63546 }
63547 if let Some(v) = &end_time {
63548 query.push(("endTime", v.to_string()));
63549 }
63550 if let Some(v) = &from_symbol {
63551 query.push(("fromSymbol", v.to_string()));
63552 }
63553 if let Some(v) = &recv_window {
63554 query.push(("recvWindow", v.to_string()));
63555 }
63556 query.push(("signature", signature.to_string()));
63557 if let Some(v) = &size {
63558 query.push(("size", v.to_string()));
63559 }
63560 if let Some(v) = &start_time {
63561 query.push(("startTime", v.to_string()));
63562 }
63563 query.push(("timestamp", timestamp.to_string()));
63564 if let Some(v) = &to_symbol {
63565 query.push(("toSymbol", v.to_string()));
63566 }
63567 query.push(("type", type_.to_string()));
63568 #[allow(unused_mut)]
63569 let mut request = self
63570 .client
63571 .get(url)
63572 .header(
63573 reqwest::header::ACCEPT,
63574 reqwest::header::HeaderValue::from_static("application/json"),
63575 )
63576 .query(&query)
63577 .build()?;
63578 (crate::pre_hook)(&self.inner, &request);
63579 let result = self.client.execute(request).await;
63580 (crate::post_hook)(&self.inner, &result);
63581 let response = result?;
63582 match response.status().as_u16() {
63583 200u16 => ResponseValue::from_response(response).await,
63584 400u16 => {
63585 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63586 }
63587 401u16 => {
63588 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63589 }
63590 _ => Err(Error::UnexpectedResponse(response)),
63591 }
63592 }
63593 /**User Universal Transfer (USER_DATA)
63594
63595You need to enable `Permits Universal Transfer` option for the api key which requests this endpoint.
63596
63597- `fromSymbol` must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
63598- `toSymbol` must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
63599
63600ENUM of transfer types:
63601 - MAIN_UMFUTURE Spot account transfer to USDⓈ-M Futures account
63602 - MAIN_CMFUTURE Spot account transfer to COIN-M Futures account
63603 - MAIN_MARGIN Spot account transfer to Margin(cross)account
63604 - UMFUTURE_MAIN USDⓈ-M Futures account transfer to Spot account
63605 - UMFUTURE_MARGIN USDⓈ-M Futures account transfer to Margin(cross)account
63606 - CMFUTURE_MAIN COIN-M Futures account transfer to Spot account
63607 - CMFUTURE_MARGIN COIN-M Futures account transfer to Margin(cross) account
63608 - MARGIN_MAIN Margin(cross)account transfer to Spot account
63609 - MARGIN_UMFUTURE Margin(cross)account transfer to USDⓈ-M Futures
63610 - MARGIN_CMFUTURE Margin(cross)account transfer to COIN-M Futures
63611 - ISOLATEDMARGIN_MARGIN Isolated margin account transfer to Margin(cross) account
63612 - MARGIN_ISOLATEDMARGIN Margin(cross) account transfer to Isolated margin account
63613 - ISOLATEDMARGIN_ISOLATEDMARGIN Isolated margin account transfer to Isolated margin account
63614 - MAIN_FUNDING Spot account transfer to Funding account
63615 - FUNDING_MAIN Funding account transfer to Spot account
63616 - FUNDING_UMFUTURE Funding account transfer to UMFUTURE account
63617 - UMFUTURE_FUNDING UMFUTURE account transfer to Funding account
63618 - MARGIN_FUNDING MARGIN account transfer to Funding account
63619 - FUNDING_MARGIN Funding account transfer to Margin account
63620 - FUNDING_CMFUTURE Funding account transfer to CMFUTURE account
63621 - CMFUTURE_FUNDING CMFUTURE account transfer to Funding account
63622 - MAIN_OPTION Spot account transfer to Options account
63623 - OPTION_MAIN Options account transfer to Spot account
63624 - UMFUTURE_OPTION USDⓈ-M Futures account transfer to Options account
63625 - OPTION_UMFUTURE Options account transfer to USDⓈ-M Futures account
63626 - MARGIN_OPTION Margin(cross)account transfer to Options account
63627 - OPTION_MARGIN Options account transfer to Margin(cross)account
63628 - FUNDING_OPTION Funding account transfer to Options account
63629 - OPTION_FUNDING Options account transfer to Funding account
63630 - MAIN_PORTFOLIO_MARGIN Spot account transfer to Portfolio Margin account
63631 - PORTFOLIO_MARGIN_MAIN Portfolio Margin account transfer to Spot account
63632 - MAIN_ISOLATED_MARGIN Spot account transfer to Isolated margin account
63633 - ISOLATED_MARGIN_MAIN Isolated margin account transfer to Spot account
63634
63635Weight(IP): 1
63636
63637Sends a `POST` request to `/sapi/v1/asset/transfer`
63638
63639Arguments:
63640- `amount`
63641- `asset`
63642- `from_symbol`: Must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
63643- `recv_window`: The value cannot be greater than 60000
63644- `signature`: Signature
63645- `timestamp`: UTC timestamp in ms
63646- `to_symbol`: Must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
63647- `type_`: Universal transfer type
63648*/
63649 pub async fn post_user_universal_transfer<'a>(
63650 &'a self,
63651 amount: f64,
63652 asset: &'a str,
63653 from_symbol: Option<&'a str>,
63654 recv_window: Option<i64>,
63655 signature: &'a str,
63656 timestamp: i64,
63657 to_symbol: Option<&'a str>,
63658 type_: types::PostUserUniversalTransferType,
63659 ) -> Result<
63660 ResponseValue<types::PostUserUniversalTransferResponse>,
63661 Error<types::Error>,
63662 > {
63663 let url = format!("{}/sapi/v1/asset/transfer", self.baseurl,);
63664 let mut query = Vec::with_capacity(8usize);
63665 query.push(("amount", amount.to_string()));
63666 query.push(("asset", asset.to_string()));
63667 if let Some(v) = &from_symbol {
63668 query.push(("fromSymbol", v.to_string()));
63669 }
63670 if let Some(v) = &recv_window {
63671 query.push(("recvWindow", v.to_string()));
63672 }
63673 query.push(("signature", signature.to_string()));
63674 query.push(("timestamp", timestamp.to_string()));
63675 if let Some(v) = &to_symbol {
63676 query.push(("toSymbol", v.to_string()));
63677 }
63678 query.push(("type", type_.to_string()));
63679 #[allow(unused_mut)]
63680 let mut request = self
63681 .client
63682 .post(url)
63683 .header(
63684 reqwest::header::ACCEPT,
63685 reqwest::header::HeaderValue::from_static("application/json"),
63686 )
63687 .query(&query)
63688 .build()?;
63689 (crate::pre_hook)(&self.inner, &request);
63690 let result = self.client.execute(request).await;
63691 (crate::post_hook)(&self.inner, &result);
63692 let response = result?;
63693 match response.status().as_u16() {
63694 200u16 => ResponseValue::from_response(response).await,
63695 400u16 => {
63696 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63697 }
63698 401u16 => {
63699 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63700 }
63701 _ => Err(Error::UnexpectedResponse(response)),
63702 }
63703 }
63704 /**Funding Wallet (USER_DATA)
63705
63706- Currently supports querying the following business assets:Binance Pay, Binance Card, Binance Gift Card, Stock Token
63707
63708Weight(IP): 1
63709
63710Sends a `POST` request to `/sapi/v1/asset/get-funding-asset`
63711
63712Arguments:
63713- `asset`
63714- `need_btc_valuation`
63715- `recv_window`: The value cannot be greater than 60000
63716- `signature`: Signature
63717- `timestamp`: UTC timestamp in ms
63718*/
63719 pub async fn asset_get_funding_asset<'a>(
63720 &'a self,
63721 asset: Option<&'a str>,
63722 need_btc_valuation: Option<types::AssetGetFundingAssetNeedBtcValuation>,
63723 recv_window: Option<i64>,
63724 signature: &'a str,
63725 timestamp: i64,
63726 ) -> Result<
63727 ResponseValue<Vec<types::AssetGetFundingAssetResponseItem>>,
63728 Error<types::Error>,
63729 > {
63730 let url = format!("{}/sapi/v1/asset/get-funding-asset", self.baseurl,);
63731 let mut query = Vec::with_capacity(5usize);
63732 if let Some(v) = &asset {
63733 query.push(("asset", v.to_string()));
63734 }
63735 if let Some(v) = &need_btc_valuation {
63736 query.push(("needBtcValuation", v.to_string()));
63737 }
63738 if let Some(v) = &recv_window {
63739 query.push(("recvWindow", v.to_string()));
63740 }
63741 query.push(("signature", signature.to_string()));
63742 query.push(("timestamp", timestamp.to_string()));
63743 #[allow(unused_mut)]
63744 let mut request = self
63745 .client
63746 .post(url)
63747 .header(
63748 reqwest::header::ACCEPT,
63749 reqwest::header::HeaderValue::from_static("application/json"),
63750 )
63751 .query(&query)
63752 .build()?;
63753 (crate::pre_hook)(&self.inner, &request);
63754 let result = self.client.execute(request).await;
63755 (crate::post_hook)(&self.inner, &result);
63756 let response = result?;
63757 match response.status().as_u16() {
63758 200u16 => ResponseValue::from_response(response).await,
63759 400u16 => {
63760 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63761 }
63762 401u16 => {
63763 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63764 }
63765 _ => Err(Error::UnexpectedResponse(response)),
63766 }
63767 }
63768 /**User Asset (USER_DATA)
63769
63770Get user assets, just for positive data.
63771
63772Weight(IP): 5
63773
63774Sends a `POST` request to `/sapi/v3/asset/getUserAsset`
63775
63776Arguments:
63777- `asset`
63778- `need_btc_valuation`
63779- `recv_window`: The value cannot be greater than 60000
63780- `signature`: Signature
63781- `timestamp`: UTC timestamp in ms
63782*/
63783 pub async fn asset_get_user_asset<'a>(
63784 &'a self,
63785 asset: Option<&'a str>,
63786 need_btc_valuation: Option<types::AssetGetUserAssetNeedBtcValuation>,
63787 recv_window: Option<i64>,
63788 signature: &'a str,
63789 timestamp: i64,
63790 ) -> Result<
63791 ResponseValue<Vec<types::AssetGetUserAssetResponseItem>>,
63792 Error<types::Error>,
63793 > {
63794 let url = format!("{}/sapi/v3/asset/getUserAsset", self.baseurl,);
63795 let mut query = Vec::with_capacity(5usize);
63796 if let Some(v) = &asset {
63797 query.push(("asset", v.to_string()));
63798 }
63799 if let Some(v) = &need_btc_valuation {
63800 query.push(("needBtcValuation", v.to_string()));
63801 }
63802 if let Some(v) = &recv_window {
63803 query.push(("recvWindow", v.to_string()));
63804 }
63805 query.push(("signature", signature.to_string()));
63806 query.push(("timestamp", timestamp.to_string()));
63807 #[allow(unused_mut)]
63808 let mut request = self
63809 .client
63810 .post(url)
63811 .header(
63812 reqwest::header::ACCEPT,
63813 reqwest::header::HeaderValue::from_static("application/json"),
63814 )
63815 .query(&query)
63816 .build()?;
63817 (crate::pre_hook)(&self.inner, &request);
63818 let result = self.client.execute(request).await;
63819 (crate::post_hook)(&self.inner, &result);
63820 let response = result?;
63821 match response.status().as_u16() {
63822 200u16 => ResponseValue::from_response(response).await,
63823 400u16 => {
63824 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63825 }
63826 401u16 => {
63827 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63828 }
63829 _ => Err(Error::UnexpectedResponse(response)),
63830 }
63831 }
63832 /**Convert Transfer (USER_DATA)
63833
63834Convert transfer, convert between BUSD and stablecoins.
63835If the clientId has been used before, will not do the convert transfer, the original transfer will be returned.
63836
63837Weight(UID): 5
63838
63839Sends a `POST` request to `/sapi/v1/asset/convert-transfer`
63840
63841Arguments:
63842- `amount`
63843- `asset`
63844- `client_tran_id`: The unique flag, the min length is 20
63845- `recv_window`: The value cannot be greater than 60000
63846- `signature`: Signature
63847- `target_asset`: Target asset you want to convert
63848- `timestamp`: UTC timestamp in ms
63849*/
63850 pub async fn asset_convert_transfer<'a>(
63851 &'a self,
63852 amount: f64,
63853 asset: &'a str,
63854 client_tran_id: &'a str,
63855 recv_window: Option<i64>,
63856 signature: &'a str,
63857 target_asset: &'a str,
63858 timestamp: i64,
63859 ) -> Result<
63860 ResponseValue<types::AssetConvertTransferResponse>,
63861 Error<types::Error>,
63862 > {
63863 let url = format!("{}/sapi/v1/asset/convert-transfer", self.baseurl,);
63864 let mut query = Vec::with_capacity(7usize);
63865 query.push(("amount", amount.to_string()));
63866 query.push(("asset", asset.to_string()));
63867 query.push(("clientTranId", client_tran_id.to_string()));
63868 if let Some(v) = &recv_window {
63869 query.push(("recvWindow", v.to_string()));
63870 }
63871 query.push(("signature", signature.to_string()));
63872 query.push(("targetAsset", target_asset.to_string()));
63873 query.push(("timestamp", timestamp.to_string()));
63874 #[allow(unused_mut)]
63875 let mut request = self
63876 .client
63877 .post(url)
63878 .header(
63879 reqwest::header::ACCEPT,
63880 reqwest::header::HeaderValue::from_static("application/json"),
63881 )
63882 .query(&query)
63883 .build()?;
63884 (crate::pre_hook)(&self.inner, &request);
63885 let result = self.client.execute(request).await;
63886 (crate::post_hook)(&self.inner, &result);
63887 let response = result?;
63888 match response.status().as_u16() {
63889 200u16 => ResponseValue::from_response(response).await,
63890 400u16 => {
63891 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63892 }
63893 401u16 => {
63894 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63895 }
63896 _ => Err(Error::UnexpectedResponse(response)),
63897 }
63898 }
63899 /**Query Convert Transfer (USER_DATA)
63900
63901Weight(UID): 5
63902
63903Sends a `GET` request to `/sapi/v1/asset/convert-transfer/queryByPage`
63904
63905Arguments:
63906- `account_type`: MAIN: main account. CARD: funding account. If it is blank, we will query spot and card wallet, otherwise, we just query the corresponding wallet
63907- `asset`: If it is blank, we will match deducted asset and target asset.
63908- `current`: Current querying page. Start from 1. Default:1
63909- `end_time`: UTC timestamp in ms
63910- `recv_window`: The value cannot be greater than 60000
63911- `signature`: Signature
63912- `size`: Default:10 Max:100
63913- `start_time`: UTC timestamp in ms
63914- `timestamp`: UTC timestamp in ms
63915- `tran_id`: The transaction id
63916*/
63917 pub async fn asset_convert_transfer_query_by_page<'a>(
63918 &'a self,
63919 account_type: Option<types::AssetConvertTransferQueryByPageAccountType>,
63920 asset: Option<&'a str>,
63921 current: Option<i32>,
63922 end_time: i64,
63923 recv_window: Option<i64>,
63924 signature: &'a str,
63925 size: Option<i32>,
63926 start_time: i64,
63927 timestamp: i64,
63928 tran_id: Option<i64>,
63929 ) -> Result<
63930 ResponseValue<types::AssetConvertTransferQueryByPageResponse>,
63931 Error<types::Error>,
63932 > {
63933 let url = format!(
63934 "{}/sapi/v1/asset/convert-transfer/queryByPage", self.baseurl,
63935 );
63936 let mut query = Vec::with_capacity(10usize);
63937 if let Some(v) = &account_type {
63938 query.push(("accountType", v.to_string()));
63939 }
63940 if let Some(v) = &asset {
63941 query.push(("asset", v.to_string()));
63942 }
63943 if let Some(v) = ¤t {
63944 query.push(("current", v.to_string()));
63945 }
63946 query.push(("endTime", end_time.to_string()));
63947 if let Some(v) = &recv_window {
63948 query.push(("recvWindow", v.to_string()));
63949 }
63950 query.push(("signature", signature.to_string()));
63951 if let Some(v) = &size {
63952 query.push(("size", v.to_string()));
63953 }
63954 query.push(("startTime", start_time.to_string()));
63955 query.push(("timestamp", timestamp.to_string()));
63956 if let Some(v) = &tran_id {
63957 query.push(("tranId", v.to_string()));
63958 }
63959 #[allow(unused_mut)]
63960 let mut request = self
63961 .client
63962 .get(url)
63963 .header(
63964 reqwest::header::ACCEPT,
63965 reqwest::header::HeaderValue::from_static("application/json"),
63966 )
63967 .query(&query)
63968 .build()?;
63969 (crate::pre_hook)(&self.inner, &request);
63970 let result = self.client.execute(request).await;
63971 (crate::post_hook)(&self.inner, &result);
63972 let response = result?;
63973 match response.status().as_u16() {
63974 200u16 => ResponseValue::from_response(response).await,
63975 400u16 => {
63976 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63977 }
63978 401u16 => {
63979 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
63980 }
63981 _ => Err(Error::UnexpectedResponse(response)),
63982 }
63983 }
63984 /**Get Cloud-Mining payment and refund history (USER_DATA)
63985
63986The query of Cloud-Mining payment and refund history
63987
63988Weight(UID): 600
63989
63990Sends a `GET` request to `/sapi/v1/asset/ledger-transfer/cloud-mining/queryByPage`
63991
63992Arguments:
63993- `asset`: If it is blank, we will query all assets
63994- `client_tran_id`: The unique flag
63995- `current`: Current querying page. Start from 1. Default:1
63996- `end_time`: UTC timestamp in ms
63997- `recv_window`: The value cannot be greater than 60000
63998- `signature`: Signature
63999- `size`: Default:10 Max:100
64000- `start_time`: UTC timestamp in ms
64001- `timestamp`: UTC timestamp in ms
64002- `tran_id`: The transaction id
64003*/
64004 pub async fn asset_ledger_transfer_cloud_mining_query_by_page<'a>(
64005 &'a self,
64006 asset: Option<&'a str>,
64007 client_tran_id: Option<&'a str>,
64008 current: Option<i32>,
64009 end_time: i64,
64010 recv_window: Option<i64>,
64011 signature: &'a str,
64012 size: Option<i32>,
64013 start_time: i64,
64014 timestamp: i64,
64015 tran_id: Option<i64>,
64016 ) -> Result<
64017 ResponseValue<types::AssetLedgerTransferCloudMiningQueryByPageResponse>,
64018 Error<types::Error>,
64019 > {
64020 let url = format!(
64021 "{}/sapi/v1/asset/ledger-transfer/cloud-mining/queryByPage", self.baseurl,
64022 );
64023 let mut query = Vec::with_capacity(10usize);
64024 if let Some(v) = &asset {
64025 query.push(("asset", v.to_string()));
64026 }
64027 if let Some(v) = &client_tran_id {
64028 query.push(("clientTranId", v.to_string()));
64029 }
64030 if let Some(v) = ¤t {
64031 query.push(("current", v.to_string()));
64032 }
64033 query.push(("endTime", end_time.to_string()));
64034 if let Some(v) = &recv_window {
64035 query.push(("recvWindow", v.to_string()));
64036 }
64037 query.push(("signature", signature.to_string()));
64038 if let Some(v) = &size {
64039 query.push(("size", v.to_string()));
64040 }
64041 query.push(("startTime", start_time.to_string()));
64042 query.push(("timestamp", timestamp.to_string()));
64043 if let Some(v) = &tran_id {
64044 query.push(("tranId", v.to_string()));
64045 }
64046 #[allow(unused_mut)]
64047 let mut request = self
64048 .client
64049 .get(url)
64050 .header(
64051 reqwest::header::ACCEPT,
64052 reqwest::header::HeaderValue::from_static("application/json"),
64053 )
64054 .query(&query)
64055 .build()?;
64056 (crate::pre_hook)(&self.inner, &request);
64057 let result = self.client.execute(request).await;
64058 (crate::post_hook)(&self.inner, &result);
64059 let response = result?;
64060 match response.status().as_u16() {
64061 200u16 => ResponseValue::from_response(response).await,
64062 400u16 => {
64063 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64064 }
64065 401u16 => {
64066 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64067 }
64068 _ => Err(Error::UnexpectedResponse(response)),
64069 }
64070 }
64071 /**Get API Key Permission (USER_DATA)
64072
64073Weight(IP): 1
64074
64075Sends a `GET` request to `/sapi/v1/account/apiRestrictions`
64076
64077Arguments:
64078- `recv_window`: The value cannot be greater than 60000
64079- `signature`: Signature
64080- `timestamp`: UTC timestamp in ms
64081*/
64082 pub async fn account_api_restrictions<'a>(
64083 &'a self,
64084 recv_window: Option<i64>,
64085 signature: &'a str,
64086 timestamp: i64,
64087 ) -> Result<
64088 ResponseValue<types::AccountApiRestrictionsResponse>,
64089 Error<types::Error>,
64090 > {
64091 let url = format!("{}/sapi/v1/account/apiRestrictions", self.baseurl,);
64092 let mut query = Vec::with_capacity(3usize);
64093 if let Some(v) = &recv_window {
64094 query.push(("recvWindow", v.to_string()));
64095 }
64096 query.push(("signature", signature.to_string()));
64097 query.push(("timestamp", timestamp.to_string()));
64098 #[allow(unused_mut)]
64099 let mut request = self
64100 .client
64101 .get(url)
64102 .header(
64103 reqwest::header::ACCEPT,
64104 reqwest::header::HeaderValue::from_static("application/json"),
64105 )
64106 .query(&query)
64107 .build()?;
64108 (crate::pre_hook)(&self.inner, &request);
64109 let result = self.client.execute(request).await;
64110 (crate::post_hook)(&self.inner, &result);
64111 let response = result?;
64112 match response.status().as_u16() {
64113 200u16 => ResponseValue::from_response(response).await,
64114 400u16 => {
64115 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64116 }
64117 401u16 => {
64118 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64119 }
64120 _ => Err(Error::UnexpectedResponse(response)),
64121 }
64122 }
64123 /**Query auto-converting stable coins (USER_DATA)
64124
64125Get a user's auto-conversion settings in deposit/withdrawal
64126
64127Weight(UID): 600'
64128
64129Sends a `GET` request to `/sapi/v1/capital/contract/convertible-coins`
64130
64131*/
64132 pub async fn capital_contract_convertible_coins<'a>(
64133 &'a self,
64134 ) -> Result<
64135 ResponseValue<types::CapitalContractConvertibleCoinsResponse>,
64136 Error<types::Error>,
64137 > {
64138 let url = format!(
64139 "{}/sapi/v1/capital/contract/convertible-coins", self.baseurl,
64140 );
64141 #[allow(unused_mut)]
64142 let mut request = self
64143 .client
64144 .get(url)
64145 .header(
64146 reqwest::header::ACCEPT,
64147 reqwest::header::HeaderValue::from_static("application/json"),
64148 )
64149 .build()?;
64150 (crate::pre_hook)(&self.inner, &request);
64151 let result = self.client.execute(request).await;
64152 (crate::post_hook)(&self.inner, &result);
64153 let response = result?;
64154 match response.status().as_u16() {
64155 200u16 => ResponseValue::from_response(response).await,
64156 400u16 => {
64157 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64158 }
64159 401u16 => {
64160 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64161 }
64162 _ => Err(Error::UnexpectedResponse(response)),
64163 }
64164 }
64165 /**Switch on/off BUSD and stable coins conversion (USER_DATA) (USER_DATA)
64166
64167User can use it to turn on or turn off the BUSD auto-conversion from/to a specific stable coin.
64168
64169Weight(UID): 600'
64170
64171Sends a `POST` request to `/sapi/v1/capital/contract/convertible-coins`
64172
64173Arguments:
64174- `coin`: Must be USDC, USDP or TUSD
64175- `enable`: true: turn on the auto-conversion. false: turn off the auto-conversion
64176*/
64177 pub async fn toggle_stable_coin_conversion<'a>(
64178 &'a self,
64179 coin: &'a str,
64180 enable: bool,
64181 ) -> Result<
64182 ResponseValue<serde_json::Map<String, serde_json::Value>>,
64183 Error<types::Error>,
64184 > {
64185 let url = format!(
64186 "{}/sapi/v1/capital/contract/convertible-coins", self.baseurl,
64187 );
64188 let mut query = Vec::with_capacity(2usize);
64189 query.push(("coin", coin.to_string()));
64190 query.push(("enable", enable.to_string()));
64191 #[allow(unused_mut)]
64192 let mut request = self
64193 .client
64194 .post(url)
64195 .header(
64196 reqwest::header::ACCEPT,
64197 reqwest::header::HeaderValue::from_static("application/json"),
64198 )
64199 .query(&query)
64200 .build()?;
64201 (crate::pre_hook)(&self.inner, &request);
64202 let result = self.client.execute(request).await;
64203 (crate::post_hook)(&self.inner, &result);
64204 let response = result?;
64205 match response.status().as_u16() {
64206 200u16 => ResponseValue::from_response(response).await,
64207 400u16 => {
64208 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64209 }
64210 401u16 => {
64211 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64212 }
64213 _ => Err(Error::UnexpectedResponse(response)),
64214 }
64215 }
64216 /**Create a Virtual Sub-account(For Master Account)
64217
64218- This request will generate a virtual sub account under your master account.
64219- You need to enable "trade" option for the api key which requests this endpoint.
64220
64221Weight(IP): 1
64222
64223Sends a `POST` request to `/sapi/v1/sub-account/virtualSubAccount`
64224
64225Arguments:
64226- `recv_window`: The value cannot be greater than 60000
64227- `signature`: Signature
64228- `sub_account_string`: Please input a string. We will create a virtual email using that string for you to register
64229- `timestamp`: UTC timestamp in ms
64230*/
64231 pub async fn sub_account_virtual_sub_account<'a>(
64232 &'a self,
64233 recv_window: Option<i64>,
64234 signature: &'a str,
64235 sub_account_string: &'a str,
64236 timestamp: i64,
64237 ) -> Result<
64238 ResponseValue<types::SubAccountVirtualSubAccountResponse>,
64239 Error<types::Error>,
64240 > {
64241 let url = format!("{}/sapi/v1/sub-account/virtualSubAccount", self.baseurl,);
64242 let mut query = Vec::with_capacity(4usize);
64243 if let Some(v) = &recv_window {
64244 query.push(("recvWindow", v.to_string()));
64245 }
64246 query.push(("signature", signature.to_string()));
64247 query.push(("subAccountString", sub_account_string.to_string()));
64248 query.push(("timestamp", timestamp.to_string()));
64249 #[allow(unused_mut)]
64250 let mut request = self
64251 .client
64252 .post(url)
64253 .header(
64254 reqwest::header::ACCEPT,
64255 reqwest::header::HeaderValue::from_static("application/json"),
64256 )
64257 .query(&query)
64258 .build()?;
64259 (crate::pre_hook)(&self.inner, &request);
64260 let result = self.client.execute(request).await;
64261 (crate::post_hook)(&self.inner, &result);
64262 let response = result?;
64263 match response.status().as_u16() {
64264 200u16 => ResponseValue::from_response(response).await,
64265 400u16 => {
64266 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64267 }
64268 401u16 => {
64269 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64270 }
64271 _ => Err(Error::UnexpectedResponse(response)),
64272 }
64273 }
64274 /**Query Sub-account List (For Master Account)
64275
64276Weight(IP): 1
64277
64278Sends a `GET` request to `/sapi/v1/sub-account/list`
64279
64280Arguments:
64281- `email`: Sub-account email
64282- `is_freeze`
64283- `limit`: Default 1; max 200
64284- `page`: Default 1
64285- `recv_window`: The value cannot be greater than 60000
64286- `signature`: Signature
64287- `timestamp`: UTC timestamp in ms
64288*/
64289 pub async fn sub_account_list<'a>(
64290 &'a self,
64291 email: Option<&'a str>,
64292 is_freeze: Option<types::SubAccountListIsFreeze>,
64293 limit: Option<i32>,
64294 page: Option<i32>,
64295 recv_window: Option<i64>,
64296 signature: &'a str,
64297 timestamp: i64,
64298 ) -> Result<ResponseValue<types::SubAccountListResponse>, Error<types::Error>> {
64299 let url = format!("{}/sapi/v1/sub-account/list", self.baseurl,);
64300 let mut query = Vec::with_capacity(7usize);
64301 if let Some(v) = &email {
64302 query.push(("email", v.to_string()));
64303 }
64304 if let Some(v) = &is_freeze {
64305 query.push(("isFreeze", v.to_string()));
64306 }
64307 if let Some(v) = &limit {
64308 query.push(("limit", v.to_string()));
64309 }
64310 if let Some(v) = &page {
64311 query.push(("page", v.to_string()));
64312 }
64313 if let Some(v) = &recv_window {
64314 query.push(("recvWindow", v.to_string()));
64315 }
64316 query.push(("signature", signature.to_string()));
64317 query.push(("timestamp", timestamp.to_string()));
64318 #[allow(unused_mut)]
64319 let mut request = self
64320 .client
64321 .get(url)
64322 .header(
64323 reqwest::header::ACCEPT,
64324 reqwest::header::HeaderValue::from_static("application/json"),
64325 )
64326 .query(&query)
64327 .build()?;
64328 (crate::pre_hook)(&self.inner, &request);
64329 let result = self.client.execute(request).await;
64330 (crate::post_hook)(&self.inner, &result);
64331 let response = result?;
64332 match response.status().as_u16() {
64333 200u16 => ResponseValue::from_response(response).await,
64334 400u16 => {
64335 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64336 }
64337 401u16 => {
64338 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64339 }
64340 _ => Err(Error::UnexpectedResponse(response)),
64341 }
64342 }
64343 /**Sub-account Spot Asset Transfer History (For Master Account)
64344
64345- fromEmail and toEmail cannot be sent at the same time.
64346- Return fromEmail equal master account email by default.
64347
64348Weight(IP): 1
64349
64350Sends a `GET` request to `/sapi/v1/sub-account/sub/transfer/history`
64351
64352Arguments:
64353- `end_time`: UTC timestamp in ms
64354- `from_email`: Sub-account email
64355- `limit`: Default 1
64356- `page`: Default 1
64357- `recv_window`: The value cannot be greater than 60000
64358- `signature`: Signature
64359- `start_time`: UTC timestamp in ms
64360- `timestamp`: UTC timestamp in ms
64361- `to_email`: Sub-account email
64362*/
64363 pub async fn sub_account_sub_transfer_history<'a>(
64364 &'a self,
64365 end_time: Option<i64>,
64366 from_email: Option<&'a str>,
64367 limit: Option<i32>,
64368 page: Option<i32>,
64369 recv_window: Option<i64>,
64370 signature: &'a str,
64371 start_time: Option<i64>,
64372 timestamp: i64,
64373 to_email: Option<&'a str>,
64374 ) -> Result<
64375 ResponseValue<Vec<types::SubAccountSubTransferHistoryResponseItem>>,
64376 Error<types::Error>,
64377 > {
64378 let url = format!("{}/sapi/v1/sub-account/sub/transfer/history", self.baseurl,);
64379 let mut query = Vec::with_capacity(9usize);
64380 if let Some(v) = &end_time {
64381 query.push(("endTime", v.to_string()));
64382 }
64383 if let Some(v) = &from_email {
64384 query.push(("fromEmail", v.to_string()));
64385 }
64386 if let Some(v) = &limit {
64387 query.push(("limit", v.to_string()));
64388 }
64389 if let Some(v) = &page {
64390 query.push(("page", v.to_string()));
64391 }
64392 if let Some(v) = &recv_window {
64393 query.push(("recvWindow", v.to_string()));
64394 }
64395 query.push(("signature", signature.to_string()));
64396 if let Some(v) = &start_time {
64397 query.push(("startTime", v.to_string()));
64398 }
64399 query.push(("timestamp", timestamp.to_string()));
64400 if let Some(v) = &to_email {
64401 query.push(("toEmail", v.to_string()));
64402 }
64403 #[allow(unused_mut)]
64404 let mut request = self
64405 .client
64406 .get(url)
64407 .header(
64408 reqwest::header::ACCEPT,
64409 reqwest::header::HeaderValue::from_static("application/json"),
64410 )
64411 .query(&query)
64412 .build()?;
64413 (crate::pre_hook)(&self.inner, &request);
64414 let result = self.client.execute(request).await;
64415 (crate::post_hook)(&self.inner, &result);
64416 let response = result?;
64417 match response.status().as_u16() {
64418 200u16 => ResponseValue::from_response(response).await,
64419 400u16 => {
64420 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64421 }
64422 401u16 => {
64423 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64424 }
64425 _ => Err(Error::UnexpectedResponse(response)),
64426 }
64427 }
64428 /**Sub-account Futures Asset Transfer History (For Master Account)
64429
64430Weight(IP): 1
64431
64432Sends a `GET` request to `/sapi/v1/sub-account/futures/internalTransfer`
64433
64434Arguments:
64435- `email`: Sub-account email
64436- `end_time`: UTC timestamp in ms
64437- `futures_type`: 1:USDT-margined Futures, 2: Coin-margined Futures
64438- `limit`: Default value: 50, Max value: 500
64439- `page`: Default 1
64440- `recv_window`: The value cannot be greater than 60000
64441- `signature`: Signature
64442- `start_time`: UTC timestamp in ms
64443- `timestamp`: UTC timestamp in ms
64444*/
64445 pub async fn sub_account_futures_internal_transfer<'a>(
64446 &'a self,
64447 email: &'a str,
64448 end_time: Option<i64>,
64449 futures_type: i32,
64450 limit: Option<i32>,
64451 page: Option<i32>,
64452 recv_window: Option<i64>,
64453 signature: &'a str,
64454 start_time: Option<i64>,
64455 timestamp: i64,
64456 ) -> Result<
64457 ResponseValue<types::SubAccountFuturesInternalTransferResponse>,
64458 Error<types::Error>,
64459 > {
64460 let url = format!(
64461 "{}/sapi/v1/sub-account/futures/internalTransfer", self.baseurl,
64462 );
64463 let mut query = Vec::with_capacity(9usize);
64464 query.push(("email", email.to_string()));
64465 if let Some(v) = &end_time {
64466 query.push(("endTime", v.to_string()));
64467 }
64468 query.push(("futuresType", futures_type.to_string()));
64469 if let Some(v) = &limit {
64470 query.push(("limit", v.to_string()));
64471 }
64472 if let Some(v) = &page {
64473 query.push(("page", v.to_string()));
64474 }
64475 if let Some(v) = &recv_window {
64476 query.push(("recvWindow", v.to_string()));
64477 }
64478 query.push(("signature", signature.to_string()));
64479 if let Some(v) = &start_time {
64480 query.push(("startTime", v.to_string()));
64481 }
64482 query.push(("timestamp", timestamp.to_string()));
64483 #[allow(unused_mut)]
64484 let mut request = self
64485 .client
64486 .get(url)
64487 .header(
64488 reqwest::header::ACCEPT,
64489 reqwest::header::HeaderValue::from_static("application/json"),
64490 )
64491 .query(&query)
64492 .build()?;
64493 (crate::pre_hook)(&self.inner, &request);
64494 let result = self.client.execute(request).await;
64495 (crate::post_hook)(&self.inner, &result);
64496 let response = result?;
64497 match response.status().as_u16() {
64498 200u16 => ResponseValue::from_response(response).await,
64499 400u16 => {
64500 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64501 }
64502 401u16 => {
64503 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64504 }
64505 _ => Err(Error::UnexpectedResponse(response)),
64506 }
64507 }
64508 /**Sub-account Futures Asset Transfer (For Master Account)
64509
64510- Master account can transfer max 2000 times a minute
64511
64512Weight(IP): 1
64513
64514Sends a `POST` request to `/sapi/v1/sub-account/futures/internalTransfer`
64515
64516Arguments:
64517- `amount`
64518- `asset`
64519- `from_email`: Sender email
64520- `futures_type`: 1:USDT-margined Futures,2: Coin-margined Futures
64521- `recv_window`: The value cannot be greater than 60000
64522- `signature`: Signature
64523- `timestamp`: UTC timestamp in ms
64524- `to_email`: Recipient email
64525*/
64526 pub async fn post_sub_account_future_asset_transfer<'a>(
64527 &'a self,
64528 amount: f64,
64529 asset: &'a str,
64530 from_email: &'a str,
64531 futures_type: i32,
64532 recv_window: Option<i64>,
64533 signature: &'a str,
64534 timestamp: i64,
64535 to_email: &'a str,
64536 ) -> Result<
64537 ResponseValue<types::PostSubAccountFutureAssetTransferResponse>,
64538 Error<types::Error>,
64539 > {
64540 let url = format!(
64541 "{}/sapi/v1/sub-account/futures/internalTransfer", self.baseurl,
64542 );
64543 let mut query = Vec::with_capacity(8usize);
64544 query.push(("amount", amount.to_string()));
64545 query.push(("asset", asset.to_string()));
64546 query.push(("fromEmail", from_email.to_string()));
64547 query.push(("futuresType", futures_type.to_string()));
64548 if let Some(v) = &recv_window {
64549 query.push(("recvWindow", v.to_string()));
64550 }
64551 query.push(("signature", signature.to_string()));
64552 query.push(("timestamp", timestamp.to_string()));
64553 query.push(("toEmail", to_email.to_string()));
64554 #[allow(unused_mut)]
64555 let mut request = self
64556 .client
64557 .post(url)
64558 .header(
64559 reqwest::header::ACCEPT,
64560 reqwest::header::HeaderValue::from_static("application/json"),
64561 )
64562 .query(&query)
64563 .build()?;
64564 (crate::pre_hook)(&self.inner, &request);
64565 let result = self.client.execute(request).await;
64566 (crate::post_hook)(&self.inner, &result);
64567 let response = result?;
64568 match response.status().as_u16() {
64569 200u16 => ResponseValue::from_response(response).await,
64570 400u16 => {
64571 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64572 }
64573 401u16 => {
64574 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64575 }
64576 _ => Err(Error::UnexpectedResponse(response)),
64577 }
64578 }
64579 /**Sub-account Assets (For Master Account)
64580
64581Fetch sub-account assets
64582
64583Weight(IP): 1
64584
64585Sends a `GET` request to `/sapi/v3/sub-account/assets`
64586
64587Arguments:
64588- `email`: Sub-account email
64589- `recv_window`: The value cannot be greater than 60000
64590- `signature`: Signature
64591- `timestamp`: UTC timestamp in ms
64592*/
64593 pub async fn set_sub_account_assets<'a>(
64594 &'a self,
64595 email: &'a str,
64596 recv_window: Option<i64>,
64597 signature: &'a str,
64598 timestamp: i64,
64599 ) -> Result<ResponseValue<types::SetSubAccountAssetsResponse>, Error<types::Error>> {
64600 let url = format!("{}/sapi/v3/sub-account/assets", self.baseurl,);
64601 let mut query = Vec::with_capacity(4usize);
64602 query.push(("email", email.to_string()));
64603 if let Some(v) = &recv_window {
64604 query.push(("recvWindow", v.to_string()));
64605 }
64606 query.push(("signature", signature.to_string()));
64607 query.push(("timestamp", timestamp.to_string()));
64608 #[allow(unused_mut)]
64609 let mut request = self
64610 .client
64611 .get(url)
64612 .header(
64613 reqwest::header::ACCEPT,
64614 reqwest::header::HeaderValue::from_static("application/json"),
64615 )
64616 .query(&query)
64617 .build()?;
64618 (crate::pre_hook)(&self.inner, &request);
64619 let result = self.client.execute(request).await;
64620 (crate::post_hook)(&self.inner, &result);
64621 let response = result?;
64622 match response.status().as_u16() {
64623 200u16 => ResponseValue::from_response(response).await,
64624 400u16 => {
64625 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64626 }
64627 401u16 => {
64628 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64629 }
64630 _ => Err(Error::UnexpectedResponse(response)),
64631 }
64632 }
64633 /**Sub-account Spot Assets Summary (For Master Account)
64634
64635Get BTC valued asset summary of subaccounts.
64636
64637Weight(IP): 1
64638
64639Sends a `GET` request to `/sapi/v1/sub-account/spotSummary`
64640
64641Arguments:
64642- `email`: Sub-account email
64643- `page`: Default 1
64644- `recv_window`: The value cannot be greater than 60000
64645- `signature`: Signature
64646- `size`: Default:10 Max:20
64647- `timestamp`: UTC timestamp in ms
64648*/
64649 pub async fn sub_account_spot_summary<'a>(
64650 &'a self,
64651 email: Option<&'a str>,
64652 page: Option<i32>,
64653 recv_window: Option<i64>,
64654 signature: &'a str,
64655 size: Option<i32>,
64656 timestamp: i64,
64657 ) -> Result<
64658 ResponseValue<types::SubAccountSpotSummaryResponse>,
64659 Error<types::Error>,
64660 > {
64661 let url = format!("{}/sapi/v1/sub-account/spotSummary", self.baseurl,);
64662 let mut query = Vec::with_capacity(6usize);
64663 if let Some(v) = &email {
64664 query.push(("email", v.to_string()));
64665 }
64666 if let Some(v) = &page {
64667 query.push(("page", v.to_string()));
64668 }
64669 if let Some(v) = &recv_window {
64670 query.push(("recvWindow", v.to_string()));
64671 }
64672 query.push(("signature", signature.to_string()));
64673 if let Some(v) = &size {
64674 query.push(("size", v.to_string()));
64675 }
64676 query.push(("timestamp", timestamp.to_string()));
64677 #[allow(unused_mut)]
64678 let mut request = self
64679 .client
64680 .get(url)
64681 .header(
64682 reqwest::header::ACCEPT,
64683 reqwest::header::HeaderValue::from_static("application/json"),
64684 )
64685 .query(&query)
64686 .build()?;
64687 (crate::pre_hook)(&self.inner, &request);
64688 let result = self.client.execute(request).await;
64689 (crate::post_hook)(&self.inner, &result);
64690 let response = result?;
64691 match response.status().as_u16() {
64692 200u16 => ResponseValue::from_response(response).await,
64693 400u16 => {
64694 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64695 }
64696 401u16 => {
64697 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64698 }
64699 _ => Err(Error::UnexpectedResponse(response)),
64700 }
64701 }
64702 /**Sub-account Spot Assets Summary (For Master Account)
64703
64704Fetch sub-account deposit address
64705
64706Weight(IP): 1
64707
64708Sends a `GET` request to `/sapi/v1/capital/deposit/subAddress`
64709
64710Arguments:
64711- `coin`: Coin name
64712- `email`: Sub-account email
64713- `network`
64714- `recv_window`: The value cannot be greater than 60000
64715- `signature`: Signature
64716- `timestamp`: UTC timestamp in ms
64717*/
64718 pub async fn capital_deposit_sub_address<'a>(
64719 &'a self,
64720 coin: &'a str,
64721 email: &'a str,
64722 network: Option<&'a str>,
64723 recv_window: Option<i64>,
64724 signature: &'a str,
64725 timestamp: i64,
64726 ) -> Result<
64727 ResponseValue<types::CapitalDepositSubAddressResponse>,
64728 Error<types::Error>,
64729 > {
64730 let url = format!("{}/sapi/v1/capital/deposit/subAddress", self.baseurl,);
64731 let mut query = Vec::with_capacity(6usize);
64732 query.push(("coin", coin.to_string()));
64733 query.push(("email", email.to_string()));
64734 if let Some(v) = &network {
64735 query.push(("network", v.to_string()));
64736 }
64737 if let Some(v) = &recv_window {
64738 query.push(("recvWindow", v.to_string()));
64739 }
64740 query.push(("signature", signature.to_string()));
64741 query.push(("timestamp", timestamp.to_string()));
64742 #[allow(unused_mut)]
64743 let mut request = self
64744 .client
64745 .get(url)
64746 .header(
64747 reqwest::header::ACCEPT,
64748 reqwest::header::HeaderValue::from_static("application/json"),
64749 )
64750 .query(&query)
64751 .build()?;
64752 (crate::pre_hook)(&self.inner, &request);
64753 let result = self.client.execute(request).await;
64754 (crate::post_hook)(&self.inner, &result);
64755 let response = result?;
64756 match response.status().as_u16() {
64757 200u16 => ResponseValue::from_response(response).await,
64758 400u16 => {
64759 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64760 }
64761 401u16 => {
64762 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64763 }
64764 _ => Err(Error::UnexpectedResponse(response)),
64765 }
64766 }
64767 /**Sub-account Deposit History (For Master Account)
64768
64769Fetch sub-account deposit history
64770
64771Weight(IP): 1
64772
64773Sends a `GET` request to `/sapi/v1/capital/deposit/subHisrec`
64774
64775Arguments:
64776- `coin`: Coin name
64777- `email`: Sub-account email
64778- `end_time`: UTC timestamp in ms
64779- `limit`
64780- `offset`
64781- `recv_window`: The value cannot be greater than 60000
64782- `signature`: Signature
64783- `start_time`: UTC timestamp in ms
64784- `status`: 0(0:pending,6: credited but cannot withdraw, 1:success)
64785- `timestamp`: UTC timestamp in ms
64786*/
64787 pub async fn capital_deposit_sub_hisrec<'a>(
64788 &'a self,
64789 coin: Option<&'a str>,
64790 email: &'a str,
64791 end_time: Option<i64>,
64792 limit: Option<i64>,
64793 offset: Option<i32>,
64794 recv_window: Option<i64>,
64795 signature: &'a str,
64796 start_time: Option<i64>,
64797 status: Option<i32>,
64798 timestamp: i64,
64799 ) -> Result<
64800 ResponseValue<Vec<types::CapitalDepositSubHisrecResponseItem>>,
64801 Error<types::Error>,
64802 > {
64803 let url = format!("{}/sapi/v1/capital/deposit/subHisrec", self.baseurl,);
64804 let mut query = Vec::with_capacity(10usize);
64805 if let Some(v) = &coin {
64806 query.push(("coin", v.to_string()));
64807 }
64808 query.push(("email", email.to_string()));
64809 if let Some(v) = &end_time {
64810 query.push(("endTime", v.to_string()));
64811 }
64812 if let Some(v) = &limit {
64813 query.push(("limit", v.to_string()));
64814 }
64815 if let Some(v) = &offset {
64816 query.push(("offset", v.to_string()));
64817 }
64818 if let Some(v) = &recv_window {
64819 query.push(("recvWindow", v.to_string()));
64820 }
64821 query.push(("signature", signature.to_string()));
64822 if let Some(v) = &start_time {
64823 query.push(("startTime", v.to_string()));
64824 }
64825 if let Some(v) = &status {
64826 query.push(("status", v.to_string()));
64827 }
64828 query.push(("timestamp", timestamp.to_string()));
64829 #[allow(unused_mut)]
64830 let mut request = self
64831 .client
64832 .get(url)
64833 .header(
64834 reqwest::header::ACCEPT,
64835 reqwest::header::HeaderValue::from_static("application/json"),
64836 )
64837 .query(&query)
64838 .build()?;
64839 (crate::pre_hook)(&self.inner, &request);
64840 let result = self.client.execute(request).await;
64841 (crate::post_hook)(&self.inner, &result);
64842 let response = result?;
64843 match response.status().as_u16() {
64844 200u16 => ResponseValue::from_response(response).await,
64845 400u16 => {
64846 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64847 }
64848 401u16 => {
64849 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64850 }
64851 _ => Err(Error::UnexpectedResponse(response)),
64852 }
64853 }
64854 /**One click arrival deposit apply (USER_DATA)
64855
64856Apply deposit credit for expired address (One click arrival)
64857
64858Weight(IP): 1
64859
64860Sends a `POST` request to `/sapi/v1/capital/deposit/credit-apply`
64861
64862Arguments:
64863- `deposit_id`: Deposit record Id, priority use
64864- `recv_window`: The value cannot be greater than 60000
64865- `signature`: Signature
64866- `sub_account_id`
64867- `sub_user_id`
64868- `timestamp`: UTC timestamp in ms
64869- `tx_id`: Deposit txId, used when depositId is not specified
64870*/
64871 pub async fn capital_deposit_credit_apply<'a>(
64872 &'a self,
64873 deposit_id: Option<i64>,
64874 recv_window: Option<i64>,
64875 signature: &'a str,
64876 sub_account_id: Option<i64>,
64877 sub_user_id: Option<i64>,
64878 timestamp: i64,
64879 tx_id: Option<&'a str>,
64880 ) -> Result<
64881 ResponseValue<types::CapitalDepositCreditApplyResponse>,
64882 Error<types::Error>,
64883 > {
64884 let url = format!("{}/sapi/v1/capital/deposit/credit-apply", self.baseurl,);
64885 let mut query = Vec::with_capacity(7usize);
64886 if let Some(v) = &deposit_id {
64887 query.push(("depositId", v.to_string()));
64888 }
64889 if let Some(v) = &recv_window {
64890 query.push(("recvWindow", v.to_string()));
64891 }
64892 query.push(("signature", signature.to_string()));
64893 if let Some(v) = &sub_account_id {
64894 query.push(("subAccountId", v.to_string()));
64895 }
64896 if let Some(v) = &sub_user_id {
64897 query.push(("subUserId", v.to_string()));
64898 }
64899 query.push(("timestamp", timestamp.to_string()));
64900 if let Some(v) = &tx_id {
64901 query.push(("txId", v.to_string()));
64902 }
64903 #[allow(unused_mut)]
64904 let mut request = self
64905 .client
64906 .post(url)
64907 .header(
64908 reqwest::header::ACCEPT,
64909 reqwest::header::HeaderValue::from_static("application/json"),
64910 )
64911 .query(&query)
64912 .build()?;
64913 (crate::pre_hook)(&self.inner, &request);
64914 let result = self.client.execute(request).await;
64915 (crate::post_hook)(&self.inner, &result);
64916 let response = result?;
64917 match response.status().as_u16() {
64918 200u16 => ResponseValue::from_response(response).await,
64919 400u16 => {
64920 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64921 }
64922 401u16 => {
64923 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64924 }
64925 _ => Err(Error::UnexpectedResponse(response)),
64926 }
64927 }
64928 /**Query User Wallet Balance (USER_DATA)
64929
64930Query User Wallet Balance
64931
64932Weight(IP): 60
64933
64934Sends a `GET` request to `/sapi/v1/asset/wallet/balance`
64935
64936Arguments:
64937- `recv_window`: The value cannot be greater than 60000
64938- `signature`: Signature
64939- `timestamp`: UTC timestamp in ms
64940*/
64941 pub async fn asset_wallet_balance<'a>(
64942 &'a self,
64943 recv_window: Option<i64>,
64944 signature: &'a str,
64945 timestamp: i64,
64946 ) -> Result<
64947 ResponseValue<Vec<types::AssetWalletBalanceResponseItem>>,
64948 Error<types::Error>,
64949 > {
64950 let url = format!("{}/sapi/v1/asset/wallet/balance", self.baseurl,);
64951 let mut query = Vec::with_capacity(3usize);
64952 if let Some(v) = &recv_window {
64953 query.push(("recvWindow", v.to_string()));
64954 }
64955 query.push(("signature", signature.to_string()));
64956 query.push(("timestamp", timestamp.to_string()));
64957 #[allow(unused_mut)]
64958 let mut request = self
64959 .client
64960 .get(url)
64961 .header(
64962 reqwest::header::ACCEPT,
64963 reqwest::header::HeaderValue::from_static("application/json"),
64964 )
64965 .query(&query)
64966 .build()?;
64967 (crate::pre_hook)(&self.inner, &request);
64968 let result = self.client.execute(request).await;
64969 (crate::post_hook)(&self.inner, &result);
64970 let response = result?;
64971 match response.status().as_u16() {
64972 200u16 => ResponseValue::from_response(response).await,
64973 400u16 => {
64974 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64975 }
64976 401u16 => {
64977 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
64978 }
64979 _ => Err(Error::UnexpectedResponse(response)),
64980 }
64981 }
64982 /**Query User Delegation History(For Master Account) (USER_DATA)
64983
64984Query User Delegation History
64985
64986Weight(IP): 60
64987
64988Sends a `GET` request to `/sapi/v1/asset/custody/transfer-history`
64989
64990Arguments:
64991- `asset`
64992- `current`: Current querying page. Start from 1. Default:1
64993- `email`
64994- `end_time`
64995- `recv_window`: The value cannot be greater than 60000
64996- `signature`: Signature
64997- `size`: Default:10 Max:100
64998- `start_time`
64999- `timestamp`: UTC timestamp in ms
65000- `type_`
65001*/
65002 pub async fn asset_custody_transfer_history<'a>(
65003 &'a self,
65004 asset: &'a str,
65005 current: Option<i32>,
65006 email: &'a str,
65007 end_time: i64,
65008 recv_window: Option<i64>,
65009 signature: &'a str,
65010 size: Option<i32>,
65011 start_time: i64,
65012 timestamp: i64,
65013 type_: Option<&'a str>,
65014 ) -> Result<
65015 ResponseValue<types::AssetCustodyTransferHistoryResponse>,
65016 Error<types::Error>,
65017 > {
65018 let url = format!("{}/sapi/v1/asset/custody/transfer-history", self.baseurl,);
65019 let mut query = Vec::with_capacity(10usize);
65020 query.push(("asset", asset.to_string()));
65021 if let Some(v) = ¤t {
65022 query.push(("current", v.to_string()));
65023 }
65024 query.push(("email", email.to_string()));
65025 query.push(("endTime", end_time.to_string()));
65026 if let Some(v) = &recv_window {
65027 query.push(("recvWindow", v.to_string()));
65028 }
65029 query.push(("signature", signature.to_string()));
65030 if let Some(v) = &size {
65031 query.push(("size", v.to_string()));
65032 }
65033 query.push(("startTime", start_time.to_string()));
65034 query.push(("timestamp", timestamp.to_string()));
65035 if let Some(v) = &type_ {
65036 query.push(("type", v.to_string()));
65037 }
65038 #[allow(unused_mut)]
65039 let mut request = self
65040 .client
65041 .get(url)
65042 .header(
65043 reqwest::header::ACCEPT,
65044 reqwest::header::HeaderValue::from_static("application/json"),
65045 )
65046 .query(&query)
65047 .build()?;
65048 (crate::pre_hook)(&self.inner, &request);
65049 let result = self.client.execute(request).await;
65050 (crate::post_hook)(&self.inner, &result);
65051 let response = result?;
65052 match response.status().as_u16() {
65053 200u16 => ResponseValue::from_response(response).await,
65054 400u16 => {
65055 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65056 }
65057 401u16 => {
65058 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65059 }
65060 _ => Err(Error::UnexpectedResponse(response)),
65061 }
65062 }
65063 /**Fetch deposit address list with network (USER_DATA)
65064
65065Fetch deposit address list with network.
65066
65067Weight(IP): 10
65068
65069Sends a `GET` request to `/sapi/v1/capital/deposit/address/list`
65070
65071Arguments:
65072- `coin`
65073- `network`
65074- `recv_window`: The value cannot be greater than 60000
65075- `signature`: Signature
65076- `timestamp`: UTC timestamp in ms
65077*/
65078 pub async fn capital_deposit_address_list<'a>(
65079 &'a self,
65080 coin: &'a str,
65081 network: Option<&'a str>,
65082 recv_window: Option<i64>,
65083 signature: &'a str,
65084 timestamp: i64,
65085 ) -> Result<
65086 ResponseValue<Vec<types::CapitalDepositAddressListResponseItem>>,
65087 Error<types::Error>,
65088 > {
65089 let url = format!("{}/sapi/v1/capital/deposit/address/list", self.baseurl,);
65090 let mut query = Vec::with_capacity(5usize);
65091 query.push(("coin", coin.to_string()));
65092 if let Some(v) = &network {
65093 query.push(("network", v.to_string()));
65094 }
65095 if let Some(v) = &recv_window {
65096 query.push(("recvWindow", v.to_string()));
65097 }
65098 query.push(("signature", signature.to_string()));
65099 query.push(("timestamp", timestamp.to_string()));
65100 #[allow(unused_mut)]
65101 let mut request = self
65102 .client
65103 .get(url)
65104 .header(
65105 reqwest::header::ACCEPT,
65106 reqwest::header::HeaderValue::from_static("application/json"),
65107 )
65108 .query(&query)
65109 .build()?;
65110 (crate::pre_hook)(&self.inner, &request);
65111 let result = self.client.execute(request).await;
65112 (crate::post_hook)(&self.inner, &result);
65113 let response = result?;
65114 match response.status().as_u16() {
65115 200u16 => ResponseValue::from_response(response).await,
65116 400u16 => {
65117 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65118 }
65119 401u16 => {
65120 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65121 }
65122 _ => Err(Error::UnexpectedResponse(response)),
65123 }
65124 }
65125 /**Sub-account's Status on Margin/Futures (For Master Account)
65126
65127- If no `email` sent, all sub-accounts' information will be returned.
65128
65129Weight(IP): 10
65130
65131Sends a `GET` request to `/sapi/v1/sub-account/status`
65132
65133Arguments:
65134- `email`: Sub-account email
65135- `recv_window`: The value cannot be greater than 60000
65136- `signature`: Signature
65137- `timestamp`: UTC timestamp in ms
65138*/
65139 pub async fn sub_account_status<'a>(
65140 &'a self,
65141 email: Option<&'a str>,
65142 recv_window: Option<i64>,
65143 signature: &'a str,
65144 timestamp: i64,
65145 ) -> Result<
65146 ResponseValue<Vec<types::SubAccountStatusResponseItem>>,
65147 Error<types::Error>,
65148 > {
65149 let url = format!("{}/sapi/v1/sub-account/status", self.baseurl,);
65150 let mut query = Vec::with_capacity(4usize);
65151 if let Some(v) = &email {
65152 query.push(("email", v.to_string()));
65153 }
65154 if let Some(v) = &recv_window {
65155 query.push(("recvWindow", v.to_string()));
65156 }
65157 query.push(("signature", signature.to_string()));
65158 query.push(("timestamp", timestamp.to_string()));
65159 #[allow(unused_mut)]
65160 let mut request = self
65161 .client
65162 .get(url)
65163 .header(
65164 reqwest::header::ACCEPT,
65165 reqwest::header::HeaderValue::from_static("application/json"),
65166 )
65167 .query(&query)
65168 .build()?;
65169 (crate::pre_hook)(&self.inner, &request);
65170 let result = self.client.execute(request).await;
65171 (crate::post_hook)(&self.inner, &result);
65172 let response = result?;
65173 match response.status().as_u16() {
65174 200u16 => ResponseValue::from_response(response).await,
65175 400u16 => {
65176 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65177 }
65178 401u16 => {
65179 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65180 }
65181 _ => Err(Error::UnexpectedResponse(response)),
65182 }
65183 }
65184 /**Enable Margin for Sub-account (For Master Account)
65185
65186Weight(IP): 1
65187
65188Sends a `POST` request to `/sapi/v1/sub-account/margin/enable`
65189
65190Arguments:
65191- `email`: Sub-account email
65192- `recv_window`: The value cannot be greater than 60000
65193- `signature`: Signature
65194- `timestamp`: UTC timestamp in ms
65195*/
65196 pub async fn sub_account_margin_enable<'a>(
65197 &'a self,
65198 email: &'a str,
65199 recv_window: Option<i64>,
65200 signature: &'a str,
65201 timestamp: i64,
65202 ) -> Result<
65203 ResponseValue<types::SubAccountMarginEnableResponse>,
65204 Error<types::Error>,
65205 > {
65206 let url = format!("{}/sapi/v1/sub-account/margin/enable", self.baseurl,);
65207 let mut query = Vec::with_capacity(4usize);
65208 query.push(("email", email.to_string()));
65209 if let Some(v) = &recv_window {
65210 query.push(("recvWindow", v.to_string()));
65211 }
65212 query.push(("signature", signature.to_string()));
65213 query.push(("timestamp", timestamp.to_string()));
65214 #[allow(unused_mut)]
65215 let mut request = self
65216 .client
65217 .post(url)
65218 .header(
65219 reqwest::header::ACCEPT,
65220 reqwest::header::HeaderValue::from_static("application/json"),
65221 )
65222 .query(&query)
65223 .build()?;
65224 (crate::pre_hook)(&self.inner, &request);
65225 let result = self.client.execute(request).await;
65226 (crate::post_hook)(&self.inner, &result);
65227 let response = result?;
65228 match response.status().as_u16() {
65229 200u16 => ResponseValue::from_response(response).await,
65230 400u16 => {
65231 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65232 }
65233 401u16 => {
65234 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65235 }
65236 _ => Err(Error::UnexpectedResponse(response)),
65237 }
65238 }
65239 /**Detail on Sub-account's Margin Account (For Master Account)
65240
65241Weight(IP): 10
65242
65243Sends a `GET` request to `/sapi/v1/sub-account/margin/account`
65244
65245Arguments:
65246- `email`: Sub-account email
65247- `recv_window`: The value cannot be greater than 60000
65248- `signature`: Signature
65249- `timestamp`: UTC timestamp in ms
65250*/
65251 pub async fn sub_account_margin_account<'a>(
65252 &'a self,
65253 email: &'a str,
65254 recv_window: Option<i64>,
65255 signature: &'a str,
65256 timestamp: i64,
65257 ) -> Result<
65258 ResponseValue<types::SubAccountMarginAccountResponse>,
65259 Error<types::Error>,
65260 > {
65261 let url = format!("{}/sapi/v1/sub-account/margin/account", self.baseurl,);
65262 let mut query = Vec::with_capacity(4usize);
65263 query.push(("email", email.to_string()));
65264 if let Some(v) = &recv_window {
65265 query.push(("recvWindow", v.to_string()));
65266 }
65267 query.push(("signature", signature.to_string()));
65268 query.push(("timestamp", timestamp.to_string()));
65269 #[allow(unused_mut)]
65270 let mut request = self
65271 .client
65272 .get(url)
65273 .header(
65274 reqwest::header::ACCEPT,
65275 reqwest::header::HeaderValue::from_static("application/json"),
65276 )
65277 .query(&query)
65278 .build()?;
65279 (crate::pre_hook)(&self.inner, &request);
65280 let result = self.client.execute(request).await;
65281 (crate::post_hook)(&self.inner, &result);
65282 let response = result?;
65283 match response.status().as_u16() {
65284 200u16 => ResponseValue::from_response(response).await,
65285 400u16 => {
65286 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65287 }
65288 401u16 => {
65289 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65290 }
65291 _ => Err(Error::UnexpectedResponse(response)),
65292 }
65293 }
65294 /**Summary of Sub-account's Margin Account (For Master Account)
65295
65296Weight(IP): 10
65297
65298Sends a `GET` request to `/sapi/v1/sub-account/margin/accountSummary`
65299
65300Arguments:
65301- `recv_window`: The value cannot be greater than 60000
65302- `signature`: Signature
65303- `timestamp`: UTC timestamp in ms
65304*/
65305 pub async fn sub_account_margin_account_summary<'a>(
65306 &'a self,
65307 recv_window: Option<i64>,
65308 signature: &'a str,
65309 timestamp: i64,
65310 ) -> Result<
65311 ResponseValue<types::SubAccountMarginAccountSummaryResponse>,
65312 Error<types::Error>,
65313 > {
65314 let url = format!("{}/sapi/v1/sub-account/margin/accountSummary", self.baseurl,);
65315 let mut query = Vec::with_capacity(3usize);
65316 if let Some(v) = &recv_window {
65317 query.push(("recvWindow", v.to_string()));
65318 }
65319 query.push(("signature", signature.to_string()));
65320 query.push(("timestamp", timestamp.to_string()));
65321 #[allow(unused_mut)]
65322 let mut request = self
65323 .client
65324 .get(url)
65325 .header(
65326 reqwest::header::ACCEPT,
65327 reqwest::header::HeaderValue::from_static("application/json"),
65328 )
65329 .query(&query)
65330 .build()?;
65331 (crate::pre_hook)(&self.inner, &request);
65332 let result = self.client.execute(request).await;
65333 (crate::post_hook)(&self.inner, &result);
65334 let response = result?;
65335 match response.status().as_u16() {
65336 200u16 => ResponseValue::from_response(response).await,
65337 400u16 => {
65338 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65339 }
65340 401u16 => {
65341 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65342 }
65343 _ => Err(Error::UnexpectedResponse(response)),
65344 }
65345 }
65346 /**Enable Futures for Sub-account (For Master Account)
65347
65348Weight(IP): 1
65349
65350Sends a `POST` request to `/sapi/v1/sub-account/futures/enable`
65351
65352Arguments:
65353- `email`: Sub-account email
65354- `recv_window`: The value cannot be greater than 60000
65355- `signature`: Signature
65356- `timestamp`: UTC timestamp in ms
65357*/
65358 pub async fn sub_account_futures_enable<'a>(
65359 &'a self,
65360 email: &'a str,
65361 recv_window: Option<i64>,
65362 signature: &'a str,
65363 timestamp: i64,
65364 ) -> Result<
65365 ResponseValue<types::SubAccountFuturesEnableResponse>,
65366 Error<types::Error>,
65367 > {
65368 let url = format!("{}/sapi/v1/sub-account/futures/enable", self.baseurl,);
65369 let mut query = Vec::with_capacity(4usize);
65370 query.push(("email", email.to_string()));
65371 if let Some(v) = &recv_window {
65372 query.push(("recvWindow", v.to_string()));
65373 }
65374 query.push(("signature", signature.to_string()));
65375 query.push(("timestamp", timestamp.to_string()));
65376 #[allow(unused_mut)]
65377 let mut request = self
65378 .client
65379 .post(url)
65380 .header(
65381 reqwest::header::ACCEPT,
65382 reqwest::header::HeaderValue::from_static("application/json"),
65383 )
65384 .query(&query)
65385 .build()?;
65386 (crate::pre_hook)(&self.inner, &request);
65387 let result = self.client.execute(request).await;
65388 (crate::post_hook)(&self.inner, &result);
65389 let response = result?;
65390 match response.status().as_u16() {
65391 200u16 => ResponseValue::from_response(response).await,
65392 400u16 => {
65393 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65394 }
65395 401u16 => {
65396 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65397 }
65398 _ => Err(Error::UnexpectedResponse(response)),
65399 }
65400 }
65401 /**Detail on Sub-account's Futures Account (For Master Account)
65402
65403Weight(IP): 10
65404
65405Sends a `GET` request to `/sapi/v1/sub-account/futures/account`
65406
65407Arguments:
65408- `email`
65409- `recv_window`: The value cannot be greater than 60000
65410- `signature`: Signature
65411- `timestamp`: UTC timestamp in ms
65412*/
65413 pub async fn query_sub_account_futures_account_v1<'a>(
65414 &'a self,
65415 email: &'a str,
65416 recv_window: Option<i64>,
65417 signature: &'a str,
65418 timestamp: i64,
65419 ) -> Result<
65420 ResponseValue<types::QuerySubAccountFuturesAccountV1Response>,
65421 Error<types::Error>,
65422 > {
65423 let url = format!("{}/sapi/v1/sub-account/futures/account", self.baseurl,);
65424 let mut query = Vec::with_capacity(4usize);
65425 query.push(("email", email.to_string()));
65426 if let Some(v) = &recv_window {
65427 query.push(("recvWindow", v.to_string()));
65428 }
65429 query.push(("signature", signature.to_string()));
65430 query.push(("timestamp", timestamp.to_string()));
65431 #[allow(unused_mut)]
65432 let mut request = self
65433 .client
65434 .get(url)
65435 .header(
65436 reqwest::header::ACCEPT,
65437 reqwest::header::HeaderValue::from_static("application/json"),
65438 )
65439 .query(&query)
65440 .build()?;
65441 (crate::pre_hook)(&self.inner, &request);
65442 let result = self.client.execute(request).await;
65443 (crate::post_hook)(&self.inner, &result);
65444 let response = result?;
65445 match response.status().as_u16() {
65446 200u16 => ResponseValue::from_response(response).await,
65447 400u16 => {
65448 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65449 }
65450 401u16 => {
65451 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65452 }
65453 _ => Err(Error::UnexpectedResponse(response)),
65454 }
65455 }
65456 /**Summary of Sub-account's Futures Account (For Master Account)
65457
65458Weight(IP): 1
65459
65460Sends a `GET` request to `/sapi/v1/sub-account/futures/accountSummary`
65461
65462Arguments:
65463- `recv_window`: The value cannot be greater than 60000
65464- `signature`: Signature
65465- `timestamp`: UTC timestamp in ms
65466*/
65467 pub async fn sub_account_futures_account_summary<'a>(
65468 &'a self,
65469 recv_window: Option<i64>,
65470 signature: &'a str,
65471 timestamp: i64,
65472 ) -> Result<
65473 ResponseValue<types::SubAccountFuturesAccountSummaryResponse>,
65474 Error<types::Error>,
65475 > {
65476 let url = format!(
65477 "{}/sapi/v1/sub-account/futures/accountSummary", self.baseurl,
65478 );
65479 let mut query = Vec::with_capacity(3usize);
65480 if let Some(v) = &recv_window {
65481 query.push(("recvWindow", v.to_string()));
65482 }
65483 query.push(("signature", signature.to_string()));
65484 query.push(("timestamp", timestamp.to_string()));
65485 #[allow(unused_mut)]
65486 let mut request = self
65487 .client
65488 .get(url)
65489 .header(
65490 reqwest::header::ACCEPT,
65491 reqwest::header::HeaderValue::from_static("application/json"),
65492 )
65493 .query(&query)
65494 .build()?;
65495 (crate::pre_hook)(&self.inner, &request);
65496 let result = self.client.execute(request).await;
65497 (crate::post_hook)(&self.inner, &result);
65498 let response = result?;
65499 match response.status().as_u16() {
65500 200u16 => ResponseValue::from_response(response).await,
65501 400u16 => {
65502 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65503 }
65504 401u16 => {
65505 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65506 }
65507 _ => Err(Error::UnexpectedResponse(response)),
65508 }
65509 }
65510 /**Futures Position-Risk of Sub-account (For Master Account)
65511
65512Weight(IP): 10
65513
65514Sends a `GET` request to `/sapi/v1/sub-account/futures/positionRisk`
65515
65516Arguments:
65517- `email`: Sub-account email
65518- `recv_window`: The value cannot be greater than 60000
65519- `signature`: Signature
65520- `timestamp`: UTC timestamp in ms
65521*/
65522 pub async fn sub_account_futures_position_risk<'a>(
65523 &'a self,
65524 email: &'a str,
65525 recv_window: Option<i64>,
65526 signature: &'a str,
65527 timestamp: i64,
65528 ) -> Result<
65529 ResponseValue<Vec<types::SubAccountFuturesPositionRiskResponseItem>>,
65530 Error<types::Error>,
65531 > {
65532 let url = format!("{}/sapi/v1/sub-account/futures/positionRisk", self.baseurl,);
65533 let mut query = Vec::with_capacity(4usize);
65534 query.push(("email", email.to_string()));
65535 if let Some(v) = &recv_window {
65536 query.push(("recvWindow", v.to_string()));
65537 }
65538 query.push(("signature", signature.to_string()));
65539 query.push(("timestamp", timestamp.to_string()));
65540 #[allow(unused_mut)]
65541 let mut request = self
65542 .client
65543 .get(url)
65544 .header(
65545 reqwest::header::ACCEPT,
65546 reqwest::header::HeaderValue::from_static("application/json"),
65547 )
65548 .query(&query)
65549 .build()?;
65550 (crate::pre_hook)(&self.inner, &request);
65551 let result = self.client.execute(request).await;
65552 (crate::post_hook)(&self.inner, &result);
65553 let response = result?;
65554 match response.status().as_u16() {
65555 200u16 => ResponseValue::from_response(response).await,
65556 400u16 => {
65557 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65558 }
65559 401u16 => {
65560 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65561 }
65562 _ => Err(Error::UnexpectedResponse(response)),
65563 }
65564 }
65565 /**Transfer for Sub-account (For Master Account)
65566
65567Weight(IP): 1
65568
65569Sends a `POST` request to `/sapi/v1/sub-account/futures/transfer`
65570
65571Arguments:
65572- `amount`
65573- `asset`
65574- `email`: Sub-account email
65575- `recv_window`: The value cannot be greater than 60000
65576- `signature`: Signature
65577- `timestamp`: UTC timestamp in ms
65578- `type_`: * `1` - transfer from subaccount's spot account to its USDT-margined futures account
65579* `2` - transfer from subaccount's USDT-margined futures account to its spot account
65580* `3` - transfer from subaccount's spot account to its COIN-margined futures account
65581* `4` - transfer from subaccount's COIN-margined futures account to its spot account
65582*/
65583 pub async fn sub_account_futures_transfer<'a>(
65584 &'a self,
65585 amount: f64,
65586 asset: &'a str,
65587 email: &'a str,
65588 recv_window: Option<i64>,
65589 signature: &'a str,
65590 timestamp: i64,
65591 type_: i64,
65592 ) -> Result<
65593 ResponseValue<types::SubAccountFuturesTransferResponse>,
65594 Error<types::Error>,
65595 > {
65596 let url = format!("{}/sapi/v1/sub-account/futures/transfer", self.baseurl,);
65597 let mut query = Vec::with_capacity(7usize);
65598 query.push(("amount", amount.to_string()));
65599 query.push(("asset", asset.to_string()));
65600 query.push(("email", email.to_string()));
65601 if let Some(v) = &recv_window {
65602 query.push(("recvWindow", v.to_string()));
65603 }
65604 query.push(("signature", signature.to_string()));
65605 query.push(("timestamp", timestamp.to_string()));
65606 query.push(("type", type_.to_string()));
65607 #[allow(unused_mut)]
65608 let mut request = self
65609 .client
65610 .post(url)
65611 .header(
65612 reqwest::header::ACCEPT,
65613 reqwest::header::HeaderValue::from_static("application/json"),
65614 )
65615 .query(&query)
65616 .build()?;
65617 (crate::pre_hook)(&self.inner, &request);
65618 let result = self.client.execute(request).await;
65619 (crate::post_hook)(&self.inner, &result);
65620 let response = result?;
65621 match response.status().as_u16() {
65622 200u16 => ResponseValue::from_response(response).await,
65623 400u16 => {
65624 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65625 }
65626 401u16 => {
65627 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65628 }
65629 _ => Err(Error::UnexpectedResponse(response)),
65630 }
65631 }
65632 /**Margin Transfer for Sub-account (For Master Account)
65633
65634Weight(IP): 1
65635
65636Sends a `POST` request to `/sapi/v1/sub-account/margin/transfer`
65637
65638Arguments:
65639- `amount`
65640- `asset`
65641- `email`: Sub-account email
65642- `recv_window`: The value cannot be greater than 60000
65643- `signature`: Signature
65644- `timestamp`: UTC timestamp in ms
65645- `type_`: * `1` - transfer from subaccount's spot account to margin account
65646* `2` - transfer from subaccount's margin account to its spot account
65647*/
65648 pub async fn sub_account_margin_transfer<'a>(
65649 &'a self,
65650 amount: f64,
65651 asset: &'a str,
65652 email: &'a str,
65653 recv_window: Option<i64>,
65654 signature: &'a str,
65655 timestamp: i64,
65656 type_: i64,
65657 ) -> Result<
65658 ResponseValue<types::SubAccountMarginTransferResponse>,
65659 Error<types::Error>,
65660 > {
65661 let url = format!("{}/sapi/v1/sub-account/margin/transfer", self.baseurl,);
65662 let mut query = Vec::with_capacity(7usize);
65663 query.push(("amount", amount.to_string()));
65664 query.push(("asset", asset.to_string()));
65665 query.push(("email", email.to_string()));
65666 if let Some(v) = &recv_window {
65667 query.push(("recvWindow", v.to_string()));
65668 }
65669 query.push(("signature", signature.to_string()));
65670 query.push(("timestamp", timestamp.to_string()));
65671 query.push(("type", type_.to_string()));
65672 #[allow(unused_mut)]
65673 let mut request = self
65674 .client
65675 .post(url)
65676 .header(
65677 reqwest::header::ACCEPT,
65678 reqwest::header::HeaderValue::from_static("application/json"),
65679 )
65680 .query(&query)
65681 .build()?;
65682 (crate::pre_hook)(&self.inner, &request);
65683 let result = self.client.execute(request).await;
65684 (crate::post_hook)(&self.inner, &result);
65685 let response = result?;
65686 match response.status().as_u16() {
65687 200u16 => ResponseValue::from_response(response).await,
65688 400u16 => {
65689 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65690 }
65691 401u16 => {
65692 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65693 }
65694 _ => Err(Error::UnexpectedResponse(response)),
65695 }
65696 }
65697 /**Transfer to Sub-account of Same Master (For Sub-account)
65698
65699Weight(IP): 1
65700
65701Sends a `POST` request to `/sapi/v1/sub-account/transfer/subToSub`
65702
65703Arguments:
65704- `amount`
65705- `asset`
65706- `recv_window`: The value cannot be greater than 60000
65707- `signature`: Signature
65708- `timestamp`: UTC timestamp in ms
65709- `to_email`: Recipient email
65710*/
65711 pub async fn sub_account_transfer_sub_to_sub<'a>(
65712 &'a self,
65713 amount: f64,
65714 asset: &'a str,
65715 recv_window: Option<i64>,
65716 signature: &'a str,
65717 timestamp: i64,
65718 to_email: &'a str,
65719 ) -> Result<
65720 ResponseValue<types::SubAccountTransferSubToSubResponse>,
65721 Error<types::Error>,
65722 > {
65723 let url = format!("{}/sapi/v1/sub-account/transfer/subToSub", self.baseurl,);
65724 let mut query = Vec::with_capacity(6usize);
65725 query.push(("amount", amount.to_string()));
65726 query.push(("asset", asset.to_string()));
65727 if let Some(v) = &recv_window {
65728 query.push(("recvWindow", v.to_string()));
65729 }
65730 query.push(("signature", signature.to_string()));
65731 query.push(("timestamp", timestamp.to_string()));
65732 query.push(("toEmail", to_email.to_string()));
65733 #[allow(unused_mut)]
65734 let mut request = self
65735 .client
65736 .post(url)
65737 .header(
65738 reqwest::header::ACCEPT,
65739 reqwest::header::HeaderValue::from_static("application/json"),
65740 )
65741 .query(&query)
65742 .build()?;
65743 (crate::pre_hook)(&self.inner, &request);
65744 let result = self.client.execute(request).await;
65745 (crate::post_hook)(&self.inner, &result);
65746 let response = result?;
65747 match response.status().as_u16() {
65748 200u16 => ResponseValue::from_response(response).await,
65749 400u16 => {
65750 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65751 }
65752 401u16 => {
65753 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65754 }
65755 _ => Err(Error::UnexpectedResponse(response)),
65756 }
65757 }
65758 /**Transfer to Master (For Sub-account)
65759
65760Weight(IP): 1
65761
65762Sends a `POST` request to `/sapi/v1/sub-account/transfer/subToMaster`
65763
65764Arguments:
65765- `amount`
65766- `asset`
65767- `recv_window`: The value cannot be greater than 60000
65768- `signature`: Signature
65769- `timestamp`: UTC timestamp in ms
65770*/
65771 pub async fn sub_account_transfer_sub_to_master<'a>(
65772 &'a self,
65773 amount: f64,
65774 asset: &'a str,
65775 recv_window: Option<i64>,
65776 signature: &'a str,
65777 timestamp: i64,
65778 ) -> Result<
65779 ResponseValue<types::SubAccountTransferSubToMasterResponse>,
65780 Error<types::Error>,
65781 > {
65782 let url = format!("{}/sapi/v1/sub-account/transfer/subToMaster", self.baseurl,);
65783 let mut query = Vec::with_capacity(5usize);
65784 query.push(("amount", amount.to_string()));
65785 query.push(("asset", asset.to_string()));
65786 if let Some(v) = &recv_window {
65787 query.push(("recvWindow", v.to_string()));
65788 }
65789 query.push(("signature", signature.to_string()));
65790 query.push(("timestamp", timestamp.to_string()));
65791 #[allow(unused_mut)]
65792 let mut request = self
65793 .client
65794 .post(url)
65795 .header(
65796 reqwest::header::ACCEPT,
65797 reqwest::header::HeaderValue::from_static("application/json"),
65798 )
65799 .query(&query)
65800 .build()?;
65801 (crate::pre_hook)(&self.inner, &request);
65802 let result = self.client.execute(request).await;
65803 (crate::post_hook)(&self.inner, &result);
65804 let response = result?;
65805 match response.status().as_u16() {
65806 200u16 => ResponseValue::from_response(response).await,
65807 400u16 => {
65808 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65809 }
65810 401u16 => {
65811 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65812 }
65813 _ => Err(Error::UnexpectedResponse(response)),
65814 }
65815 }
65816 /**Sub-account Transfer History (For Sub-account)
65817
65818- If `type` is not sent, the records of type 2: transfer out will be returned by default.
65819- If `startTime` and `endTime` are not sent, the recent 30-day data will be returned.
65820
65821Weight(IP): 1
65822
65823Sends a `GET` request to `/sapi/v1/sub-account/transfer/subUserHistory`
65824
65825Arguments:
65826- `asset`
65827- `end_time`: UTC timestamp in ms
65828- `limit`: Default 500; max 1000.
65829- `recv_window`: The value cannot be greater than 60000
65830- `signature`: Signature
65831- `start_time`: UTC timestamp in ms
65832- `timestamp`: UTC timestamp in ms
65833- `type_`: * `1` - transfer in
65834* `2` - transfer out
65835*/
65836 pub async fn sub_account_transfer_sub_user_history<'a>(
65837 &'a self,
65838 asset: Option<&'a str>,
65839 end_time: Option<i64>,
65840 limit: Option<i32>,
65841 recv_window: Option<i64>,
65842 signature: &'a str,
65843 start_time: Option<i64>,
65844 timestamp: i64,
65845 type_: Option<i32>,
65846 ) -> Result<
65847 ResponseValue<Vec<types::SubAccountTransferSubUserHistoryResponseItem>>,
65848 Error<types::Error>,
65849 > {
65850 let url = format!(
65851 "{}/sapi/v1/sub-account/transfer/subUserHistory", self.baseurl,
65852 );
65853 let mut query = Vec::with_capacity(8usize);
65854 if let Some(v) = &asset {
65855 query.push(("asset", v.to_string()));
65856 }
65857 if let Some(v) = &end_time {
65858 query.push(("endTime", v.to_string()));
65859 }
65860 if let Some(v) = &limit {
65861 query.push(("limit", v.to_string()));
65862 }
65863 if let Some(v) = &recv_window {
65864 query.push(("recvWindow", v.to_string()));
65865 }
65866 query.push(("signature", signature.to_string()));
65867 if let Some(v) = &start_time {
65868 query.push(("startTime", v.to_string()));
65869 }
65870 query.push(("timestamp", timestamp.to_string()));
65871 if let Some(v) = &type_ {
65872 query.push(("type", v.to_string()));
65873 }
65874 #[allow(unused_mut)]
65875 let mut request = self
65876 .client
65877 .get(url)
65878 .header(
65879 reqwest::header::ACCEPT,
65880 reqwest::header::HeaderValue::from_static("application/json"),
65881 )
65882 .query(&query)
65883 .build()?;
65884 (crate::pre_hook)(&self.inner, &request);
65885 let result = self.client.execute(request).await;
65886 (crate::post_hook)(&self.inner, &result);
65887 let response = result?;
65888 match response.status().as_u16() {
65889 200u16 => ResponseValue::from_response(response).await,
65890 400u16 => {
65891 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65892 }
65893 401u16 => {
65894 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65895 }
65896 _ => Err(Error::UnexpectedResponse(response)),
65897 }
65898 }
65899 /**Universal Transfer History (For Master Account)
65900
65901- `fromEmail` and `toEmail` cannot be sent at the same time.
65902- Return `fromEmail` equal master account email by default.
65903- The query time period must be less then 30 days.
65904- If startTime and endTime not sent, return records of the last 30 days by default.
65905
65906Weight(IP): 1
65907
65908Sends a `GET` request to `/sapi/v1/sub-account/universalTransfer`
65909
65910Arguments:
65911- `client_tran_id`
65912- `end_time`: UTC timestamp in ms
65913- `from_email`: Sub-account email
65914- `limit`: Default 500, Max 500
65915- `page`: Default 1
65916- `recv_window`: The value cannot be greater than 60000
65917- `signature`: Signature
65918- `start_time`: UTC timestamp in ms
65919- `timestamp`: UTC timestamp in ms
65920- `to_email`: Sub-account email
65921*/
65922 pub async fn sub_account_universal_transfer<'a>(
65923 &'a self,
65924 client_tran_id: Option<&'a str>,
65925 end_time: Option<i64>,
65926 from_email: Option<&'a str>,
65927 limit: Option<i32>,
65928 page: Option<i32>,
65929 recv_window: Option<i64>,
65930 signature: &'a str,
65931 start_time: Option<i64>,
65932 timestamp: i64,
65933 to_email: Option<&'a str>,
65934 ) -> Result<
65935 ResponseValue<Vec<types::SubAccountUniversalTransferResponseItem>>,
65936 Error<types::Error>,
65937 > {
65938 let url = format!("{}/sapi/v1/sub-account/universalTransfer", self.baseurl,);
65939 let mut query = Vec::with_capacity(10usize);
65940 if let Some(v) = &client_tran_id {
65941 query.push(("clientTranId", v.to_string()));
65942 }
65943 if let Some(v) = &end_time {
65944 query.push(("endTime", v.to_string()));
65945 }
65946 if let Some(v) = &from_email {
65947 query.push(("fromEmail", v.to_string()));
65948 }
65949 if let Some(v) = &limit {
65950 query.push(("limit", v.to_string()));
65951 }
65952 if let Some(v) = &page {
65953 query.push(("page", v.to_string()));
65954 }
65955 if let Some(v) = &recv_window {
65956 query.push(("recvWindow", v.to_string()));
65957 }
65958 query.push(("signature", signature.to_string()));
65959 if let Some(v) = &start_time {
65960 query.push(("startTime", v.to_string()));
65961 }
65962 query.push(("timestamp", timestamp.to_string()));
65963 if let Some(v) = &to_email {
65964 query.push(("toEmail", v.to_string()));
65965 }
65966 #[allow(unused_mut)]
65967 let mut request = self
65968 .client
65969 .get(url)
65970 .header(
65971 reqwest::header::ACCEPT,
65972 reqwest::header::HeaderValue::from_static("application/json"),
65973 )
65974 .query(&query)
65975 .build()?;
65976 (crate::pre_hook)(&self.inner, &request);
65977 let result = self.client.execute(request).await;
65978 (crate::post_hook)(&self.inner, &result);
65979 let response = result?;
65980 match response.status().as_u16() {
65981 200u16 => ResponseValue::from_response(response).await,
65982 400u16 => {
65983 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65984 }
65985 401u16 => {
65986 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
65987 }
65988 _ => Err(Error::UnexpectedResponse(response)),
65989 }
65990 }
65991 /**Universal Transfer (For Master Account)
65992
65993- You need to enable "internal transfer" option for the api key which requests this endpoint.
65994- Transfer from master account by default if fromEmail is not sent.
65995- Transfer to master account by default if toEmail is not sent.
65996- Supported transfer scenarios:
65997 - Master account SPOT transfer to sub-account SPOT,USDT_FUTURE,COIN_FUTURE,MARGIN(Cross),ISOLATED_MARGIN
65998 - Sub-account SPOT,USDT_FUTURE,COIN_FUTURE,MARGIN(Cross),ISOLATED_MARGIN transfer to master account SPOT
65999 - Transfer between two sub-account SPOT accounts
66000
66001Weight(IP): 1
66002
66003Sends a `POST` request to `/sapi/v1/sub-account/universalTransfer`
66004
66005Arguments:
66006- `amount`
66007- `asset`
66008- `client_tran_id`
66009- `from_account_type`
66010- `from_email`: Sub-account email
66011- `recv_window`: The value cannot be greater than 60000
66012- `signature`: Signature
66013- `symbol`: Only supported under ISOLATED_MARGIN type
66014- `timestamp`: UTC timestamp in ms
66015- `to_account_type`
66016- `to_email`: Sub-account email
66017*/
66018 pub async fn universal_transfer_master_account<'a>(
66019 &'a self,
66020 amount: f64,
66021 asset: &'a str,
66022 client_tran_id: Option<&'a str>,
66023 from_account_type: types::UniversalTransferMasterAccountFromAccountType,
66024 from_email: Option<&'a str>,
66025 recv_window: Option<i64>,
66026 signature: &'a str,
66027 symbol: Option<&'a str>,
66028 timestamp: i64,
66029 to_account_type: types::UniversalTransferMasterAccountToAccountType,
66030 to_email: Option<&'a str>,
66031 ) -> Result<
66032 ResponseValue<types::UniversalTransferMasterAccountResponse>,
66033 Error<types::Error>,
66034 > {
66035 let url = format!("{}/sapi/v1/sub-account/universalTransfer", self.baseurl,);
66036 let mut query = Vec::with_capacity(11usize);
66037 query.push(("amount", amount.to_string()));
66038 query.push(("asset", asset.to_string()));
66039 if let Some(v) = &client_tran_id {
66040 query.push(("clientTranId", v.to_string()));
66041 }
66042 query.push(("fromAccountType", from_account_type.to_string()));
66043 if let Some(v) = &from_email {
66044 query.push(("fromEmail", v.to_string()));
66045 }
66046 if let Some(v) = &recv_window {
66047 query.push(("recvWindow", v.to_string()));
66048 }
66049 query.push(("signature", signature.to_string()));
66050 if let Some(v) = &symbol {
66051 query.push(("symbol", v.to_string()));
66052 }
66053 query.push(("timestamp", timestamp.to_string()));
66054 query.push(("toAccountType", to_account_type.to_string()));
66055 if let Some(v) = &to_email {
66056 query.push(("toEmail", v.to_string()));
66057 }
66058 #[allow(unused_mut)]
66059 let mut request = self
66060 .client
66061 .post(url)
66062 .header(
66063 reqwest::header::ACCEPT,
66064 reqwest::header::HeaderValue::from_static("application/json"),
66065 )
66066 .query(&query)
66067 .build()?;
66068 (crate::pre_hook)(&self.inner, &request);
66069 let result = self.client.execute(request).await;
66070 (crate::post_hook)(&self.inner, &result);
66071 let response = result?;
66072 match response.status().as_u16() {
66073 200u16 => ResponseValue::from_response(response).await,
66074 400u16 => {
66075 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66076 }
66077 401u16 => {
66078 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66079 }
66080 _ => Err(Error::UnexpectedResponse(response)),
66081 }
66082 }
66083 /**Detail on Sub-account's Futures Account V2 (For Master Account)
66084
66085Weight(IP): 1
66086
66087Sends a `GET` request to `/sapi/v2/sub-account/futures/account`
66088
66089Arguments:
66090- `email`: Sub-account email
66091- `futures_type`: * `1` - USDT Margined Futures
66092* `2` - COIN Margined Futures
66093- `recv_window`: The value cannot be greater than 60000
66094- `signature`: Signature
66095- `timestamp`: UTC timestamp in ms
66096*/
66097 pub async fn query_sub_account_futures_account_v2<'a>(
66098 &'a self,
66099 email: &'a str,
66100 futures_type: i32,
66101 recv_window: Option<i64>,
66102 signature: &'a str,
66103 timestamp: i64,
66104 ) -> Result<
66105 ResponseValue<types::QuerySubAccountFuturesAccountV2Response>,
66106 Error<types::Error>,
66107 > {
66108 let url = format!("{}/sapi/v2/sub-account/futures/account", self.baseurl,);
66109 let mut query = Vec::with_capacity(5usize);
66110 query.push(("email", email.to_string()));
66111 query.push(("futuresType", futures_type.to_string()));
66112 if let Some(v) = &recv_window {
66113 query.push(("recvWindow", v.to_string()));
66114 }
66115 query.push(("signature", signature.to_string()));
66116 query.push(("timestamp", timestamp.to_string()));
66117 #[allow(unused_mut)]
66118 let mut request = self
66119 .client
66120 .get(url)
66121 .header(
66122 reqwest::header::ACCEPT,
66123 reqwest::header::HeaderValue::from_static("application/json"),
66124 )
66125 .query(&query)
66126 .build()?;
66127 (crate::pre_hook)(&self.inner, &request);
66128 let result = self.client.execute(request).await;
66129 (crate::post_hook)(&self.inner, &result);
66130 let response = result?;
66131 match response.status().as_u16() {
66132 200u16 => ResponseValue::from_response(response).await,
66133 400u16 => {
66134 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66135 }
66136 401u16 => {
66137 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66138 }
66139 _ => Err(Error::UnexpectedResponse(response)),
66140 }
66141 }
66142 /**Summary of Sub-account's Futures Account V2 (For Master Account)
66143
66144Weight(IP): 10
66145
66146Sends a `GET` request to `/sapi/v2/sub-account/futures/accountSummary`
66147
66148Arguments:
66149- `futures_type`: * `1` - USDT Margined Futures
66150* `2` - COIN Margined Futures
66151- `limit`: Default 10, Max 20
66152- `page`: Default 1
66153- `recv_window`: The value cannot be greater than 60000
66154- `signature`: Signature
66155- `timestamp`: UTC timestamp in ms
66156*/
66157 pub async fn query_sub_account_futures_account_summary<'a>(
66158 &'a self,
66159 futures_type: i32,
66160 limit: Option<i32>,
66161 page: Option<i32>,
66162 recv_window: Option<i64>,
66163 signature: &'a str,
66164 timestamp: i64,
66165 ) -> Result<
66166 ResponseValue<types::QuerySubAccountFuturesAccountSummaryResponse>,
66167 Error<types::Error>,
66168 > {
66169 let url = format!(
66170 "{}/sapi/v2/sub-account/futures/accountSummary", self.baseurl,
66171 );
66172 let mut query = Vec::with_capacity(6usize);
66173 query.push(("futuresType", futures_type.to_string()));
66174 if let Some(v) = &limit {
66175 query.push(("limit", v.to_string()));
66176 }
66177 if let Some(v) = &page {
66178 query.push(("page", v.to_string()));
66179 }
66180 if let Some(v) = &recv_window {
66181 query.push(("recvWindow", v.to_string()));
66182 }
66183 query.push(("signature", signature.to_string()));
66184 query.push(("timestamp", timestamp.to_string()));
66185 #[allow(unused_mut)]
66186 let mut request = self
66187 .client
66188 .get(url)
66189 .header(
66190 reqwest::header::ACCEPT,
66191 reqwest::header::HeaderValue::from_static("application/json"),
66192 )
66193 .query(&query)
66194 .build()?;
66195 (crate::pre_hook)(&self.inner, &request);
66196 let result = self.client.execute(request).await;
66197 (crate::post_hook)(&self.inner, &result);
66198 let response = result?;
66199 match response.status().as_u16() {
66200 200u16 => ResponseValue::from_response(response).await,
66201 400u16 => {
66202 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66203 }
66204 401u16 => {
66205 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66206 }
66207 _ => Err(Error::UnexpectedResponse(response)),
66208 }
66209 }
66210 /**Futures Position-Risk of Sub-account V2 (For Master Account)
66211
66212Weight(IP): 1
66213
66214Sends a `GET` request to `/sapi/v2/sub-account/futures/positionRisk`
66215
66216Arguments:
66217- `email`: Sub-account email
66218- `futures_type`: * `1` - USDT Margined Futures
66219* `2` - COIN Margined Futures
66220- `recv_window`: The value cannot be greater than 60000
66221- `signature`: Signature
66222- `timestamp`: UTC timestamp in ms
66223*/
66224 pub async fn query_sub_account_futures_position_risk<'a>(
66225 &'a self,
66226 email: &'a str,
66227 futures_type: i32,
66228 recv_window: Option<i64>,
66229 signature: &'a str,
66230 timestamp: i64,
66231 ) -> Result<
66232 ResponseValue<types::QuerySubAccountFuturesPositionRiskResponse>,
66233 Error<types::Error>,
66234 > {
66235 let url = format!("{}/sapi/v2/sub-account/futures/positionRisk", self.baseurl,);
66236 let mut query = Vec::with_capacity(5usize);
66237 query.push(("email", email.to_string()));
66238 query.push(("futuresType", futures_type.to_string()));
66239 if let Some(v) = &recv_window {
66240 query.push(("recvWindow", v.to_string()));
66241 }
66242 query.push(("signature", signature.to_string()));
66243 query.push(("timestamp", timestamp.to_string()));
66244 #[allow(unused_mut)]
66245 let mut request = self
66246 .client
66247 .get(url)
66248 .header(
66249 reqwest::header::ACCEPT,
66250 reqwest::header::HeaderValue::from_static("application/json"),
66251 )
66252 .query(&query)
66253 .build()?;
66254 (crate::pre_hook)(&self.inner, &request);
66255 let result = self.client.execute(request).await;
66256 (crate::post_hook)(&self.inner, &result);
66257 let response = result?;
66258 match response.status().as_u16() {
66259 200u16 => ResponseValue::from_response(response).await,
66260 400u16 => {
66261 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66262 }
66263 401u16 => {
66264 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66265 }
66266 _ => Err(Error::UnexpectedResponse(response)),
66267 }
66268 }
66269 /**Enable Leverage Token for Sub-account (For Master Account)
66270
66271Weight(IP): 1
66272
66273Sends a `POST` request to `/sapi/v1/sub-account/blvt/enable`
66274
66275Arguments:
66276- `email`: Sub-account email
66277- `enable_blvt`: Only true for now
66278- `recv_window`: The value cannot be greater than 60000
66279- `signature`: Signature
66280- `timestamp`: UTC timestamp in ms
66281*/
66282 pub async fn sub_account_blvt_enable<'a>(
66283 &'a self,
66284 email: &'a str,
66285 enable_blvt: bool,
66286 recv_window: Option<i64>,
66287 signature: &'a str,
66288 timestamp: i64,
66289 ) -> Result<
66290 ResponseValue<types::SubAccountBlvtEnableResponse>,
66291 Error<types::Error>,
66292 > {
66293 let url = format!("{}/sapi/v1/sub-account/blvt/enable", self.baseurl,);
66294 let mut query = Vec::with_capacity(5usize);
66295 query.push(("email", email.to_string()));
66296 query.push(("enableBlvt", enable_blvt.to_string()));
66297 if let Some(v) = &recv_window {
66298 query.push(("recvWindow", v.to_string()));
66299 }
66300 query.push(("signature", signature.to_string()));
66301 query.push(("timestamp", timestamp.to_string()));
66302 #[allow(unused_mut)]
66303 let mut request = self
66304 .client
66305 .post(url)
66306 .header(
66307 reqwest::header::ACCEPT,
66308 reqwest::header::HeaderValue::from_static("application/json"),
66309 )
66310 .query(&query)
66311 .build()?;
66312 (crate::pre_hook)(&self.inner, &request);
66313 let result = self.client.execute(request).await;
66314 (crate::post_hook)(&self.inner, &result);
66315 let response = result?;
66316 match response.status().as_u16() {
66317 200u16 => ResponseValue::from_response(response).await,
66318 400u16 => {
66319 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66320 }
66321 401u16 => {
66322 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66323 }
66324 _ => Err(Error::UnexpectedResponse(response)),
66325 }
66326 }
66327 /**Deposit assets into the managed sub-account(For Investor Master Account)
66328
66329Weight(IP): 1
66330
66331Sends a `POST` request to `/sapi/v1/managed-subaccount/deposit`
66332
66333Arguments:
66334- `amount`
66335- `asset`
66336- `recv_window`: The value cannot be greater than 60000
66337- `signature`: Signature
66338- `timestamp`: UTC timestamp in ms
66339- `to_email`: Recipient email
66340*/
66341 pub async fn managed_subaccount_deposit<'a>(
66342 &'a self,
66343 amount: f64,
66344 asset: &'a str,
66345 recv_window: Option<i64>,
66346 signature: &'a str,
66347 timestamp: i64,
66348 to_email: &'a str,
66349 ) -> Result<
66350 ResponseValue<types::ManagedSubaccountDepositResponse>,
66351 Error<types::Error>,
66352 > {
66353 let url = format!("{}/sapi/v1/managed-subaccount/deposit", self.baseurl,);
66354 let mut query = Vec::with_capacity(6usize);
66355 query.push(("amount", amount.to_string()));
66356 query.push(("asset", asset.to_string()));
66357 if let Some(v) = &recv_window {
66358 query.push(("recvWindow", v.to_string()));
66359 }
66360 query.push(("signature", signature.to_string()));
66361 query.push(("timestamp", timestamp.to_string()));
66362 query.push(("toEmail", to_email.to_string()));
66363 #[allow(unused_mut)]
66364 let mut request = self
66365 .client
66366 .post(url)
66367 .header(
66368 reqwest::header::ACCEPT,
66369 reqwest::header::HeaderValue::from_static("application/json"),
66370 )
66371 .query(&query)
66372 .build()?;
66373 (crate::pre_hook)(&self.inner, &request);
66374 let result = self.client.execute(request).await;
66375 (crate::post_hook)(&self.inner, &result);
66376 let response = result?;
66377 match response.status().as_u16() {
66378 200u16 => ResponseValue::from_response(response).await,
66379 400u16 => {
66380 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66381 }
66382 401u16 => {
66383 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66384 }
66385 _ => Err(Error::UnexpectedResponse(response)),
66386 }
66387 }
66388 /**Managed sub-account asset details(For Investor Master Account)
66389
66390Weight(IP): 1
66391
66392Sends a `GET` request to `/sapi/v1/managed-subaccount/asset`
66393
66394Arguments:
66395- `email`: Sub-account email
66396- `recv_window`: The value cannot be greater than 60000
66397- `signature`: Signature
66398- `timestamp`: UTC timestamp in ms
66399*/
66400 pub async fn managed_subaccount_asset<'a>(
66401 &'a self,
66402 email: &'a str,
66403 recv_window: Option<i64>,
66404 signature: &'a str,
66405 timestamp: i64,
66406 ) -> Result<
66407 ResponseValue<Vec<types::ManagedSubaccountAssetResponseItem>>,
66408 Error<types::Error>,
66409 > {
66410 let url = format!("{}/sapi/v1/managed-subaccount/asset", self.baseurl,);
66411 let mut query = Vec::with_capacity(4usize);
66412 query.push(("email", email.to_string()));
66413 if let Some(v) = &recv_window {
66414 query.push(("recvWindow", v.to_string()));
66415 }
66416 query.push(("signature", signature.to_string()));
66417 query.push(("timestamp", timestamp.to_string()));
66418 #[allow(unused_mut)]
66419 let mut request = self
66420 .client
66421 .get(url)
66422 .header(
66423 reqwest::header::ACCEPT,
66424 reqwest::header::HeaderValue::from_static("application/json"),
66425 )
66426 .query(&query)
66427 .build()?;
66428 (crate::pre_hook)(&self.inner, &request);
66429 let result = self.client.execute(request).await;
66430 (crate::post_hook)(&self.inner, &result);
66431 let response = result?;
66432 match response.status().as_u16() {
66433 200u16 => ResponseValue::from_response(response).await,
66434 400u16 => {
66435 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66436 }
66437 401u16 => {
66438 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66439 }
66440 _ => Err(Error::UnexpectedResponse(response)),
66441 }
66442 }
66443 /**Withdrawl assets from the managed sub-account(For Investor Master Account)
66444
66445Weight(IP): 1
66446
66447Sends a `POST` request to `/sapi/v1/managed-subaccount/withdraw`
66448
66449Arguments:
66450- `amount`
66451- `asset`
66452- `from_email`: Sender email
66453- `recv_window`: The value cannot be greater than 60000
66454- `signature`: Signature
66455- `timestamp`: UTC timestamp in ms
66456- `transfer_date`: Withdrawals is automatically occur on the transfer date(UTC0). If a date is not selected, the withdrawal occurs right now
66457*/
66458 pub async fn managed_subaccount_withdraw<'a>(
66459 &'a self,
66460 amount: f64,
66461 asset: &'a str,
66462 from_email: &'a str,
66463 recv_window: Option<i64>,
66464 signature: &'a str,
66465 timestamp: i64,
66466 transfer_date: Option<i64>,
66467 ) -> Result<
66468 ResponseValue<types::ManagedSubaccountWithdrawResponse>,
66469 Error<types::Error>,
66470 > {
66471 let url = format!("{}/sapi/v1/managed-subaccount/withdraw", self.baseurl,);
66472 let mut query = Vec::with_capacity(7usize);
66473 query.push(("amount", amount.to_string()));
66474 query.push(("asset", asset.to_string()));
66475 query.push(("fromEmail", from_email.to_string()));
66476 if let Some(v) = &recv_window {
66477 query.push(("recvWindow", v.to_string()));
66478 }
66479 query.push(("signature", signature.to_string()));
66480 query.push(("timestamp", timestamp.to_string()));
66481 if let Some(v) = &transfer_date {
66482 query.push(("transferDate", v.to_string()));
66483 }
66484 #[allow(unused_mut)]
66485 let mut request = self
66486 .client
66487 .post(url)
66488 .header(
66489 reqwest::header::ACCEPT,
66490 reqwest::header::HeaderValue::from_static("application/json"),
66491 )
66492 .query(&query)
66493 .build()?;
66494 (crate::pre_hook)(&self.inner, &request);
66495 let result = self.client.execute(request).await;
66496 (crate::post_hook)(&self.inner, &result);
66497 let response = result?;
66498 match response.status().as_u16() {
66499 200u16 => ResponseValue::from_response(response).await,
66500 400u16 => {
66501 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66502 }
66503 401u16 => {
66504 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66505 }
66506 _ => Err(Error::UnexpectedResponse(response)),
66507 }
66508 }
66509 /**Managed sub-account snapshot (For Investor Master Account)
66510
66511- The query time period must be less then 30 days
66512- Support query within the last one month only
66513- If `startTime` and `endTime` not sent, return records of the last 7 days by default
66514
66515Weight(IP): 2400
66516
66517Sends a `GET` request to `/sapi/v1/managed-subaccount/accountSnapshot`
66518
66519Arguments:
66520- `email`: Sub-account email
66521- `end_time`: UTC timestamp in ms
66522- `limit`: min 7, max 30, default 7
66523- `recv_window`: The value cannot be greater than 60000
66524- `signature`: Signature
66525- `start_time`: UTC timestamp in ms
66526- `timestamp`: UTC timestamp in ms
66527- `type_`: "SPOT", "MARGIN"(cross), "FUTURES"(UM)
66528*/
66529 pub async fn managed_subaccount_account_snapshot<'a>(
66530 &'a self,
66531 email: &'a str,
66532 end_time: Option<i64>,
66533 limit: Option<i32>,
66534 recv_window: Option<i64>,
66535 signature: &'a str,
66536 start_time: Option<i64>,
66537 timestamp: i64,
66538 type_: &'a str,
66539 ) -> Result<
66540 ResponseValue<types::ManagedSubaccountAccountSnapshotResponse>,
66541 Error<types::Error>,
66542 > {
66543 let url = format!(
66544 "{}/sapi/v1/managed-subaccount/accountSnapshot", self.baseurl,
66545 );
66546 let mut query = Vec::with_capacity(8usize);
66547 query.push(("email", email.to_string()));
66548 if let Some(v) = &end_time {
66549 query.push(("endTime", v.to_string()));
66550 }
66551 if let Some(v) = &limit {
66552 query.push(("limit", v.to_string()));
66553 }
66554 if let Some(v) = &recv_window {
66555 query.push(("recvWindow", v.to_string()));
66556 }
66557 query.push(("signature", signature.to_string()));
66558 if let Some(v) = &start_time {
66559 query.push(("startTime", v.to_string()));
66560 }
66561 query.push(("timestamp", timestamp.to_string()));
66562 query.push(("type", type_.to_string()));
66563 #[allow(unused_mut)]
66564 let mut request = self
66565 .client
66566 .get(url)
66567 .header(
66568 reqwest::header::ACCEPT,
66569 reqwest::header::HeaderValue::from_static("application/json"),
66570 )
66571 .query(&query)
66572 .build()?;
66573 (crate::pre_hook)(&self.inner, &request);
66574 let result = self.client.execute(request).await;
66575 (crate::post_hook)(&self.inner, &result);
66576 let response = result?;
66577 match response.status().as_u16() {
66578 200u16 => ResponseValue::from_response(response).await,
66579 400u16 => {
66580 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66581 }
66582 401u16 => {
66583 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66584 }
66585 _ => Err(Error::UnexpectedResponse(response)),
66586 }
66587 }
66588 /**Query Managed Sub Account Transfer Log (For Investor Master Account)
66589
66590Investor can use this api to query managed sub account transfer log. This endpoint is available for investor of Managed Sub-Account. A Managed Sub-Account is an account type for investors who value flexibility in asset allocation and account application, while delegating trades to a professional trading team.
66591
66592Weight(IP): 1
66593
66594Sends a `GET` request to `/sapi/v1/managed-subaccount/queryTransLogForInvestor`
66595
66596Arguments:
66597- `email`
66598- `end_time`: UTC timestamp in ms
66599- `limit`: Default 500; max 1000.
66600- `page`: Default 1
66601- `recv_window`: The value cannot be greater than 60000
66602- `signature`: Signature
66603- `start_time`: UTC timestamp in ms
66604- `timestamp`: UTC timestamp in ms
66605- `transfer_function_account_type`: Transfer function account type (SPOT/MARGIN/ISOLATED_MARGIN/USDT_FUTURE/COIN_FUTURE)
66606- `transfers`: Transfer Direction (FROM/TO)
66607*/
66608 pub async fn managed_subaccount_query_trans_log_for_investor<'a>(
66609 &'a self,
66610 email: &'a str,
66611 end_time: Option<i64>,
66612 limit: Option<i32>,
66613 page: Option<i32>,
66614 recv_window: Option<i64>,
66615 signature: &'a str,
66616 start_time: Option<i64>,
66617 timestamp: i64,
66618 transfer_function_account_type: Option<&'a str>,
66619 transfers: Option<&'a str>,
66620 ) -> Result<
66621 ResponseValue<types::ManagedSubaccountQueryTransLogForInvestorResponse>,
66622 Error<types::Error>,
66623 > {
66624 let url = format!(
66625 "{}/sapi/v1/managed-subaccount/queryTransLogForInvestor", self.baseurl,
66626 );
66627 let mut query = Vec::with_capacity(10usize);
66628 query.push(("email", email.to_string()));
66629 if let Some(v) = &end_time {
66630 query.push(("endTime", v.to_string()));
66631 }
66632 if let Some(v) = &limit {
66633 query.push(("limit", v.to_string()));
66634 }
66635 if let Some(v) = &page {
66636 query.push(("page", v.to_string()));
66637 }
66638 if let Some(v) = &recv_window {
66639 query.push(("recvWindow", v.to_string()));
66640 }
66641 query.push(("signature", signature.to_string()));
66642 if let Some(v) = &start_time {
66643 query.push(("startTime", v.to_string()));
66644 }
66645 query.push(("timestamp", timestamp.to_string()));
66646 if let Some(v) = &transfer_function_account_type {
66647 query.push(("transferFunctionAccountType", v.to_string()));
66648 }
66649 if let Some(v) = &transfers {
66650 query.push(("transfers", v.to_string()));
66651 }
66652 #[allow(unused_mut)]
66653 let mut request = self
66654 .client
66655 .get(url)
66656 .header(
66657 reqwest::header::ACCEPT,
66658 reqwest::header::HeaderValue::from_static("application/json"),
66659 )
66660 .query(&query)
66661 .build()?;
66662 (crate::pre_hook)(&self.inner, &request);
66663 let result = self.client.execute(request).await;
66664 (crate::post_hook)(&self.inner, &result);
66665 let response = result?;
66666 match response.status().as_u16() {
66667 200u16 => ResponseValue::from_response(response).await,
66668 400u16 => {
66669 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66670 }
66671 401u16 => {
66672 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66673 }
66674 _ => Err(Error::UnexpectedResponse(response)),
66675 }
66676 }
66677 /**Query Managed Sub Account Transfer Log (For Trading Team Master Account)
66678
66679Trading team can use this api to query managed sub account transfer log. This endpoint is available for trading team of Managed Sub-Account. A Managed Sub-Account is an account type for investors who value flexibility in asset allocation and account application, while delegating trades to a professional trading team
66680
66681Weight(IP): 60
66682
66683Sends a `GET` request to `/sapi/v1/managed-subaccount/queryTransLogForTradeParent`
66684
66685Arguments:
66686- `email`
66687- `end_time`: UTC timestamp in ms
66688- `limit`: Default 500; max 1000.
66689- `page`: Default 1
66690- `recv_window`: The value cannot be greater than 60000
66691- `signature`: Signature
66692- `start_time`: UTC timestamp in ms
66693- `timestamp`: UTC timestamp in ms
66694- `transfer_function_account_type`: Transfer function account type (SPOT/MARGIN/ISOLATED_MARGIN/USDT_FUTURE/COIN_FUTURE)
66695- `transfers`: Transfer Direction (FROM/TO)
66696*/
66697 pub async fn managed_subaccount_query_trans_log_for_trade_parent<'a>(
66698 &'a self,
66699 email: &'a str,
66700 end_time: Option<i64>,
66701 limit: Option<i32>,
66702 page: Option<i32>,
66703 recv_window: Option<i64>,
66704 signature: &'a str,
66705 start_time: Option<i64>,
66706 timestamp: i64,
66707 transfer_function_account_type: Option<&'a str>,
66708 transfers: Option<&'a str>,
66709 ) -> Result<
66710 ResponseValue<types::ManagedSubaccountQueryTransLogForTradeParentResponse>,
66711 Error<types::Error>,
66712 > {
66713 let url = format!(
66714 "{}/sapi/v1/managed-subaccount/queryTransLogForTradeParent", self.baseurl,
66715 );
66716 let mut query = Vec::with_capacity(10usize);
66717 query.push(("email", email.to_string()));
66718 if let Some(v) = &end_time {
66719 query.push(("endTime", v.to_string()));
66720 }
66721 if let Some(v) = &limit {
66722 query.push(("limit", v.to_string()));
66723 }
66724 if let Some(v) = &page {
66725 query.push(("page", v.to_string()));
66726 }
66727 if let Some(v) = &recv_window {
66728 query.push(("recvWindow", v.to_string()));
66729 }
66730 query.push(("signature", signature.to_string()));
66731 if let Some(v) = &start_time {
66732 query.push(("startTime", v.to_string()));
66733 }
66734 query.push(("timestamp", timestamp.to_string()));
66735 if let Some(v) = &transfer_function_account_type {
66736 query.push(("transferFunctionAccountType", v.to_string()));
66737 }
66738 if let Some(v) = &transfers {
66739 query.push(("transfers", v.to_string()));
66740 }
66741 #[allow(unused_mut)]
66742 let mut request = self
66743 .client
66744 .get(url)
66745 .header(
66746 reqwest::header::ACCEPT,
66747 reqwest::header::HeaderValue::from_static("application/json"),
66748 )
66749 .query(&query)
66750 .build()?;
66751 (crate::pre_hook)(&self.inner, &request);
66752 let result = self.client.execute(request).await;
66753 (crate::post_hook)(&self.inner, &result);
66754 let response = result?;
66755 match response.status().as_u16() {
66756 200u16 => ResponseValue::from_response(response).await,
66757 400u16 => {
66758 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66759 }
66760 401u16 => {
66761 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66762 }
66763 _ => Err(Error::UnexpectedResponse(response)),
66764 }
66765 }
66766 /**Query Managed Sub-account Futures Asset Details (For Investor Master Account)
66767
66768Investor can use this api to query managed sub account futures asset details
66769
66770Sends a `GET` request to `/sapi/v1/managed-subaccount/fetch-future-asset`
66771
66772Arguments:
66773- `email`
66774- `recv_window`: The value cannot be greater than 60000
66775- `signature`: Signature
66776- `timestamp`: UTC timestamp in ms
66777*/
66778 pub async fn managed_subaccount_fetch_future_asset<'a>(
66779 &'a self,
66780 email: &'a str,
66781 recv_window: Option<i64>,
66782 signature: &'a str,
66783 timestamp: i64,
66784 ) -> Result<
66785 ResponseValue<types::ManagedSubaccountFetchFutureAssetResponse>,
66786 Error<types::Error>,
66787 > {
66788 let url = format!(
66789 "{}/sapi/v1/managed-subaccount/fetch-future-asset", self.baseurl,
66790 );
66791 let mut query = Vec::with_capacity(4usize);
66792 query.push(("email", email.to_string()));
66793 if let Some(v) = &recv_window {
66794 query.push(("recvWindow", v.to_string()));
66795 }
66796 query.push(("signature", signature.to_string()));
66797 query.push(("timestamp", timestamp.to_string()));
66798 #[allow(unused_mut)]
66799 let mut request = self
66800 .client
66801 .get(url)
66802 .header(
66803 reqwest::header::ACCEPT,
66804 reqwest::header::HeaderValue::from_static("application/json"),
66805 )
66806 .query(&query)
66807 .build()?;
66808 (crate::pre_hook)(&self.inner, &request);
66809 let result = self.client.execute(request).await;
66810 (crate::post_hook)(&self.inner, &result);
66811 let response = result?;
66812 match response.status().as_u16() {
66813 200u16 => ResponseValue::from_response(response).await,
66814 400u16 => {
66815 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66816 }
66817 401u16 => {
66818 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66819 }
66820 _ => Err(Error::UnexpectedResponse(response)),
66821 }
66822 }
66823 /**Query Managed Sub-account Margin Asset Details (For Investor Master Account)
66824
66825Investor can use this api to query managed sub account margin asset details
66826
66827Sends a `GET` request to `/sapi/v1/managed-subaccount/marginAsset`
66828
66829Arguments:
66830- `email`
66831- `recv_window`: The value cannot be greater than 60000
66832- `signature`: Signature
66833- `timestamp`: UTC timestamp in ms
66834*/
66835 pub async fn managed_subaccount_margin_asset<'a>(
66836 &'a self,
66837 email: &'a str,
66838 recv_window: Option<i64>,
66839 signature: &'a str,
66840 timestamp: i64,
66841 ) -> Result<
66842 ResponseValue<types::ManagedSubaccountMarginAssetResponse>,
66843 Error<types::Error>,
66844 > {
66845 let url = format!("{}/sapi/v1/managed-subaccount/marginAsset", self.baseurl,);
66846 let mut query = Vec::with_capacity(4usize);
66847 query.push(("email", email.to_string()));
66848 if let Some(v) = &recv_window {
66849 query.push(("recvWindow", v.to_string()));
66850 }
66851 query.push(("signature", signature.to_string()));
66852 query.push(("timestamp", timestamp.to_string()));
66853 #[allow(unused_mut)]
66854 let mut request = self
66855 .client
66856 .get(url)
66857 .header(
66858 reqwest::header::ACCEPT,
66859 reqwest::header::HeaderValue::from_static("application/json"),
66860 )
66861 .query(&query)
66862 .build()?;
66863 (crate::pre_hook)(&self.inner, &request);
66864 let result = self.client.execute(request).await;
66865 (crate::post_hook)(&self.inner, &result);
66866 let response = result?;
66867 match response.status().as_u16() {
66868 200u16 => ResponseValue::from_response(response).await,
66869 400u16 => {
66870 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66871 }
66872 401u16 => {
66873 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66874 }
66875 _ => Err(Error::UnexpectedResponse(response)),
66876 }
66877 }
66878 /**Query Managed Sub-account List (For Investor)
66879
66880Get investor's managed sub-account list.
66881
66882Weight(UID): 60
66883
66884Sends a `GET` request to `/sapi/v1/managed-subaccount/info`
66885
66886Arguments:
66887- `email`
66888- `limit`: Default 500; max 1000.
66889- `page`: Default 1
66890- `recv_window`: The value cannot be greater than 60000
66891- `signature`: Signature
66892- `timestamp`: UTC timestamp in ms
66893*/
66894 pub async fn managed_subaccount_info<'a>(
66895 &'a self,
66896 email: &'a str,
66897 limit: Option<i32>,
66898 page: Option<i32>,
66899 recv_window: Option<i64>,
66900 signature: &'a str,
66901 timestamp: i64,
66902 ) -> Result<
66903 ResponseValue<types::ManagedSubaccountInfoResponse>,
66904 Error<types::Error>,
66905 > {
66906 let url = format!("{}/sapi/v1/managed-subaccount/info", self.baseurl,);
66907 let mut query = Vec::with_capacity(6usize);
66908 query.push(("email", email.to_string()));
66909 if let Some(v) = &limit {
66910 query.push(("limit", v.to_string()));
66911 }
66912 if let Some(v) = &page {
66913 query.push(("page", v.to_string()));
66914 }
66915 if let Some(v) = &recv_window {
66916 query.push(("recvWindow", v.to_string()));
66917 }
66918 query.push(("signature", signature.to_string()));
66919 query.push(("timestamp", timestamp.to_string()));
66920 #[allow(unused_mut)]
66921 let mut request = self
66922 .client
66923 .get(url)
66924 .header(
66925 reqwest::header::ACCEPT,
66926 reqwest::header::HeaderValue::from_static("application/json"),
66927 )
66928 .query(&query)
66929 .build()?;
66930 (crate::pre_hook)(&self.inner, &request);
66931 let result = self.client.execute(request).await;
66932 (crate::post_hook)(&self.inner, &result);
66933 let response = result?;
66934 match response.status().as_u16() {
66935 200u16 => ResponseValue::from_response(response).await,
66936 400u16 => {
66937 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66938 }
66939 401u16 => {
66940 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
66941 }
66942 _ => Err(Error::UnexpectedResponse(response)),
66943 }
66944 }
66945 /**Get Managed Sub-account Deposit Address (For Investor Master Account)
66946
66947Get investor's managed sub-account deposit address
66948
66949Weight(UID): 1
66950
66951Sends a `GET` request to `/sapi/v1/managed-subaccount/deposit/address`
66952
66953Arguments:
66954- `coin`: Coin name
66955- `email`
66956- `network`
66957- `recv_window`: The value cannot be greater than 60000
66958- `signature`: Signature
66959- `timestamp`: UTC timestamp in ms
66960*/
66961 pub async fn managed_subaccount_deposit_address<'a>(
66962 &'a self,
66963 coin: &'a str,
66964 email: &'a str,
66965 network: Option<&'a str>,
66966 recv_window: Option<i64>,
66967 signature: &'a str,
66968 timestamp: i64,
66969 ) -> Result<
66970 ResponseValue<types::ManagedSubaccountDepositAddressResponse>,
66971 Error<types::Error>,
66972 > {
66973 let url = format!(
66974 "{}/sapi/v1/managed-subaccount/deposit/address", self.baseurl,
66975 );
66976 let mut query = Vec::with_capacity(6usize);
66977 query.push(("coin", coin.to_string()));
66978 query.push(("email", email.to_string()));
66979 if let Some(v) = &network {
66980 query.push(("network", v.to_string()));
66981 }
66982 if let Some(v) = &recv_window {
66983 query.push(("recvWindow", v.to_string()));
66984 }
66985 query.push(("signature", signature.to_string()));
66986 query.push(("timestamp", timestamp.to_string()));
66987 #[allow(unused_mut)]
66988 let mut request = self
66989 .client
66990 .get(url)
66991 .header(
66992 reqwest::header::ACCEPT,
66993 reqwest::header::HeaderValue::from_static("application/json"),
66994 )
66995 .query(&query)
66996 .build()?;
66997 (crate::pre_hook)(&self.inner, &request);
66998 let result = self.client.execute(request).await;
66999 (crate::post_hook)(&self.inner, &result);
67000 let response = result?;
67001 match response.status().as_u16() {
67002 200u16 => ResponseValue::from_response(response).await,
67003 400u16 => {
67004 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67005 }
67006 401u16 => {
67007 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67008 }
67009 _ => Err(Error::UnexpectedResponse(response)),
67010 }
67011 }
67012 /**Query Managed Sub Account Transfer Log (For Trading Team Sub Account)(USER_DATA)
67013
67014Query Managed Sub Account Transfer Log (For Trading Team Sub Account)
67015
67016Weight(UID): 60
67017
67018Sends a `GET` request to `/sapi/v1/managed-subaccount/query-trans-log`
67019
67020Arguments:
67021- `end_time`: UTC timestamp in ms
67022- `limit`: Default 500; max 1000.
67023- `page`: Default 1
67024- `recv_window`: The value cannot be greater than 60000
67025- `signature`: Signature
67026- `start_time`: UTC timestamp in ms
67027- `timestamp`: UTC timestamp in ms
67028- `transfer_function_account_type`: Transfer function account type
67029- `transfers`: Transfer Direction
67030*/
67031 pub async fn managed_subaccount_query_trans_log<'a>(
67032 &'a self,
67033 end_time: Option<i64>,
67034 limit: Option<i32>,
67035 page: Option<i32>,
67036 recv_window: Option<i64>,
67037 signature: &'a str,
67038 start_time: Option<i64>,
67039 timestamp: i64,
67040 transfer_function_account_type: types::ManagedSubaccountQueryTransLogTransferFunctionAccountType,
67041 transfers: types::ManagedSubaccountQueryTransLogTransfers,
67042 ) -> Result<
67043 ResponseValue<types::ManagedSubaccountQueryTransLogResponse>,
67044 Error<types::Error>,
67045 > {
67046 let url = format!(
67047 "{}/sapi/v1/managed-subaccount/query-trans-log", self.baseurl,
67048 );
67049 let mut query = Vec::with_capacity(9usize);
67050 if let Some(v) = &end_time {
67051 query.push(("endTime", v.to_string()));
67052 }
67053 if let Some(v) = &limit {
67054 query.push(("limit", v.to_string()));
67055 }
67056 if let Some(v) = &page {
67057 query.push(("page", v.to_string()));
67058 }
67059 if let Some(v) = &recv_window {
67060 query.push(("recvWindow", v.to_string()));
67061 }
67062 query.push(("signature", signature.to_string()));
67063 if let Some(v) = &start_time {
67064 query.push(("startTime", v.to_string()));
67065 }
67066 query.push(("timestamp", timestamp.to_string()));
67067 query
67068 .push((
67069 "transferFunctionAccountType",
67070 transfer_function_account_type.to_string(),
67071 ));
67072 query.push(("transfers", transfers.to_string()));
67073 #[allow(unused_mut)]
67074 let mut request = self
67075 .client
67076 .get(url)
67077 .header(
67078 reqwest::header::ACCEPT,
67079 reqwest::header::HeaderValue::from_static("application/json"),
67080 )
67081 .query(&query)
67082 .build()?;
67083 (crate::pre_hook)(&self.inner, &request);
67084 let result = self.client.execute(request).await;
67085 (crate::post_hook)(&self.inner, &result);
67086 let response = result?;
67087 match response.status().as_u16() {
67088 200u16 => ResponseValue::from_response(response).await,
67089 400u16 => {
67090 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67091 }
67092 401u16 => {
67093 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67094 }
67095 _ => Err(Error::UnexpectedResponse(response)),
67096 }
67097 }
67098 /**Get IP Restriction for a Sub-account API Key (For Master Account)
67099
67100Weight(UID): 3000
67101
67102Sends a `GET` request to `/sapi/v1/sub-account/subAccountApi/ipRestriction`
67103
67104Arguments:
67105- `email`: Sub-account email
67106- `recv_window`: The value cannot be greater than 60000
67107- `signature`: Signature
67108- `sub_account_api_key`
67109- `timestamp`: UTC timestamp in ms
67110*/
67111 pub async fn query_sub_account_sub_account_api_ip_restriction<'a>(
67112 &'a self,
67113 email: &'a str,
67114 recv_window: Option<i64>,
67115 signature: &'a str,
67116 sub_account_api_key: &'a str,
67117 timestamp: i64,
67118 ) -> Result<
67119 ResponseValue<types::QuerySubAccountSubAccountApiIpRestrictionResponse>,
67120 Error<types::Error>,
67121 > {
67122 let url = format!(
67123 "{}/sapi/v1/sub-account/subAccountApi/ipRestriction", self.baseurl,
67124 );
67125 let mut query = Vec::with_capacity(5usize);
67126 query.push(("email", email.to_string()));
67127 if let Some(v) = &recv_window {
67128 query.push(("recvWindow", v.to_string()));
67129 }
67130 query.push(("signature", signature.to_string()));
67131 query.push(("subAccountApiKey", sub_account_api_key.to_string()));
67132 query.push(("timestamp", timestamp.to_string()));
67133 #[allow(unused_mut)]
67134 let mut request = self
67135 .client
67136 .get(url)
67137 .header(
67138 reqwest::header::ACCEPT,
67139 reqwest::header::HeaderValue::from_static("application/json"),
67140 )
67141 .query(&query)
67142 .build()?;
67143 (crate::pre_hook)(&self.inner, &request);
67144 let result = self.client.execute(request).await;
67145 (crate::post_hook)(&self.inner, &result);
67146 let response = result?;
67147 match response.status().as_u16() {
67148 200u16 => ResponseValue::from_response(response).await,
67149 400u16 => {
67150 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67151 }
67152 401u16 => {
67153 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67154 }
67155 _ => Err(Error::UnexpectedResponse(response)),
67156 }
67157 }
67158 /**Delete IP List for a Sub-account API Key (For Master Account)
67159
67160Weight(UID): 3000
67161
67162Sends a `DELETE` request to `/sapi/v1/sub-account/subAccountApi/ipRestriction/ipList`
67163
67164Arguments:
67165- `email`: Sub-account email
67166- `ip_address`: Can be added in batches, separated by commas
67167- `recv_window`: The value cannot be greater than 60000
67168- `signature`: Signature
67169- `sub_account_api_key`
67170- `third_party_name`: third party IP list name
67171- `timestamp`: UTC timestamp in ms
67172*/
67173 pub async fn sub_account_delete_ip_list<'a>(
67174 &'a self,
67175 email: &'a str,
67176 ip_address: Option<&'a str>,
67177 recv_window: Option<i64>,
67178 signature: &'a str,
67179 sub_account_api_key: &'a str,
67180 third_party_name: Option<&'a str>,
67181 timestamp: i64,
67182 ) -> Result<
67183 ResponseValue<types::SubAccountDeleteIpListResponse>,
67184 Error<types::Error>,
67185 > {
67186 let url = format!(
67187 "{}/sapi/v1/sub-account/subAccountApi/ipRestriction/ipList", self.baseurl,
67188 );
67189 let mut query = Vec::with_capacity(7usize);
67190 query.push(("email", email.to_string()));
67191 if let Some(v) = &ip_address {
67192 query.push(("ipAddress", v.to_string()));
67193 }
67194 if let Some(v) = &recv_window {
67195 query.push(("recvWindow", v.to_string()));
67196 }
67197 query.push(("signature", signature.to_string()));
67198 query.push(("subAccountApiKey", sub_account_api_key.to_string()));
67199 if let Some(v) = &third_party_name {
67200 query.push(("thirdPartyName", v.to_string()));
67201 }
67202 query.push(("timestamp", timestamp.to_string()));
67203 #[allow(unused_mut)]
67204 let mut request = self
67205 .client
67206 .delete(url)
67207 .header(
67208 reqwest::header::ACCEPT,
67209 reqwest::header::HeaderValue::from_static("application/json"),
67210 )
67211 .query(&query)
67212 .build()?;
67213 (crate::pre_hook)(&self.inner, &request);
67214 let result = self.client.execute(request).await;
67215 (crate::post_hook)(&self.inner, &result);
67216 let response = result?;
67217 match response.status().as_u16() {
67218 200u16 => ResponseValue::from_response(response).await,
67219 400u16 => {
67220 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67221 }
67222 401u16 => {
67223 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67224 }
67225 _ => Err(Error::UnexpectedResponse(response)),
67226 }
67227 }
67228 /**Query Sub-account Transaction Statistics (For Master Account)
67229
67230Query Sub-account Transaction statistics (For Master Account).
67231
67232Weight(UID): 60
67233
67234Sends a `GET` request to `/sapi/v1/sub-account/transaction-statistics`
67235
67236Arguments:
67237- `email`
67238- `recv_window`: The value cannot be greater than 60000
67239- `signature`: Signature
67240- `timestamp`: UTC timestamp in ms
67241*/
67242 pub async fn sub_account_transaction_statistics<'a>(
67243 &'a self,
67244 email: &'a str,
67245 recv_window: Option<i64>,
67246 signature: &'a str,
67247 timestamp: i64,
67248 ) -> Result<
67249 ResponseValue<types::SubAccountTransactionStatisticsResponse>,
67250 Error<types::Error>,
67251 > {
67252 let url = format!(
67253 "{}/sapi/v1/sub-account/transaction-statistics", self.baseurl,
67254 );
67255 let mut query = Vec::with_capacity(4usize);
67256 query.push(("email", email.to_string()));
67257 if let Some(v) = &recv_window {
67258 query.push(("recvWindow", v.to_string()));
67259 }
67260 query.push(("signature", signature.to_string()));
67261 query.push(("timestamp", timestamp.to_string()));
67262 #[allow(unused_mut)]
67263 let mut request = self
67264 .client
67265 .get(url)
67266 .header(
67267 reqwest::header::ACCEPT,
67268 reqwest::header::HeaderValue::from_static("application/json"),
67269 )
67270 .query(&query)
67271 .build()?;
67272 (crate::pre_hook)(&self.inner, &request);
67273 let result = self.client.execute(request).await;
67274 (crate::post_hook)(&self.inner, &result);
67275 let response = result?;
67276 match response.status().as_u16() {
67277 200u16 => ResponseValue::from_response(response).await,
67278 400u16 => {
67279 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67280 }
67281 401u16 => {
67282 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67283 }
67284 _ => Err(Error::UnexpectedResponse(response)),
67285 }
67286 }
67287 /**Enable Options for Sub-account (For Master Account)(USER_DATA)
67288
67289Enable Options for Sub-account (For Master Account).
67290
67291Weight(IP): 1
67292
67293Sends a `POST` request to `/sapi/v1/sub-account/eoptions/enable`
67294
67295Arguments:
67296- `email`
67297- `recv_window`: The value cannot be greater than 60000
67298- `signature`: Signature
67299- `timestamp`: UTC timestamp in ms
67300*/
67301 pub async fn sub_account_eoptions_enable<'a>(
67302 &'a self,
67303 email: &'a str,
67304 recv_window: Option<i64>,
67305 signature: &'a str,
67306 timestamp: i64,
67307 ) -> Result<
67308 ResponseValue<types::SubAccountEoptionsEnableResponse>,
67309 Error<types::Error>,
67310 > {
67311 let url = format!("{}/sapi/v1/sub-account/eoptions/enable", self.baseurl,);
67312 let mut query = Vec::with_capacity(4usize);
67313 query.push(("email", email.to_string()));
67314 if let Some(v) = &recv_window {
67315 query.push(("recvWindow", v.to_string()));
67316 }
67317 query.push(("signature", signature.to_string()));
67318 query.push(("timestamp", timestamp.to_string()));
67319 #[allow(unused_mut)]
67320 let mut request = self
67321 .client
67322 .post(url)
67323 .header(
67324 reqwest::header::ACCEPT,
67325 reqwest::header::HeaderValue::from_static("application/json"),
67326 )
67327 .query(&query)
67328 .build()?;
67329 (crate::pre_hook)(&self.inner, &request);
67330 let result = self.client.execute(request).await;
67331 (crate::post_hook)(&self.inner, &result);
67332 let response = result?;
67333 match response.status().as_u16() {
67334 200u16 => ResponseValue::from_response(response).await,
67335 400u16 => {
67336 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67337 }
67338 401u16 => {
67339 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67340 }
67341 _ => Err(Error::UnexpectedResponse(response)),
67342 }
67343 }
67344 /**Update IP Restriction for Sub-Account API key (For Master Account)
67345
67346Update IP Restriction for Sub-Account API key
67347
67348Weight(UID): 3000
67349
67350Sends a `POST` request to `/sapi/v2/sub-account/subAccountApi/ipRestriction`
67351
67352Arguments:
67353- `email`: Sub-account email
67354- `recv_window`: The value cannot be greater than 60000
67355- `signature`: Signature
67356- `status`: IP Restriction status. 1 = IP Unrestricted. 2 = Restrict access to trusted IPs only. 3 = Restrict access to users' trusted third party IPs only
67357- `sub_account_api_key`
67358- `third_party_name`: third party IP list name
67359- `timestamp`: UTC timestamp in ms
67360*/
67361 pub async fn set_sub_account_sub_account_api_ip_restriction<'a>(
67362 &'a self,
67363 email: &'a str,
67364 recv_window: Option<i64>,
67365 signature: &'a str,
67366 status: &'a str,
67367 sub_account_api_key: &'a str,
67368 third_party_name: Option<&'a str>,
67369 timestamp: i64,
67370 ) -> Result<
67371 ResponseValue<types::SetSubAccountSubAccountApiIpRestrictionResponse>,
67372 Error<types::Error>,
67373 > {
67374 let url = format!(
67375 "{}/sapi/v2/sub-account/subAccountApi/ipRestriction", self.baseurl,
67376 );
67377 let mut query = Vec::with_capacity(7usize);
67378 query.push(("email", email.to_string()));
67379 if let Some(v) = &recv_window {
67380 query.push(("recvWindow", v.to_string()));
67381 }
67382 query.push(("signature", signature.to_string()));
67383 query.push(("status", status.to_string()));
67384 query.push(("subAccountApiKey", sub_account_api_key.to_string()));
67385 if let Some(v) = &third_party_name {
67386 query.push(("thirdPartyName", v.to_string()));
67387 }
67388 query.push(("timestamp", timestamp.to_string()));
67389 #[allow(unused_mut)]
67390 let mut request = self
67391 .client
67392 .post(url)
67393 .header(
67394 reqwest::header::ACCEPT,
67395 reqwest::header::HeaderValue::from_static("application/json"),
67396 )
67397 .query(&query)
67398 .build()?;
67399 (crate::pre_hook)(&self.inner, &request);
67400 let result = self.client.execute(request).await;
67401 (crate::post_hook)(&self.inner, &result);
67402 let response = result?;
67403 match response.status().as_u16() {
67404 200u16 => ResponseValue::from_response(response).await,
67405 400u16 => {
67406 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67407 }
67408 401u16 => {
67409 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67410 }
67411 _ => Err(Error::UnexpectedResponse(response)),
67412 }
67413 }
67414 /**Query Sub-account Assets (For Master Account)
67415
67416Fetch sub-account assets
67417
67418Weight(UID): 60
67419
67420Sends a `GET` request to `/sapi/v4/sub-account/assets`
67421
67422Arguments:
67423- `email`
67424- `recv_window`: The value cannot be greater than 60000
67425- `signature`: Signature
67426- `timestamp`: UTC timestamp in ms
67427*/
67428 pub async fn query_sub_account_assets<'a>(
67429 &'a self,
67430 email: &'a str,
67431 recv_window: Option<i64>,
67432 signature: &'a str,
67433 timestamp: i64,
67434 ) -> Result<
67435 ResponseValue<types::QuerySubAccountAssetsResponse>,
67436 Error<types::Error>,
67437 > {
67438 let url = format!("{}/sapi/v4/sub-account/assets", self.baseurl,);
67439 let mut query = Vec::with_capacity(4usize);
67440 query.push(("email", email.to_string()));
67441 if let Some(v) = &recv_window {
67442 query.push(("recvWindow", v.to_string()));
67443 }
67444 query.push(("signature", signature.to_string()));
67445 query.push(("timestamp", timestamp.to_string()));
67446 #[allow(unused_mut)]
67447 let mut request = self
67448 .client
67449 .get(url)
67450 .header(
67451 reqwest::header::ACCEPT,
67452 reqwest::header::HeaderValue::from_static("application/json"),
67453 )
67454 .query(&query)
67455 .build()?;
67456 (crate::pre_hook)(&self.inner, &request);
67457 let result = self.client.execute(request).await;
67458 (crate::post_hook)(&self.inner, &result);
67459 let response = result?;
67460 match response.status().as_u16() {
67461 200u16 => ResponseValue::from_response(response).await,
67462 400u16 => {
67463 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67464 }
67465 401u16 => {
67466 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67467 }
67468 _ => Err(Error::UnexpectedResponse(response)),
67469 }
67470 }
67471 /**Ping/Keep-alive a ListenKey (USER_STREAM)
67472
67473Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 30 minutes.
67474
67475Weight: 2
67476
67477Sends a `PUT` request to `/api/v3/userDataStream`
67478
67479Arguments:
67480- `listen_key`: User websocket listen key
67481*/
67482 pub async fn ping_keep_alive_listen_key<'a>(
67483 &'a self,
67484 listen_key: Option<&'a str>,
67485 ) -> Result<
67486 ResponseValue<serde_json::Map<String, serde_json::Value>>,
67487 Error<types::Error>,
67488 > {
67489 let url = format!("{}/api/v3/userDataStream", self.baseurl,);
67490 let mut query = Vec::with_capacity(1usize);
67491 if let Some(v) = &listen_key {
67492 query.push(("listenKey", v.to_string()));
67493 }
67494 #[allow(unused_mut)]
67495 let mut request = self
67496 .client
67497 .put(url)
67498 .header(
67499 reqwest::header::ACCEPT,
67500 reqwest::header::HeaderValue::from_static("application/json"),
67501 )
67502 .query(&query)
67503 .build()?;
67504 (crate::pre_hook)(&self.inner, &request);
67505 let result = self.client.execute(request).await;
67506 (crate::post_hook)(&self.inner, &result);
67507 let response = result?;
67508 match response.status().as_u16() {
67509 200u16 => ResponseValue::from_response(response).await,
67510 400u16 => {
67511 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67512 }
67513 _ => Err(Error::UnexpectedResponse(response)),
67514 }
67515 }
67516 /**Create a ListenKey (USER_STREAM)
67517
67518Start a new user data stream.
67519The stream will close after 60 minutes unless a keepalive is sent. If the account has an active `listenKey`, that `listenKey` will be returned and its validity will be extended for 60 minutes.
67520
67521Weight: 2
67522
67523Sends a `POST` request to `/api/v3/userDataStream`
67524
67525*/
67526 pub async fn create_user_data_stream<'a>(
67527 &'a self,
67528 ) -> Result<ResponseValue<types::CreateUserDataStreamResponse>, Error<()>> {
67529 let url = format!("{}/api/v3/userDataStream", self.baseurl,);
67530 #[allow(unused_mut)]
67531 let mut request = self
67532 .client
67533 .post(url)
67534 .header(
67535 reqwest::header::ACCEPT,
67536 reqwest::header::HeaderValue::from_static("application/json"),
67537 )
67538 .build()?;
67539 (crate::pre_hook)(&self.inner, &request);
67540 let result = self.client.execute(request).await;
67541 (crate::post_hook)(&self.inner, &result);
67542 let response = result?;
67543 match response.status().as_u16() {
67544 200u16 => ResponseValue::from_response(response).await,
67545 _ => Err(Error::UnexpectedResponse(response)),
67546 }
67547 }
67548 /**Close a ListenKey (USER_STREAM)
67549
67550Close out a user data stream.
67551
67552Weight: 2
67553
67554Sends a `DELETE` request to `/api/v3/userDataStream`
67555
67556Arguments:
67557- `listen_key`: User websocket listen key
67558*/
67559 pub async fn close_listen_key<'a>(
67560 &'a self,
67561 listen_key: Option<&'a str>,
67562 ) -> Result<
67563 ResponseValue<serde_json::Map<String, serde_json::Value>>,
67564 Error<types::Error>,
67565 > {
67566 let url = format!("{}/api/v3/userDataStream", self.baseurl,);
67567 let mut query = Vec::with_capacity(1usize);
67568 if let Some(v) = &listen_key {
67569 query.push(("listenKey", v.to_string()));
67570 }
67571 #[allow(unused_mut)]
67572 let mut request = self
67573 .client
67574 .delete(url)
67575 .header(
67576 reqwest::header::ACCEPT,
67577 reqwest::header::HeaderValue::from_static("application/json"),
67578 )
67579 .query(&query)
67580 .build()?;
67581 (crate::pre_hook)(&self.inner, &request);
67582 let result = self.client.execute(request).await;
67583 (crate::post_hook)(&self.inner, &result);
67584 let response = result?;
67585 match response.status().as_u16() {
67586 200u16 => ResponseValue::from_response(response).await,
67587 400u16 => {
67588 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67589 }
67590 _ => Err(Error::UnexpectedResponse(response)),
67591 }
67592 }
67593 /**Ping/Keep-alive a ListenKey (USER_STREAM)
67594
67595Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 30 minutes.
67596
67597Weight: 1
67598
67599Sends a `PUT` request to `/sapi/v1/userDataStream`
67600
67601Arguments:
67602- `listen_key`: User websocket listen key
67603*/
67604 pub async fn ping_keep_alive_user_stream<'a>(
67605 &'a self,
67606 listen_key: Option<&'a str>,
67607 ) -> Result<
67608 ResponseValue<serde_json::Map<String, serde_json::Value>>,
67609 Error<types::Error>,
67610 > {
67611 let url = format!("{}/sapi/v1/userDataStream", self.baseurl,);
67612 let mut query = Vec::with_capacity(1usize);
67613 if let Some(v) = &listen_key {
67614 query.push(("listenKey", v.to_string()));
67615 }
67616 #[allow(unused_mut)]
67617 let mut request = self
67618 .client
67619 .put(url)
67620 .header(
67621 reqwest::header::ACCEPT,
67622 reqwest::header::HeaderValue::from_static("application/json"),
67623 )
67624 .query(&query)
67625 .build()?;
67626 (crate::pre_hook)(&self.inner, &request);
67627 let result = self.client.execute(request).await;
67628 (crate::post_hook)(&self.inner, &result);
67629 let response = result?;
67630 match response.status().as_u16() {
67631 200u16 => ResponseValue::from_response(response).await,
67632 400u16 => {
67633 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67634 }
67635 _ => Err(Error::UnexpectedResponse(response)),
67636 }
67637 }
67638 /**Create a ListenKey (USER_STREAM)
67639
67640Start a new user data stream.
67641The stream will close after 60 minutes unless a keepalive is sent. If the account has an active `listenKey`, that `listenKey` will be returned and its validity will be extended for 60 minutes.
67642
67643Weight: 1
67644
67645Sends a `POST` request to `/sapi/v1/userDataStream`
67646
67647*/
67648 pub async fn create_listen_key_user_data_stream<'a>(
67649 &'a self,
67650 ) -> Result<ResponseValue<types::CreateListenKeyUserDataStreamResponse>, Error<()>> {
67651 let url = format!("{}/sapi/v1/userDataStream", self.baseurl,);
67652 #[allow(unused_mut)]
67653 let mut request = self
67654 .client
67655 .post(url)
67656 .header(
67657 reqwest::header::ACCEPT,
67658 reqwest::header::HeaderValue::from_static("application/json"),
67659 )
67660 .build()?;
67661 (crate::pre_hook)(&self.inner, &request);
67662 let result = self.client.execute(request).await;
67663 (crate::post_hook)(&self.inner, &result);
67664 let response = result?;
67665 match response.status().as_u16() {
67666 200u16 => ResponseValue::from_response(response).await,
67667 _ => Err(Error::UnexpectedResponse(response)),
67668 }
67669 }
67670 /**Close a ListenKey (USER_STREAM)
67671
67672Close out a user data stream.
67673
67674Weight: 1
67675
67676Sends a `DELETE` request to `/sapi/v1/userDataStream`
67677
67678Arguments:
67679- `listen_key`: User websocket listen key
67680*/
67681 pub async fn close_listen_key_user_stream<'a>(
67682 &'a self,
67683 listen_key: Option<&'a str>,
67684 ) -> Result<
67685 ResponseValue<serde_json::Map<String, serde_json::Value>>,
67686 Error<types::Error>,
67687 > {
67688 let url = format!("{}/sapi/v1/userDataStream", self.baseurl,);
67689 let mut query = Vec::with_capacity(1usize);
67690 if let Some(v) = &listen_key {
67691 query.push(("listenKey", v.to_string()));
67692 }
67693 #[allow(unused_mut)]
67694 let mut request = self
67695 .client
67696 .delete(url)
67697 .header(
67698 reqwest::header::ACCEPT,
67699 reqwest::header::HeaderValue::from_static("application/json"),
67700 )
67701 .query(&query)
67702 .build()?;
67703 (crate::pre_hook)(&self.inner, &request);
67704 let result = self.client.execute(request).await;
67705 (crate::post_hook)(&self.inner, &result);
67706 let response = result?;
67707 match response.status().as_u16() {
67708 200u16 => ResponseValue::from_response(response).await,
67709 400u16 => {
67710 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67711 }
67712 _ => Err(Error::UnexpectedResponse(response)),
67713 }
67714 }
67715 /**Ping/Keep-alive a Listen Key (USER_STREAM)
67716
67717Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 30 minutes.
67718
67719Weight: 1
67720
67721Sends a `PUT` request to `/sapi/v1/userDataStream/isolated`
67722
67723Arguments:
67724- `listen_key`: User websocket listen key
67725*/
67726 pub async fn ping_keep_alive_user_stream_again<'a>(
67727 &'a self,
67728 listen_key: Option<&'a str>,
67729 ) -> Result<
67730 ResponseValue<serde_json::Map<String, serde_json::Value>>,
67731 Error<types::Error>,
67732 > {
67733 let url = format!("{}/sapi/v1/userDataStream/isolated", self.baseurl,);
67734 let mut query = Vec::with_capacity(1usize);
67735 if let Some(v) = &listen_key {
67736 query.push(("listenKey", v.to_string()));
67737 }
67738 #[allow(unused_mut)]
67739 let mut request = self
67740 .client
67741 .put(url)
67742 .header(
67743 reqwest::header::ACCEPT,
67744 reqwest::header::HeaderValue::from_static("application/json"),
67745 )
67746 .query(&query)
67747 .build()?;
67748 (crate::pre_hook)(&self.inner, &request);
67749 let result = self.client.execute(request).await;
67750 (crate::post_hook)(&self.inner, &result);
67751 let response = result?;
67752 match response.status().as_u16() {
67753 200u16 => ResponseValue::from_response(response).await,
67754 400u16 => {
67755 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67756 }
67757 _ => Err(Error::UnexpectedResponse(response)),
67758 }
67759 }
67760 /**Generate a Listen Key (USER_STREAM)
67761
67762Start a new user data stream.
67763The stream will close after 60 minutes unless a keepalive is sent. If the account has an active `listenKey`, that `listenKey` will be returned and its validity will be extended for 60 minutes.
67764
67765Weight: 1
67766
67767Sends a `POST` request to `/sapi/v1/userDataStream/isolated`
67768
67769*/
67770 pub async fn user_data_stream_isolated<'a>(
67771 &'a self,
67772 ) -> Result<ResponseValue<types::UserDataStreamIsolatedResponse>, Error<()>> {
67773 let url = format!("{}/sapi/v1/userDataStream/isolated", self.baseurl,);
67774 #[allow(unused_mut)]
67775 let mut request = self
67776 .client
67777 .post(url)
67778 .header(
67779 reqwest::header::ACCEPT,
67780 reqwest::header::HeaderValue::from_static("application/json"),
67781 )
67782 .build()?;
67783 (crate::pre_hook)(&self.inner, &request);
67784 let result = self.client.execute(request).await;
67785 (crate::post_hook)(&self.inner, &result);
67786 let response = result?;
67787 match response.status().as_u16() {
67788 200u16 => ResponseValue::from_response(response).await,
67789 _ => Err(Error::UnexpectedResponse(response)),
67790 }
67791 }
67792 /**Close a ListenKey (USER_STREAM)
67793
67794Close out a user data stream.
67795
67796Weight: 1
67797
67798Sends a `DELETE` request to `/sapi/v1/userDataStream/isolated`
67799
67800Arguments:
67801- `listen_key`: User websocket listen key
67802*/
67803 pub async fn close_listen_key_us<'a>(
67804 &'a self,
67805 listen_key: Option<&'a str>,
67806 ) -> Result<
67807 ResponseValue<serde_json::Map<String, serde_json::Value>>,
67808 Error<types::Error>,
67809 > {
67810 let url = format!("{}/sapi/v1/userDataStream/isolated", self.baseurl,);
67811 let mut query = Vec::with_capacity(1usize);
67812 if let Some(v) = &listen_key {
67813 query.push(("listenKey", v.to_string()));
67814 }
67815 #[allow(unused_mut)]
67816 let mut request = self
67817 .client
67818 .delete(url)
67819 .header(
67820 reqwest::header::ACCEPT,
67821 reqwest::header::HeaderValue::from_static("application/json"),
67822 )
67823 .query(&query)
67824 .build()?;
67825 (crate::pre_hook)(&self.inner, &request);
67826 let result = self.client.execute(request).await;
67827 (crate::post_hook)(&self.inner, &result);
67828 let response = result?;
67829 match response.status().as_u16() {
67830 200u16 => ResponseValue::from_response(response).await,
67831 400u16 => {
67832 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67833 }
67834 _ => Err(Error::UnexpectedResponse(response)),
67835 }
67836 }
67837 /**Fiat Deposit/Withdraw History (USER_DATA)
67838
67839- If beginTime and endTime are not sent, the recent 30-day data will be returned.
67840
67841Weight(UID): 90000
67842
67843Sends a `GET` request to `/sapi/v1/fiat/orders`
67844
67845Arguments:
67846- `begin_time`
67847- `end_time`: UTC timestamp in ms
67848- `page`: Default 1
67849- `recv_window`: The value cannot be greater than 60000
67850- `rows`: Default 100, max 500
67851- `signature`: Signature
67852- `timestamp`: UTC timestamp in ms
67853- `transaction_type`: * `0` - deposit
67854* `1` - withdraw
67855*/
67856 pub async fn fiat_orders<'a>(
67857 &'a self,
67858 begin_time: Option<i64>,
67859 end_time: Option<i64>,
67860 page: Option<i32>,
67861 recv_window: Option<i64>,
67862 rows: Option<i32>,
67863 signature: &'a str,
67864 timestamp: i64,
67865 transaction_type: i64,
67866 ) -> Result<ResponseValue<types::FiatOrdersResponse>, Error<types::Error>> {
67867 let url = format!("{}/sapi/v1/fiat/orders", self.baseurl,);
67868 let mut query = Vec::with_capacity(8usize);
67869 if let Some(v) = &begin_time {
67870 query.push(("beginTime", v.to_string()));
67871 }
67872 if let Some(v) = &end_time {
67873 query.push(("endTime", v.to_string()));
67874 }
67875 if let Some(v) = &page {
67876 query.push(("page", v.to_string()));
67877 }
67878 if let Some(v) = &recv_window {
67879 query.push(("recvWindow", v.to_string()));
67880 }
67881 if let Some(v) = &rows {
67882 query.push(("rows", v.to_string()));
67883 }
67884 query.push(("signature", signature.to_string()));
67885 query.push(("timestamp", timestamp.to_string()));
67886 query.push(("transactionType", transaction_type.to_string()));
67887 #[allow(unused_mut)]
67888 let mut request = self
67889 .client
67890 .get(url)
67891 .header(
67892 reqwest::header::ACCEPT,
67893 reqwest::header::HeaderValue::from_static("application/json"),
67894 )
67895 .query(&query)
67896 .build()?;
67897 (crate::pre_hook)(&self.inner, &request);
67898 let result = self.client.execute(request).await;
67899 (crate::post_hook)(&self.inner, &result);
67900 let response = result?;
67901 match response.status().as_u16() {
67902 200u16 => ResponseValue::from_response(response).await,
67903 400u16 => {
67904 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67905 }
67906 401u16 => {
67907 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67908 }
67909 _ => Err(Error::UnexpectedResponse(response)),
67910 }
67911 }
67912 /**Fiat Payments History (USER_DATA)
67913
67914- If beginTime and endTime are not sent, the recent 30-day data will be returned.
67915
67916Weight(IP): 1
67917
67918Sends a `GET` request to `/sapi/v1/fiat/payments`
67919
67920Arguments:
67921- `begin_time`
67922- `end_time`: UTC timestamp in ms
67923- `page`: Default 1
67924- `recv_window`: The value cannot be greater than 60000
67925- `rows`: Default 100, max 500
67926- `signature`: Signature
67927- `timestamp`: UTC timestamp in ms
67928- `transaction_type`: * `0` - deposit
67929* `1` - withdraw
67930*/
67931 pub async fn fiat_payments<'a>(
67932 &'a self,
67933 begin_time: Option<i64>,
67934 end_time: Option<i64>,
67935 page: Option<i32>,
67936 recv_window: Option<i64>,
67937 rows: Option<i32>,
67938 signature: &'a str,
67939 timestamp: i64,
67940 transaction_type: i64,
67941 ) -> Result<ResponseValue<types::FiatPaymentsResponse>, Error<types::Error>> {
67942 let url = format!("{}/sapi/v1/fiat/payments", self.baseurl,);
67943 let mut query = Vec::with_capacity(8usize);
67944 if let Some(v) = &begin_time {
67945 query.push(("beginTime", v.to_string()));
67946 }
67947 if let Some(v) = &end_time {
67948 query.push(("endTime", v.to_string()));
67949 }
67950 if let Some(v) = &page {
67951 query.push(("page", v.to_string()));
67952 }
67953 if let Some(v) = &recv_window {
67954 query.push(("recvWindow", v.to_string()));
67955 }
67956 if let Some(v) = &rows {
67957 query.push(("rows", v.to_string()));
67958 }
67959 query.push(("signature", signature.to_string()));
67960 query.push(("timestamp", timestamp.to_string()));
67961 query.push(("transactionType", transaction_type.to_string()));
67962 #[allow(unused_mut)]
67963 let mut request = self
67964 .client
67965 .get(url)
67966 .header(
67967 reqwest::header::ACCEPT,
67968 reqwest::header::HeaderValue::from_static("application/json"),
67969 )
67970 .query(&query)
67971 .build()?;
67972 (crate::pre_hook)(&self.inner, &request);
67973 let result = self.client.execute(request).await;
67974 (crate::post_hook)(&self.inner, &result);
67975 let response = result?;
67976 match response.status().as_u16() {
67977 200u16 => ResponseValue::from_response(response).await,
67978 400u16 => {
67979 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67980 }
67981 401u16 => {
67982 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
67983 }
67984 _ => Err(Error::UnexpectedResponse(response)),
67985 }
67986 }
67987 /**Get Fixed/Activity Project List(USER_DATA)
67988
67989Weight(IP): 1
67990
67991Sends a `GET` request to `/sapi/v1/lending/project/list`
67992
67993Arguments:
67994- `asset`
67995- `current`: Current querying page. Start from 1. Default:1
67996- `is_sort_asc`: default "true"
67997- `recv_window`: The value cannot be greater than 60000
67998- `signature`: Signature
67999- `size`: Default:10 Max:100
68000- `sort_by`: Default `START_TIME`
68001- `status`: Default `ALL`
68002- `timestamp`: UTC timestamp in ms
68003- `type_`
68004*/
68005 pub async fn lending_project_list<'a>(
68006 &'a self,
68007 asset: Option<&'a str>,
68008 current: Option<i32>,
68009 is_sort_asc: Option<bool>,
68010 recv_window: Option<i64>,
68011 signature: &'a str,
68012 size: Option<i32>,
68013 sort_by: Option<types::LendingProjectListSortBy>,
68014 status: Option<types::LendingProjectListStatus>,
68015 timestamp: i64,
68016 type_: types::LendingProjectListType,
68017 ) -> Result<
68018 ResponseValue<Vec<types::LendingProjectListResponseItem>>,
68019 Error<types::Error>,
68020 > {
68021 let url = format!("{}/sapi/v1/lending/project/list", self.baseurl,);
68022 let mut query = Vec::with_capacity(10usize);
68023 if let Some(v) = &asset {
68024 query.push(("asset", v.to_string()));
68025 }
68026 if let Some(v) = ¤t {
68027 query.push(("current", v.to_string()));
68028 }
68029 if let Some(v) = &is_sort_asc {
68030 query.push(("isSortAsc", v.to_string()));
68031 }
68032 if let Some(v) = &recv_window {
68033 query.push(("recvWindow", v.to_string()));
68034 }
68035 query.push(("signature", signature.to_string()));
68036 if let Some(v) = &size {
68037 query.push(("size", v.to_string()));
68038 }
68039 if let Some(v) = &sort_by {
68040 query.push(("sortBy", v.to_string()));
68041 }
68042 if let Some(v) = &status {
68043 query.push(("status", v.to_string()));
68044 }
68045 query.push(("timestamp", timestamp.to_string()));
68046 query.push(("type", type_.to_string()));
68047 #[allow(unused_mut)]
68048 let mut request = self
68049 .client
68050 .get(url)
68051 .header(
68052 reqwest::header::ACCEPT,
68053 reqwest::header::HeaderValue::from_static("application/json"),
68054 )
68055 .query(&query)
68056 .build()?;
68057 (crate::pre_hook)(&self.inner, &request);
68058 let result = self.client.execute(request).await;
68059 (crate::post_hook)(&self.inner, &result);
68060 let response = result?;
68061 match response.status().as_u16() {
68062 200u16 => ResponseValue::from_response(response).await,
68063 400u16 => {
68064 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68065 }
68066 401u16 => {
68067 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68068 }
68069 _ => Err(Error::UnexpectedResponse(response)),
68070 }
68071 }
68072 /**Purchase Fixed/Activity Project (USER_DATA)
68073
68074Weight(IP): 1
68075
68076Sends a `POST` request to `/sapi/v1/lending/customizedFixed/purchase`
68077
68078Arguments:
68079- `lot`
68080- `project_id`
68081- `recv_window`: The value cannot be greater than 60000
68082- `signature`: Signature
68083- `timestamp`: UTC timestamp in ms
68084*/
68085 pub async fn lending_customized_fixed_purchase<'a>(
68086 &'a self,
68087 lot: &'a str,
68088 project_id: &'a str,
68089 recv_window: Option<i64>,
68090 signature: &'a str,
68091 timestamp: i64,
68092 ) -> Result<
68093 ResponseValue<types::LendingCustomizedFixedPurchaseResponse>,
68094 Error<types::Error>,
68095 > {
68096 let url = format!("{}/sapi/v1/lending/customizedFixed/purchase", self.baseurl,);
68097 let mut query = Vec::with_capacity(5usize);
68098 query.push(("lot", lot.to_string()));
68099 query.push(("projectId", project_id.to_string()));
68100 if let Some(v) = &recv_window {
68101 query.push(("recvWindow", v.to_string()));
68102 }
68103 query.push(("signature", signature.to_string()));
68104 query.push(("timestamp", timestamp.to_string()));
68105 #[allow(unused_mut)]
68106 let mut request = self
68107 .client
68108 .post(url)
68109 .header(
68110 reqwest::header::ACCEPT,
68111 reqwest::header::HeaderValue::from_static("application/json"),
68112 )
68113 .query(&query)
68114 .build()?;
68115 (crate::pre_hook)(&self.inner, &request);
68116 let result = self.client.execute(request).await;
68117 (crate::post_hook)(&self.inner, &result);
68118 let response = result?;
68119 match response.status().as_u16() {
68120 200u16 => ResponseValue::from_response(response).await,
68121 400u16 => {
68122 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68123 }
68124 401u16 => {
68125 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68126 }
68127 _ => Err(Error::UnexpectedResponse(response)),
68128 }
68129 }
68130 /**Get Fixed/Activity Project Position (USER_DATA)
68131
68132Weight(IP): 1
68133
68134Sends a `GET` request to `/sapi/v1/lending/project/position/list`
68135
68136Arguments:
68137- `asset`
68138- `project_id`
68139- `recv_window`: The value cannot be greater than 60000
68140- `signature`: Signature
68141- `status`: Default `ALL`
68142- `timestamp`: UTC timestamp in ms
68143*/
68144 pub async fn lending_project_position_list<'a>(
68145 &'a self,
68146 asset: &'a str,
68147 project_id: Option<&'a str>,
68148 recv_window: Option<i64>,
68149 signature: &'a str,
68150 status: Option<types::LendingProjectPositionListStatus>,
68151 timestamp: i64,
68152 ) -> Result<
68153 ResponseValue<Vec<types::LendingProjectPositionListResponseItem>>,
68154 Error<types::Error>,
68155 > {
68156 let url = format!("{}/sapi/v1/lending/project/position/list", self.baseurl,);
68157 let mut query = Vec::with_capacity(6usize);
68158 query.push(("asset", asset.to_string()));
68159 if let Some(v) = &project_id {
68160 query.push(("projectId", v.to_string()));
68161 }
68162 if let Some(v) = &recv_window {
68163 query.push(("recvWindow", v.to_string()));
68164 }
68165 query.push(("signature", signature.to_string()));
68166 if let Some(v) = &status {
68167 query.push(("status", v.to_string()));
68168 }
68169 query.push(("timestamp", timestamp.to_string()));
68170 #[allow(unused_mut)]
68171 let mut request = self
68172 .client
68173 .get(url)
68174 .header(
68175 reqwest::header::ACCEPT,
68176 reqwest::header::HeaderValue::from_static("application/json"),
68177 )
68178 .query(&query)
68179 .build()?;
68180 (crate::pre_hook)(&self.inner, &request);
68181 let result = self.client.execute(request).await;
68182 (crate::post_hook)(&self.inner, &result);
68183 let response = result?;
68184 match response.status().as_u16() {
68185 200u16 => ResponseValue::from_response(response).await,
68186 400u16 => {
68187 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68188 }
68189 401u16 => {
68190 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68191 }
68192 _ => Err(Error::UnexpectedResponse(response)),
68193 }
68194 }
68195 /**Change Fixed/Activity Position to Daily Position (USER_DATA)
68196
68197- PositionId is mandatory parameter for fixed position.
68198
68199Weight(IP): 1
68200
68201Sends a `POST` request to `/sapi/v1/lending/positionChanged`
68202
68203Arguments:
68204- `lot`
68205- `position_id`
68206- `project_id`
68207- `recv_window`: The value cannot be greater than 60000
68208- `signature`: Signature
68209- `timestamp`: UTC timestamp in ms
68210*/
68211 pub async fn lending_position_changed<'a>(
68212 &'a self,
68213 lot: &'a str,
68214 position_id: Option<&'a str>,
68215 project_id: &'a str,
68216 recv_window: Option<i64>,
68217 signature: &'a str,
68218 timestamp: i64,
68219 ) -> Result<
68220 ResponseValue<types::LendingPositionChangedResponse>,
68221 Error<types::Error>,
68222 > {
68223 let url = format!("{}/sapi/v1/lending/positionChanged", self.baseurl,);
68224 let mut query = Vec::with_capacity(6usize);
68225 query.push(("lot", lot.to_string()));
68226 if let Some(v) = &position_id {
68227 query.push(("positionId", v.to_string()));
68228 }
68229 query.push(("projectId", project_id.to_string()));
68230 if let Some(v) = &recv_window {
68231 query.push(("recvWindow", v.to_string()));
68232 }
68233 query.push(("signature", signature.to_string()));
68234 query.push(("timestamp", timestamp.to_string()));
68235 #[allow(unused_mut)]
68236 let mut request = self
68237 .client
68238 .post(url)
68239 .header(
68240 reqwest::header::ACCEPT,
68241 reqwest::header::HeaderValue::from_static("application/json"),
68242 )
68243 .query(&query)
68244 .build()?;
68245 (crate::pre_hook)(&self.inner, &request);
68246 let result = self.client.execute(request).await;
68247 (crate::post_hook)(&self.inner, &result);
68248 let response = result?;
68249 match response.status().as_u16() {
68250 200u16 => ResponseValue::from_response(response).await,
68251 400u16 => {
68252 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68253 }
68254 401u16 => {
68255 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68256 }
68257 _ => Err(Error::UnexpectedResponse(response)),
68258 }
68259 }
68260 /**Get Staking Product List (USER_DATA)
68261
68262Get available Staking product list.
68263
68264Weight(IP): 1
68265
68266Sends a `GET` request to `/sapi/v1/staking/productList`
68267
68268Arguments:
68269- `asset`
68270- `current`: Current querying page. Start from 1. Default:1
68271- `product`: * `STAKING` - for Locked Staking
68272* `F_DEFI` - for flexible DeFi Staking
68273* `L_DEFI` - for locked DeFi Staking
68274- `recv_window`: The value cannot be greater than 60000
68275- `signature`: Signature
68276- `size`: Default:10 Max:100
68277- `timestamp`: UTC timestamp in ms
68278*/
68279 pub async fn staking_product_list<'a>(
68280 &'a self,
68281 asset: Option<&'a str>,
68282 current: Option<i32>,
68283 product: &'a str,
68284 recv_window: Option<i64>,
68285 signature: &'a str,
68286 size: Option<i32>,
68287 timestamp: i64,
68288 ) -> Result<
68289 ResponseValue<Vec<types::StakingProductListResponseItem>>,
68290 Error<types::Error>,
68291 > {
68292 let url = format!("{}/sapi/v1/staking/productList", self.baseurl,);
68293 let mut query = Vec::with_capacity(7usize);
68294 if let Some(v) = &asset {
68295 query.push(("asset", v.to_string()));
68296 }
68297 if let Some(v) = ¤t {
68298 query.push(("current", v.to_string()));
68299 }
68300 query.push(("product", product.to_string()));
68301 if let Some(v) = &recv_window {
68302 query.push(("recvWindow", v.to_string()));
68303 }
68304 query.push(("signature", signature.to_string()));
68305 if let Some(v) = &size {
68306 query.push(("size", v.to_string()));
68307 }
68308 query.push(("timestamp", timestamp.to_string()));
68309 #[allow(unused_mut)]
68310 let mut request = self
68311 .client
68312 .get(url)
68313 .header(
68314 reqwest::header::ACCEPT,
68315 reqwest::header::HeaderValue::from_static("application/json"),
68316 )
68317 .query(&query)
68318 .build()?;
68319 (crate::pre_hook)(&self.inner, &request);
68320 let result = self.client.execute(request).await;
68321 (crate::post_hook)(&self.inner, &result);
68322 let response = result?;
68323 match response.status().as_u16() {
68324 200u16 => ResponseValue::from_response(response).await,
68325 400u16 => {
68326 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68327 }
68328 401u16 => {
68329 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68330 }
68331 _ => Err(Error::UnexpectedResponse(response)),
68332 }
68333 }
68334 /**Purchase Staking Product (USER_DATA)
68335
68336Weight(IP): 1
68337
68338Sends a `POST` request to `/sapi/v1/staking/purchase`
68339
68340Arguments:
68341- `amount`
68342- `product`: * `STAKING` - for Locked Staking
68343* `F_DEFI` - for flexible DeFi Staking
68344* `L_DEFI` - for locked DeFi Staking
68345- `product_id`
68346- `recv_window`: The value cannot be greater than 60000
68347- `renewable`: true or false, default false. Active if product is `STAKING` or `L_DEFI`
68348- `signature`: Signature
68349- `timestamp`: UTC timestamp in ms
68350*/
68351 pub async fn staking_purchase<'a>(
68352 &'a self,
68353 amount: f64,
68354 product: &'a str,
68355 product_id: &'a str,
68356 recv_window: Option<i64>,
68357 renewable: Option<&'a str>,
68358 signature: &'a str,
68359 timestamp: i64,
68360 ) -> Result<ResponseValue<types::StakingPurchaseResponse>, Error<types::Error>> {
68361 let url = format!("{}/sapi/v1/staking/purchase", self.baseurl,);
68362 let mut query = Vec::with_capacity(7usize);
68363 query.push(("amount", amount.to_string()));
68364 query.push(("product", product.to_string()));
68365 query.push(("productId", product_id.to_string()));
68366 if let Some(v) = &recv_window {
68367 query.push(("recvWindow", v.to_string()));
68368 }
68369 if let Some(v) = &renewable {
68370 query.push(("renewable", v.to_string()));
68371 }
68372 query.push(("signature", signature.to_string()));
68373 query.push(("timestamp", timestamp.to_string()));
68374 #[allow(unused_mut)]
68375 let mut request = self
68376 .client
68377 .post(url)
68378 .header(
68379 reqwest::header::ACCEPT,
68380 reqwest::header::HeaderValue::from_static("application/json"),
68381 )
68382 .query(&query)
68383 .build()?;
68384 (crate::pre_hook)(&self.inner, &request);
68385 let result = self.client.execute(request).await;
68386 (crate::post_hook)(&self.inner, &result);
68387 let response = result?;
68388 match response.status().as_u16() {
68389 200u16 => ResponseValue::from_response(response).await,
68390 400u16 => {
68391 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68392 }
68393 401u16 => {
68394 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68395 }
68396 _ => Err(Error::UnexpectedResponse(response)),
68397 }
68398 }
68399 /**Redeem Staking Product (USER_DATA)
68400
68401Redeem Staking product. Locked staking and Locked DeFI staking belong to early redemption, redeeming in advance will result in loss of interest that you have earned.
68402
68403Weight(IP): 1
68404
68405Sends a `POST` request to `/sapi/v1/staking/redeem`
68406
68407Arguments:
68408- `amount`: Mandatory if product is `F_DEFI`
68409- `position_id`: Mandatory if product is `STAKING` or `L_DEFI`
68410- `product`: * `STAKING` - for Locked Staking
68411* `F_DEFI` - for flexible DeFi Staking
68412* `L_DEFI` - for locked DeFi Staking
68413- `product_id`
68414- `recv_window`: The value cannot be greater than 60000
68415- `signature`: Signature
68416- `timestamp`: UTC timestamp in ms
68417*/
68418 pub async fn staking_redeem<'a>(
68419 &'a self,
68420 amount: Option<f64>,
68421 position_id: Option<&'a str>,
68422 product: &'a str,
68423 product_id: &'a str,
68424 recv_window: Option<i64>,
68425 signature: &'a str,
68426 timestamp: i64,
68427 ) -> Result<ResponseValue<types::StakingRedeemResponse>, Error<types::Error>> {
68428 let url = format!("{}/sapi/v1/staking/redeem", self.baseurl,);
68429 let mut query = Vec::with_capacity(7usize);
68430 if let Some(v) = &amount {
68431 query.push(("amount", v.to_string()));
68432 }
68433 if let Some(v) = &position_id {
68434 query.push(("positionId", v.to_string()));
68435 }
68436 query.push(("product", product.to_string()));
68437 query.push(("productId", product_id.to_string()));
68438 if let Some(v) = &recv_window {
68439 query.push(("recvWindow", v.to_string()));
68440 }
68441 query.push(("signature", signature.to_string()));
68442 query.push(("timestamp", timestamp.to_string()));
68443 #[allow(unused_mut)]
68444 let mut request = self
68445 .client
68446 .post(url)
68447 .header(
68448 reqwest::header::ACCEPT,
68449 reqwest::header::HeaderValue::from_static("application/json"),
68450 )
68451 .query(&query)
68452 .build()?;
68453 (crate::pre_hook)(&self.inner, &request);
68454 let result = self.client.execute(request).await;
68455 (crate::post_hook)(&self.inner, &result);
68456 let response = result?;
68457 match response.status().as_u16() {
68458 200u16 => ResponseValue::from_response(response).await,
68459 400u16 => {
68460 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68461 }
68462 401u16 => {
68463 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68464 }
68465 _ => Err(Error::UnexpectedResponse(response)),
68466 }
68467 }
68468 /**Get Staking Product Position (USER_DATA)
68469
68470Weight(IP): 1
68471
68472Sends a `GET` request to `/sapi/v1/staking/position`
68473
68474Arguments:
68475- `asset`
68476- `current`: Current querying page. Start from 1. Default:1
68477- `product`: * `STAKING` - for Locked Staking
68478* `F_DEFI` - for flexible DeFi Staking
68479* `L_DEFI` - for locked DeFi Staking
68480- `product_id`
68481- `recv_window`: The value cannot be greater than 60000
68482- `signature`: Signature
68483- `size`: Default:10 Max:100
68484- `timestamp`: UTC timestamp in ms
68485*/
68486 pub async fn staking_position<'a>(
68487 &'a self,
68488 asset: Option<&'a str>,
68489 current: Option<i32>,
68490 product: &'a str,
68491 product_id: Option<&'a str>,
68492 recv_window: Option<i64>,
68493 signature: &'a str,
68494 size: Option<i32>,
68495 timestamp: i64,
68496 ) -> Result<
68497 ResponseValue<Vec<types::StakingPositionResponseItem>>,
68498 Error<types::Error>,
68499 > {
68500 let url = format!("{}/sapi/v1/staking/position", self.baseurl,);
68501 let mut query = Vec::with_capacity(8usize);
68502 if let Some(v) = &asset {
68503 query.push(("asset", v.to_string()));
68504 }
68505 if let Some(v) = ¤t {
68506 query.push(("current", v.to_string()));
68507 }
68508 query.push(("product", product.to_string()));
68509 if let Some(v) = &product_id {
68510 query.push(("productId", v.to_string()));
68511 }
68512 if let Some(v) = &recv_window {
68513 query.push(("recvWindow", v.to_string()));
68514 }
68515 query.push(("signature", signature.to_string()));
68516 if let Some(v) = &size {
68517 query.push(("size", v.to_string()));
68518 }
68519 query.push(("timestamp", timestamp.to_string()));
68520 #[allow(unused_mut)]
68521 let mut request = self
68522 .client
68523 .get(url)
68524 .header(
68525 reqwest::header::ACCEPT,
68526 reqwest::header::HeaderValue::from_static("application/json"),
68527 )
68528 .query(&query)
68529 .build()?;
68530 (crate::pre_hook)(&self.inner, &request);
68531 let result = self.client.execute(request).await;
68532 (crate::post_hook)(&self.inner, &result);
68533 let response = result?;
68534 match response.status().as_u16() {
68535 200u16 => ResponseValue::from_response(response).await,
68536 400u16 => {
68537 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68538 }
68539 401u16 => {
68540 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68541 }
68542 _ => Err(Error::UnexpectedResponse(response)),
68543 }
68544 }
68545 /**Get Staking History (USER_DATA)
68546
68547Weight(IP): 1
68548
68549Sends a `GET` request to `/sapi/v1/staking/stakingRecord`
68550
68551Arguments:
68552- `asset`
68553- `current`: Current querying page. Start from 1. Default:1
68554- `end_time`: UTC timestamp in ms
68555- `product`: * `STAKING` - for Locked Staking
68556* `F_DEFI` - for flexible DeFi Staking
68557* `L_DEFI` - for locked DeFi Staking
68558- `recv_window`: The value cannot be greater than 60000
68559- `signature`: Signature
68560- `size`: Default:10 Max:100
68561- `start_time`: UTC timestamp in ms
68562- `timestamp`: UTC timestamp in ms
68563- `txn_type`: `SUBSCRIPTION`, `REDEMPTION`, `INTEREST`
68564*/
68565 pub async fn staking_staking_record<'a>(
68566 &'a self,
68567 asset: Option<&'a str>,
68568 current: Option<i32>,
68569 end_time: Option<i64>,
68570 product: &'a str,
68571 recv_window: Option<i64>,
68572 signature: &'a str,
68573 size: Option<i32>,
68574 start_time: Option<i64>,
68575 timestamp: i64,
68576 txn_type: &'a str,
68577 ) -> Result<
68578 ResponseValue<Vec<types::StakingStakingRecordResponseItem>>,
68579 Error<types::Error>,
68580 > {
68581 let url = format!("{}/sapi/v1/staking/stakingRecord", self.baseurl,);
68582 let mut query = Vec::with_capacity(10usize);
68583 if let Some(v) = &asset {
68584 query.push(("asset", v.to_string()));
68585 }
68586 if let Some(v) = ¤t {
68587 query.push(("current", v.to_string()));
68588 }
68589 if let Some(v) = &end_time {
68590 query.push(("endTime", v.to_string()));
68591 }
68592 query.push(("product", product.to_string()));
68593 if let Some(v) = &recv_window {
68594 query.push(("recvWindow", v.to_string()));
68595 }
68596 query.push(("signature", signature.to_string()));
68597 if let Some(v) = &size {
68598 query.push(("size", v.to_string()));
68599 }
68600 if let Some(v) = &start_time {
68601 query.push(("startTime", v.to_string()));
68602 }
68603 query.push(("timestamp", timestamp.to_string()));
68604 query.push(("txnType", txn_type.to_string()));
68605 #[allow(unused_mut)]
68606 let mut request = self
68607 .client
68608 .get(url)
68609 .header(
68610 reqwest::header::ACCEPT,
68611 reqwest::header::HeaderValue::from_static("application/json"),
68612 )
68613 .query(&query)
68614 .build()?;
68615 (crate::pre_hook)(&self.inner, &request);
68616 let result = self.client.execute(request).await;
68617 (crate::post_hook)(&self.inner, &result);
68618 let response = result?;
68619 match response.status().as_u16() {
68620 200u16 => ResponseValue::from_response(response).await,
68621 400u16 => {
68622 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68623 }
68624 401u16 => {
68625 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68626 }
68627 _ => Err(Error::UnexpectedResponse(response)),
68628 }
68629 }
68630 /**Set Auto Staking (USER_DATA)
68631
68632Set auto staking on Locked Staking or Locked DeFi Staking
68633
68634Weight(IP): 1
68635
68636Sends a `POST` request to `/sapi/v1/staking/setAutoStaking`
68637
68638Arguments:
68639- `position_id`
68640- `product`: * `STAKING` - for Locked Staking
68641* `L_DEFI` - for locked DeFi Staking
68642- `recv_window`: The value cannot be greater than 60000
68643- `renewable`: true or false
68644- `signature`: Signature
68645- `timestamp`: UTC timestamp in ms
68646*/
68647 pub async fn staking_set_auto_staking<'a>(
68648 &'a self,
68649 position_id: &'a str,
68650 product: &'a str,
68651 recv_window: Option<i64>,
68652 renewable: &'a str,
68653 signature: &'a str,
68654 timestamp: i64,
68655 ) -> Result<
68656 ResponseValue<types::StakingSetAutoStakingResponse>,
68657 Error<types::Error>,
68658 > {
68659 let url = format!("{}/sapi/v1/staking/setAutoStaking", self.baseurl,);
68660 let mut query = Vec::with_capacity(6usize);
68661 query.push(("positionId", position_id.to_string()));
68662 query.push(("product", product.to_string()));
68663 if let Some(v) = &recv_window {
68664 query.push(("recvWindow", v.to_string()));
68665 }
68666 query.push(("renewable", renewable.to_string()));
68667 query.push(("signature", signature.to_string()));
68668 query.push(("timestamp", timestamp.to_string()));
68669 #[allow(unused_mut)]
68670 let mut request = self
68671 .client
68672 .post(url)
68673 .header(
68674 reqwest::header::ACCEPT,
68675 reqwest::header::HeaderValue::from_static("application/json"),
68676 )
68677 .query(&query)
68678 .build()?;
68679 (crate::pre_hook)(&self.inner, &request);
68680 let result = self.client.execute(request).await;
68681 (crate::post_hook)(&self.inner, &result);
68682 let response = result?;
68683 match response.status().as_u16() {
68684 200u16 => ResponseValue::from_response(response).await,
68685 400u16 => {
68686 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68687 }
68688 401u16 => {
68689 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68690 }
68691 _ => Err(Error::UnexpectedResponse(response)),
68692 }
68693 }
68694 /**Get Personal Left Quota of Staking Product (USER_DATA)
68695
68696Weight(IP): 1
68697
68698Sends a `GET` request to `/sapi/v1/staking/personalLeftQuota`
68699
68700Arguments:
68701- `product`: * `STAKING` - for Locked Staking
68702* `F_DEFI` - for flexible DeFi Staking
68703* `L_DEFI` - for locked DeFi Staking
68704- `product_id`
68705- `recv_window`: The value cannot be greater than 60000
68706- `signature`: Signature
68707- `timestamp`: UTC timestamp in ms
68708*/
68709 pub async fn staking_personal_left_quota<'a>(
68710 &'a self,
68711 product: &'a str,
68712 product_id: &'a str,
68713 recv_window: Option<i64>,
68714 signature: &'a str,
68715 timestamp: i64,
68716 ) -> Result<
68717 ResponseValue<Vec<types::StakingPersonalLeftQuotaResponseItem>>,
68718 Error<types::Error>,
68719 > {
68720 let url = format!("{}/sapi/v1/staking/personalLeftQuota", self.baseurl,);
68721 let mut query = Vec::with_capacity(5usize);
68722 query.push(("product", product.to_string()));
68723 query.push(("productId", product_id.to_string()));
68724 if let Some(v) = &recv_window {
68725 query.push(("recvWindow", v.to_string()));
68726 }
68727 query.push(("signature", signature.to_string()));
68728 query.push(("timestamp", timestamp.to_string()));
68729 #[allow(unused_mut)]
68730 let mut request = self
68731 .client
68732 .get(url)
68733 .header(
68734 reqwest::header::ACCEPT,
68735 reqwest::header::HeaderValue::from_static("application/json"),
68736 )
68737 .query(&query)
68738 .build()?;
68739 (crate::pre_hook)(&self.inner, &request);
68740 let result = self.client.execute(request).await;
68741 (crate::post_hook)(&self.inner, &result);
68742 let response = result?;
68743 match response.status().as_u16() {
68744 200u16 => ResponseValue::from_response(response).await,
68745 400u16 => {
68746 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68747 }
68748 401u16 => {
68749 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68750 }
68751 _ => Err(Error::UnexpectedResponse(response)),
68752 }
68753 }
68754 /**Acquiring Algorithm (MARKET_DATA)
68755
68756Weight(IP): 1
68757
68758Sends a `GET` request to `/sapi/v1/mining/pub/algoList`
68759
68760*/
68761 pub async fn mining_pub_algo_list<'a>(
68762 &'a self,
68763 ) -> Result<ResponseValue<types::MiningPubAlgoListResponse>, Error<types::Error>> {
68764 let url = format!("{}/sapi/v1/mining/pub/algoList", self.baseurl,);
68765 #[allow(unused_mut)]
68766 let mut request = self
68767 .client
68768 .get(url)
68769 .header(
68770 reqwest::header::ACCEPT,
68771 reqwest::header::HeaderValue::from_static("application/json"),
68772 )
68773 .build()?;
68774 (crate::pre_hook)(&self.inner, &request);
68775 let result = self.client.execute(request).await;
68776 (crate::post_hook)(&self.inner, &result);
68777 let response = result?;
68778 match response.status().as_u16() {
68779 200u16 => ResponseValue::from_response(response).await,
68780 400u16 => {
68781 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68782 }
68783 _ => Err(Error::UnexpectedResponse(response)),
68784 }
68785 }
68786 /**Acquiring CoinName (MARKET_DATA)
68787
68788Weight(IP): 1
68789
68790Sends a `GET` request to `/sapi/v1/mining/pub/coinList`
68791
68792*/
68793 pub async fn mining_pub_coin_list<'a>(
68794 &'a self,
68795 ) -> Result<ResponseValue<types::MiningPubCoinListResponse>, Error<types::Error>> {
68796 let url = format!("{}/sapi/v1/mining/pub/coinList", self.baseurl,);
68797 #[allow(unused_mut)]
68798 let mut request = self
68799 .client
68800 .get(url)
68801 .header(
68802 reqwest::header::ACCEPT,
68803 reqwest::header::HeaderValue::from_static("application/json"),
68804 )
68805 .build()?;
68806 (crate::pre_hook)(&self.inner, &request);
68807 let result = self.client.execute(request).await;
68808 (crate::post_hook)(&self.inner, &result);
68809 let response = result?;
68810 match response.status().as_u16() {
68811 200u16 => ResponseValue::from_response(response).await,
68812 400u16 => {
68813 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68814 }
68815 _ => Err(Error::UnexpectedResponse(response)),
68816 }
68817 }
68818 /**Request for Detail Miner List (USER_DATA)
68819
68820Weight(IP): 5
68821
68822Sends a `GET` request to `/sapi/v1/mining/worker/detail`
68823
68824Arguments:
68825- `algo`: Algorithm(sha256)
68826- `recv_window`: The value cannot be greater than 60000
68827- `signature`: Signature
68828- `timestamp`: UTC timestamp in ms
68829- `user_name`: Mining Account
68830- `worker_name`: Miner’s name
68831*/
68832 pub async fn mining_worker_detail<'a>(
68833 &'a self,
68834 algo: &'a str,
68835 recv_window: Option<i64>,
68836 signature: &'a str,
68837 timestamp: i64,
68838 user_name: &'a str,
68839 worker_name: &'a str,
68840 ) -> Result<ResponseValue<types::MiningWorkerDetailResponse>, Error<types::Error>> {
68841 let url = format!("{}/sapi/v1/mining/worker/detail", self.baseurl,);
68842 let mut query = Vec::with_capacity(6usize);
68843 query.push(("algo", algo.to_string()));
68844 if let Some(v) = &recv_window {
68845 query.push(("recvWindow", v.to_string()));
68846 }
68847 query.push(("signature", signature.to_string()));
68848 query.push(("timestamp", timestamp.to_string()));
68849 query.push(("userName", user_name.to_string()));
68850 query.push(("workerName", worker_name.to_string()));
68851 #[allow(unused_mut)]
68852 let mut request = self
68853 .client
68854 .get(url)
68855 .header(
68856 reqwest::header::ACCEPT,
68857 reqwest::header::HeaderValue::from_static("application/json"),
68858 )
68859 .query(&query)
68860 .build()?;
68861 (crate::pre_hook)(&self.inner, &request);
68862 let result = self.client.execute(request).await;
68863 (crate::post_hook)(&self.inner, &result);
68864 let response = result?;
68865 match response.status().as_u16() {
68866 200u16 => ResponseValue::from_response(response).await,
68867 400u16 => {
68868 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68869 }
68870 401u16 => {
68871 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68872 }
68873 _ => Err(Error::UnexpectedResponse(response)),
68874 }
68875 }
68876 /**Request for Miner List (USER_DATA)
68877
68878Weight(IP): 5
68879
68880Sends a `GET` request to `/sapi/v1/mining/worker/list`
68881
68882Arguments:
68883- `algo`: Algorithm(sha256)
68884- `page_index`: Page number, default is first page, start form 1
68885- `recv_window`: The value cannot be greater than 60000
68886- `signature`: Signature
68887- `sort`: sort sequence(default=0)0 positive sequence, 1 negative sequence
68888- `sort_column`: Sort by( default 1): 1: miner name, 2: real-time computing power, 3: daily average computing power, 4: real-time rejection rate, 5: last submission time
68889- `timestamp`: UTC timestamp in ms
68890- `user_name`: Mining Account
68891- `worker_status`: miners status(default=0)0 all, 1 valid, 2 invalid, 3 failure
68892*/
68893 pub async fn mining_worker_list<'a>(
68894 &'a self,
68895 algo: &'a str,
68896 page_index: Option<i32>,
68897 recv_window: Option<i64>,
68898 signature: &'a str,
68899 sort: Option<i32>,
68900 sort_column: Option<i32>,
68901 timestamp: i64,
68902 user_name: &'a str,
68903 worker_status: Option<i32>,
68904 ) -> Result<ResponseValue<types::MiningWorkerListResponse>, Error<types::Error>> {
68905 let url = format!("{}/sapi/v1/mining/worker/list", self.baseurl,);
68906 let mut query = Vec::with_capacity(9usize);
68907 query.push(("algo", algo.to_string()));
68908 if let Some(v) = &page_index {
68909 query.push(("pageIndex", v.to_string()));
68910 }
68911 if let Some(v) = &recv_window {
68912 query.push(("recvWindow", v.to_string()));
68913 }
68914 query.push(("signature", signature.to_string()));
68915 if let Some(v) = &sort {
68916 query.push(("sort", v.to_string()));
68917 }
68918 if let Some(v) = &sort_column {
68919 query.push(("sortColumn", v.to_string()));
68920 }
68921 query.push(("timestamp", timestamp.to_string()));
68922 query.push(("userName", user_name.to_string()));
68923 if let Some(v) = &worker_status {
68924 query.push(("workerStatus", v.to_string()));
68925 }
68926 #[allow(unused_mut)]
68927 let mut request = self
68928 .client
68929 .get(url)
68930 .header(
68931 reqwest::header::ACCEPT,
68932 reqwest::header::HeaderValue::from_static("application/json"),
68933 )
68934 .query(&query)
68935 .build()?;
68936 (crate::pre_hook)(&self.inner, &request);
68937 let result = self.client.execute(request).await;
68938 (crate::post_hook)(&self.inner, &result);
68939 let response = result?;
68940 match response.status().as_u16() {
68941 200u16 => ResponseValue::from_response(response).await,
68942 400u16 => {
68943 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68944 }
68945 401u16 => {
68946 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
68947 }
68948 _ => Err(Error::UnexpectedResponse(response)),
68949 }
68950 }
68951 /**Earnings List (USER_DATA)
68952
68953Weight(IP): 5
68954
68955Sends a `GET` request to `/sapi/v1/mining/payment/list`
68956
68957Arguments:
68958- `algo`: Algorithm(sha256)
68959- `coin`: Coin name
68960- `end_date`: Search date, millisecond timestamp, while empty query all
68961- `page_index`: Page number, default is first page, start form 1
68962- `page_size`: Number of pages, minimum 10, maximum 200
68963- `recv_window`: The value cannot be greater than 60000
68964- `signature`: Signature
68965- `start_date`: Search date, millisecond timestamp, while empty query all
68966- `timestamp`: UTC timestamp in ms
68967- `user_name`: Mining Account
68968*/
68969 pub async fn mining_payment_list<'a>(
68970 &'a self,
68971 algo: &'a str,
68972 coin: Option<&'a str>,
68973 end_date: Option<&'a str>,
68974 page_index: Option<i32>,
68975 page_size: Option<&'a str>,
68976 recv_window: Option<i64>,
68977 signature: &'a str,
68978 start_date: Option<&'a str>,
68979 timestamp: i64,
68980 user_name: &'a str,
68981 ) -> Result<ResponseValue<types::MiningPaymentListResponse>, Error<types::Error>> {
68982 let url = format!("{}/sapi/v1/mining/payment/list", self.baseurl,);
68983 let mut query = Vec::with_capacity(10usize);
68984 query.push(("algo", algo.to_string()));
68985 if let Some(v) = &coin {
68986 query.push(("coin", v.to_string()));
68987 }
68988 if let Some(v) = &end_date {
68989 query.push(("endDate", v.to_string()));
68990 }
68991 if let Some(v) = &page_index {
68992 query.push(("pageIndex", v.to_string()));
68993 }
68994 if let Some(v) = &page_size {
68995 query.push(("pageSize", v.to_string()));
68996 }
68997 if let Some(v) = &recv_window {
68998 query.push(("recvWindow", v.to_string()));
68999 }
69000 query.push(("signature", signature.to_string()));
69001 if let Some(v) = &start_date {
69002 query.push(("startDate", v.to_string()));
69003 }
69004 query.push(("timestamp", timestamp.to_string()));
69005 query.push(("userName", user_name.to_string()));
69006 #[allow(unused_mut)]
69007 let mut request = self
69008 .client
69009 .get(url)
69010 .header(
69011 reqwest::header::ACCEPT,
69012 reqwest::header::HeaderValue::from_static("application/json"),
69013 )
69014 .query(&query)
69015 .build()?;
69016 (crate::pre_hook)(&self.inner, &request);
69017 let result = self.client.execute(request).await;
69018 (crate::post_hook)(&self.inner, &result);
69019 let response = result?;
69020 match response.status().as_u16() {
69021 200u16 => ResponseValue::from_response(response).await,
69022 400u16 => {
69023 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69024 }
69025 401u16 => {
69026 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69027 }
69028 _ => Err(Error::UnexpectedResponse(response)),
69029 }
69030 }
69031 /**Extra Bonus List (USER_DATA)
69032
69033Weight(IP): 5
69034
69035Sends a `GET` request to `/sapi/v1/mining/payment/other`
69036
69037Arguments:
69038- `algo`: Algorithm(sha256)
69039- `coin`: Coin name
69040- `end_date`: Search date, millisecond timestamp, while empty query all
69041- `page_index`: Page number, default is first page, start form 1
69042- `page_size`: Number of pages, minimum 10, maximum 200
69043- `recv_window`: The value cannot be greater than 60000
69044- `signature`: Signature
69045- `start_date`: Search date, millisecond timestamp, while empty query all
69046- `timestamp`: UTC timestamp in ms
69047- `user_name`: Mining Account
69048*/
69049 pub async fn mining_payment_other<'a>(
69050 &'a self,
69051 algo: &'a str,
69052 coin: Option<&'a str>,
69053 end_date: Option<&'a str>,
69054 page_index: Option<i32>,
69055 page_size: Option<&'a str>,
69056 recv_window: Option<i64>,
69057 signature: &'a str,
69058 start_date: Option<&'a str>,
69059 timestamp: i64,
69060 user_name: &'a str,
69061 ) -> Result<ResponseValue<types::MiningPaymentOtherResponse>, Error<types::Error>> {
69062 let url = format!("{}/sapi/v1/mining/payment/other", self.baseurl,);
69063 let mut query = Vec::with_capacity(10usize);
69064 query.push(("algo", algo.to_string()));
69065 if let Some(v) = &coin {
69066 query.push(("coin", v.to_string()));
69067 }
69068 if let Some(v) = &end_date {
69069 query.push(("endDate", v.to_string()));
69070 }
69071 if let Some(v) = &page_index {
69072 query.push(("pageIndex", v.to_string()));
69073 }
69074 if let Some(v) = &page_size {
69075 query.push(("pageSize", v.to_string()));
69076 }
69077 if let Some(v) = &recv_window {
69078 query.push(("recvWindow", v.to_string()));
69079 }
69080 query.push(("signature", signature.to_string()));
69081 if let Some(v) = &start_date {
69082 query.push(("startDate", v.to_string()));
69083 }
69084 query.push(("timestamp", timestamp.to_string()));
69085 query.push(("userName", user_name.to_string()));
69086 #[allow(unused_mut)]
69087 let mut request = self
69088 .client
69089 .get(url)
69090 .header(
69091 reqwest::header::ACCEPT,
69092 reqwest::header::HeaderValue::from_static("application/json"),
69093 )
69094 .query(&query)
69095 .build()?;
69096 (crate::pre_hook)(&self.inner, &request);
69097 let result = self.client.execute(request).await;
69098 (crate::post_hook)(&self.inner, &result);
69099 let response = result?;
69100 match response.status().as_u16() {
69101 200u16 => ResponseValue::from_response(response).await,
69102 400u16 => {
69103 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69104 }
69105 401u16 => {
69106 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69107 }
69108 _ => Err(Error::UnexpectedResponse(response)),
69109 }
69110 }
69111 /**Hashrate Resale List (USER_DATA)
69112
69113Weight(IP): 5
69114
69115Sends a `GET` request to `/sapi/v1/mining/hash-transfer/config/details/list`
69116
69117Arguments:
69118- `page_index`: Page number, default is first page, start form 1
69119- `page_size`: Number of pages, minimum 10, maximum 200
69120- `recv_window`: The value cannot be greater than 60000
69121- `signature`: Signature
69122- `timestamp`: UTC timestamp in ms
69123*/
69124 pub async fn mining_hash_transfer_config_details_list<'a>(
69125 &'a self,
69126 page_index: Option<i32>,
69127 page_size: Option<&'a str>,
69128 recv_window: Option<i64>,
69129 signature: &'a str,
69130 timestamp: i64,
69131 ) -> Result<
69132 ResponseValue<types::MiningHashTransferConfigDetailsListResponse>,
69133 Error<types::Error>,
69134 > {
69135 let url = format!(
69136 "{}/sapi/v1/mining/hash-transfer/config/details/list", self.baseurl,
69137 );
69138 let mut query = Vec::with_capacity(5usize);
69139 if let Some(v) = &page_index {
69140 query.push(("pageIndex", v.to_string()));
69141 }
69142 if let Some(v) = &page_size {
69143 query.push(("pageSize", v.to_string()));
69144 }
69145 if let Some(v) = &recv_window {
69146 query.push(("recvWindow", v.to_string()));
69147 }
69148 query.push(("signature", signature.to_string()));
69149 query.push(("timestamp", timestamp.to_string()));
69150 #[allow(unused_mut)]
69151 let mut request = self
69152 .client
69153 .get(url)
69154 .header(
69155 reqwest::header::ACCEPT,
69156 reqwest::header::HeaderValue::from_static("application/json"),
69157 )
69158 .query(&query)
69159 .build()?;
69160 (crate::pre_hook)(&self.inner, &request);
69161 let result = self.client.execute(request).await;
69162 (crate::post_hook)(&self.inner, &result);
69163 let response = result?;
69164 match response.status().as_u16() {
69165 200u16 => ResponseValue::from_response(response).await,
69166 400u16 => {
69167 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69168 }
69169 401u16 => {
69170 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69171 }
69172 _ => Err(Error::UnexpectedResponse(response)),
69173 }
69174 }
69175 /**Hashrate Resale Details (USER_DATA)
69176
69177Weight(IP): 5
69178
69179Sends a `GET` request to `/sapi/v1/mining/hash-transfer/profit/details`
69180
69181Arguments:
69182- `config_id`: Mining ID
69183- `page_index`: Page number, default is first page, start form 1
69184- `page_size`: Number of pages, minimum 10, maximum 200
69185- `recv_window`: The value cannot be greater than 60000
69186- `signature`: Signature
69187- `timestamp`: UTC timestamp in ms
69188- `user_name`: Mining Account
69189*/
69190 pub async fn mining_hash_transfer_profit_details<'a>(
69191 &'a self,
69192 config_id: &'a str,
69193 page_index: Option<i32>,
69194 page_size: Option<&'a str>,
69195 recv_window: Option<i64>,
69196 signature: &'a str,
69197 timestamp: i64,
69198 user_name: &'a str,
69199 ) -> Result<
69200 ResponseValue<types::MiningHashTransferProfitDetailsResponse>,
69201 Error<types::Error>,
69202 > {
69203 let url = format!(
69204 "{}/sapi/v1/mining/hash-transfer/profit/details", self.baseurl,
69205 );
69206 let mut query = Vec::with_capacity(7usize);
69207 query.push(("configId", config_id.to_string()));
69208 if let Some(v) = &page_index {
69209 query.push(("pageIndex", v.to_string()));
69210 }
69211 if let Some(v) = &page_size {
69212 query.push(("pageSize", v.to_string()));
69213 }
69214 if let Some(v) = &recv_window {
69215 query.push(("recvWindow", v.to_string()));
69216 }
69217 query.push(("signature", signature.to_string()));
69218 query.push(("timestamp", timestamp.to_string()));
69219 query.push(("userName", user_name.to_string()));
69220 #[allow(unused_mut)]
69221 let mut request = self
69222 .client
69223 .get(url)
69224 .header(
69225 reqwest::header::ACCEPT,
69226 reqwest::header::HeaderValue::from_static("application/json"),
69227 )
69228 .query(&query)
69229 .build()?;
69230 (crate::pre_hook)(&self.inner, &request);
69231 let result = self.client.execute(request).await;
69232 (crate::post_hook)(&self.inner, &result);
69233 let response = result?;
69234 match response.status().as_u16() {
69235 200u16 => ResponseValue::from_response(response).await,
69236 400u16 => {
69237 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69238 }
69239 401u16 => {
69240 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69241 }
69242 _ => Err(Error::UnexpectedResponse(response)),
69243 }
69244 }
69245 /**Hashrate Resale Request (USER_DATA)
69246
69247Weight(IP): 5
69248
69249Sends a `POST` request to `/sapi/v1/mining/hash-transfer/config`
69250
69251Arguments:
69252- `algo`: Algorithm(sha256)
69253- `end_date`: Search date, millisecond timestamp, while empty query all
69254- `hash_rate`: Resale hashrate h/s must be transferred (BTC is greater than 500000000000 ETH is greater than 500000)
69255- `recv_window`: The value cannot be greater than 60000
69256- `signature`: Signature
69257- `start_date`: Search date, millisecond timestamp, while empty query all
69258- `timestamp`: UTC timestamp in ms
69259- `to_pool_user`: Mining Account
69260- `user_name`: Mining Account
69261*/
69262 pub async fn mining_hash_transfer_config<'a>(
69263 &'a self,
69264 algo: &'a str,
69265 end_date: Option<&'a str>,
69266 hash_rate: &'a str,
69267 recv_window: Option<i64>,
69268 signature: &'a str,
69269 start_date: Option<&'a str>,
69270 timestamp: i64,
69271 to_pool_user: &'a str,
69272 user_name: &'a str,
69273 ) -> Result<
69274 ResponseValue<types::MiningHashTransferConfigResponse>,
69275 Error<types::Error>,
69276 > {
69277 let url = format!("{}/sapi/v1/mining/hash-transfer/config", self.baseurl,);
69278 let mut query = Vec::with_capacity(9usize);
69279 query.push(("algo", algo.to_string()));
69280 if let Some(v) = &end_date {
69281 query.push(("endDate", v.to_string()));
69282 }
69283 query.push(("hashRate", hash_rate.to_string()));
69284 if let Some(v) = &recv_window {
69285 query.push(("recvWindow", v.to_string()));
69286 }
69287 query.push(("signature", signature.to_string()));
69288 if let Some(v) = &start_date {
69289 query.push(("startDate", v.to_string()));
69290 }
69291 query.push(("timestamp", timestamp.to_string()));
69292 query.push(("toPoolUser", to_pool_user.to_string()));
69293 query.push(("userName", user_name.to_string()));
69294 #[allow(unused_mut)]
69295 let mut request = self
69296 .client
69297 .post(url)
69298 .header(
69299 reqwest::header::ACCEPT,
69300 reqwest::header::HeaderValue::from_static("application/json"),
69301 )
69302 .query(&query)
69303 .build()?;
69304 (crate::pre_hook)(&self.inner, &request);
69305 let result = self.client.execute(request).await;
69306 (crate::post_hook)(&self.inner, &result);
69307 let response = result?;
69308 match response.status().as_u16() {
69309 200u16 => ResponseValue::from_response(response).await,
69310 400u16 => {
69311 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69312 }
69313 401u16 => {
69314 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69315 }
69316 _ => Err(Error::UnexpectedResponse(response)),
69317 }
69318 }
69319 /**Cancel Hashrate Resale configuration (USER_DATA)
69320
69321Weight(IP): 5
69322
69323Sends a `POST` request to `/sapi/v1/mining/hash-transfer/config/cancel`
69324
69325Arguments:
69326- `config_id`: Mining ID
69327- `recv_window`: The value cannot be greater than 60000
69328- `signature`: Signature
69329- `timestamp`: UTC timestamp in ms
69330- `user_name`: Mining Account
69331*/
69332 pub async fn mining_hash_transfer_config_cancel<'a>(
69333 &'a self,
69334 config_id: &'a str,
69335 recv_window: Option<i64>,
69336 signature: &'a str,
69337 timestamp: i64,
69338 user_name: &'a str,
69339 ) -> Result<
69340 ResponseValue<types::MiningHashTransferConfigCancelResponse>,
69341 Error<types::Error>,
69342 > {
69343 let url = format!(
69344 "{}/sapi/v1/mining/hash-transfer/config/cancel", self.baseurl,
69345 );
69346 let mut query = Vec::with_capacity(5usize);
69347 query.push(("configId", config_id.to_string()));
69348 if let Some(v) = &recv_window {
69349 query.push(("recvWindow", v.to_string()));
69350 }
69351 query.push(("signature", signature.to_string()));
69352 query.push(("timestamp", timestamp.to_string()));
69353 query.push(("userName", user_name.to_string()));
69354 #[allow(unused_mut)]
69355 let mut request = self
69356 .client
69357 .post(url)
69358 .header(
69359 reqwest::header::ACCEPT,
69360 reqwest::header::HeaderValue::from_static("application/json"),
69361 )
69362 .query(&query)
69363 .build()?;
69364 (crate::pre_hook)(&self.inner, &request);
69365 let result = self.client.execute(request).await;
69366 (crate::post_hook)(&self.inner, &result);
69367 let response = result?;
69368 match response.status().as_u16() {
69369 200u16 => ResponseValue::from_response(response).await,
69370 400u16 => {
69371 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69372 }
69373 401u16 => {
69374 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69375 }
69376 _ => Err(Error::UnexpectedResponse(response)),
69377 }
69378 }
69379 /**Statistic List (USER_DATA)
69380
69381Weight(IP): 5
69382
69383Sends a `GET` request to `/sapi/v1/mining/statistics/user/status`
69384
69385Arguments:
69386- `algo`: Algorithm(sha256)
69387- `recv_window`: The value cannot be greater than 60000
69388- `signature`: Signature
69389- `timestamp`: UTC timestamp in ms
69390- `user_name`: Mining Account
69391*/
69392 pub async fn mining_statistics_user_status<'a>(
69393 &'a self,
69394 algo: &'a str,
69395 recv_window: Option<i64>,
69396 signature: &'a str,
69397 timestamp: i64,
69398 user_name: &'a str,
69399 ) -> Result<
69400 ResponseValue<types::MiningStatisticsUserStatusResponse>,
69401 Error<types::Error>,
69402 > {
69403 let url = format!("{}/sapi/v1/mining/statistics/user/status", self.baseurl,);
69404 let mut query = Vec::with_capacity(5usize);
69405 query.push(("algo", algo.to_string()));
69406 if let Some(v) = &recv_window {
69407 query.push(("recvWindow", v.to_string()));
69408 }
69409 query.push(("signature", signature.to_string()));
69410 query.push(("timestamp", timestamp.to_string()));
69411 query.push(("userName", user_name.to_string()));
69412 #[allow(unused_mut)]
69413 let mut request = self
69414 .client
69415 .get(url)
69416 .header(
69417 reqwest::header::ACCEPT,
69418 reqwest::header::HeaderValue::from_static("application/json"),
69419 )
69420 .query(&query)
69421 .build()?;
69422 (crate::pre_hook)(&self.inner, &request);
69423 let result = self.client.execute(request).await;
69424 (crate::post_hook)(&self.inner, &result);
69425 let response = result?;
69426 match response.status().as_u16() {
69427 200u16 => ResponseValue::from_response(response).await,
69428 400u16 => {
69429 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69430 }
69431 401u16 => {
69432 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69433 }
69434 _ => Err(Error::UnexpectedResponse(response)),
69435 }
69436 }
69437 /**Account List (USER_DATA)
69438
69439Weight(IP): 5
69440
69441Sends a `GET` request to `/sapi/v1/mining/statistics/user/list`
69442
69443Arguments:
69444- `algo`: Algorithm(sha256)
69445- `recv_window`: The value cannot be greater than 60000
69446- `signature`: Signature
69447- `timestamp`: UTC timestamp in ms
69448- `user_name`: Mining Account
69449*/
69450 pub async fn mining_statistics_user_list<'a>(
69451 &'a self,
69452 algo: &'a str,
69453 recv_window: Option<i64>,
69454 signature: &'a str,
69455 timestamp: i64,
69456 user_name: &'a str,
69457 ) -> Result<
69458 ResponseValue<types::MiningStatisticsUserListResponse>,
69459 Error<types::Error>,
69460 > {
69461 let url = format!("{}/sapi/v1/mining/statistics/user/list", self.baseurl,);
69462 let mut query = Vec::with_capacity(5usize);
69463 query.push(("algo", algo.to_string()));
69464 if let Some(v) = &recv_window {
69465 query.push(("recvWindow", v.to_string()));
69466 }
69467 query.push(("signature", signature.to_string()));
69468 query.push(("timestamp", timestamp.to_string()));
69469 query.push(("userName", user_name.to_string()));
69470 #[allow(unused_mut)]
69471 let mut request = self
69472 .client
69473 .get(url)
69474 .header(
69475 reqwest::header::ACCEPT,
69476 reqwest::header::HeaderValue::from_static("application/json"),
69477 )
69478 .query(&query)
69479 .build()?;
69480 (crate::pre_hook)(&self.inner, &request);
69481 let result = self.client.execute(request).await;
69482 (crate::post_hook)(&self.inner, &result);
69483 let response = result?;
69484 match response.status().as_u16() {
69485 200u16 => ResponseValue::from_response(response).await,
69486 400u16 => {
69487 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69488 }
69489 401u16 => {
69490 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69491 }
69492 _ => Err(Error::UnexpectedResponse(response)),
69493 }
69494 }
69495 /**Mining Account Earning (USER_DATA)
69496
69497Weight(IP): 5
69498
69499Sends a `GET` request to `/sapi/v1/mining/payment/uid`
69500
69501Arguments:
69502- `algo`: Algorithm(sha256)
69503- `end_date`: Search date, millisecond timestamp, while empty query all
69504- `page_index`: Page number, default is first page, start form 1
69505- `page_size`: Number of pages, minimum 10, maximum 200
69506- `recv_window`: The value cannot be greater than 60000
69507- `signature`: Signature
69508- `start_date`: Search date, millisecond timestamp, while empty query all
69509- `timestamp`: UTC timestamp in ms
69510*/
69511 pub async fn mining_payment_uid<'a>(
69512 &'a self,
69513 algo: &'a str,
69514 end_date: Option<&'a str>,
69515 page_index: Option<i32>,
69516 page_size: Option<&'a str>,
69517 recv_window: Option<i64>,
69518 signature: &'a str,
69519 start_date: Option<&'a str>,
69520 timestamp: i64,
69521 ) -> Result<ResponseValue<types::MiningPaymentUidResponse>, Error<types::Error>> {
69522 let url = format!("{}/sapi/v1/mining/payment/uid", self.baseurl,);
69523 let mut query = Vec::with_capacity(8usize);
69524 query.push(("algo", algo.to_string()));
69525 if let Some(v) = &end_date {
69526 query.push(("endDate", v.to_string()));
69527 }
69528 if let Some(v) = &page_index {
69529 query.push(("pageIndex", v.to_string()));
69530 }
69531 if let Some(v) = &page_size {
69532 query.push(("pageSize", v.to_string()));
69533 }
69534 if let Some(v) = &recv_window {
69535 query.push(("recvWindow", v.to_string()));
69536 }
69537 query.push(("signature", signature.to_string()));
69538 if let Some(v) = &start_date {
69539 query.push(("startDate", v.to_string()));
69540 }
69541 query.push(("timestamp", timestamp.to_string()));
69542 #[allow(unused_mut)]
69543 let mut request = self
69544 .client
69545 .get(url)
69546 .header(
69547 reqwest::header::ACCEPT,
69548 reqwest::header::HeaderValue::from_static("application/json"),
69549 )
69550 .query(&query)
69551 .build()?;
69552 (crate::pre_hook)(&self.inner, &request);
69553 let result = self.client.execute(request).await;
69554 (crate::post_hook)(&self.inner, &result);
69555 let response = result?;
69556 match response.status().as_u16() {
69557 200u16 => ResponseValue::from_response(response).await,
69558 400u16 => {
69559 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69560 }
69561 401u16 => {
69562 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69563 }
69564 _ => Err(Error::UnexpectedResponse(response)),
69565 }
69566 }
69567 /**Get Future Account Transaction History List (USER_DATA)
69568
69569Weight(IP): 10
69570
69571Sends a `GET` request to `/sapi/v1/futures/transfer`
69572
69573Arguments:
69574- `asset`
69575- `current`: Current querying page. Start from 1. Default:1
69576- `end_time`: UTC timestamp in ms
69577- `recv_window`: The value cannot be greater than 60000
69578- `signature`: Signature
69579- `size`: Default:10 Max:100
69580- `start_time`: UTC timestamp in ms
69581- `timestamp`: UTC timestamp in ms
69582*/
69583 pub async fn get_future_account_transaction_history<'a>(
69584 &'a self,
69585 asset: &'a str,
69586 current: Option<i32>,
69587 end_time: Option<i64>,
69588 recv_window: Option<i64>,
69589 signature: &'a str,
69590 size: Option<i32>,
69591 start_time: i64,
69592 timestamp: i64,
69593 ) -> Result<
69594 ResponseValue<types::GetFutureAccountTransactionHistoryResponse>,
69595 Error<types::Error>,
69596 > {
69597 let url = format!("{}/sapi/v1/futures/transfer", self.baseurl,);
69598 let mut query = Vec::with_capacity(8usize);
69599 query.push(("asset", asset.to_string()));
69600 if let Some(v) = ¤t {
69601 query.push(("current", v.to_string()));
69602 }
69603 if let Some(v) = &end_time {
69604 query.push(("endTime", v.to_string()));
69605 }
69606 if let Some(v) = &recv_window {
69607 query.push(("recvWindow", v.to_string()));
69608 }
69609 query.push(("signature", signature.to_string()));
69610 if let Some(v) = &size {
69611 query.push(("size", v.to_string()));
69612 }
69613 query.push(("startTime", start_time.to_string()));
69614 query.push(("timestamp", timestamp.to_string()));
69615 #[allow(unused_mut)]
69616 let mut request = self
69617 .client
69618 .get(url)
69619 .header(
69620 reqwest::header::ACCEPT,
69621 reqwest::header::HeaderValue::from_static("application/json"),
69622 )
69623 .query(&query)
69624 .build()?;
69625 (crate::pre_hook)(&self.inner, &request);
69626 let result = self.client.execute(request).await;
69627 (crate::post_hook)(&self.inner, &result);
69628 let response = result?;
69629 match response.status().as_u16() {
69630 200u16 => ResponseValue::from_response(response).await,
69631 400u16 => {
69632 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69633 }
69634 401u16 => {
69635 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69636 }
69637 _ => Err(Error::UnexpectedResponse(response)),
69638 }
69639 }
69640 /**New Future Account Transfer (USER_DATA)
69641
69642Execute transfer between spot account and futures account.
69643
69644Weight(IP): 1
69645
69646Sends a `POST` request to `/sapi/v1/futures/transfer`
69647
69648Arguments:
69649- `amount`
69650- `asset`
69651- `recv_window`: The value cannot be greater than 60000
69652- `signature`: Signature
69653- `timestamp`: UTC timestamp in ms
69654- `type_`: 1: transfer from spot account to USDT-Ⓜ futures account. 2: transfer from USDT-Ⓜ futures account to spot account. 3: transfer from spot account to COIN-Ⓜ futures account. 4: transfer from COIN-Ⓜ futures account to spot account.
69655*/
69656 pub async fn futures_transfer<'a>(
69657 &'a self,
69658 amount: f64,
69659 asset: &'a str,
69660 recv_window: Option<i64>,
69661 signature: &'a str,
69662 timestamp: i64,
69663 type_: i64,
69664 ) -> Result<ResponseValue<types::FuturesTransferResponse>, Error<types::Error>> {
69665 let url = format!("{}/sapi/v1/futures/transfer", self.baseurl,);
69666 let mut query = Vec::with_capacity(6usize);
69667 query.push(("amount", amount.to_string()));
69668 query.push(("asset", asset.to_string()));
69669 if let Some(v) = &recv_window {
69670 query.push(("recvWindow", v.to_string()));
69671 }
69672 query.push(("signature", signature.to_string()));
69673 query.push(("timestamp", timestamp.to_string()));
69674 query.push(("type", type_.to_string()));
69675 #[allow(unused_mut)]
69676 let mut request = self
69677 .client
69678 .post(url)
69679 .header(
69680 reqwest::header::ACCEPT,
69681 reqwest::header::HeaderValue::from_static("application/json"),
69682 )
69683 .query(&query)
69684 .build()?;
69685 (crate::pre_hook)(&self.inner, &request);
69686 let result = self.client.execute(request).await;
69687 (crate::post_hook)(&self.inner, &result);
69688 let response = result?;
69689 match response.status().as_u16() {
69690 200u16 => ResponseValue::from_response(response).await,
69691 400u16 => {
69692 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69693 }
69694 401u16 => {
69695 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69696 }
69697 _ => Err(Error::UnexpectedResponse(response)),
69698 }
69699 }
69700 /**Get Future TickLevel Orderbook Historical Data Download Link (USER_DATA)
69701
69702Weight(IP): 1
69703
69704Sends a `GET` request to `/sapi/v1/futures/histDataLink`
69705
69706Arguments:
69707- `data_type`
69708- `end_time`: UTC timestamp in ms
69709- `recv_window`: The value cannot be greater than 60000
69710- `signature`: Signature
69711- `start_time`: UTC timestamp in ms
69712- `symbol`
69713- `timestamp`: UTC timestamp in ms
69714*/
69715 pub async fn futures_hist_data_link<'a>(
69716 &'a self,
69717 data_type: types::FuturesHistDataLinkDataType,
69718 end_time: Option<i64>,
69719 recv_window: Option<i64>,
69720 signature: &'a str,
69721 start_time: Option<i64>,
69722 symbol: &'a str,
69723 timestamp: i64,
69724 ) -> Result<ResponseValue<types::FuturesHistDataLinkResponse>, Error<types::Error>> {
69725 let url = format!("{}/sapi/v1/futures/histDataLink", self.baseurl,);
69726 let mut query = Vec::with_capacity(7usize);
69727 query.push(("dataType", data_type.to_string()));
69728 if let Some(v) = &end_time {
69729 query.push(("endTime", v.to_string()));
69730 }
69731 if let Some(v) = &recv_window {
69732 query.push(("recvWindow", v.to_string()));
69733 }
69734 query.push(("signature", signature.to_string()));
69735 if let Some(v) = &start_time {
69736 query.push(("startTime", v.to_string()));
69737 }
69738 query.push(("symbol", symbol.to_string()));
69739 query.push(("timestamp", timestamp.to_string()));
69740 #[allow(unused_mut)]
69741 let mut request = self
69742 .client
69743 .get(url)
69744 .header(
69745 reqwest::header::ACCEPT,
69746 reqwest::header::HeaderValue::from_static("application/json"),
69747 )
69748 .query(&query)
69749 .build()?;
69750 (crate::pre_hook)(&self.inner, &request);
69751 let result = self.client.execute(request).await;
69752 (crate::post_hook)(&self.inner, &result);
69753 let response = result?;
69754 match response.status().as_u16() {
69755 200u16 => ResponseValue::from_response(response).await,
69756 400u16 => {
69757 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69758 }
69759 401u16 => {
69760 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69761 }
69762 _ => Err(Error::UnexpectedResponse(response)),
69763 }
69764 }
69765 /**Volume Participation(VP) New Order (TRADE)
69766
69767Send in a VP new order. Only support on USDⓈ-M Contracts.
69768
69769- You need to enable `Futures Trading Permission` for the api key which requests this endpoint.
69770- Base URL: https://api.binance.com
69771
69772- Total Algo open orders max allowed: 10 orders.
69773- Leverage of symbols and position mode will be the same as your futures account settings. You can set up through the trading page or fapi.
69774- Receiving "success": true does not mean that your order will be executed. Please use the query order endpoints(GET sapi/v1/algo/futures/openOrders or GET sapi/v1/algo/futures/historicalOrders) to check the order status. For example: Your futures balance is insufficient, or open position with reduce only or position side is inconsistent with your own setting. In these cases you will receive "success": true, but the order status will be expired after we check it.
69775
69776Weight(UID): 3000
69777
69778Sends a `POST` request to `/sapi/v1/algo/futures/newOrderVp`
69779
69780Arguments:
69781- `client_algo_id`: A unique id among Algo orders (length should be 32 characters), If it is not sent, we will give default value
69782- `limit_price`: Limit price of the order; If it is not sent, will place order by market price by default
69783- `position_side`: Default BOTH for One-way Mode ; LONG or SHORT for Hedge Mode. It must be sent in Hedge Mode.
69784- `quantity`: Quantity of base asset; The notional (quantity * mark price(base asset)) must be more than the equivalent of 10,000 USDT and less than the equivalent of 1,000,000 USDT
69785- `recv_window`: The value cannot be greater than 60000
69786- `reduce_only`: 'true' or 'false'. Default 'false'; Cannot be sent in Hedge Mode; Cannot be sent when you open a position
69787- `side`
69788- `signature`: Signature
69789- `symbol`: Trading symbol, e.g. BNBUSDT
69790- `timestamp`: UTC timestamp in ms
69791- `urgency`: Represent the relative speed of the current execution; ENUM: LOW, MEDIUM, HIGH
69792*/
69793 pub async fn algo_futures_new_order_vp<'a>(
69794 &'a self,
69795 client_algo_id: Option<&'a str>,
69796 limit_price: Option<f64>,
69797 position_side: Option<types::AlgoFuturesNewOrderVpPositionSide>,
69798 quantity: f64,
69799 recv_window: Option<i64>,
69800 reduce_only: Option<bool>,
69801 side: types::AlgoFuturesNewOrderVpSide,
69802 signature: &'a str,
69803 symbol: &'a str,
69804 timestamp: i64,
69805 urgency: types::AlgoFuturesNewOrderVpUrgency,
69806 ) -> Result<
69807 ResponseValue<types::AlgoFuturesNewOrderVpResponse>,
69808 Error<types::Error>,
69809 > {
69810 let url = format!("{}/sapi/v1/algo/futures/newOrderVp", self.baseurl,);
69811 let mut query = Vec::with_capacity(11usize);
69812 if let Some(v) = &client_algo_id {
69813 query.push(("clientAlgoId", v.to_string()));
69814 }
69815 if let Some(v) = &limit_price {
69816 query.push(("limitPrice", v.to_string()));
69817 }
69818 if let Some(v) = &position_side {
69819 query.push(("positionSide", v.to_string()));
69820 }
69821 query.push(("quantity", quantity.to_string()));
69822 if let Some(v) = &recv_window {
69823 query.push(("recvWindow", v.to_string()));
69824 }
69825 if let Some(v) = &reduce_only {
69826 query.push(("reduceOnly", v.to_string()));
69827 }
69828 query.push(("side", side.to_string()));
69829 query.push(("signature", signature.to_string()));
69830 query.push(("symbol", symbol.to_string()));
69831 query.push(("timestamp", timestamp.to_string()));
69832 query.push(("urgency", urgency.to_string()));
69833 #[allow(unused_mut)]
69834 let mut request = self
69835 .client
69836 .post(url)
69837 .header(
69838 reqwest::header::ACCEPT,
69839 reqwest::header::HeaderValue::from_static("application/json"),
69840 )
69841 .query(&query)
69842 .build()?;
69843 (crate::pre_hook)(&self.inner, &request);
69844 let result = self.client.execute(request).await;
69845 (crate::post_hook)(&self.inner, &result);
69846 let response = result?;
69847 match response.status().as_u16() {
69848 200u16 => ResponseValue::from_response(response).await,
69849 400u16 => {
69850 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69851 }
69852 401u16 => {
69853 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69854 }
69855 _ => Err(Error::UnexpectedResponse(response)),
69856 }
69857 }
69858 /**Time-Weighted Average Price(Twap) New Order (TRADE)
69859
69860Send in a Twap new order. Only support on USDⓈ-M Contracts.
69861
69862You need to enable Futures Trading Permission for the api key which requests this endpoint.
69863Base URL: https://api.binance.com
69864
69865- Total Algo open orders max allowed: 10 orders.
69866- Leverage of symbols and position mode will be the same as your futures account settings. You can set up through the trading page or fapi.
69867- Receiving "success": true does not mean that your order will be executed. Please use the query order endpoints(GET sapi/v1/algo/futures/openOrders or GET sapi/v1/algo/futures/historicalOrders) to check the order status. For example: Your futures balance is insufficient, or open position with reduce only or position side is inconsistent with your own setting. In these cases you will receive "success": true, but the order status will be expired after we check it.
69868- quantity * 60 / duration should be larger than minQty
69869- duration cannot be less than 5 mins or more than 24 hours.
69870- For delivery contracts, TWAP end time should be one hour earlier than the delivery time of the symbol.
69871
69872Weight(UID): 3000
69873
69874Sends a `POST` request to `/sapi/v1/algo/futures/newOrderTwap`
69875
69876Arguments:
69877- `client_algo_id`: A unique id among Algo orders (length should be 32 characters), If it is not sent, we will give default value
69878- `duration`: Duration for TWAP orders in seconds. [300, 86400];Less than 5min => defaults to 5 min; Greater than 24h => defaults to 24h
69879- `limit_price`: Limit price of the order; If it is not sent, will place order by market price by default
69880- `position_side`: Default BOTH for One-way Mode ; LONG or SHORT for Hedge Mode. It must be sent in Hedge Mode.
69881- `quantity`: Quantity of base asset; The notional (quantity * mark price(base asset)) must be more than the equivalent of 10,000 USDT and less than the equivalent of 1,000,000 USDT
69882- `recv_window`: The value cannot be greater than 60000
69883- `reduce_only`: 'true' or 'false'. Default 'false'; Cannot be sent in Hedge Mode; Cannot be sent when you open a position
69884- `side`
69885- `signature`: Signature
69886- `symbol`: Trading symbol, e.g. BNBUSDT
69887- `timestamp`: UTC timestamp in ms
69888*/
69889 pub async fn algo_futures_new_order_twap<'a>(
69890 &'a self,
69891 client_algo_id: Option<&'a str>,
69892 duration: i64,
69893 limit_price: Option<f64>,
69894 position_side: Option<types::AlgoFuturesNewOrderTwapPositionSide>,
69895 quantity: f64,
69896 recv_window: Option<i64>,
69897 reduce_only: Option<bool>,
69898 side: types::AlgoFuturesNewOrderTwapSide,
69899 signature: &'a str,
69900 symbol: &'a str,
69901 timestamp: i64,
69902 ) -> Result<
69903 ResponseValue<types::AlgoFuturesNewOrderTwapResponse>,
69904 Error<types::Error>,
69905 > {
69906 let url = format!("{}/sapi/v1/algo/futures/newOrderTwap", self.baseurl,);
69907 let mut query = Vec::with_capacity(11usize);
69908 if let Some(v) = &client_algo_id {
69909 query.push(("clientAlgoId", v.to_string()));
69910 }
69911 query.push(("duration", duration.to_string()));
69912 if let Some(v) = &limit_price {
69913 query.push(("limitPrice", v.to_string()));
69914 }
69915 if let Some(v) = &position_side {
69916 query.push(("positionSide", v.to_string()));
69917 }
69918 query.push(("quantity", quantity.to_string()));
69919 if let Some(v) = &recv_window {
69920 query.push(("recvWindow", v.to_string()));
69921 }
69922 if let Some(v) = &reduce_only {
69923 query.push(("reduceOnly", v.to_string()));
69924 }
69925 query.push(("side", side.to_string()));
69926 query.push(("signature", signature.to_string()));
69927 query.push(("symbol", symbol.to_string()));
69928 query.push(("timestamp", timestamp.to_string()));
69929 #[allow(unused_mut)]
69930 let mut request = self
69931 .client
69932 .post(url)
69933 .header(
69934 reqwest::header::ACCEPT,
69935 reqwest::header::HeaderValue::from_static("application/json"),
69936 )
69937 .query(&query)
69938 .build()?;
69939 (crate::pre_hook)(&self.inner, &request);
69940 let result = self.client.execute(request).await;
69941 (crate::post_hook)(&self.inner, &result);
69942 let response = result?;
69943 match response.status().as_u16() {
69944 200u16 => ResponseValue::from_response(response).await,
69945 400u16 => {
69946 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69947 }
69948 401u16 => {
69949 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
69950 }
69951 _ => Err(Error::UnexpectedResponse(response)),
69952 }
69953 }
69954 /**Cancel Algo Order(TRADE)
69955
69956Cancel an active order.
69957- You need to enable Futures Trading Permission for the api key which requests this endpoint.
69958- Base URL: https://api.binance.com
69959
69960Weight(IP): 1
69961
69962Sends a `DELETE` request to `/sapi/v1/algo/futures/order`
69963
69964Arguments:
69965- `algo_id`: Eg. 14511
69966- `recv_window`: The value cannot be greater than 60000
69967- `signature`: Signature
69968- `timestamp`: UTC timestamp in ms
69969*/
69970 pub async fn cancel_algo_futures_order<'a>(
69971 &'a self,
69972 algo_id: i64,
69973 recv_window: Option<i64>,
69974 signature: &'a str,
69975 timestamp: i64,
69976 ) -> Result<
69977 ResponseValue<types::CancelAlgoFuturesOrderResponse>,
69978 Error<types::Error>,
69979 > {
69980 let url = format!("{}/sapi/v1/algo/futures/order", self.baseurl,);
69981 let mut query = Vec::with_capacity(4usize);
69982 query.push(("algoId", algo_id.to_string()));
69983 if let Some(v) = &recv_window {
69984 query.push(("recvWindow", v.to_string()));
69985 }
69986 query.push(("signature", signature.to_string()));
69987 query.push(("timestamp", timestamp.to_string()));
69988 #[allow(unused_mut)]
69989 let mut request = self
69990 .client
69991 .delete(url)
69992 .header(
69993 reqwest::header::ACCEPT,
69994 reqwest::header::HeaderValue::from_static("application/json"),
69995 )
69996 .query(&query)
69997 .build()?;
69998 (crate::pre_hook)(&self.inner, &request);
69999 let result = self.client.execute(request).await;
70000 (crate::post_hook)(&self.inner, &result);
70001 let response = result?;
70002 match response.status().as_u16() {
70003 200u16 => ResponseValue::from_response(response).await,
70004 400u16 => {
70005 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70006 }
70007 401u16 => {
70008 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70009 }
70010 _ => Err(Error::UnexpectedResponse(response)),
70011 }
70012 }
70013 /**Query Current Algo Open Orders (USER_DATA)
70014
70015- You need to enable Futures Trading Permission for the api key which requests this endpoint.
70016- Base URL: https://api.binance.com
70017
70018Weight(IP): 1
70019
70020Sends a `GET` request to `/sapi/v1/algo/futures/openOrders`
70021
70022Arguments:
70023- `recv_window`: The value cannot be greater than 60000
70024- `signature`: Signature
70025- `timestamp`: UTC timestamp in ms
70026*/
70027 pub async fn algo_futures_open_orders<'a>(
70028 &'a self,
70029 recv_window: Option<i64>,
70030 signature: &'a str,
70031 timestamp: i64,
70032 ) -> Result<
70033 ResponseValue<types::AlgoFuturesOpenOrdersResponse>,
70034 Error<types::Error>,
70035 > {
70036 let url = format!("{}/sapi/v1/algo/futures/openOrders", self.baseurl,);
70037 let mut query = Vec::with_capacity(3usize);
70038 if let Some(v) = &recv_window {
70039 query.push(("recvWindow", v.to_string()));
70040 }
70041 query.push(("signature", signature.to_string()));
70042 query.push(("timestamp", timestamp.to_string()));
70043 #[allow(unused_mut)]
70044 let mut request = self
70045 .client
70046 .get(url)
70047 .header(
70048 reqwest::header::ACCEPT,
70049 reqwest::header::HeaderValue::from_static("application/json"),
70050 )
70051 .query(&query)
70052 .build()?;
70053 (crate::pre_hook)(&self.inner, &request);
70054 let result = self.client.execute(request).await;
70055 (crate::post_hook)(&self.inner, &result);
70056 let response = result?;
70057 match response.status().as_u16() {
70058 200u16 => ResponseValue::from_response(response).await,
70059 400u16 => {
70060 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70061 }
70062 401u16 => {
70063 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70064 }
70065 _ => Err(Error::UnexpectedResponse(response)),
70066 }
70067 }
70068 /**Query Historical Algo Orders (USER_DATA)
70069
70070- You need to enable Futures Trading Permission for the api key which requests this endpoint.
70071- Base URL: https://api.binance.com
70072
70073Weight(IP): 1
70074
70075Sends a `GET` request to `/sapi/v1/algo/futures/historicalOrders`
70076
70077Arguments:
70078- `end_time`: UTC timestamp in ms
70079- `page`: Default 1
70080- `page_size`: Page size, minimum 1, maximum 100, default 100
70081- `recv_window`: The value cannot be greater than 60000
70082- `side`
70083- `signature`: Signature
70084- `start_time`: UTC timestamp in ms
70085- `symbol`: Trading symbol, e.g. BNBUSDT
70086- `timestamp`: UTC timestamp in ms
70087*/
70088 pub async fn algo_futures_historical_orders<'a>(
70089 &'a self,
70090 end_time: Option<i64>,
70091 page: Option<i32>,
70092 page_size: Option<&'a str>,
70093 recv_window: Option<i64>,
70094 side: Option<types::AlgoFuturesHistoricalOrdersSide>,
70095 signature: &'a str,
70096 start_time: Option<i64>,
70097 symbol: Option<&'a str>,
70098 timestamp: i64,
70099 ) -> Result<
70100 ResponseValue<types::AlgoFuturesHistoricalOrdersResponse>,
70101 Error<types::Error>,
70102 > {
70103 let url = format!("{}/sapi/v1/algo/futures/historicalOrders", self.baseurl,);
70104 let mut query = Vec::with_capacity(9usize);
70105 if let Some(v) = &end_time {
70106 query.push(("endTime", v.to_string()));
70107 }
70108 if let Some(v) = &page {
70109 query.push(("page", v.to_string()));
70110 }
70111 if let Some(v) = &page_size {
70112 query.push(("pageSize", v.to_string()));
70113 }
70114 if let Some(v) = &recv_window {
70115 query.push(("recvWindow", v.to_string()));
70116 }
70117 if let Some(v) = &side {
70118 query.push(("side", v.to_string()));
70119 }
70120 query.push(("signature", signature.to_string()));
70121 if let Some(v) = &start_time {
70122 query.push(("startTime", v.to_string()));
70123 }
70124 if let Some(v) = &symbol {
70125 query.push(("symbol", v.to_string()));
70126 }
70127 query.push(("timestamp", timestamp.to_string()));
70128 #[allow(unused_mut)]
70129 let mut request = self
70130 .client
70131 .get(url)
70132 .header(
70133 reqwest::header::ACCEPT,
70134 reqwest::header::HeaderValue::from_static("application/json"),
70135 )
70136 .query(&query)
70137 .build()?;
70138 (crate::pre_hook)(&self.inner, &request);
70139 let result = self.client.execute(request).await;
70140 (crate::post_hook)(&self.inner, &result);
70141 let response = result?;
70142 match response.status().as_u16() {
70143 200u16 => ResponseValue::from_response(response).await,
70144 400u16 => {
70145 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70146 }
70147 401u16 => {
70148 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70149 }
70150 _ => Err(Error::UnexpectedResponse(response)),
70151 }
70152 }
70153 /**Query Sub Orders (USER_DATA)
70154
70155- You need to enable Futures Trading Permission for the api key which requests this endpoint.
70156- Base URL: https://api.binance.com
70157
70158Weight(IP): 1
70159
70160Sends a `GET` request to `/sapi/v1/algo/futures/subOrders`
70161
70162Arguments:
70163- `algo_id`
70164- `page`: Default 1
70165- `page_size`: Page size, minimum 1, maximum 100, default 100
70166- `recv_window`: The value cannot be greater than 60000
70167- `signature`: Signature
70168- `timestamp`: UTC timestamp in ms
70169*/
70170 pub async fn algo_futures_sub_orders<'a>(
70171 &'a self,
70172 algo_id: i64,
70173 page: Option<i32>,
70174 page_size: Option<&'a str>,
70175 recv_window: Option<i64>,
70176 signature: &'a str,
70177 timestamp: i64,
70178 ) -> Result<
70179 ResponseValue<types::AlgoFuturesSubOrdersResponse>,
70180 Error<types::Error>,
70181 > {
70182 let url = format!("{}/sapi/v1/algo/futures/subOrders", self.baseurl,);
70183 let mut query = Vec::with_capacity(6usize);
70184 query.push(("algoId", algo_id.to_string()));
70185 if let Some(v) = &page {
70186 query.push(("page", v.to_string()));
70187 }
70188 if let Some(v) = &page_size {
70189 query.push(("pageSize", v.to_string()));
70190 }
70191 if let Some(v) = &recv_window {
70192 query.push(("recvWindow", v.to_string()));
70193 }
70194 query.push(("signature", signature.to_string()));
70195 query.push(("timestamp", timestamp.to_string()));
70196 #[allow(unused_mut)]
70197 let mut request = self
70198 .client
70199 .get(url)
70200 .header(
70201 reqwest::header::ACCEPT,
70202 reqwest::header::HeaderValue::from_static("application/json"),
70203 )
70204 .query(&query)
70205 .build()?;
70206 (crate::pre_hook)(&self.inner, &request);
70207 let result = self.client.execute(request).await;
70208 (crate::post_hook)(&self.inner, &result);
70209 let response = result?;
70210 match response.status().as_u16() {
70211 200u16 => ResponseValue::from_response(response).await,
70212 400u16 => {
70213 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70214 }
70215 401u16 => {
70216 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70217 }
70218 _ => Err(Error::UnexpectedResponse(response)),
70219 }
70220 }
70221 /**Time-Weighted Average Price (Twap) New Order
70222
70223Place a new spot TWAP order with Algo service.
70224
70225Weight(UID): 3000
70226
70227Sends a `POST` request to `/sapi/v1/algo/spot/newOrderTwap`
70228
70229Arguments:
70230- `client_algo_id`
70231- `duration`
70232- `limit_price`
70233- `quantity`
70234- `recv_window`: The value cannot be greater than 60000
70235- `side`
70236- `signature`: Signature
70237- `symbol`: Trading symbol, e.g. BNBUSDT
70238- `timestamp`: UTC timestamp in ms
70239*/
70240 pub async fn algo_spot_new_order_twap<'a>(
70241 &'a self,
70242 client_algo_id: Option<&'a str>,
70243 duration: i32,
70244 limit_price: Option<f32>,
70245 quantity: f64,
70246 recv_window: Option<i64>,
70247 side: types::AlgoSpotNewOrderTwapSide,
70248 signature: &'a str,
70249 symbol: &'a str,
70250 timestamp: i64,
70251 ) -> Result<
70252 ResponseValue<types::AlgoSpotNewOrderTwapResponse>,
70253 Error<types::Error>,
70254 > {
70255 let url = format!("{}/sapi/v1/algo/spot/newOrderTwap", self.baseurl,);
70256 let mut query = Vec::with_capacity(9usize);
70257 if let Some(v) = &client_algo_id {
70258 query.push(("clientAlgoId", v.to_string()));
70259 }
70260 query.push(("duration", duration.to_string()));
70261 if let Some(v) = &limit_price {
70262 query.push(("limitPrice", v.to_string()));
70263 }
70264 query.push(("quantity", quantity.to_string()));
70265 if let Some(v) = &recv_window {
70266 query.push(("recvWindow", v.to_string()));
70267 }
70268 query.push(("side", side.to_string()));
70269 query.push(("signature", signature.to_string()));
70270 query.push(("symbol", symbol.to_string()));
70271 query.push(("timestamp", timestamp.to_string()));
70272 #[allow(unused_mut)]
70273 let mut request = self
70274 .client
70275 .post(url)
70276 .header(
70277 reqwest::header::ACCEPT,
70278 reqwest::header::HeaderValue::from_static("application/json"),
70279 )
70280 .query(&query)
70281 .build()?;
70282 (crate::pre_hook)(&self.inner, &request);
70283 let result = self.client.execute(request).await;
70284 (crate::post_hook)(&self.inner, &result);
70285 let response = result?;
70286 match response.status().as_u16() {
70287 200u16 => ResponseValue::from_response(response).await,
70288 400u16 => {
70289 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70290 }
70291 401u16 => {
70292 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70293 }
70294 _ => Err(Error::UnexpectedResponse(response)),
70295 }
70296 }
70297 /**Cancel Algo Order
70298
70299Cancel an open TWAP order
70300
70301Weight(IP): 1
70302
70303Sends a `DELETE` request to `/sapi/v1/algo/spot/order`
70304
70305Arguments:
70306- `algo_id`
70307- `recv_window`: The value cannot be greater than 60000
70308- `signature`: Signature
70309- `timestamp`: UTC timestamp in ms
70310*/
70311 pub async fn cancel_algo_spot_order<'a>(
70312 &'a self,
70313 algo_id: i64,
70314 recv_window: Option<i64>,
70315 signature: &'a str,
70316 timestamp: i64,
70317 ) -> Result<ResponseValue<types::CancelAlgoSpotOrderResponse>, Error<types::Error>> {
70318 let url = format!("{}/sapi/v1/algo/spot/order", self.baseurl,);
70319 let mut query = Vec::with_capacity(4usize);
70320 query.push(("algoId", algo_id.to_string()));
70321 if let Some(v) = &recv_window {
70322 query.push(("recvWindow", v.to_string()));
70323 }
70324 query.push(("signature", signature.to_string()));
70325 query.push(("timestamp", timestamp.to_string()));
70326 #[allow(unused_mut)]
70327 let mut request = self
70328 .client
70329 .delete(url)
70330 .header(
70331 reqwest::header::ACCEPT,
70332 reqwest::header::HeaderValue::from_static("application/json"),
70333 )
70334 .query(&query)
70335 .build()?;
70336 (crate::pre_hook)(&self.inner, &request);
70337 let result = self.client.execute(request).await;
70338 (crate::post_hook)(&self.inner, &result);
70339 let response = result?;
70340 match response.status().as_u16() {
70341 200u16 => ResponseValue::from_response(response).await,
70342 400u16 => {
70343 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70344 }
70345 401u16 => {
70346 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70347 }
70348 _ => Err(Error::UnexpectedResponse(response)),
70349 }
70350 }
70351 /**Query Current Algo Open Orders
70352
70353Get all open SPOT TWAP orders
70354
70355Weight(IP): 1
70356
70357Sends a `GET` request to `/sapi/v1/algo/spot/openOrders`
70358
70359Arguments:
70360- `recv_window`: The value cannot be greater than 60000
70361- `signature`: Signature
70362- `timestamp`: UTC timestamp in ms
70363*/
70364 pub async fn algo_spot_open_orders<'a>(
70365 &'a self,
70366 recv_window: Option<i64>,
70367 signature: &'a str,
70368 timestamp: i64,
70369 ) -> Result<ResponseValue<types::AlgoSpotOpenOrdersResponse>, Error<types::Error>> {
70370 let url = format!("{}/sapi/v1/algo/spot/openOrders", self.baseurl,);
70371 let mut query = Vec::with_capacity(3usize);
70372 if let Some(v) = &recv_window {
70373 query.push(("recvWindow", v.to_string()));
70374 }
70375 query.push(("signature", signature.to_string()));
70376 query.push(("timestamp", timestamp.to_string()));
70377 #[allow(unused_mut)]
70378 let mut request = self
70379 .client
70380 .get(url)
70381 .header(
70382 reqwest::header::ACCEPT,
70383 reqwest::header::HeaderValue::from_static("application/json"),
70384 )
70385 .query(&query)
70386 .build()?;
70387 (crate::pre_hook)(&self.inner, &request);
70388 let result = self.client.execute(request).await;
70389 (crate::post_hook)(&self.inner, &result);
70390 let response = result?;
70391 match response.status().as_u16() {
70392 200u16 => ResponseValue::from_response(response).await,
70393 400u16 => {
70394 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70395 }
70396 401u16 => {
70397 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70398 }
70399 _ => Err(Error::UnexpectedResponse(response)),
70400 }
70401 }
70402 /**Query Historical Algo Orders
70403
70404Get all historical SPOT TWAP orders
70405
70406Weight(IP): 1
70407
70408Sends a `GET` request to `/sapi/v1/algo/spot/historicalOrders`
70409
70410Arguments:
70411- `end_time`: UTC timestamp in ms
70412- `page`: Default 1
70413- `page_size`: Number of pages, minimum 10, maximum 200
70414- `recv_window`: The value cannot be greater than 60000
70415- `side`
70416- `signature`: Signature
70417- `start_time`: UTC timestamp in ms
70418- `symbol`: Trading symbol, e.g. BNBUSDT
70419- `timestamp`: UTC timestamp in ms
70420*/
70421 pub async fn algo_spot_historical_orders<'a>(
70422 &'a self,
70423 end_time: Option<i64>,
70424 page: Option<i32>,
70425 page_size: Option<&'a str>,
70426 recv_window: Option<i64>,
70427 side: types::AlgoSpotHistoricalOrdersSide,
70428 signature: &'a str,
70429 start_time: Option<i64>,
70430 symbol: &'a str,
70431 timestamp: i64,
70432 ) -> Result<
70433 ResponseValue<types::AlgoSpotHistoricalOrdersResponse>,
70434 Error<types::Error>,
70435 > {
70436 let url = format!("{}/sapi/v1/algo/spot/historicalOrders", self.baseurl,);
70437 let mut query = Vec::with_capacity(9usize);
70438 if let Some(v) = &end_time {
70439 query.push(("endTime", v.to_string()));
70440 }
70441 if let Some(v) = &page {
70442 query.push(("page", v.to_string()));
70443 }
70444 if let Some(v) = &page_size {
70445 query.push(("pageSize", v.to_string()));
70446 }
70447 if let Some(v) = &recv_window {
70448 query.push(("recvWindow", v.to_string()));
70449 }
70450 query.push(("side", side.to_string()));
70451 query.push(("signature", signature.to_string()));
70452 if let Some(v) = &start_time {
70453 query.push(("startTime", v.to_string()));
70454 }
70455 query.push(("symbol", symbol.to_string()));
70456 query.push(("timestamp", timestamp.to_string()));
70457 #[allow(unused_mut)]
70458 let mut request = self
70459 .client
70460 .get(url)
70461 .header(
70462 reqwest::header::ACCEPT,
70463 reqwest::header::HeaderValue::from_static("application/json"),
70464 )
70465 .query(&query)
70466 .build()?;
70467 (crate::pre_hook)(&self.inner, &request);
70468 let result = self.client.execute(request).await;
70469 (crate::post_hook)(&self.inner, &result);
70470 let response = result?;
70471 match response.status().as_u16() {
70472 200u16 => ResponseValue::from_response(response).await,
70473 400u16 => {
70474 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70475 }
70476 401u16 => {
70477 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70478 }
70479 _ => Err(Error::UnexpectedResponse(response)),
70480 }
70481 }
70482 /**Query Sub Orders
70483
70484Get respective sub orders for a specified algoId
70485
70486Weight(IP): 1
70487
70488Sends a `GET` request to `/sapi/v1/algo/spot/subOrders`
70489
70490Arguments:
70491- `algo_id`
70492- `page`: Default 1
70493- `page_size`: Number of pages, minimum 10, maximum 200
70494- `recv_window`: The value cannot be greater than 60000
70495- `signature`: Signature
70496- `timestamp`: UTC timestamp in ms
70497*/
70498 pub async fn algo_spot_sub_orders<'a>(
70499 &'a self,
70500 algo_id: i64,
70501 page: Option<i32>,
70502 page_size: Option<&'a str>,
70503 recv_window: Option<i64>,
70504 signature: &'a str,
70505 timestamp: i64,
70506 ) -> Result<ResponseValue<types::AlgoSpotSubOrdersResponse>, Error<types::Error>> {
70507 let url = format!("{}/sapi/v1/algo/spot/subOrders", self.baseurl,);
70508 let mut query = Vec::with_capacity(6usize);
70509 query.push(("algoId", algo_id.to_string()));
70510 if let Some(v) = &page {
70511 query.push(("page", v.to_string()));
70512 }
70513 if let Some(v) = &page_size {
70514 query.push(("pageSize", v.to_string()));
70515 }
70516 if let Some(v) = &recv_window {
70517 query.push(("recvWindow", v.to_string()));
70518 }
70519 query.push(("signature", signature.to_string()));
70520 query.push(("timestamp", timestamp.to_string()));
70521 #[allow(unused_mut)]
70522 let mut request = self
70523 .client
70524 .get(url)
70525 .header(
70526 reqwest::header::ACCEPT,
70527 reqwest::header::HeaderValue::from_static("application/json"),
70528 )
70529 .query(&query)
70530 .build()?;
70531 (crate::pre_hook)(&self.inner, &request);
70532 let result = self.client.execute(request).await;
70533 (crate::post_hook)(&self.inner, &result);
70534 let response = result?;
70535 match response.status().as_u16() {
70536 200u16 => ResponseValue::from_response(response).await,
70537 400u16 => {
70538 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70539 }
70540 401u16 => {
70541 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70542 }
70543 _ => Err(Error::UnexpectedResponse(response)),
70544 }
70545 }
70546 /**Portfolio Margin Account (USER_DATA)
70547
70548Get the account info
70549
70550'Weight(IP): 1'
70551
70552Sends a `GET` request to `/sapi/v1/portfolio/account`
70553
70554Arguments:
70555- `recv_window`: The value cannot be greater than 60000
70556- `signature`: Signature
70557- `timestamp`: UTC timestamp in ms
70558*/
70559 pub async fn portfolio_account<'a>(
70560 &'a self,
70561 recv_window: Option<i64>,
70562 signature: &'a str,
70563 timestamp: i64,
70564 ) -> Result<ResponseValue<types::PortfolioAccountResponse>, Error<types::Error>> {
70565 let url = format!("{}/sapi/v1/portfolio/account", self.baseurl,);
70566 let mut query = Vec::with_capacity(3usize);
70567 if let Some(v) = &recv_window {
70568 query.push(("recvWindow", v.to_string()));
70569 }
70570 query.push(("signature", signature.to_string()));
70571 query.push(("timestamp", timestamp.to_string()));
70572 #[allow(unused_mut)]
70573 let mut request = self
70574 .client
70575 .get(url)
70576 .header(
70577 reqwest::header::ACCEPT,
70578 reqwest::header::HeaderValue::from_static("application/json"),
70579 )
70580 .query(&query)
70581 .build()?;
70582 (crate::pre_hook)(&self.inner, &request);
70583 let result = self.client.execute(request).await;
70584 (crate::post_hook)(&self.inner, &result);
70585 let response = result?;
70586 match response.status().as_u16() {
70587 200u16 => ResponseValue::from_response(response).await,
70588 400u16 => {
70589 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70590 }
70591 401u16 => {
70592 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70593 }
70594 _ => Err(Error::UnexpectedResponse(response)),
70595 }
70596 }
70597 /**Portfolio Margin Collateral Rate (MARKET_DATA)
70598
70599Portfolio Margin Collateral Rate.
70600
70601Weight(IP): 50
70602
70603Sends a `GET` request to `/sapi/v1/portfolio/collateralRate`
70604
70605*/
70606 pub async fn portfolio_collateral_rate<'a>(
70607 &'a self,
70608 ) -> Result<
70609 ResponseValue<Vec<types::PortfolioCollateralRateResponseItem>>,
70610 Error<types::Error>,
70611 > {
70612 let url = format!("{}/sapi/v1/portfolio/collateralRate", self.baseurl,);
70613 #[allow(unused_mut)]
70614 let mut request = self
70615 .client
70616 .get(url)
70617 .header(
70618 reqwest::header::ACCEPT,
70619 reqwest::header::HeaderValue::from_static("application/json"),
70620 )
70621 .build()?;
70622 (crate::pre_hook)(&self.inner, &request);
70623 let result = self.client.execute(request).await;
70624 (crate::post_hook)(&self.inner, &result);
70625 let response = result?;
70626 match response.status().as_u16() {
70627 200u16 => ResponseValue::from_response(response).await,
70628 400u16 => {
70629 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70630 }
70631 _ => Err(Error::UnexpectedResponse(response)),
70632 }
70633 }
70634 /**Portfolio Margin Bankruptcy Loan Amount (USER_DATA)
70635
70636Query Portfolio Margin Bankruptcy Loan Amount.
70637
70638Weight(UID): 500
70639
70640Sends a `GET` request to `/sapi/v1/portfolio/pmLoan`
70641
70642Arguments:
70643- `recv_window`: The value cannot be greater than 60000
70644- `signature`: Signature
70645- `timestamp`: UTC timestamp in ms
70646*/
70647 pub async fn portfolio_pm_loan<'a>(
70648 &'a self,
70649 recv_window: Option<i64>,
70650 signature: &'a str,
70651 timestamp: i64,
70652 ) -> Result<ResponseValue<types::PortfolioPmLoanResponse>, Error<types::Error>> {
70653 let url = format!("{}/sapi/v1/portfolio/pmLoan", self.baseurl,);
70654 let mut query = Vec::with_capacity(3usize);
70655 if let Some(v) = &recv_window {
70656 query.push(("recvWindow", v.to_string()));
70657 }
70658 query.push(("signature", signature.to_string()));
70659 query.push(("timestamp", timestamp.to_string()));
70660 #[allow(unused_mut)]
70661 let mut request = self
70662 .client
70663 .get(url)
70664 .header(
70665 reqwest::header::ACCEPT,
70666 reqwest::header::HeaderValue::from_static("application/json"),
70667 )
70668 .query(&query)
70669 .build()?;
70670 (crate::pre_hook)(&self.inner, &request);
70671 let result = self.client.execute(request).await;
70672 (crate::post_hook)(&self.inner, &result);
70673 let response = result?;
70674 match response.status().as_u16() {
70675 200u16 => ResponseValue::from_response(response).await,
70676 400u16 => {
70677 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70678 }
70679 401u16 => {
70680 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70681 }
70682 _ => Err(Error::UnexpectedResponse(response)),
70683 }
70684 }
70685 /**Portfolio Margin Bankruptcy Loan Repay (USER_DATA)
70686
70687Repay Portfolio Margin Bankruptcy Loan.
70688
70689Weight(UID): 3000
70690
70691Sends a `POST` request to `/sapi/v1/portfolio/repay`
70692
70693Arguments:
70694- `from`
70695- `recv_window`: The value cannot be greater than 60000
70696- `signature`: Signature
70697- `timestamp`: UTC timestamp in ms
70698*/
70699 pub async fn portfolio_repay<'a>(
70700 &'a self,
70701 from: Option<&'a str>,
70702 recv_window: Option<i64>,
70703 signature: &'a str,
70704 timestamp: i64,
70705 ) -> Result<ResponseValue<types::PortfolioRepayResponse>, Error<types::Error>> {
70706 let url = format!("{}/sapi/v1/portfolio/repay", self.baseurl,);
70707 let mut query = Vec::with_capacity(4usize);
70708 if let Some(v) = &from {
70709 query.push(("from", v.to_string()));
70710 }
70711 if let Some(v) = &recv_window {
70712 query.push(("recvWindow", v.to_string()));
70713 }
70714 query.push(("signature", signature.to_string()));
70715 query.push(("timestamp", timestamp.to_string()));
70716 #[allow(unused_mut)]
70717 let mut request = self
70718 .client
70719 .post(url)
70720 .header(
70721 reqwest::header::ACCEPT,
70722 reqwest::header::HeaderValue::from_static("application/json"),
70723 )
70724 .query(&query)
70725 .build()?;
70726 (crate::pre_hook)(&self.inner, &request);
70727 let result = self.client.execute(request).await;
70728 (crate::post_hook)(&self.inner, &result);
70729 let response = result?;
70730 match response.status().as_u16() {
70731 200u16 => ResponseValue::from_response(response).await,
70732 400u16 => {
70733 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70734 }
70735 401u16 => {
70736 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70737 }
70738 _ => Err(Error::UnexpectedResponse(response)),
70739 }
70740 }
70741 /**Query Classic Portfolio Margin Negative Balance Interest History (USER_DATA)
70742
70743Query interest history of negative balance for portfolio margin.
70744
70745Weight(IP): 50
70746
70747Sends a `GET` request to `/sapi/v1/portfolio/interest-history`
70748
70749Arguments:
70750- `asset`
70751- `end_time`: UTC timestamp in ms
70752- `recv_window`: The value cannot be greater than 60000
70753- `signature`: Signature
70754- `size`: Default:10 Max:100
70755- `start_time`: UTC timestamp in ms
70756- `timestamp`: UTC timestamp in ms
70757*/
70758 pub async fn portfolio_interest_history<'a>(
70759 &'a self,
70760 asset: &'a str,
70761 end_time: Option<i64>,
70762 recv_window: Option<i64>,
70763 signature: &'a str,
70764 size: Option<i32>,
70765 start_time: Option<i64>,
70766 timestamp: i64,
70767 ) -> Result<
70768 ResponseValue<Vec<types::PortfolioInterestHistoryResponseItem>>,
70769 Error<types::Error>,
70770 > {
70771 let url = format!("{}/sapi/v1/portfolio/interest-history", self.baseurl,);
70772 let mut query = Vec::with_capacity(7usize);
70773 query.push(("asset", asset.to_string()));
70774 if let Some(v) = &end_time {
70775 query.push(("endTime", v.to_string()));
70776 }
70777 if let Some(v) = &recv_window {
70778 query.push(("recvWindow", v.to_string()));
70779 }
70780 query.push(("signature", signature.to_string()));
70781 if let Some(v) = &size {
70782 query.push(("size", v.to_string()));
70783 }
70784 if let Some(v) = &start_time {
70785 query.push(("startTime", v.to_string()));
70786 }
70787 query.push(("timestamp", timestamp.to_string()));
70788 #[allow(unused_mut)]
70789 let mut request = self
70790 .client
70791 .get(url)
70792 .header(
70793 reqwest::header::ACCEPT,
70794 reqwest::header::HeaderValue::from_static("application/json"),
70795 )
70796 .query(&query)
70797 .build()?;
70798 (crate::pre_hook)(&self.inner, &request);
70799 let result = self.client.execute(request).await;
70800 (crate::post_hook)(&self.inner, &result);
70801 let response = result?;
70802 match response.status().as_u16() {
70803 200u16 => ResponseValue::from_response(response).await,
70804 400u16 => {
70805 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70806 }
70807 401u16 => {
70808 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70809 }
70810 _ => Err(Error::UnexpectedResponse(response)),
70811 }
70812 }
70813 /**Query Portfolio Margin Asset Index Price (MARKET_DATA)
70814
70815Query Portfolio Margin Asset Index Price
70816
70817Weight(IP):
70818- 1 if send asset
70819- 50 if not send asset
70820
70821Sends a `GET` request to `/sapi/v1/portfolio/asset-index-price`
70822
70823*/
70824 pub async fn portfolio_asset_index_price<'a>(
70825 &'a self,
70826 asset: Option<&'a str>,
70827 ) -> Result<
70828 ResponseValue<Vec<types::PortfolioAssetIndexPriceResponseItem>>,
70829 Error<types::Error>,
70830 > {
70831 let url = format!("{}/sapi/v1/portfolio/asset-index-price", self.baseurl,);
70832 let mut query = Vec::with_capacity(1usize);
70833 if let Some(v) = &asset {
70834 query.push(("asset", v.to_string()));
70835 }
70836 #[allow(unused_mut)]
70837 let mut request = self
70838 .client
70839 .get(url)
70840 .header(
70841 reqwest::header::ACCEPT,
70842 reqwest::header::HeaderValue::from_static("application/json"),
70843 )
70844 .query(&query)
70845 .build()?;
70846 (crate::pre_hook)(&self.inner, &request);
70847 let result = self.client.execute(request).await;
70848 (crate::post_hook)(&self.inner, &result);
70849 let response = result?;
70850 match response.status().as_u16() {
70851 200u16 => ResponseValue::from_response(response).await,
70852 400u16 => {
70853 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70854 }
70855 _ => Err(Error::UnexpectedResponse(response)),
70856 }
70857 }
70858 /**Fund Auto-collection (USER_DATA)
70859
70860Transfers all assets from Futures Account to Margin account
70861
70862Weight(IP): 1500
70863
70864Sends a `POST` request to `/sapi/v1/portfolio/auto-collection`
70865
70866Arguments:
70867- `recv_window`: The value cannot be greater than 60000
70868- `signature`: Signature
70869- `timestamp`: UTC timestamp in ms
70870*/
70871 pub async fn portfolio_auto_collection<'a>(
70872 &'a self,
70873 recv_window: Option<i64>,
70874 signature: &'a str,
70875 timestamp: i64,
70876 ) -> Result<
70877 ResponseValue<types::PortfolioAutoCollectionResponse>,
70878 Error<types::Error>,
70879 > {
70880 let url = format!("{}/sapi/v1/portfolio/auto-collection", self.baseurl,);
70881 let mut query = Vec::with_capacity(3usize);
70882 if let Some(v) = &recv_window {
70883 query.push(("recvWindow", v.to_string()));
70884 }
70885 query.push(("signature", signature.to_string()));
70886 query.push(("timestamp", timestamp.to_string()));
70887 #[allow(unused_mut)]
70888 let mut request = self
70889 .client
70890 .post(url)
70891 .header(
70892 reqwest::header::ACCEPT,
70893 reqwest::header::HeaderValue::from_static("application/json"),
70894 )
70895 .query(&query)
70896 .build()?;
70897 (crate::pre_hook)(&self.inner, &request);
70898 let result = self.client.execute(request).await;
70899 (crate::post_hook)(&self.inner, &result);
70900 let response = result?;
70901 match response.status().as_u16() {
70902 200u16 => ResponseValue::from_response(response).await,
70903 400u16 => {
70904 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70905 }
70906 401u16 => {
70907 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70908 }
70909 _ => Err(Error::UnexpectedResponse(response)),
70910 }
70911 }
70912 /**BNB Transfer (USER_DATA)
70913
70914BNB transfer can be between Margin Account and USDM Account
70915
70916Weight(IP): 1500
70917
70918Sends a `POST` request to `/sapi/v1/portfolio/bnb-transfer`
70919
70920Arguments:
70921- `amount`
70922- `recv_window`: The value cannot be greater than 60000
70923- `signature`: Signature
70924- `timestamp`: UTC timestamp in ms
70925- `transfer_side`
70926*/
70927 pub async fn portfolio_bnb_transfer<'a>(
70928 &'a self,
70929 amount: f64,
70930 recv_window: Option<i64>,
70931 signature: &'a str,
70932 timestamp: i64,
70933 transfer_side: types::PortfolioBnbTransferTransferSide,
70934 ) -> Result<
70935 ResponseValue<types::PortfolioBnbTransferResponse>,
70936 Error<types::Error>,
70937 > {
70938 let url = format!("{}/sapi/v1/portfolio/bnb-transfer", self.baseurl,);
70939 let mut query = Vec::with_capacity(5usize);
70940 query.push(("amount", amount.to_string()));
70941 if let Some(v) = &recv_window {
70942 query.push(("recvWindow", v.to_string()));
70943 }
70944 query.push(("signature", signature.to_string()));
70945 query.push(("timestamp", timestamp.to_string()));
70946 query.push(("transferSide", transfer_side.to_string()));
70947 #[allow(unused_mut)]
70948 let mut request = self
70949 .client
70950 .post(url)
70951 .header(
70952 reqwest::header::ACCEPT,
70953 reqwest::header::HeaderValue::from_static("application/json"),
70954 )
70955 .query(&query)
70956 .build()?;
70957 (crate::pre_hook)(&self.inner, &request);
70958 let result = self.client.execute(request).await;
70959 (crate::post_hook)(&self.inner, &result);
70960 let response = result?;
70961 match response.status().as_u16() {
70962 200u16 => ResponseValue::from_response(response).await,
70963 400u16 => {
70964 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70965 }
70966 401u16 => {
70967 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
70968 }
70969 _ => Err(Error::UnexpectedResponse(response)),
70970 }
70971 }
70972 /**Get Auto-repay-futures Status (USER_DATA)
70973
70974Query Auto-repay-futures Status
70975
70976Weight(IP): 30
70977
70978Sends a `GET` request to `/sapi/v1/portfolio/repay-futures-switch`
70979
70980Arguments:
70981- `recv_window`: The value cannot be greater than 60000
70982- `signature`: Signature
70983- `timestamp`: UTC timestamp in ms
70984*/
70985 pub async fn get_auto_repay_futures_status<'a>(
70986 &'a self,
70987 recv_window: Option<i64>,
70988 signature: &'a str,
70989 timestamp: i64,
70990 ) -> Result<
70991 ResponseValue<types::GetAutoRepayFuturesStatusResponse>,
70992 Error<types::Error>,
70993 > {
70994 let url = format!("{}/sapi/v1/portfolio/repay-futures-switch", self.baseurl,);
70995 let mut query = Vec::with_capacity(3usize);
70996 if let Some(v) = &recv_window {
70997 query.push(("recvWindow", v.to_string()));
70998 }
70999 query.push(("signature", signature.to_string()));
71000 query.push(("timestamp", timestamp.to_string()));
71001 #[allow(unused_mut)]
71002 let mut request = self
71003 .client
71004 .get(url)
71005 .header(
71006 reqwest::header::ACCEPT,
71007 reqwest::header::HeaderValue::from_static("application/json"),
71008 )
71009 .query(&query)
71010 .build()?;
71011 (crate::pre_hook)(&self.inner, &request);
71012 let result = self.client.execute(request).await;
71013 (crate::post_hook)(&self.inner, &result);
71014 let response = result?;
71015 match response.status().as_u16() {
71016 200u16 => ResponseValue::from_response(response).await,
71017 400u16 => {
71018 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71019 }
71020 401u16 => {
71021 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71022 }
71023 _ => Err(Error::UnexpectedResponse(response)),
71024 }
71025 }
71026 /**Change Auto-repay-futures Status (USER_DATA)
71027
71028Change Auto-repay-futures Status
71029
71030Weight(IP): 1500
71031
71032Sends a `POST` request to `/sapi/v1/portfolio/repay-futures-switch`
71033
71034Arguments:
71035- `auto_repay`
71036- `recv_window`: The value cannot be greater than 60000
71037- `signature`: Signature
71038- `timestamp`: UTC timestamp in ms
71039*/
71040 pub async fn portfolio_repay_futures_switch<'a>(
71041 &'a self,
71042 auto_repay: bool,
71043 recv_window: Option<i64>,
71044 signature: &'a str,
71045 timestamp: i64,
71046 ) -> Result<
71047 ResponseValue<types::PortfolioRepayFuturesSwitchResponse>,
71048 Error<types::Error>,
71049 > {
71050 let url = format!("{}/sapi/v1/portfolio/repay-futures-switch", self.baseurl,);
71051 let mut query = Vec::with_capacity(4usize);
71052 query.push(("autoRepay", auto_repay.to_string()));
71053 if let Some(v) = &recv_window {
71054 query.push(("recvWindow", v.to_string()));
71055 }
71056 query.push(("signature", signature.to_string()));
71057 query.push(("timestamp", timestamp.to_string()));
71058 #[allow(unused_mut)]
71059 let mut request = self
71060 .client
71061 .post(url)
71062 .header(
71063 reqwest::header::ACCEPT,
71064 reqwest::header::HeaderValue::from_static("application/json"),
71065 )
71066 .query(&query)
71067 .build()?;
71068 (crate::pre_hook)(&self.inner, &request);
71069 let result = self.client.execute(request).await;
71070 (crate::post_hook)(&self.inner, &result);
71071 let response = result?;
71072 match response.status().as_u16() {
71073 200u16 => ResponseValue::from_response(response).await,
71074 400u16 => {
71075 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71076 }
71077 401u16 => {
71078 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71079 }
71080 _ => Err(Error::UnexpectedResponse(response)),
71081 }
71082 }
71083 /**Repay futures Negative Balance (USER_DATA)
71084
71085Repay futures Negative Balance
71086
71087Weight(IP): 1500
71088
71089Sends a `POST` request to `/sapi/v1/portfolio/repay-futures-negative-balance`
71090
71091Arguments:
71092- `recv_window`: The value cannot be greater than 60000
71093- `signature`: Signature
71094- `timestamp`: UTC timestamp in ms
71095*/
71096 pub async fn portfolio_repay_futures_negative_balance<'a>(
71097 &'a self,
71098 recv_window: Option<i64>,
71099 signature: &'a str,
71100 timestamp: i64,
71101 ) -> Result<
71102 ResponseValue<types::PortfolioRepayFuturesNegativeBalanceResponse>,
71103 Error<types::Error>,
71104 > {
71105 let url = format!(
71106 "{}/sapi/v1/portfolio/repay-futures-negative-balance", self.baseurl,
71107 );
71108 let mut query = Vec::with_capacity(3usize);
71109 if let Some(v) = &recv_window {
71110 query.push(("recvWindow", v.to_string()));
71111 }
71112 query.push(("signature", signature.to_string()));
71113 query.push(("timestamp", timestamp.to_string()));
71114 #[allow(unused_mut)]
71115 let mut request = self
71116 .client
71117 .post(url)
71118 .header(
71119 reqwest::header::ACCEPT,
71120 reqwest::header::HeaderValue::from_static("application/json"),
71121 )
71122 .query(&query)
71123 .build()?;
71124 (crate::pre_hook)(&self.inner, &request);
71125 let result = self.client.execute(request).await;
71126 (crate::post_hook)(&self.inner, &result);
71127 let response = result?;
71128 match response.status().as_u16() {
71129 200u16 => ResponseValue::from_response(response).await,
71130 400u16 => {
71131 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71132 }
71133 401u16 => {
71134 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71135 }
71136 _ => Err(Error::UnexpectedResponse(response)),
71137 }
71138 }
71139 /**Get Portfolio Margin Asset Leverage (USER_DATA)
71140
71141Weight(IP): 50
71142
71143Sends a `GET` request to `/sapi/v1/portfolio/margin-asset-leverage`
71144
71145*/
71146 pub async fn portfolio_margin_asset_leverage<'a>(
71147 &'a self,
71148 ) -> Result<
71149 ResponseValue<Vec<types::PortfolioMarginAssetLeverageResponseItem>>,
71150 Error<types::Error>,
71151 > {
71152 let url = format!("{}/sapi/v1/portfolio/margin-asset-leverage", self.baseurl,);
71153 #[allow(unused_mut)]
71154 let mut request = self
71155 .client
71156 .get(url)
71157 .header(
71158 reqwest::header::ACCEPT,
71159 reqwest::header::HeaderValue::from_static("application/json"),
71160 )
71161 .build()?;
71162 (crate::pre_hook)(&self.inner, &request);
71163 let result = self.client.execute(request).await;
71164 (crate::post_hook)(&self.inner, &result);
71165 let response = result?;
71166 match response.status().as_u16() {
71167 200u16 => ResponseValue::from_response(response).await,
71168 400u16 => {
71169 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71170 }
71171 401u16 => {
71172 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71173 }
71174 _ => Err(Error::UnexpectedResponse(response)),
71175 }
71176 }
71177 /**Fund Collection by Asset (USER_DATA)
71178
71179Transfers specific asset from Futures Account to Margin account
71180
71181Weight(IP): 60
71182
71183Sends a `POST` request to `/sapi/v1/portfolio/asset-collection`
71184
71185Arguments:
71186- `asset`
71187- `recv_window`: The value cannot be greater than 60000
71188- `signature`: Signature
71189- `timestamp`: UTC timestamp in ms
71190*/
71191 pub async fn portfolio_asset_collection<'a>(
71192 &'a self,
71193 asset: &'a str,
71194 recv_window: Option<i64>,
71195 signature: &'a str,
71196 timestamp: i64,
71197 ) -> Result<
71198 ResponseValue<types::PortfolioAssetCollectionResponse>,
71199 Error<types::Error>,
71200 > {
71201 let url = format!("{}/sapi/v1/portfolio/asset-collection", self.baseurl,);
71202 let mut query = Vec::with_capacity(4usize);
71203 query.push(("asset", asset.to_string()));
71204 if let Some(v) = &recv_window {
71205 query.push(("recvWindow", v.to_string()));
71206 }
71207 query.push(("signature", signature.to_string()));
71208 query.push(("timestamp", timestamp.to_string()));
71209 #[allow(unused_mut)]
71210 let mut request = self
71211 .client
71212 .post(url)
71213 .header(
71214 reqwest::header::ACCEPT,
71215 reqwest::header::HeaderValue::from_static("application/json"),
71216 )
71217 .query(&query)
71218 .build()?;
71219 (crate::pre_hook)(&self.inner, &request);
71220 let result = self.client.execute(request).await;
71221 (crate::post_hook)(&self.inner, &result);
71222 let response = result?;
71223 match response.status().as_u16() {
71224 200u16 => ResponseValue::from_response(response).await,
71225 400u16 => {
71226 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71227 }
71228 401u16 => {
71229 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71230 }
71231 _ => Err(Error::UnexpectedResponse(response)),
71232 }
71233 }
71234 /**BLVT Info (MARKET_DATA)
71235
71236Weight(IP): 1
71237
71238Sends a `GET` request to `/sapi/v1/blvt/tokenInfo`
71239
71240Arguments:
71241- `token_name`: BTCDOWN, BTCUP
71242*/
71243 pub async fn blvt_token_info<'a>(
71244 &'a self,
71245 token_name: Option<&'a str>,
71246 ) -> Result<
71247 ResponseValue<Vec<types::BlvtTokenInfoResponseItem>>,
71248 Error<types::Error>,
71249 > {
71250 let url = format!("{}/sapi/v1/blvt/tokenInfo", self.baseurl,);
71251 let mut query = Vec::with_capacity(1usize);
71252 if let Some(v) = &token_name {
71253 query.push(("tokenName", v.to_string()));
71254 }
71255 #[allow(unused_mut)]
71256 let mut request = self
71257 .client
71258 .get(url)
71259 .header(
71260 reqwest::header::ACCEPT,
71261 reqwest::header::HeaderValue::from_static("application/json"),
71262 )
71263 .query(&query)
71264 .build()?;
71265 (crate::pre_hook)(&self.inner, &request);
71266 let result = self.client.execute(request).await;
71267 (crate::post_hook)(&self.inner, &result);
71268 let response = result?;
71269 match response.status().as_u16() {
71270 200u16 => ResponseValue::from_response(response).await,
71271 400u16 => {
71272 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71273 }
71274 _ => Err(Error::UnexpectedResponse(response)),
71275 }
71276 }
71277 /**Subscribe BLVT (USER_DATA)
71278
71279Weight(IP): 1
71280
71281Sends a `POST` request to `/sapi/v1/blvt/subscribe`
71282
71283Arguments:
71284- `cost`: Spot balance
71285- `recv_window`: The value cannot be greater than 60000
71286- `signature`: Signature
71287- `timestamp`: UTC timestamp in ms
71288- `token_name`: BTCDOWN, BTCUP
71289*/
71290 pub async fn blvt_subscribe<'a>(
71291 &'a self,
71292 cost: f64,
71293 recv_window: Option<i64>,
71294 signature: &'a str,
71295 timestamp: i64,
71296 token_name: &'a str,
71297 ) -> Result<ResponseValue<types::BlvtSubscribeResponse>, Error<types::Error>> {
71298 let url = format!("{}/sapi/v1/blvt/subscribe", self.baseurl,);
71299 let mut query = Vec::with_capacity(5usize);
71300 query.push(("cost", cost.to_string()));
71301 if let Some(v) = &recv_window {
71302 query.push(("recvWindow", v.to_string()));
71303 }
71304 query.push(("signature", signature.to_string()));
71305 query.push(("timestamp", timestamp.to_string()));
71306 query.push(("tokenName", token_name.to_string()));
71307 #[allow(unused_mut)]
71308 let mut request = self
71309 .client
71310 .post(url)
71311 .header(
71312 reqwest::header::ACCEPT,
71313 reqwest::header::HeaderValue::from_static("application/json"),
71314 )
71315 .query(&query)
71316 .build()?;
71317 (crate::pre_hook)(&self.inner, &request);
71318 let result = self.client.execute(request).await;
71319 (crate::post_hook)(&self.inner, &result);
71320 let response = result?;
71321 match response.status().as_u16() {
71322 200u16 => ResponseValue::from_response(response).await,
71323 400u16 => {
71324 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71325 }
71326 401u16 => {
71327 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71328 }
71329 _ => Err(Error::UnexpectedResponse(response)),
71330 }
71331 }
71332 /**Query Subscription Record (USER_DATA)
71333
71334- Only the data of the latest 90 days is available
71335
71336Weight(IP): 1
71337
71338Sends a `GET` request to `/sapi/v1/blvt/subscribe/record`
71339
71340Arguments:
71341- `end_time`: UTC timestamp in ms
71342- `id`
71343- `limit`: Default 500; max 1000.
71344- `recv_window`: The value cannot be greater than 60000
71345- `signature`: Signature
71346- `start_time`: UTC timestamp in ms
71347- `timestamp`: UTC timestamp in ms
71348- `token_name`: BTCDOWN, BTCUP
71349*/
71350 pub async fn blvt_subscribe_record<'a>(
71351 &'a self,
71352 end_time: Option<i64>,
71353 id: Option<i64>,
71354 limit: Option<i32>,
71355 recv_window: Option<i64>,
71356 signature: &'a str,
71357 start_time: Option<i64>,
71358 timestamp: i64,
71359 token_name: Option<&'a str>,
71360 ) -> Result<ResponseValue<types::BlvtSubscribeRecordResponse>, Error<types::Error>> {
71361 let url = format!("{}/sapi/v1/blvt/subscribe/record", self.baseurl,);
71362 let mut query = Vec::with_capacity(8usize);
71363 if let Some(v) = &end_time {
71364 query.push(("endTime", v.to_string()));
71365 }
71366 if let Some(v) = &id {
71367 query.push(("id", v.to_string()));
71368 }
71369 if let Some(v) = &limit {
71370 query.push(("limit", v.to_string()));
71371 }
71372 if let Some(v) = &recv_window {
71373 query.push(("recvWindow", v.to_string()));
71374 }
71375 query.push(("signature", signature.to_string()));
71376 if let Some(v) = &start_time {
71377 query.push(("startTime", v.to_string()));
71378 }
71379 query.push(("timestamp", timestamp.to_string()));
71380 if let Some(v) = &token_name {
71381 query.push(("tokenName", v.to_string()));
71382 }
71383 #[allow(unused_mut)]
71384 let mut request = self
71385 .client
71386 .get(url)
71387 .header(
71388 reqwest::header::ACCEPT,
71389 reqwest::header::HeaderValue::from_static("application/json"),
71390 )
71391 .query(&query)
71392 .build()?;
71393 (crate::pre_hook)(&self.inner, &request);
71394 let result = self.client.execute(request).await;
71395 (crate::post_hook)(&self.inner, &result);
71396 let response = result?;
71397 match response.status().as_u16() {
71398 200u16 => ResponseValue::from_response(response).await,
71399 400u16 => {
71400 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71401 }
71402 401u16 => {
71403 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71404 }
71405 _ => Err(Error::UnexpectedResponse(response)),
71406 }
71407 }
71408 /**Redeem BLVT (USER_DATA)
71409
71410Weight(IP): 1
71411
71412Sends a `POST` request to `/sapi/v1/blvt/redeem`
71413
71414Arguments:
71415- `amount`
71416- `recv_window`: The value cannot be greater than 60000
71417- `signature`: Signature
71418- `timestamp`: UTC timestamp in ms
71419- `token_name`: BTCDOWN, BTCUP
71420*/
71421 pub async fn blvt_redeem<'a>(
71422 &'a self,
71423 amount: f64,
71424 recv_window: Option<i64>,
71425 signature: &'a str,
71426 timestamp: i64,
71427 token_name: &'a str,
71428 ) -> Result<ResponseValue<types::BlvtRedeemResponse>, Error<types::Error>> {
71429 let url = format!("{}/sapi/v1/blvt/redeem", self.baseurl,);
71430 let mut query = Vec::with_capacity(5usize);
71431 query.push(("amount", amount.to_string()));
71432 if let Some(v) = &recv_window {
71433 query.push(("recvWindow", v.to_string()));
71434 }
71435 query.push(("signature", signature.to_string()));
71436 query.push(("timestamp", timestamp.to_string()));
71437 query.push(("tokenName", token_name.to_string()));
71438 #[allow(unused_mut)]
71439 let mut request = self
71440 .client
71441 .post(url)
71442 .header(
71443 reqwest::header::ACCEPT,
71444 reqwest::header::HeaderValue::from_static("application/json"),
71445 )
71446 .query(&query)
71447 .build()?;
71448 (crate::pre_hook)(&self.inner, &request);
71449 let result = self.client.execute(request).await;
71450 (crate::post_hook)(&self.inner, &result);
71451 let response = result?;
71452 match response.status().as_u16() {
71453 200u16 => ResponseValue::from_response(response).await,
71454 400u16 => {
71455 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71456 }
71457 401u16 => {
71458 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71459 }
71460 _ => Err(Error::UnexpectedResponse(response)),
71461 }
71462 }
71463 /**Redemption Record (USER_DATA)
71464
71465- Only the data of the latest 90 days is available
71466
71467Weight(IP): 1
71468
71469Sends a `GET` request to `/sapi/v1/blvt/redeem/record`
71470
71471Arguments:
71472- `end_time`: UTC timestamp in ms
71473- `id`
71474- `limit`: default 1000, max 1000
71475- `recv_window`: The value cannot be greater than 60000
71476- `signature`: Signature
71477- `start_time`: UTC timestamp in ms
71478- `timestamp`: UTC timestamp in ms
71479- `token_name`: BTCDOWN, BTCUP
71480*/
71481 pub async fn blvt_redeem_record<'a>(
71482 &'a self,
71483 end_time: Option<i64>,
71484 id: Option<i64>,
71485 limit: Option<i32>,
71486 recv_window: Option<i64>,
71487 signature: &'a str,
71488 start_time: Option<i64>,
71489 timestamp: i64,
71490 token_name: Option<&'a str>,
71491 ) -> Result<
71492 ResponseValue<Vec<types::BlvtRedeemRecordResponseItem>>,
71493 Error<types::Error>,
71494 > {
71495 let url = format!("{}/sapi/v1/blvt/redeem/record", self.baseurl,);
71496 let mut query = Vec::with_capacity(8usize);
71497 if let Some(v) = &end_time {
71498 query.push(("endTime", v.to_string()));
71499 }
71500 if let Some(v) = &id {
71501 query.push(("id", v.to_string()));
71502 }
71503 if let Some(v) = &limit {
71504 query.push(("limit", v.to_string()));
71505 }
71506 if let Some(v) = &recv_window {
71507 query.push(("recvWindow", v.to_string()));
71508 }
71509 query.push(("signature", signature.to_string()));
71510 if let Some(v) = &start_time {
71511 query.push(("startTime", v.to_string()));
71512 }
71513 query.push(("timestamp", timestamp.to_string()));
71514 if let Some(v) = &token_name {
71515 query.push(("tokenName", v.to_string()));
71516 }
71517 #[allow(unused_mut)]
71518 let mut request = self
71519 .client
71520 .get(url)
71521 .header(
71522 reqwest::header::ACCEPT,
71523 reqwest::header::HeaderValue::from_static("application/json"),
71524 )
71525 .query(&query)
71526 .build()?;
71527 (crate::pre_hook)(&self.inner, &request);
71528 let result = self.client.execute(request).await;
71529 (crate::post_hook)(&self.inner, &result);
71530 let response = result?;
71531 match response.status().as_u16() {
71532 200u16 => ResponseValue::from_response(response).await,
71533 400u16 => {
71534 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71535 }
71536 401u16 => {
71537 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71538 }
71539 _ => Err(Error::UnexpectedResponse(response)),
71540 }
71541 }
71542 /**BLVT User Limit Info (USER_DATA)
71543
71544Weight(IP): 1
71545
71546Sends a `GET` request to `/sapi/v1/blvt/userLimit`
71547
71548Arguments:
71549- `recv_window`: The value cannot be greater than 60000
71550- `signature`: Signature
71551- `timestamp`: UTC timestamp in ms
71552- `token_name`: BTCDOWN, BTCUP
71553*/
71554 pub async fn blvt_user_limit<'a>(
71555 &'a self,
71556 recv_window: Option<i64>,
71557 signature: &'a str,
71558 timestamp: i64,
71559 token_name: Option<&'a str>,
71560 ) -> Result<
71561 ResponseValue<Vec<types::BlvtUserLimitResponseItem>>,
71562 Error<types::Error>,
71563 > {
71564 let url = format!("{}/sapi/v1/blvt/userLimit", self.baseurl,);
71565 let mut query = Vec::with_capacity(4usize);
71566 if let Some(v) = &recv_window {
71567 query.push(("recvWindow", v.to_string()));
71568 }
71569 query.push(("signature", signature.to_string()));
71570 query.push(("timestamp", timestamp.to_string()));
71571 if let Some(v) = &token_name {
71572 query.push(("tokenName", v.to_string()));
71573 }
71574 #[allow(unused_mut)]
71575 let mut request = self
71576 .client
71577 .get(url)
71578 .header(
71579 reqwest::header::ACCEPT,
71580 reqwest::header::HeaderValue::from_static("application/json"),
71581 )
71582 .query(&query)
71583 .build()?;
71584 (crate::pre_hook)(&self.inner, &request);
71585 let result = self.client.execute(request).await;
71586 (crate::post_hook)(&self.inner, &result);
71587 let response = result?;
71588 match response.status().as_u16() {
71589 200u16 => ResponseValue::from_response(response).await,
71590 400u16 => {
71591 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71592 }
71593 401u16 => {
71594 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71595 }
71596 _ => Err(Error::UnexpectedResponse(response)),
71597 }
71598 }
71599 /**List All Swap Pools (MARKET_DATA)
71600
71601Get metadata about all swap pools.
71602
71603Weight(IP): 1
71604
71605Sends a `GET` request to `/sapi/v1/bswap/pools`
71606
71607*/
71608 pub async fn bswap_pools<'a>(
71609 &'a self,
71610 ) -> Result<ResponseValue<Vec<types::BswapPoolsResponseItem>>, Error<types::Error>> {
71611 let url = format!("{}/sapi/v1/bswap/pools", self.baseurl,);
71612 #[allow(unused_mut)]
71613 let mut request = self
71614 .client
71615 .get(url)
71616 .header(
71617 reqwest::header::ACCEPT,
71618 reqwest::header::HeaderValue::from_static("application/json"),
71619 )
71620 .build()?;
71621 (crate::pre_hook)(&self.inner, &request);
71622 let result = self.client.execute(request).await;
71623 (crate::post_hook)(&self.inner, &result);
71624 let response = result?;
71625 match response.status().as_u16() {
71626 200u16 => ResponseValue::from_response(response).await,
71627 400u16 => {
71628 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71629 }
71630 _ => Err(Error::UnexpectedResponse(response)),
71631 }
71632 }
71633 /**Liquidity information of a pool (USER_DATA)
71634
71635Get liquidity information and user share of a pool.
71636
71637Weight(IP):
71638- `1` for one pool;
71639- `10` when the poolId parameter is omitted;
71640
71641Sends a `GET` request to `/sapi/v1/bswap/liquidity`
71642
71643Arguments:
71644- `pool_id`
71645- `recv_window`: The value cannot be greater than 60000
71646- `signature`: Signature
71647- `timestamp`: UTC timestamp in ms
71648*/
71649 pub async fn bswap_liquidity<'a>(
71650 &'a self,
71651 pool_id: Option<i64>,
71652 recv_window: Option<i64>,
71653 signature: &'a str,
71654 timestamp: i64,
71655 ) -> Result<
71656 ResponseValue<Vec<types::BswapLiquidityResponseItem>>,
71657 Error<types::Error>,
71658 > {
71659 let url = format!("{}/sapi/v1/bswap/liquidity", self.baseurl,);
71660 let mut query = Vec::with_capacity(4usize);
71661 if let Some(v) = &pool_id {
71662 query.push(("poolId", v.to_string()));
71663 }
71664 if let Some(v) = &recv_window {
71665 query.push(("recvWindow", v.to_string()));
71666 }
71667 query.push(("signature", signature.to_string()));
71668 query.push(("timestamp", timestamp.to_string()));
71669 #[allow(unused_mut)]
71670 let mut request = self
71671 .client
71672 .get(url)
71673 .header(
71674 reqwest::header::ACCEPT,
71675 reqwest::header::HeaderValue::from_static("application/json"),
71676 )
71677 .query(&query)
71678 .build()?;
71679 (crate::pre_hook)(&self.inner, &request);
71680 let result = self.client.execute(request).await;
71681 (crate::post_hook)(&self.inner, &result);
71682 let response = result?;
71683 match response.status().as_u16() {
71684 200u16 => ResponseValue::from_response(response).await,
71685 400u16 => {
71686 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71687 }
71688 401u16 => {
71689 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71690 }
71691 _ => Err(Error::UnexpectedResponse(response)),
71692 }
71693 }
71694 /**Add Liquidity (TRADE)
71695
71696Add liquidity to a pool.
71697
71698Weight(UID): 1000 (Additional: 3 times one second)
71699
71700Sends a `POST` request to `/sapi/v1/bswap/liquidityAdd`
71701
71702Arguments:
71703- `asset`
71704- `pool_id`
71705- `quantity`
71706- `recv_window`: The value cannot be greater than 60000
71707- `signature`: Signature
71708- `timestamp`: UTC timestamp in ms
71709- `type_`: * `Single` - to add a single token
71710* `Combination` - to add dual tokens
71711*/
71712 pub async fn bswap_liquidity_add<'a>(
71713 &'a self,
71714 asset: &'a str,
71715 pool_id: i64,
71716 quantity: f64,
71717 recv_window: Option<i64>,
71718 signature: &'a str,
71719 timestamp: i64,
71720 type_: Option<types::BswapLiquidityAddType>,
71721 ) -> Result<ResponseValue<types::BswapLiquidityAddResponse>, Error<types::Error>> {
71722 let url = format!("{}/sapi/v1/bswap/liquidityAdd", self.baseurl,);
71723 let mut query = Vec::with_capacity(7usize);
71724 query.push(("asset", asset.to_string()));
71725 query.push(("poolId", pool_id.to_string()));
71726 query.push(("quantity", quantity.to_string()));
71727 if let Some(v) = &recv_window {
71728 query.push(("recvWindow", v.to_string()));
71729 }
71730 query.push(("signature", signature.to_string()));
71731 query.push(("timestamp", timestamp.to_string()));
71732 if let Some(v) = &type_ {
71733 query.push(("type", v.to_string()));
71734 }
71735 #[allow(unused_mut)]
71736 let mut request = self
71737 .client
71738 .post(url)
71739 .header(
71740 reqwest::header::ACCEPT,
71741 reqwest::header::HeaderValue::from_static("application/json"),
71742 )
71743 .query(&query)
71744 .build()?;
71745 (crate::pre_hook)(&self.inner, &request);
71746 let result = self.client.execute(request).await;
71747 (crate::post_hook)(&self.inner, &result);
71748 let response = result?;
71749 match response.status().as_u16() {
71750 200u16 => ResponseValue::from_response(response).await,
71751 400u16 => {
71752 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71753 }
71754 401u16 => {
71755 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71756 }
71757 _ => Err(Error::UnexpectedResponse(response)),
71758 }
71759 }
71760 /**Remove Liquidity (TRADE)
71761
71762Remove liquidity from a pool, `type` include `SINGLE` and `COMBINATION`, asset is mandatory for single asset removal
71763
71764Weight(UID): 1000 (Additional: 3 times one second)
71765
71766Sends a `POST` request to `/sapi/v1/bswap/liquidityRemove`
71767
71768Arguments:
71769- `asset`: Mandatory for single asset removal
71770- `pool_id`
71771- `recv_window`: The value cannot be greater than 60000
71772- `share_amount`
71773- `signature`: Signature
71774- `timestamp`: UTC timestamp in ms
71775- `type_`: * `SINGLE` - for single asset removal
71776* `COMBINATION` - for combination of all coins removal
71777*/
71778 pub async fn bswap_liquidity_remove<'a>(
71779 &'a self,
71780 asset: Option<&'a str>,
71781 pool_id: i64,
71782 recv_window: Option<i64>,
71783 share_amount: f64,
71784 signature: &'a str,
71785 timestamp: i64,
71786 type_: types::BswapLiquidityRemoveType,
71787 ) -> Result<
71788 ResponseValue<types::BswapLiquidityRemoveResponse>,
71789 Error<types::Error>,
71790 > {
71791 let url = format!("{}/sapi/v1/bswap/liquidityRemove", self.baseurl,);
71792 let mut query = Vec::with_capacity(7usize);
71793 if let Some(v) = &asset {
71794 query.push(("asset", v.to_string()));
71795 }
71796 query.push(("poolId", pool_id.to_string()));
71797 if let Some(v) = &recv_window {
71798 query.push(("recvWindow", v.to_string()));
71799 }
71800 query.push(("shareAmount", share_amount.to_string()));
71801 query.push(("signature", signature.to_string()));
71802 query.push(("timestamp", timestamp.to_string()));
71803 query.push(("type", type_.to_string()));
71804 #[allow(unused_mut)]
71805 let mut request = self
71806 .client
71807 .post(url)
71808 .header(
71809 reqwest::header::ACCEPT,
71810 reqwest::header::HeaderValue::from_static("application/json"),
71811 )
71812 .query(&query)
71813 .build()?;
71814 (crate::pre_hook)(&self.inner, &request);
71815 let result = self.client.execute(request).await;
71816 (crate::post_hook)(&self.inner, &result);
71817 let response = result?;
71818 match response.status().as_u16() {
71819 200u16 => ResponseValue::from_response(response).await,
71820 400u16 => {
71821 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71822 }
71823 401u16 => {
71824 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71825 }
71826 _ => Err(Error::UnexpectedResponse(response)),
71827 }
71828 }
71829 /**Liquidity Operation Record (USER_DATA)
71830
71831Get liquidity operation (add/remove) records.
71832
71833Weight(UID): 3000
71834
71835Sends a `GET` request to `/sapi/v1/bswap/liquidityOps`
71836
71837Arguments:
71838- `end_time`: UTC timestamp in ms
71839- `limit`: Default 500; max 1000.
71840- `operation`
71841- `operation_id`
71842- `pool_id`
71843- `recv_window`: The value cannot be greater than 60000
71844- `signature`: Signature
71845- `start_time`: UTC timestamp in ms
71846- `timestamp`: UTC timestamp in ms
71847*/
71848 pub async fn bswap_liquidity_ops<'a>(
71849 &'a self,
71850 end_time: Option<i64>,
71851 limit: Option<i32>,
71852 operation: Option<types::BswapLiquidityOpsOperation>,
71853 operation_id: Option<i64>,
71854 pool_id: Option<i64>,
71855 recv_window: Option<i64>,
71856 signature: &'a str,
71857 start_time: Option<i64>,
71858 timestamp: i64,
71859 ) -> Result<
71860 ResponseValue<Vec<types::BswapLiquidityOpsResponseItem>>,
71861 Error<types::Error>,
71862 > {
71863 let url = format!("{}/sapi/v1/bswap/liquidityOps", self.baseurl,);
71864 let mut query = Vec::with_capacity(9usize);
71865 if let Some(v) = &end_time {
71866 query.push(("endTime", v.to_string()));
71867 }
71868 if let Some(v) = &limit {
71869 query.push(("limit", v.to_string()));
71870 }
71871 if let Some(v) = &operation {
71872 query.push(("operation", v.to_string()));
71873 }
71874 if let Some(v) = &operation_id {
71875 query.push(("operationId", v.to_string()));
71876 }
71877 if let Some(v) = &pool_id {
71878 query.push(("poolId", v.to_string()));
71879 }
71880 if let Some(v) = &recv_window {
71881 query.push(("recvWindow", v.to_string()));
71882 }
71883 query.push(("signature", signature.to_string()));
71884 if let Some(v) = &start_time {
71885 query.push(("startTime", v.to_string()));
71886 }
71887 query.push(("timestamp", timestamp.to_string()));
71888 #[allow(unused_mut)]
71889 let mut request = self
71890 .client
71891 .get(url)
71892 .header(
71893 reqwest::header::ACCEPT,
71894 reqwest::header::HeaderValue::from_static("application/json"),
71895 )
71896 .query(&query)
71897 .build()?;
71898 (crate::pre_hook)(&self.inner, &request);
71899 let result = self.client.execute(request).await;
71900 (crate::post_hook)(&self.inner, &result);
71901 let response = result?;
71902 match response.status().as_u16() {
71903 200u16 => ResponseValue::from_response(response).await,
71904 400u16 => {
71905 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71906 }
71907 401u16 => {
71908 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71909 }
71910 _ => Err(Error::UnexpectedResponse(response)),
71911 }
71912 }
71913 /**Request Quote (USER_DATA)
71914
71915Request a quote for swap quote asset (selling asset) for base asset (buying asset), essentially price/exchange rates.
71916
71917quoteQty is quantity of quote asset (to sell).
71918
71919Please be noted the quote is for reference only, the actual price will change as the liquidity changes, it's recommended to swap immediate after request a quote for slippage prevention.
71920
71921Weight(UID): 150
71922
71923Sends a `GET` request to `/sapi/v1/bswap/quote`
71924
71925Arguments:
71926- `base_asset`
71927- `quote_asset`
71928- `quote_qty`
71929- `recv_window`: The value cannot be greater than 60000
71930- `signature`: Signature
71931- `timestamp`: UTC timestamp in ms
71932*/
71933 pub async fn bswap_quote<'a>(
71934 &'a self,
71935 base_asset: &'a str,
71936 quote_asset: &'a str,
71937 quote_qty: f64,
71938 recv_window: Option<i64>,
71939 signature: &'a str,
71940 timestamp: i64,
71941 ) -> Result<ResponseValue<types::BswapQuoteResponse>, Error<types::Error>> {
71942 let url = format!("{}/sapi/v1/bswap/quote", self.baseurl,);
71943 let mut query = Vec::with_capacity(6usize);
71944 query.push(("baseAsset", base_asset.to_string()));
71945 query.push(("quoteAsset", quote_asset.to_string()));
71946 query.push(("quoteQty", quote_qty.to_string()));
71947 if let Some(v) = &recv_window {
71948 query.push(("recvWindow", v.to_string()));
71949 }
71950 query.push(("signature", signature.to_string()));
71951 query.push(("timestamp", timestamp.to_string()));
71952 #[allow(unused_mut)]
71953 let mut request = self
71954 .client
71955 .get(url)
71956 .header(
71957 reqwest::header::ACCEPT,
71958 reqwest::header::HeaderValue::from_static("application/json"),
71959 )
71960 .query(&query)
71961 .build()?;
71962 (crate::pre_hook)(&self.inner, &request);
71963 let result = self.client.execute(request).await;
71964 (crate::post_hook)(&self.inner, &result);
71965 let response = result?;
71966 match response.status().as_u16() {
71967 200u16 => ResponseValue::from_response(response).await,
71968 400u16 => {
71969 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71970 }
71971 401u16 => {
71972 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
71973 }
71974 _ => Err(Error::UnexpectedResponse(response)),
71975 }
71976 }
71977 /**Swap History (USER_DATA)
71978
71979Get swap history.
71980
71981Weight(UID): 3000
71982
71983Sends a `GET` request to `/sapi/v1/bswap/swap`
71984
71985Arguments:
71986- `base_asset`
71987- `end_time`: UTC timestamp in ms
71988- `limit`: default 3, max 100
71989- `quote_asset`
71990- `recv_window`: The value cannot be greater than 60000
71991- `signature`: Signature
71992- `start_time`: UTC timestamp in ms
71993- `status`: * `0` - pending for swap
71994* `1` - success
71995* `2` - failed
71996- `swap_id`
71997- `timestamp`: UTC timestamp in ms
71998*/
71999 pub async fn swap_history<'a>(
72000 &'a self,
72001 base_asset: Option<&'a str>,
72002 end_time: Option<i64>,
72003 limit: Option<i32>,
72004 quote_asset: Option<&'a str>,
72005 recv_window: Option<i64>,
72006 signature: &'a str,
72007 start_time: Option<i64>,
72008 status: Option<i32>,
72009 swap_id: Option<i64>,
72010 timestamp: i64,
72011 ) -> Result<
72012 ResponseValue<Vec<types::SwapHistoryResponseItem>>,
72013 Error<types::Error>,
72014 > {
72015 let url = format!("{}/sapi/v1/bswap/swap", self.baseurl,);
72016 let mut query = Vec::with_capacity(10usize);
72017 if let Some(v) = &base_asset {
72018 query.push(("baseAsset", v.to_string()));
72019 }
72020 if let Some(v) = &end_time {
72021 query.push(("endTime", v.to_string()));
72022 }
72023 if let Some(v) = &limit {
72024 query.push(("limit", v.to_string()));
72025 }
72026 if let Some(v) = "e_asset {
72027 query.push(("quoteAsset", v.to_string()));
72028 }
72029 if let Some(v) = &recv_window {
72030 query.push(("recvWindow", v.to_string()));
72031 }
72032 query.push(("signature", signature.to_string()));
72033 if let Some(v) = &start_time {
72034 query.push(("startTime", v.to_string()));
72035 }
72036 if let Some(v) = &status {
72037 query.push(("status", v.to_string()));
72038 }
72039 if let Some(v) = &swap_id {
72040 query.push(("swapId", v.to_string()));
72041 }
72042 query.push(("timestamp", timestamp.to_string()));
72043 #[allow(unused_mut)]
72044 let mut request = self
72045 .client
72046 .get(url)
72047 .header(
72048 reqwest::header::ACCEPT,
72049 reqwest::header::HeaderValue::from_static("application/json"),
72050 )
72051 .query(&query)
72052 .build()?;
72053 (crate::pre_hook)(&self.inner, &request);
72054 let result = self.client.execute(request).await;
72055 (crate::post_hook)(&self.inner, &result);
72056 let response = result?;
72057 match response.status().as_u16() {
72058 200u16 => ResponseValue::from_response(response).await,
72059 400u16 => {
72060 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72061 }
72062 401u16 => {
72063 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72064 }
72065 _ => Err(Error::UnexpectedResponse(response)),
72066 }
72067 }
72068 /**Swap (TRADE)
72069
72070Swap `quoteAsset` for `baseAsset`.
72071
72072Weight(UID): 1000 (Additional: 3 times one second)
72073
72074Sends a `POST` request to `/sapi/v1/bswap/swap`
72075
72076Arguments:
72077- `base_asset`
72078- `quote_asset`
72079- `quote_qty`
72080- `recv_window`: The value cannot be greater than 60000
72081- `signature`: Signature
72082- `timestamp`: UTC timestamp in ms
72083*/
72084 pub async fn bswap_swap<'a>(
72085 &'a self,
72086 base_asset: &'a str,
72087 quote_asset: &'a str,
72088 quote_qty: f64,
72089 recv_window: Option<i64>,
72090 signature: &'a str,
72091 timestamp: i64,
72092 ) -> Result<ResponseValue<types::BswapSwapResponse>, Error<types::Error>> {
72093 let url = format!("{}/sapi/v1/bswap/swap", self.baseurl,);
72094 let mut query = Vec::with_capacity(6usize);
72095 query.push(("baseAsset", base_asset.to_string()));
72096 query.push(("quoteAsset", quote_asset.to_string()));
72097 query.push(("quoteQty", quote_qty.to_string()));
72098 if let Some(v) = &recv_window {
72099 query.push(("recvWindow", v.to_string()));
72100 }
72101 query.push(("signature", signature.to_string()));
72102 query.push(("timestamp", timestamp.to_string()));
72103 #[allow(unused_mut)]
72104 let mut request = self
72105 .client
72106 .post(url)
72107 .header(
72108 reqwest::header::ACCEPT,
72109 reqwest::header::HeaderValue::from_static("application/json"),
72110 )
72111 .query(&query)
72112 .build()?;
72113 (crate::pre_hook)(&self.inner, &request);
72114 let result = self.client.execute(request).await;
72115 (crate::post_hook)(&self.inner, &result);
72116 let response = result?;
72117 match response.status().as_u16() {
72118 200u16 => ResponseValue::from_response(response).await,
72119 400u16 => {
72120 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72121 }
72122 401u16 => {
72123 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72124 }
72125 _ => Err(Error::UnexpectedResponse(response)),
72126 }
72127 }
72128 /**Pool Configure (USER_DATA)
72129
72130Weight(IP): 150
72131
72132Sends a `GET` request to `/sapi/v1/bswap/poolConfigure`
72133
72134Arguments:
72135- `pool_id`
72136- `recv_window`: The value cannot be greater than 60000
72137- `signature`: Signature
72138- `timestamp`: UTC timestamp in ms
72139*/
72140 pub async fn bswap_pool_configure<'a>(
72141 &'a self,
72142 pool_id: Option<i64>,
72143 recv_window: Option<i64>,
72144 signature: &'a str,
72145 timestamp: i64,
72146 ) -> Result<
72147 ResponseValue<Vec<types::BswapPoolConfigureResponseItem>>,
72148 Error<types::Error>,
72149 > {
72150 let url = format!("{}/sapi/v1/bswap/poolConfigure", self.baseurl,);
72151 let mut query = Vec::with_capacity(4usize);
72152 if let Some(v) = &pool_id {
72153 query.push(("poolId", v.to_string()));
72154 }
72155 if let Some(v) = &recv_window {
72156 query.push(("recvWindow", v.to_string()));
72157 }
72158 query.push(("signature", signature.to_string()));
72159 query.push(("timestamp", timestamp.to_string()));
72160 #[allow(unused_mut)]
72161 let mut request = self
72162 .client
72163 .get(url)
72164 .header(
72165 reqwest::header::ACCEPT,
72166 reqwest::header::HeaderValue::from_static("application/json"),
72167 )
72168 .query(&query)
72169 .build()?;
72170 (crate::pre_hook)(&self.inner, &request);
72171 let result = self.client.execute(request).await;
72172 (crate::post_hook)(&self.inner, &result);
72173 let response = result?;
72174 match response.status().as_u16() {
72175 200u16 => ResponseValue::from_response(response).await,
72176 400u16 => {
72177 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72178 }
72179 401u16 => {
72180 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72181 }
72182 _ => Err(Error::UnexpectedResponse(response)),
72183 }
72184 }
72185 /**Add Liquidity Preview (USER_DATA)
72186
72187Calculate expected share amount for adding liquidity in single or dual token.
72188
72189Weight(IP): 150
72190
72191Sends a `GET` request to `/sapi/v1/bswap/addLiquidityPreview`
72192
72193Arguments:
72194- `pool_id`
72195- `quote_asset`
72196- `quote_qty`
72197- `recv_window`: The value cannot be greater than 60000
72198- `signature`: Signature
72199- `timestamp`: UTC timestamp in ms
72200- `type_`: * `SINGLE` - for adding a single token
72201* `COMBINATION` - for adding dual tokens
72202*/
72203 pub async fn bswap_add_liquidity_preview<'a>(
72204 &'a self,
72205 pool_id: i64,
72206 quote_asset: &'a str,
72207 quote_qty: f64,
72208 recv_window: Option<i64>,
72209 signature: &'a str,
72210 timestamp: i64,
72211 type_: types::BswapAddLiquidityPreviewType,
72212 ) -> Result<
72213 ResponseValue<types::BswapAddLiquidityPreviewResponse>,
72214 Error<types::Error>,
72215 > {
72216 let url = format!("{}/sapi/v1/bswap/addLiquidityPreview", self.baseurl,);
72217 let mut query = Vec::with_capacity(7usize);
72218 query.push(("poolId", pool_id.to_string()));
72219 query.push(("quoteAsset", quote_asset.to_string()));
72220 query.push(("quoteQty", quote_qty.to_string()));
72221 if let Some(v) = &recv_window {
72222 query.push(("recvWindow", v.to_string()));
72223 }
72224 query.push(("signature", signature.to_string()));
72225 query.push(("timestamp", timestamp.to_string()));
72226 query.push(("type", type_.to_string()));
72227 #[allow(unused_mut)]
72228 let mut request = self
72229 .client
72230 .get(url)
72231 .header(
72232 reqwest::header::ACCEPT,
72233 reqwest::header::HeaderValue::from_static("application/json"),
72234 )
72235 .query(&query)
72236 .build()?;
72237 (crate::pre_hook)(&self.inner, &request);
72238 let result = self.client.execute(request).await;
72239 (crate::post_hook)(&self.inner, &result);
72240 let response = result?;
72241 match response.status().as_u16() {
72242 200u16 => ResponseValue::from_response(response).await,
72243 400u16 => {
72244 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72245 }
72246 401u16 => {
72247 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72248 }
72249 _ => Err(Error::UnexpectedResponse(response)),
72250 }
72251 }
72252 /**Remove Liquidity Preview (USER_DATA)
72253
72254Calculate the expected asset amount of single token redemption or dual token redemption.
72255
72256Weight(IP): 150
72257
72258Sends a `GET` request to `/sapi/v1/bswap/removeLiquidityPreview`
72259
72260Arguments:
72261- `pool_id`
72262- `quote_asset`
72263- `recv_window`: The value cannot be greater than 60000
72264- `share_amount`
72265- `signature`: Signature
72266- `timestamp`: UTC timestamp in ms
72267- `type_`: * `SINGLE` - remove and obtain a single token
72268* `COMBINATION` - remove and obtain dual token
72269*/
72270 pub async fn bswap_remove_liquidity_preview<'a>(
72271 &'a self,
72272 pool_id: i64,
72273 quote_asset: &'a str,
72274 recv_window: Option<i64>,
72275 share_amount: f64,
72276 signature: &'a str,
72277 timestamp: i64,
72278 type_: types::BswapRemoveLiquidityPreviewType,
72279 ) -> Result<
72280 ResponseValue<types::BswapRemoveLiquidityPreviewResponse>,
72281 Error<types::Error>,
72282 > {
72283 let url = format!("{}/sapi/v1/bswap/removeLiquidityPreview", self.baseurl,);
72284 let mut query = Vec::with_capacity(7usize);
72285 query.push(("poolId", pool_id.to_string()));
72286 query.push(("quoteAsset", quote_asset.to_string()));
72287 if let Some(v) = &recv_window {
72288 query.push(("recvWindow", v.to_string()));
72289 }
72290 query.push(("shareAmount", share_amount.to_string()));
72291 query.push(("signature", signature.to_string()));
72292 query.push(("timestamp", timestamp.to_string()));
72293 query.push(("type", type_.to_string()));
72294 #[allow(unused_mut)]
72295 let mut request = self
72296 .client
72297 .get(url)
72298 .header(
72299 reqwest::header::ACCEPT,
72300 reqwest::header::HeaderValue::from_static("application/json"),
72301 )
72302 .query(&query)
72303 .build()?;
72304 (crate::pre_hook)(&self.inner, &request);
72305 let result = self.client.execute(request).await;
72306 (crate::post_hook)(&self.inner, &result);
72307 let response = result?;
72308 match response.status().as_u16() {
72309 200u16 => ResponseValue::from_response(response).await,
72310 400u16 => {
72311 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72312 }
72313 401u16 => {
72314 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72315 }
72316 _ => Err(Error::UnexpectedResponse(response)),
72317 }
72318 }
72319 /**Get Unclaimed Rewards Record (USER_DATA)
72320
72321Get unclaimed rewards record.
72322
72323Weight(UID): 1000
72324
72325Sends a `GET` request to `/sapi/v1/bswap/unclaimedRewards`
72326
72327Arguments:
72328- `recv_window`: The value cannot be greater than 60000
72329- `signature`: Signature
72330- `timestamp`: UTC timestamp in ms
72331- `type_`: 0: Swap rewards, 1: Liquidity rewards, default to 0
72332*/
72333 pub async fn bswap_unclaimed_rewards<'a>(
72334 &'a self,
72335 recv_window: Option<i64>,
72336 signature: &'a str,
72337 timestamp: i64,
72338 type_: Option<i32>,
72339 ) -> Result<
72340 ResponseValue<types::BswapUnclaimedRewardsResponse>,
72341 Error<types::Error>,
72342 > {
72343 let url = format!("{}/sapi/v1/bswap/unclaimedRewards", self.baseurl,);
72344 let mut query = Vec::with_capacity(4usize);
72345 if let Some(v) = &recv_window {
72346 query.push(("recvWindow", v.to_string()));
72347 }
72348 query.push(("signature", signature.to_string()));
72349 query.push(("timestamp", timestamp.to_string()));
72350 if let Some(v) = &type_ {
72351 query.push(("type", v.to_string()));
72352 }
72353 #[allow(unused_mut)]
72354 let mut request = self
72355 .client
72356 .get(url)
72357 .header(
72358 reqwest::header::ACCEPT,
72359 reqwest::header::HeaderValue::from_static("application/json"),
72360 )
72361 .query(&query)
72362 .build()?;
72363 (crate::pre_hook)(&self.inner, &request);
72364 let result = self.client.execute(request).await;
72365 (crate::post_hook)(&self.inner, &result);
72366 let response = result?;
72367 match response.status().as_u16() {
72368 200u16 => ResponseValue::from_response(response).await,
72369 400u16 => {
72370 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72371 }
72372 401u16 => {
72373 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72374 }
72375 _ => Err(Error::UnexpectedResponse(response)),
72376 }
72377 }
72378 /**Claim rewards (TRADE)
72379
72380Claim swap rewards or liquidity rewards
72381
72382Weight(UID): 1000
72383
72384Sends a `POST` request to `/sapi/v1/bswap/claimRewards`
72385
72386Arguments:
72387- `recv_window`: The value cannot be greater than 60000
72388- `signature`: Signature
72389- `timestamp`: UTC timestamp in ms
72390- `type_`: 0: Swap rewards, 1: Liquidity rewards, default to 0
72391*/
72392 pub async fn bswap_claim_rewards<'a>(
72393 &'a self,
72394 recv_window: Option<i64>,
72395 signature: &'a str,
72396 timestamp: i64,
72397 type_: Option<i32>,
72398 ) -> Result<ResponseValue<types::BswapClaimRewardsResponse>, Error<types::Error>> {
72399 let url = format!("{}/sapi/v1/bswap/claimRewards", self.baseurl,);
72400 let mut query = Vec::with_capacity(4usize);
72401 if let Some(v) = &recv_window {
72402 query.push(("recvWindow", v.to_string()));
72403 }
72404 query.push(("signature", signature.to_string()));
72405 query.push(("timestamp", timestamp.to_string()));
72406 if let Some(v) = &type_ {
72407 query.push(("type", v.to_string()));
72408 }
72409 #[allow(unused_mut)]
72410 let mut request = self
72411 .client
72412 .post(url)
72413 .header(
72414 reqwest::header::ACCEPT,
72415 reqwest::header::HeaderValue::from_static("application/json"),
72416 )
72417 .query(&query)
72418 .build()?;
72419 (crate::pre_hook)(&self.inner, &request);
72420 let result = self.client.execute(request).await;
72421 (crate::post_hook)(&self.inner, &result);
72422 let response = result?;
72423 match response.status().as_u16() {
72424 200u16 => ResponseValue::from_response(response).await,
72425 400u16 => {
72426 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72427 }
72428 401u16 => {
72429 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72430 }
72431 _ => Err(Error::UnexpectedResponse(response)),
72432 }
72433 }
72434 /**Get Claimed History (USER_DATA)
72435
72436Get history of claimed rewards.
72437
72438Weight(UID): 1000
72439
72440Sends a `GET` request to `/sapi/v1/bswap/claimedHistory`
72441
72442Arguments:
72443- `asset_rewards`
72444- `end_time`: UTC timestamp in ms
72445- `limit`: Default 3, max 100
72446- `pool_id`
72447- `recv_window`: The value cannot be greater than 60000
72448- `signature`: Signature
72449- `start_time`: UTC timestamp in ms
72450- `timestamp`: UTC timestamp in ms
72451- `type_`: 0: Swap rewards, 1: Liquidity rewards, default to 0
72452*/
72453 pub async fn bswap_claimed_history<'a>(
72454 &'a self,
72455 asset_rewards: Option<&'a str>,
72456 end_time: Option<i64>,
72457 limit: Option<i32>,
72458 pool_id: Option<i64>,
72459 recv_window: Option<i64>,
72460 signature: &'a str,
72461 start_time: Option<i64>,
72462 timestamp: i64,
72463 type_: Option<i32>,
72464 ) -> Result<
72465 ResponseValue<Vec<types::BswapClaimedHistoryResponseItem>>,
72466 Error<types::Error>,
72467 > {
72468 let url = format!("{}/sapi/v1/bswap/claimedHistory", self.baseurl,);
72469 let mut query = Vec::with_capacity(9usize);
72470 if let Some(v) = &asset_rewards {
72471 query.push(("assetRewards", v.to_string()));
72472 }
72473 if let Some(v) = &end_time {
72474 query.push(("endTime", v.to_string()));
72475 }
72476 if let Some(v) = &limit {
72477 query.push(("limit", v.to_string()));
72478 }
72479 if let Some(v) = &pool_id {
72480 query.push(("poolId", v.to_string()));
72481 }
72482 if let Some(v) = &recv_window {
72483 query.push(("recvWindow", v.to_string()));
72484 }
72485 query.push(("signature", signature.to_string()));
72486 if let Some(v) = &start_time {
72487 query.push(("startTime", v.to_string()));
72488 }
72489 query.push(("timestamp", timestamp.to_string()));
72490 if let Some(v) = &type_ {
72491 query.push(("type", v.to_string()));
72492 }
72493 #[allow(unused_mut)]
72494 let mut request = self
72495 .client
72496 .get(url)
72497 .header(
72498 reqwest::header::ACCEPT,
72499 reqwest::header::HeaderValue::from_static("application/json"),
72500 )
72501 .query(&query)
72502 .build()?;
72503 (crate::pre_hook)(&self.inner, &request);
72504 let result = self.client.execute(request).await;
72505 (crate::post_hook)(&self.inner, &result);
72506 let response = result?;
72507 match response.status().as_u16() {
72508 200u16 => ResponseValue::from_response(response).await,
72509 400u16 => {
72510 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72511 }
72512 401u16 => {
72513 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72514 }
72515 _ => Err(Error::UnexpectedResponse(response)),
72516 }
72517 }
72518 /**Get C2C Trade History (USER_DATA)
72519
72520- If startTimestamp and endTimestamp are not sent, the recent 30-day data will be returned.
72521- The max interval between startTimestamp and endTimestamp is 30 days.
72522
72523Weight(IP): 1
72524
72525Sends a `GET` request to `/sapi/v1/c2c/orderMatch/listUserOrderHistory`
72526
72527Arguments:
72528- `end_timestamp`: UTC timestamp in ms
72529- `page`: Default 1
72530- `recv_window`: The value cannot be greater than 60000
72531- `rows`: default 100, max 100
72532- `signature`: Signature
72533- `start_timestamp`: UTC timestamp in ms
72534- `timestamp`: UTC timestamp in ms
72535- `trade_type`
72536*/
72537 pub async fn c2c_order_match_list_user_order_history<'a>(
72538 &'a self,
72539 end_timestamp: Option<i64>,
72540 page: Option<i32>,
72541 recv_window: Option<i64>,
72542 rows: Option<i32>,
72543 signature: &'a str,
72544 start_timestamp: Option<i64>,
72545 timestamp: i64,
72546 trade_type: types::C2cOrderMatchListUserOrderHistoryTradeType,
72547 ) -> Result<
72548 ResponseValue<types::C2cOrderMatchListUserOrderHistoryResponse>,
72549 Error<types::Error>,
72550 > {
72551 let url = format!(
72552 "{}/sapi/v1/c2c/orderMatch/listUserOrderHistory", self.baseurl,
72553 );
72554 let mut query = Vec::with_capacity(8usize);
72555 if let Some(v) = &end_timestamp {
72556 query.push(("endTimestamp", v.to_string()));
72557 }
72558 if let Some(v) = &page {
72559 query.push(("page", v.to_string()));
72560 }
72561 if let Some(v) = &recv_window {
72562 query.push(("recvWindow", v.to_string()));
72563 }
72564 if let Some(v) = &rows {
72565 query.push(("rows", v.to_string()));
72566 }
72567 query.push(("signature", signature.to_string()));
72568 if let Some(v) = &start_timestamp {
72569 query.push(("startTimestamp", v.to_string()));
72570 }
72571 query.push(("timestamp", timestamp.to_string()));
72572 query.push(("tradeType", trade_type.to_string()));
72573 #[allow(unused_mut)]
72574 let mut request = self
72575 .client
72576 .get(url)
72577 .header(
72578 reqwest::header::ACCEPT,
72579 reqwest::header::HeaderValue::from_static("application/json"),
72580 )
72581 .query(&query)
72582 .build()?;
72583 (crate::pre_hook)(&self.inner, &request);
72584 let result = self.client.execute(request).await;
72585 (crate::post_hook)(&self.inner, &result);
72586 let response = result?;
72587 match response.status().as_u16() {
72588 200u16 => ResponseValue::from_response(response).await,
72589 400u16 => {
72590 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72591 }
72592 401u16 => {
72593 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72594 }
72595 _ => Err(Error::UnexpectedResponse(response)),
72596 }
72597 }
72598 /**Get VIP Loan Ongoing Orders (USER_DATA)
72599
72600VIP loan is available for VIP users only.
72601
72602Weight(IP): 400
72603
72604Sends a `GET` request to `/sapi/v1/loan/vip/ongoing/orders`
72605
72606Arguments:
72607- `collateral_account_id`
72608- `collateral_coin`: Coin used as collateral
72609- `current`: Current querying page. Start from 1. Default:1
72610- `limit`: Default 10; max 100.
72611- `loan_coin`: Coin loaned
72612- `order_id`: Order id
72613- `recv_window`: The value cannot be greater than 60000
72614- `signature`: Signature
72615- `timestamp`: UTC timestamp in ms
72616*/
72617 pub async fn loan_vip_ongoing_orders<'a>(
72618 &'a self,
72619 collateral_account_id: Option<i64>,
72620 collateral_coin: Option<&'a str>,
72621 current: Option<i32>,
72622 limit: Option<i32>,
72623 loan_coin: Option<&'a str>,
72624 order_id: Option<i64>,
72625 recv_window: Option<i64>,
72626 signature: &'a str,
72627 timestamp: i64,
72628 ) -> Result<
72629 ResponseValue<types::LoanVipOngoingOrdersResponse>,
72630 Error<types::Error>,
72631 > {
72632 let url = format!("{}/sapi/v1/loan/vip/ongoing/orders", self.baseurl,);
72633 let mut query = Vec::with_capacity(9usize);
72634 if let Some(v) = &collateral_account_id {
72635 query.push(("collateralAccountId", v.to_string()));
72636 }
72637 if let Some(v) = &collateral_coin {
72638 query.push(("collateralCoin", v.to_string()));
72639 }
72640 if let Some(v) = ¤t {
72641 query.push(("current", v.to_string()));
72642 }
72643 if let Some(v) = &limit {
72644 query.push(("limit", v.to_string()));
72645 }
72646 if let Some(v) = &loan_coin {
72647 query.push(("loanCoin", v.to_string()));
72648 }
72649 if let Some(v) = &order_id {
72650 query.push(("orderId", v.to_string()));
72651 }
72652 if let Some(v) = &recv_window {
72653 query.push(("recvWindow", v.to_string()));
72654 }
72655 query.push(("signature", signature.to_string()));
72656 query.push(("timestamp", timestamp.to_string()));
72657 #[allow(unused_mut)]
72658 let mut request = self
72659 .client
72660 .get(url)
72661 .header(
72662 reqwest::header::ACCEPT,
72663 reqwest::header::HeaderValue::from_static("application/json"),
72664 )
72665 .query(&query)
72666 .build()?;
72667 (crate::pre_hook)(&self.inner, &request);
72668 let result = self.client.execute(request).await;
72669 (crate::post_hook)(&self.inner, &result);
72670 let response = result?;
72671 match response.status().as_u16() {
72672 200u16 => ResponseValue::from_response(response).await,
72673 400u16 => {
72674 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72675 }
72676 401u16 => {
72677 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72678 }
72679 _ => Err(Error::UnexpectedResponse(response)),
72680 }
72681 }
72682 /**VIP Loan Repay (TRADE)
72683
72684VIP loan is available for VIP users only.
72685
72686Weight(UID): 6000
72687
72688Sends a `POST` request to `/sapi/v1/loan/vip/repay`
72689
72690Arguments:
72691- `amount`
72692- `order_id`: Order id
72693- `recv_window`: The value cannot be greater than 60000
72694- `signature`: Signature
72695- `timestamp`: UTC timestamp in ms
72696*/
72697 pub async fn loan_vip_repay<'a>(
72698 &'a self,
72699 amount: f64,
72700 order_id: Option<i64>,
72701 recv_window: Option<i64>,
72702 signature: &'a str,
72703 timestamp: i64,
72704 ) -> Result<ResponseValue<types::LoanVipRepayResponse>, Error<types::Error>> {
72705 let url = format!("{}/sapi/v1/loan/vip/repay", self.baseurl,);
72706 let mut query = Vec::with_capacity(5usize);
72707 query.push(("amount", amount.to_string()));
72708 if let Some(v) = &order_id {
72709 query.push(("orderId", v.to_string()));
72710 }
72711 if let Some(v) = &recv_window {
72712 query.push(("recvWindow", v.to_string()));
72713 }
72714 query.push(("signature", signature.to_string()));
72715 query.push(("timestamp", timestamp.to_string()));
72716 #[allow(unused_mut)]
72717 let mut request = self
72718 .client
72719 .post(url)
72720 .header(
72721 reqwest::header::ACCEPT,
72722 reqwest::header::HeaderValue::from_static("application/json"),
72723 )
72724 .query(&query)
72725 .build()?;
72726 (crate::pre_hook)(&self.inner, &request);
72727 let result = self.client.execute(request).await;
72728 (crate::post_hook)(&self.inner, &result);
72729 let response = result?;
72730 match response.status().as_u16() {
72731 200u16 => ResponseValue::from_response(response).await,
72732 400u16 => {
72733 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72734 }
72735 401u16 => {
72736 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72737 }
72738 _ => Err(Error::UnexpectedResponse(response)),
72739 }
72740 }
72741 /**Get VIP Loan Repayment History (USER_DATA)
72742
72743VIP loan is available for VIP users only.
72744
72745Weight(IP): 400
72746
72747Sends a `GET` request to `/sapi/v1/loan/vip/repay/history`
72748
72749Arguments:
72750- `current`: Current querying page. Start from 1. Default:1
72751- `end_time`: UTC timestamp in ms
72752- `limit`: Default 10; max 100.
72753- `loan_coin`: Coin loaned
72754- `order_id`: Order id
72755- `recv_window`: The value cannot be greater than 60000
72756- `signature`: Signature
72757- `start_time`: UTC timestamp in ms
72758- `timestamp`: UTC timestamp in ms
72759*/
72760 pub async fn loan_vip_repay_history<'a>(
72761 &'a self,
72762 current: Option<i32>,
72763 end_time: Option<i64>,
72764 limit: Option<i32>,
72765 loan_coin: Option<&'a str>,
72766 order_id: Option<i64>,
72767 recv_window: Option<i64>,
72768 signature: &'a str,
72769 start_time: Option<i64>,
72770 timestamp: i64,
72771 ) -> Result<ResponseValue<types::LoanVipRepayHistoryResponse>, Error<types::Error>> {
72772 let url = format!("{}/sapi/v1/loan/vip/repay/history", self.baseurl,);
72773 let mut query = Vec::with_capacity(9usize);
72774 if let Some(v) = ¤t {
72775 query.push(("current", v.to_string()));
72776 }
72777 if let Some(v) = &end_time {
72778 query.push(("endTime", v.to_string()));
72779 }
72780 if let Some(v) = &limit {
72781 query.push(("limit", v.to_string()));
72782 }
72783 if let Some(v) = &loan_coin {
72784 query.push(("loanCoin", v.to_string()));
72785 }
72786 if let Some(v) = &order_id {
72787 query.push(("orderId", v.to_string()));
72788 }
72789 if let Some(v) = &recv_window {
72790 query.push(("recvWindow", v.to_string()));
72791 }
72792 query.push(("signature", signature.to_string()));
72793 if let Some(v) = &start_time {
72794 query.push(("startTime", v.to_string()));
72795 }
72796 query.push(("timestamp", timestamp.to_string()));
72797 #[allow(unused_mut)]
72798 let mut request = self
72799 .client
72800 .get(url)
72801 .header(
72802 reqwest::header::ACCEPT,
72803 reqwest::header::HeaderValue::from_static("application/json"),
72804 )
72805 .query(&query)
72806 .build()?;
72807 (crate::pre_hook)(&self.inner, &request);
72808 let result = self.client.execute(request).await;
72809 (crate::post_hook)(&self.inner, &result);
72810 let response = result?;
72811 match response.status().as_u16() {
72812 200u16 => ResponseValue::from_response(response).await,
72813 400u16 => {
72814 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72815 }
72816 401u16 => {
72817 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72818 }
72819 _ => Err(Error::UnexpectedResponse(response)),
72820 }
72821 }
72822 /**Check Locked Value of VIP Collateral Account (USER_DATA)
72823
72824VIP loan is available for VIP users only.
72825
72826Weight(IP): 6000
72827
72828Sends a `GET` request to `/sapi/v1/loan/vip/collateral/account`
72829
72830Arguments:
72831- `collateral_account_id`
72832- `order_id`: Order id
72833- `recv_window`: The value cannot be greater than 60000
72834- `signature`: Signature
72835- `timestamp`: UTC timestamp in ms
72836*/
72837 pub async fn loan_vip_collateral_account<'a>(
72838 &'a self,
72839 collateral_account_id: Option<i64>,
72840 order_id: Option<i64>,
72841 recv_window: Option<i64>,
72842 signature: &'a str,
72843 timestamp: i64,
72844 ) -> Result<
72845 ResponseValue<types::LoanVipCollateralAccountResponse>,
72846 Error<types::Error>,
72847 > {
72848 let url = format!("{}/sapi/v1/loan/vip/collateral/account", self.baseurl,);
72849 let mut query = Vec::with_capacity(5usize);
72850 if let Some(v) = &collateral_account_id {
72851 query.push(("collateralAccountId", v.to_string()));
72852 }
72853 if let Some(v) = &order_id {
72854 query.push(("orderId", v.to_string()));
72855 }
72856 if let Some(v) = &recv_window {
72857 query.push(("recvWindow", v.to_string()));
72858 }
72859 query.push(("signature", signature.to_string()));
72860 query.push(("timestamp", timestamp.to_string()));
72861 #[allow(unused_mut)]
72862 let mut request = self
72863 .client
72864 .get(url)
72865 .header(
72866 reqwest::header::ACCEPT,
72867 reqwest::header::HeaderValue::from_static("application/json"),
72868 )
72869 .query(&query)
72870 .build()?;
72871 (crate::pre_hook)(&self.inner, &request);
72872 let result = self.client.execute(request).await;
72873 (crate::post_hook)(&self.inner, &result);
72874 let response = result?;
72875 match response.status().as_u16() {
72876 200u16 => ResponseValue::from_response(response).await,
72877 400u16 => {
72878 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72879 }
72880 401u16 => {
72881 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72882 }
72883 _ => Err(Error::UnexpectedResponse(response)),
72884 }
72885 }
72886 /**VIP Loan Borrow
72887
72888VIP loan is available for VIP users only.
72889
72890Weight(UID): 6000
72891
72892Sends a `POST` request to `/sapi/v1/loan/vip/borrow`
72893
72894Arguments:
72895- `collateral_account_id`
72896- `collateral_coin`
72897- `is_flexible_rate`
72898- `loan_account_id`
72899- `loan_amount`
72900- `loan_coin`: Coin loaned
72901- `loan_term`
72902- `recv_window`: The value cannot be greater than 60000
72903- `signature`: Signature
72904- `timestamp`: UTC timestamp in ms
72905*/
72906 pub async fn loan_vip_borrow<'a>(
72907 &'a self,
72908 collateral_account_id: &'a str,
72909 collateral_coin: &'a str,
72910 is_flexible_rate: types::LoanVipBorrowIsFlexibleRate,
72911 loan_account_id: i64,
72912 loan_amount: f32,
72913 loan_coin: Option<&'a str>,
72914 loan_term: Option<i64>,
72915 recv_window: Option<i64>,
72916 signature: &'a str,
72917 timestamp: i64,
72918 ) -> Result<ResponseValue<types::LoanVipBorrowResponse>, Error<types::Error>> {
72919 let url = format!("{}/sapi/v1/loan/vip/borrow", self.baseurl,);
72920 let mut query = Vec::with_capacity(10usize);
72921 query.push(("collateralAccountId", collateral_account_id.to_string()));
72922 query.push(("collateralCoin", collateral_coin.to_string()));
72923 query.push(("isFlexibleRate", is_flexible_rate.to_string()));
72924 query.push(("loanAccountId", loan_account_id.to_string()));
72925 query.push(("loanAmount", loan_amount.to_string()));
72926 if let Some(v) = &loan_coin {
72927 query.push(("loanCoin", v.to_string()));
72928 }
72929 if let Some(v) = &loan_term {
72930 query.push(("loanTerm", v.to_string()));
72931 }
72932 if let Some(v) = &recv_window {
72933 query.push(("recvWindow", v.to_string()));
72934 }
72935 query.push(("signature", signature.to_string()));
72936 query.push(("timestamp", timestamp.to_string()));
72937 #[allow(unused_mut)]
72938 let mut request = self
72939 .client
72940 .post(url)
72941 .header(
72942 reqwest::header::ACCEPT,
72943 reqwest::header::HeaderValue::from_static("application/json"),
72944 )
72945 .query(&query)
72946 .build()?;
72947 (crate::pre_hook)(&self.inner, &request);
72948 let result = self.client.execute(request).await;
72949 (crate::post_hook)(&self.inner, &result);
72950 let response = result?;
72951 match response.status().as_u16() {
72952 200u16 => ResponseValue::from_response(response).await,
72953 400u16 => {
72954 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72955 }
72956 401u16 => {
72957 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
72958 }
72959 _ => Err(Error::UnexpectedResponse(response)),
72960 }
72961 }
72962 /**Get Loanable Assets Data
72963
72964Get interest rate and borrow limit of loanable assets. The borrow limit is shown in USD value.
72965
72966Weight(IP): 400
72967
72968Sends a `GET` request to `/sapi/v1/loan/vip/loanable/data`
72969
72970Arguments:
72971- `loan_coin`: Coin loaned
72972- `recv_window`: The value cannot be greater than 60000
72973- `signature`: Signature
72974- `timestamp`: UTC timestamp in ms
72975- `vip_level`: Defaults to user's vip level
72976*/
72977 pub async fn loan_vip_loanable_data<'a>(
72978 &'a self,
72979 loan_coin: Option<&'a str>,
72980 recv_window: Option<i64>,
72981 signature: &'a str,
72982 timestamp: i64,
72983 vip_level: Option<i32>,
72984 ) -> Result<ResponseValue<types::LoanVipLoanableDataResponse>, Error<types::Error>> {
72985 let url = format!("{}/sapi/v1/loan/vip/loanable/data", self.baseurl,);
72986 let mut query = Vec::with_capacity(5usize);
72987 if let Some(v) = &loan_coin {
72988 query.push(("loanCoin", v.to_string()));
72989 }
72990 if let Some(v) = &recv_window {
72991 query.push(("recvWindow", v.to_string()));
72992 }
72993 query.push(("signature", signature.to_string()));
72994 query.push(("timestamp", timestamp.to_string()));
72995 if let Some(v) = &vip_level {
72996 query.push(("vipLevel", v.to_string()));
72997 }
72998 #[allow(unused_mut)]
72999 let mut request = self
73000 .client
73001 .get(url)
73002 .header(
73003 reqwest::header::ACCEPT,
73004 reqwest::header::HeaderValue::from_static("application/json"),
73005 )
73006 .query(&query)
73007 .build()?;
73008 (crate::pre_hook)(&self.inner, &request);
73009 let result = self.client.execute(request).await;
73010 (crate::post_hook)(&self.inner, &result);
73011 let response = result?;
73012 match response.status().as_u16() {
73013 200u16 => ResponseValue::from_response(response).await,
73014 400u16 => {
73015 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73016 }
73017 401u16 => {
73018 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73019 }
73020 _ => Err(Error::UnexpectedResponse(response)),
73021 }
73022 }
73023 /**Get Collateral Asset Data (USER_DATA)
73024
73025Get collateral asset data.
73026
73027Weight(IP): 400
73028
73029Sends a `GET` request to `/sapi/v1/loan/vip/collateral/data`
73030
73031Arguments:
73032- `collateral_coin`: Coin used as collateral
73033- `recv_window`: The value cannot be greater than 60000
73034- `signature`: Signature
73035- `timestamp`: UTC timestamp in ms
73036*/
73037 pub async fn loan_vip_collateral_data<'a>(
73038 &'a self,
73039 collateral_coin: Option<&'a str>,
73040 recv_window: Option<i64>,
73041 signature: &'a str,
73042 timestamp: i64,
73043 ) -> Result<
73044 ResponseValue<types::LoanVipCollateralDataResponse>,
73045 Error<types::Error>,
73046 > {
73047 let url = format!("{}/sapi/v1/loan/vip/collateral/data", self.baseurl,);
73048 let mut query = Vec::with_capacity(4usize);
73049 if let Some(v) = &collateral_coin {
73050 query.push(("collateralCoin", v.to_string()));
73051 }
73052 if let Some(v) = &recv_window {
73053 query.push(("recvWindow", v.to_string()));
73054 }
73055 query.push(("signature", signature.to_string()));
73056 query.push(("timestamp", timestamp.to_string()));
73057 #[allow(unused_mut)]
73058 let mut request = self
73059 .client
73060 .get(url)
73061 .header(
73062 reqwest::header::ACCEPT,
73063 reqwest::header::HeaderValue::from_static("application/json"),
73064 )
73065 .query(&query)
73066 .build()?;
73067 (crate::pre_hook)(&self.inner, &request);
73068 let result = self.client.execute(request).await;
73069 (crate::post_hook)(&self.inner, &result);
73070 let response = result?;
73071 match response.status().as_u16() {
73072 200u16 => ResponseValue::from_response(response).await,
73073 400u16 => {
73074 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73075 }
73076 401u16 => {
73077 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73078 }
73079 _ => Err(Error::UnexpectedResponse(response)),
73080 }
73081 }
73082 /**Query Application Status (USER_DATA)
73083
73084Get Application Status
73085
73086Weight(UID): 400
73087
73088Sends a `GET` request to `/sapi/v1/loan/vip/request/data`
73089
73090Arguments:
73091- `current`: Current querying page. Start from 1. Default:1
73092- `limit`: Default 500; max 1000.
73093- `recv_window`: The value cannot be greater than 60000
73094- `signature`: Signature
73095- `timestamp`: UTC timestamp in ms
73096*/
73097 pub async fn loan_vip_request_data<'a>(
73098 &'a self,
73099 current: Option<i32>,
73100 limit: Option<i32>,
73101 recv_window: Option<i64>,
73102 signature: &'a str,
73103 timestamp: i64,
73104 ) -> Result<ResponseValue<types::LoanVipRequestDataResponse>, Error<types::Error>> {
73105 let url = format!("{}/sapi/v1/loan/vip/request/data", self.baseurl,);
73106 let mut query = Vec::with_capacity(5usize);
73107 if let Some(v) = ¤t {
73108 query.push(("current", v.to_string()));
73109 }
73110 if let Some(v) = &limit {
73111 query.push(("limit", v.to_string()));
73112 }
73113 if let Some(v) = &recv_window {
73114 query.push(("recvWindow", v.to_string()));
73115 }
73116 query.push(("signature", signature.to_string()));
73117 query.push(("timestamp", timestamp.to_string()));
73118 #[allow(unused_mut)]
73119 let mut request = self
73120 .client
73121 .get(url)
73122 .header(
73123 reqwest::header::ACCEPT,
73124 reqwest::header::HeaderValue::from_static("application/json"),
73125 )
73126 .query(&query)
73127 .build()?;
73128 (crate::pre_hook)(&self.inner, &request);
73129 let result = self.client.execute(request).await;
73130 (crate::post_hook)(&self.inner, &result);
73131 let response = result?;
73132 match response.status().as_u16() {
73133 200u16 => ResponseValue::from_response(response).await,
73134 400u16 => {
73135 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73136 }
73137 401u16 => {
73138 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73139 }
73140 _ => Err(Error::UnexpectedResponse(response)),
73141 }
73142 }
73143 /**Get Borrow Interest Rate (USER_DATA)
73144
73145Get borrow interest rate.
73146
73147Weight(UID): 400
73148
73149Sends a `GET` request to `/sapi/v1/loan/vip/request/interestRate`
73150
73151Arguments:
73152- `loan_coin`: Max 10 assets, Multiple split by ","
73153- `recv_window`: The value cannot be greater than 60000
73154- `signature`: Signature
73155- `timestamp`: UTC timestamp in ms
73156*/
73157 pub async fn loan_vip_request_interest_rate<'a>(
73158 &'a self,
73159 loan_coin: Option<&'a str>,
73160 recv_window: Option<i64>,
73161 signature: &'a str,
73162 timestamp: i64,
73163 ) -> Result<
73164 ResponseValue<Vec<types::LoanVipRequestInterestRateResponseItem>>,
73165 Error<types::Error>,
73166 > {
73167 let url = format!("{}/sapi/v1/loan/vip/request/interestRate", self.baseurl,);
73168 let mut query = Vec::with_capacity(4usize);
73169 if let Some(v) = &loan_coin {
73170 query.push(("loanCoin", v.to_string()));
73171 }
73172 if let Some(v) = &recv_window {
73173 query.push(("recvWindow", v.to_string()));
73174 }
73175 query.push(("signature", signature.to_string()));
73176 query.push(("timestamp", timestamp.to_string()));
73177 #[allow(unused_mut)]
73178 let mut request = self
73179 .client
73180 .get(url)
73181 .header(
73182 reqwest::header::ACCEPT,
73183 reqwest::header::HeaderValue::from_static("application/json"),
73184 )
73185 .query(&query)
73186 .build()?;
73187 (crate::pre_hook)(&self.inner, &request);
73188 let result = self.client.execute(request).await;
73189 (crate::post_hook)(&self.inner, &result);
73190 let response = result?;
73191 match response.status().as_u16() {
73192 200u16 => ResponseValue::from_response(response).await,
73193 400u16 => {
73194 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73195 }
73196 401u16 => {
73197 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73198 }
73199 _ => Err(Error::UnexpectedResponse(response)),
73200 }
73201 }
73202 /**VIP Loan Renew
73203
73204VIP loan is available for VIP users only.
73205
73206Weight(UID): 6000
73207
73208Sends a `POST` request to `/sapi/v1/loan/vip/renew`
73209
73210Arguments:
73211- `loan_term`
73212- `order_id`: Order id
73213- `recv_window`: The value cannot be greater than 60000
73214- `signature`: Signature
73215- `timestamp`: UTC timestamp in ms
73216*/
73217 pub async fn loan_vip_renew<'a>(
73218 &'a self,
73219 loan_term: Option<i64>,
73220 order_id: Option<i64>,
73221 recv_window: Option<i64>,
73222 signature: &'a str,
73223 timestamp: i64,
73224 ) -> Result<ResponseValue<types::LoanVipRenewResponse>, Error<types::Error>> {
73225 let url = format!("{}/sapi/v1/loan/vip/renew", self.baseurl,);
73226 let mut query = Vec::with_capacity(5usize);
73227 if let Some(v) = &loan_term {
73228 query.push(("loanTerm", v.to_string()));
73229 }
73230 if let Some(v) = &order_id {
73231 query.push(("orderId", v.to_string()));
73232 }
73233 if let Some(v) = &recv_window {
73234 query.push(("recvWindow", v.to_string()));
73235 }
73236 query.push(("signature", signature.to_string()));
73237 query.push(("timestamp", timestamp.to_string()));
73238 #[allow(unused_mut)]
73239 let mut request = self
73240 .client
73241 .post(url)
73242 .header(
73243 reqwest::header::ACCEPT,
73244 reqwest::header::HeaderValue::from_static("application/json"),
73245 )
73246 .query(&query)
73247 .build()?;
73248 (crate::pre_hook)(&self.inner, &request);
73249 let result = self.client.execute(request).await;
73250 (crate::post_hook)(&self.inner, &result);
73251 let response = result?;
73252 match response.status().as_u16() {
73253 200u16 => ResponseValue::from_response(response).await,
73254 400u16 => {
73255 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73256 }
73257 401u16 => {
73258 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73259 }
73260 _ => Err(Error::UnexpectedResponse(response)),
73261 }
73262 }
73263 /**Get Crypto Loans Income History (USER_DATA)
73264
73265- If startTime and endTime are not sent, the recent 7-day data will be returned.
73266- The max interval between startTime and endTime is 30 days.
73267
73268Weight(UID): 6000
73269
73270Sends a `GET` request to `/sapi/v1/loan/income`
73271
73272Arguments:
73273- `asset`
73274- `end_time`: UTC timestamp in ms
73275- `limit`: default 20, max 100
73276- `recv_window`: The value cannot be greater than 60000
73277- `signature`: Signature
73278- `start_time`: UTC timestamp in ms
73279- `timestamp`: UTC timestamp in ms
73280- `type_`: All types will be returned by default.
73281 * `borrowIn`
73282 * `collateralSpent`
73283 * `repayAmount`
73284 * `collateralReturn` - Collateral return after repayment
73285 * `addCollateral`
73286 * `removeCollateral`
73287 * `collateralReturnAfterLiquidation`
73288*/
73289 pub async fn loan_income<'a>(
73290 &'a self,
73291 asset: Option<&'a str>,
73292 end_time: Option<i64>,
73293 limit: Option<i32>,
73294 recv_window: Option<i64>,
73295 signature: &'a str,
73296 start_time: Option<i64>,
73297 timestamp: i64,
73298 type_: Option<types::LoanIncomeType>,
73299 ) -> Result<ResponseValue<Vec<types::LoanIncomeResponseItem>>, Error<types::Error>> {
73300 let url = format!("{}/sapi/v1/loan/income", self.baseurl,);
73301 let mut query = Vec::with_capacity(8usize);
73302 if let Some(v) = &asset {
73303 query.push(("asset", v.to_string()));
73304 }
73305 if let Some(v) = &end_time {
73306 query.push(("endTime", v.to_string()));
73307 }
73308 if let Some(v) = &limit {
73309 query.push(("limit", v.to_string()));
73310 }
73311 if let Some(v) = &recv_window {
73312 query.push(("recvWindow", v.to_string()));
73313 }
73314 query.push(("signature", signature.to_string()));
73315 if let Some(v) = &start_time {
73316 query.push(("startTime", v.to_string()));
73317 }
73318 query.push(("timestamp", timestamp.to_string()));
73319 if let Some(v) = &type_ {
73320 query.push(("type", v.to_string()));
73321 }
73322 #[allow(unused_mut)]
73323 let mut request = self
73324 .client
73325 .get(url)
73326 .header(
73327 reqwest::header::ACCEPT,
73328 reqwest::header::HeaderValue::from_static("application/json"),
73329 )
73330 .query(&query)
73331 .build()?;
73332 (crate::pre_hook)(&self.inner, &request);
73333 let result = self.client.execute(request).await;
73334 (crate::post_hook)(&self.inner, &result);
73335 let response = result?;
73336 match response.status().as_u16() {
73337 200u16 => ResponseValue::from_response(response).await,
73338 400u16 => {
73339 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73340 }
73341 401u16 => {
73342 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73343 }
73344 _ => Err(Error::UnexpectedResponse(response)),
73345 }
73346 }
73347 /**Crypto Loan Borrow (TRADE)
73348
73349Weight(UID): 6000
73350
73351Sends a `POST` request to `/sapi/v1/loan/borrow`
73352
73353Arguments:
73354- `collateral_amount`
73355- `collateral_coin`: Coin used as collateral
73356- `loan_amount`: Loan amount
73357- `loan_coin`: Coin loaned
73358- `loan_term`: 7/14/30/90/180 days
73359- `recv_window`: The value cannot be greater than 60000
73360- `signature`: Signature
73361- `timestamp`: UTC timestamp in ms
73362*/
73363 pub async fn loan_borrow<'a>(
73364 &'a self,
73365 collateral_amount: Option<f32>,
73366 collateral_coin: &'a str,
73367 loan_amount: Option<f32>,
73368 loan_coin: &'a str,
73369 loan_term: i32,
73370 recv_window: Option<i64>,
73371 signature: &'a str,
73372 timestamp: i64,
73373 ) -> Result<ResponseValue<types::LoanBorrowResponse>, Error<types::Error>> {
73374 let url = format!("{}/sapi/v1/loan/borrow", self.baseurl,);
73375 let mut query = Vec::with_capacity(8usize);
73376 if let Some(v) = &collateral_amount {
73377 query.push(("collateralAmount", v.to_string()));
73378 }
73379 query.push(("collateralCoin", collateral_coin.to_string()));
73380 if let Some(v) = &loan_amount {
73381 query.push(("loanAmount", v.to_string()));
73382 }
73383 query.push(("loanCoin", loan_coin.to_string()));
73384 query.push(("loanTerm", loan_term.to_string()));
73385 if let Some(v) = &recv_window {
73386 query.push(("recvWindow", v.to_string()));
73387 }
73388 query.push(("signature", signature.to_string()));
73389 query.push(("timestamp", timestamp.to_string()));
73390 #[allow(unused_mut)]
73391 let mut request = self
73392 .client
73393 .post(url)
73394 .header(
73395 reqwest::header::ACCEPT,
73396 reqwest::header::HeaderValue::from_static("application/json"),
73397 )
73398 .query(&query)
73399 .build()?;
73400 (crate::pre_hook)(&self.inner, &request);
73401 let result = self.client.execute(request).await;
73402 (crate::post_hook)(&self.inner, &result);
73403 let response = result?;
73404 match response.status().as_u16() {
73405 200u16 => ResponseValue::from_response(response).await,
73406 400u16 => {
73407 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73408 }
73409 401u16 => {
73410 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73411 }
73412 _ => Err(Error::UnexpectedResponse(response)),
73413 }
73414 }
73415 /**Get Crypto Loans Borrow History (USER_DATA)
73416
73417- If startTime and endTime are not sent, the recent 90-day data will be returned.
73418- The max interval between startTime and endTime is 180 days.
73419
73420Weight(IP): 400
73421
73422Sends a `GET` request to `/sapi/v1/loan/borrow/history`
73423
73424Arguments:
73425- `collateral_coin`: Coin used as collateral
73426- `current`: Current querying page. Start from 1. Default:1
73427- `end_time`: UTC timestamp in ms
73428- `limit`: default 10, max 100
73429- `loan_coin`: Coin loaned
73430- `order_id`: orderId in POST /sapi/v1/loan/borrow
73431- `recv_window`: The value cannot be greater than 60000
73432- `signature`: Signature
73433- `start_time`: UTC timestamp in ms
73434- `timestamp`: UTC timestamp in ms
73435*/
73436 pub async fn loan_borrow_history<'a>(
73437 &'a self,
73438 collateral_coin: Option<&'a str>,
73439 current: Option<i32>,
73440 end_time: Option<i64>,
73441 limit: Option<i64>,
73442 loan_coin: Option<&'a str>,
73443 order_id: Option<i64>,
73444 recv_window: Option<i64>,
73445 signature: &'a str,
73446 start_time: Option<i64>,
73447 timestamp: i64,
73448 ) -> Result<ResponseValue<types::LoanBorrowHistoryResponse>, Error<types::Error>> {
73449 let url = format!("{}/sapi/v1/loan/borrow/history", self.baseurl,);
73450 let mut query = Vec::with_capacity(10usize);
73451 if let Some(v) = &collateral_coin {
73452 query.push(("collateralCoin", v.to_string()));
73453 }
73454 if let Some(v) = ¤t {
73455 query.push(("current", v.to_string()));
73456 }
73457 if let Some(v) = &end_time {
73458 query.push(("endTime", v.to_string()));
73459 }
73460 if let Some(v) = &limit {
73461 query.push(("limit", v.to_string()));
73462 }
73463 if let Some(v) = &loan_coin {
73464 query.push(("loanCoin", v.to_string()));
73465 }
73466 if let Some(v) = &order_id {
73467 query.push(("orderId", v.to_string()));
73468 }
73469 if let Some(v) = &recv_window {
73470 query.push(("recvWindow", v.to_string()));
73471 }
73472 query.push(("signature", signature.to_string()));
73473 if let Some(v) = &start_time {
73474 query.push(("startTime", v.to_string()));
73475 }
73476 query.push(("timestamp", timestamp.to_string()));
73477 #[allow(unused_mut)]
73478 let mut request = self
73479 .client
73480 .get(url)
73481 .header(
73482 reqwest::header::ACCEPT,
73483 reqwest::header::HeaderValue::from_static("application/json"),
73484 )
73485 .query(&query)
73486 .build()?;
73487 (crate::pre_hook)(&self.inner, &request);
73488 let result = self.client.execute(request).await;
73489 (crate::post_hook)(&self.inner, &result);
73490 let response = result?;
73491 match response.status().as_u16() {
73492 200u16 => ResponseValue::from_response(response).await,
73493 400u16 => {
73494 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73495 }
73496 401u16 => {
73497 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73498 }
73499 _ => Err(Error::UnexpectedResponse(response)),
73500 }
73501 }
73502 /**Get Loan Ongoing Orders (USER_DATA)
73503
73504Weight(IP): 300
73505
73506Sends a `GET` request to `/sapi/v1/loan/ongoing/orders`
73507
73508Arguments:
73509- `collateral_coin`: Coin used as collateral
73510- `current`: Current querying page. Start from 1; default:1, max:1000
73511- `limit`: default 10, max 100
73512- `loan_coin`: Coin loaned
73513- `order_id`: orderId in POST /sapi/v1/loan/borrow
73514- `recv_window`: The value cannot be greater than 60000
73515- `signature`: Signature
73516- `timestamp`: UTC timestamp in ms
73517*/
73518 pub async fn loan_ongoing_orders<'a>(
73519 &'a self,
73520 collateral_coin: Option<&'a str>,
73521 current: Option<i32>,
73522 limit: Option<i64>,
73523 loan_coin: Option<&'a str>,
73524 order_id: Option<i64>,
73525 recv_window: Option<i64>,
73526 signature: &'a str,
73527 timestamp: i64,
73528 ) -> Result<ResponseValue<types::LoanOngoingOrdersResponse>, Error<types::Error>> {
73529 let url = format!("{}/sapi/v1/loan/ongoing/orders", self.baseurl,);
73530 let mut query = Vec::with_capacity(8usize);
73531 if let Some(v) = &collateral_coin {
73532 query.push(("collateralCoin", v.to_string()));
73533 }
73534 if let Some(v) = ¤t {
73535 query.push(("current", v.to_string()));
73536 }
73537 if let Some(v) = &limit {
73538 query.push(("limit", v.to_string()));
73539 }
73540 if let Some(v) = &loan_coin {
73541 query.push(("loanCoin", v.to_string()));
73542 }
73543 if let Some(v) = &order_id {
73544 query.push(("orderId", v.to_string()));
73545 }
73546 if let Some(v) = &recv_window {
73547 query.push(("recvWindow", v.to_string()));
73548 }
73549 query.push(("signature", signature.to_string()));
73550 query.push(("timestamp", timestamp.to_string()));
73551 #[allow(unused_mut)]
73552 let mut request = self
73553 .client
73554 .get(url)
73555 .header(
73556 reqwest::header::ACCEPT,
73557 reqwest::header::HeaderValue::from_static("application/json"),
73558 )
73559 .query(&query)
73560 .build()?;
73561 (crate::pre_hook)(&self.inner, &request);
73562 let result = self.client.execute(request).await;
73563 (crate::post_hook)(&self.inner, &result);
73564 let response = result?;
73565 match response.status().as_u16() {
73566 200u16 => ResponseValue::from_response(response).await,
73567 400u16 => {
73568 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73569 }
73570 401u16 => {
73571 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73572 }
73573 _ => Err(Error::UnexpectedResponse(response)),
73574 }
73575 }
73576 /**Crypto Loan Repay (TRADE)
73577
73578Weight(UID): 6000
73579
73580Sends a `POST` request to `/sapi/v1/loan/repay`
73581
73582Arguments:
73583- `amount`: Repayment Amount
73584- `collateral_return`: Default: TRUE. TRUE: Return extra collateral to spot account; FALSE: Keep extra collateral in the order.
73585- `order_id`: Order ID
73586- `recv_window`: The value cannot be greater than 60000
73587- `signature`: Signature
73588- `timestamp`: UTC timestamp in ms
73589- `type_`: Default: 1. 1 for 'repay with borrowed coin'; 2 for 'repay with collateral'.
73590*/
73591 pub async fn loan_repay<'a>(
73592 &'a self,
73593 amount: f64,
73594 collateral_return: Option<bool>,
73595 order_id: i64,
73596 recv_window: Option<i64>,
73597 signature: &'a str,
73598 timestamp: i64,
73599 type_: Option<i32>,
73600 ) -> Result<ResponseValue<types::LoanRepayResponse>, Error<types::Error>> {
73601 let url = format!("{}/sapi/v1/loan/repay", self.baseurl,);
73602 let mut query = Vec::with_capacity(7usize);
73603 query.push(("amount", amount.to_string()));
73604 if let Some(v) = &collateral_return {
73605 query.push(("collateralReturn", v.to_string()));
73606 }
73607 query.push(("orderId", order_id.to_string()));
73608 if let Some(v) = &recv_window {
73609 query.push(("recvWindow", v.to_string()));
73610 }
73611 query.push(("signature", signature.to_string()));
73612 query.push(("timestamp", timestamp.to_string()));
73613 if let Some(v) = &type_ {
73614 query.push(("type", v.to_string()));
73615 }
73616 #[allow(unused_mut)]
73617 let mut request = self
73618 .client
73619 .post(url)
73620 .header(
73621 reqwest::header::ACCEPT,
73622 reqwest::header::HeaderValue::from_static("application/json"),
73623 )
73624 .query(&query)
73625 .build()?;
73626 (crate::pre_hook)(&self.inner, &request);
73627 let result = self.client.execute(request).await;
73628 (crate::post_hook)(&self.inner, &result);
73629 let response = result?;
73630 match response.status().as_u16() {
73631 200u16 => ResponseValue::from_response(response).await,
73632 400u16 => {
73633 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73634 }
73635 401u16 => {
73636 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73637 }
73638 _ => Err(Error::UnexpectedResponse(response)),
73639 }
73640 }
73641 /**Get Loan Repayment History (USER_DATA)
73642
73643If startTime and endTime are not sent, the recent 90-day data will be returned.
73644The max interval between startTime and endTime is 180 days.
73645
73646Weight(IP): 400
73647
73648Sends a `GET` request to `/sapi/v1/loan/repay/history`
73649
73650Arguments:
73651- `collateral_coin`: Coin used as collateral
73652- `current`: Current querying page. Start from 1. Default:1
73653- `end_time`: UTC timestamp in ms
73654- `limit`: default 10, max 100
73655- `loan_coin`: Coin loaned
73656- `order_id`: Order ID
73657- `recv_window`: The value cannot be greater than 60000
73658- `signature`: Signature
73659- `start_time`: UTC timestamp in ms
73660- `timestamp`: UTC timestamp in ms
73661*/
73662 pub async fn loan_repay_history<'a>(
73663 &'a self,
73664 collateral_coin: Option<&'a str>,
73665 current: Option<i32>,
73666 end_time: Option<i64>,
73667 limit: Option<i64>,
73668 loan_coin: Option<&'a str>,
73669 order_id: Option<i64>,
73670 recv_window: Option<i64>,
73671 signature: &'a str,
73672 start_time: Option<i64>,
73673 timestamp: i64,
73674 ) -> Result<ResponseValue<types::LoanRepayHistoryResponse>, Error<types::Error>> {
73675 let url = format!("{}/sapi/v1/loan/repay/history", self.baseurl,);
73676 let mut query = Vec::with_capacity(10usize);
73677 if let Some(v) = &collateral_coin {
73678 query.push(("collateralCoin", v.to_string()));
73679 }
73680 if let Some(v) = ¤t {
73681 query.push(("current", v.to_string()));
73682 }
73683 if let Some(v) = &end_time {
73684 query.push(("endTime", v.to_string()));
73685 }
73686 if let Some(v) = &limit {
73687 query.push(("limit", v.to_string()));
73688 }
73689 if let Some(v) = &loan_coin {
73690 query.push(("loanCoin", v.to_string()));
73691 }
73692 if let Some(v) = &order_id {
73693 query.push(("orderId", v.to_string()));
73694 }
73695 if let Some(v) = &recv_window {
73696 query.push(("recvWindow", v.to_string()));
73697 }
73698 query.push(("signature", signature.to_string()));
73699 if let Some(v) = &start_time {
73700 query.push(("startTime", v.to_string()));
73701 }
73702 query.push(("timestamp", timestamp.to_string()));
73703 #[allow(unused_mut)]
73704 let mut request = self
73705 .client
73706 .get(url)
73707 .header(
73708 reqwest::header::ACCEPT,
73709 reqwest::header::HeaderValue::from_static("application/json"),
73710 )
73711 .query(&query)
73712 .build()?;
73713 (crate::pre_hook)(&self.inner, &request);
73714 let result = self.client.execute(request).await;
73715 (crate::post_hook)(&self.inner, &result);
73716 let response = result?;
73717 match response.status().as_u16() {
73718 200u16 => ResponseValue::from_response(response).await,
73719 400u16 => {
73720 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73721 }
73722 401u16 => {
73723 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73724 }
73725 _ => Err(Error::UnexpectedResponse(response)),
73726 }
73727 }
73728 /**Crypto Loan Adjust LTV (TRADE)
73729
73730Weight(UID): 6000
73731
73732Sends a `POST` request to `/sapi/v1/loan/adjust/ltv`
73733
73734Arguments:
73735- `amount`: Amount
73736- `direction`: 'ADDITIONAL', 'REDUCED'
73737- `order_id`: Order ID
73738- `recv_window`: The value cannot be greater than 60000
73739- `signature`: Signature
73740- `timestamp`: UTC timestamp in ms
73741*/
73742 pub async fn loan_adjust_ltv<'a>(
73743 &'a self,
73744 amount: f64,
73745 direction: types::LoanAdjustLtvDirection,
73746 order_id: i64,
73747 recv_window: Option<i64>,
73748 signature: &'a str,
73749 timestamp: i64,
73750 ) -> Result<ResponseValue<types::LoanAdjustLtvResponse>, Error<types::Error>> {
73751 let url = format!("{}/sapi/v1/loan/adjust/ltv", self.baseurl,);
73752 let mut query = Vec::with_capacity(6usize);
73753 query.push(("amount", amount.to_string()));
73754 query.push(("direction", direction.to_string()));
73755 query.push(("orderId", order_id.to_string()));
73756 if let Some(v) = &recv_window {
73757 query.push(("recvWindow", v.to_string()));
73758 }
73759 query.push(("signature", signature.to_string()));
73760 query.push(("timestamp", timestamp.to_string()));
73761 #[allow(unused_mut)]
73762 let mut request = self
73763 .client
73764 .post(url)
73765 .header(
73766 reqwest::header::ACCEPT,
73767 reqwest::header::HeaderValue::from_static("application/json"),
73768 )
73769 .query(&query)
73770 .build()?;
73771 (crate::pre_hook)(&self.inner, &request);
73772 let result = self.client.execute(request).await;
73773 (crate::post_hook)(&self.inner, &result);
73774 let response = result?;
73775 match response.status().as_u16() {
73776 200u16 => ResponseValue::from_response(response).await,
73777 400u16 => {
73778 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73779 }
73780 401u16 => {
73781 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73782 }
73783 _ => Err(Error::UnexpectedResponse(response)),
73784 }
73785 }
73786 /**Get Loan LTV Adjustment History (USER_DATA)
73787
73788If startTime and endTime are not sent, the recent 90-day data will be returned.
73789The max interval between startTime and endTime is 180 days.
73790
73791Weight(IP): 400
73792
73793Sends a `GET` request to `/sapi/v1/loan/ltv/adjustment/history`
73794
73795Arguments:
73796- `collateral_coin`: Coin used as collateral
73797- `current`: Current querying page. Start from 1. Default:1
73798- `end_time`: UTC timestamp in ms
73799- `limit`: default 10, max 100
73800- `loan_coin`: Coin loaned
73801- `order_id`: Order ID
73802- `recv_window`: The value cannot be greater than 60000
73803- `signature`: Signature
73804- `start_time`: UTC timestamp in ms
73805- `timestamp`: UTC timestamp in ms
73806*/
73807 pub async fn loan_ltv_adjustment_history<'a>(
73808 &'a self,
73809 collateral_coin: Option<&'a str>,
73810 current: Option<i32>,
73811 end_time: Option<i64>,
73812 limit: Option<i64>,
73813 loan_coin: Option<&'a str>,
73814 order_id: Option<i64>,
73815 recv_window: Option<i64>,
73816 signature: &'a str,
73817 start_time: Option<i64>,
73818 timestamp: i64,
73819 ) -> Result<
73820 ResponseValue<types::LoanLtvAdjustmentHistoryResponse>,
73821 Error<types::Error>,
73822 > {
73823 let url = format!("{}/sapi/v1/loan/ltv/adjustment/history", self.baseurl,);
73824 let mut query = Vec::with_capacity(10usize);
73825 if let Some(v) = &collateral_coin {
73826 query.push(("collateralCoin", v.to_string()));
73827 }
73828 if let Some(v) = ¤t {
73829 query.push(("current", v.to_string()));
73830 }
73831 if let Some(v) = &end_time {
73832 query.push(("endTime", v.to_string()));
73833 }
73834 if let Some(v) = &limit {
73835 query.push(("limit", v.to_string()));
73836 }
73837 if let Some(v) = &loan_coin {
73838 query.push(("loanCoin", v.to_string()));
73839 }
73840 if let Some(v) = &order_id {
73841 query.push(("orderId", v.to_string()));
73842 }
73843 if let Some(v) = &recv_window {
73844 query.push(("recvWindow", v.to_string()));
73845 }
73846 query.push(("signature", signature.to_string()));
73847 if let Some(v) = &start_time {
73848 query.push(("startTime", v.to_string()));
73849 }
73850 query.push(("timestamp", timestamp.to_string()));
73851 #[allow(unused_mut)]
73852 let mut request = self
73853 .client
73854 .get(url)
73855 .header(
73856 reqwest::header::ACCEPT,
73857 reqwest::header::HeaderValue::from_static("application/json"),
73858 )
73859 .query(&query)
73860 .build()?;
73861 (crate::pre_hook)(&self.inner, &request);
73862 let result = self.client.execute(request).await;
73863 (crate::post_hook)(&self.inner, &result);
73864 let response = result?;
73865 match response.status().as_u16() {
73866 200u16 => ResponseValue::from_response(response).await,
73867 400u16 => {
73868 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73869 }
73870 401u16 => {
73871 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73872 }
73873 _ => Err(Error::UnexpectedResponse(response)),
73874 }
73875 }
73876 /**Get Loanable Assets Data (USER_DATA)
73877
73878Get interest rate and borrow limit of loanable assets. The borrow limit is shown in USD value.
73879
73880Weight(IP): 400
73881
73882Sends a `GET` request to `/sapi/v1/loan/loanable/data`
73883
73884Arguments:
73885- `loan_coin`: Coin loaned
73886- `recv_window`: The value cannot be greater than 60000
73887- `signature`: Signature
73888- `timestamp`: UTC timestamp in ms
73889- `vip_level`: Defaults to user's vip level
73890*/
73891 pub async fn loan_loanable_data<'a>(
73892 &'a self,
73893 loan_coin: Option<&'a str>,
73894 recv_window: Option<i64>,
73895 signature: &'a str,
73896 timestamp: i64,
73897 vip_level: Option<i32>,
73898 ) -> Result<ResponseValue<types::LoanLoanableDataResponse>, Error<types::Error>> {
73899 let url = format!("{}/sapi/v1/loan/loanable/data", self.baseurl,);
73900 let mut query = Vec::with_capacity(5usize);
73901 if let Some(v) = &loan_coin {
73902 query.push(("loanCoin", v.to_string()));
73903 }
73904 if let Some(v) = &recv_window {
73905 query.push(("recvWindow", v.to_string()));
73906 }
73907 query.push(("signature", signature.to_string()));
73908 query.push(("timestamp", timestamp.to_string()));
73909 if let Some(v) = &vip_level {
73910 query.push(("vipLevel", v.to_string()));
73911 }
73912 #[allow(unused_mut)]
73913 let mut request = self
73914 .client
73915 .get(url)
73916 .header(
73917 reqwest::header::ACCEPT,
73918 reqwest::header::HeaderValue::from_static("application/json"),
73919 )
73920 .query(&query)
73921 .build()?;
73922 (crate::pre_hook)(&self.inner, &request);
73923 let result = self.client.execute(request).await;
73924 (crate::post_hook)(&self.inner, &result);
73925 let response = result?;
73926 match response.status().as_u16() {
73927 200u16 => ResponseValue::from_response(response).await,
73928 400u16 => {
73929 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73930 }
73931 401u16 => {
73932 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73933 }
73934 _ => Err(Error::UnexpectedResponse(response)),
73935 }
73936 }
73937 /**Get Collateral Assets Data (USER_DATA)
73938
73939Get LTV information and collateral limit of collateral assets. The collateral limit is shown in USD value.
73940
73941Weight(IP): 400
73942
73943Sends a `GET` request to `/sapi/v1/loan/collateral/data`
73944
73945Arguments:
73946- `collateral_coin`: Coin used as collateral
73947- `recv_window`: The value cannot be greater than 60000
73948- `signature`: Signature
73949- `timestamp`: UTC timestamp in ms
73950- `vip_level`: Defaults to user's vip level
73951*/
73952 pub async fn loan_collateral_data<'a>(
73953 &'a self,
73954 collateral_coin: Option<&'a str>,
73955 recv_window: Option<i64>,
73956 signature: &'a str,
73957 timestamp: i64,
73958 vip_level: Option<i32>,
73959 ) -> Result<ResponseValue<types::LoanCollateralDataResponse>, Error<types::Error>> {
73960 let url = format!("{}/sapi/v1/loan/collateral/data", self.baseurl,);
73961 let mut query = Vec::with_capacity(5usize);
73962 if let Some(v) = &collateral_coin {
73963 query.push(("collateralCoin", v.to_string()));
73964 }
73965 if let Some(v) = &recv_window {
73966 query.push(("recvWindow", v.to_string()));
73967 }
73968 query.push(("signature", signature.to_string()));
73969 query.push(("timestamp", timestamp.to_string()));
73970 if let Some(v) = &vip_level {
73971 query.push(("vipLevel", v.to_string()));
73972 }
73973 #[allow(unused_mut)]
73974 let mut request = self
73975 .client
73976 .get(url)
73977 .header(
73978 reqwest::header::ACCEPT,
73979 reqwest::header::HeaderValue::from_static("application/json"),
73980 )
73981 .query(&query)
73982 .build()?;
73983 (crate::pre_hook)(&self.inner, &request);
73984 let result = self.client.execute(request).await;
73985 (crate::post_hook)(&self.inner, &result);
73986 let response = result?;
73987 match response.status().as_u16() {
73988 200u16 => ResponseValue::from_response(response).await,
73989 400u16 => {
73990 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73991 }
73992 401u16 => {
73993 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
73994 }
73995 _ => Err(Error::UnexpectedResponse(response)),
73996 }
73997 }
73998 /**Check Collateral Repay Rate (USER_DATA)
73999
74000Get the the rate of collateral coin / loan coin when using collateral repay, the rate will be valid within 8 second.
74001
74002Weight(IP): 6000
74003
74004Sends a `GET` request to `/sapi/v1/loan/repay/collateral/rate`
74005
74006Arguments:
74007- `collateral_coin`: Coin used as collateral
74008- `loan_coin`: Coin loaned
74009- `recv_window`: The value cannot be greater than 60000
74010- `repay_amount`: repay amount of loanCoin
74011- `signature`: Signature
74012- `timestamp`: UTC timestamp in ms
74013*/
74014 pub async fn loan_repay_collateral_rate<'a>(
74015 &'a self,
74016 collateral_coin: &'a str,
74017 loan_coin: &'a str,
74018 recv_window: Option<i64>,
74019 repay_amount: f32,
74020 signature: &'a str,
74021 timestamp: i64,
74022 ) -> Result<
74023 ResponseValue<types::LoanRepayCollateralRateResponse>,
74024 Error<types::Error>,
74025 > {
74026 let url = format!("{}/sapi/v1/loan/repay/collateral/rate", self.baseurl,);
74027 let mut query = Vec::with_capacity(6usize);
74028 query.push(("collateralCoin", collateral_coin.to_string()));
74029 query.push(("loanCoin", loan_coin.to_string()));
74030 if let Some(v) = &recv_window {
74031 query.push(("recvWindow", v.to_string()));
74032 }
74033 query.push(("repayAmount", repay_amount.to_string()));
74034 query.push(("signature", signature.to_string()));
74035 query.push(("timestamp", timestamp.to_string()));
74036 #[allow(unused_mut)]
74037 let mut request = self
74038 .client
74039 .get(url)
74040 .header(
74041 reqwest::header::ACCEPT,
74042 reqwest::header::HeaderValue::from_static("application/json"),
74043 )
74044 .query(&query)
74045 .build()?;
74046 (crate::pre_hook)(&self.inner, &request);
74047 let result = self.client.execute(request).await;
74048 (crate::post_hook)(&self.inner, &result);
74049 let response = result?;
74050 match response.status().as_u16() {
74051 200u16 => ResponseValue::from_response(response).await,
74052 400u16 => {
74053 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74054 }
74055 401u16 => {
74056 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74057 }
74058 _ => Err(Error::UnexpectedResponse(response)),
74059 }
74060 }
74061 /**Crypto Loan Customize Margin Call (TRADE)
74062
74063Customize margin call for ongoing orders only.
74064
74065Weight(UID): 6000
74066
74067Sends a `POST` request to `/sapi/v1/loan/customize/margin_call`
74068
74069Arguments:
74070- `collateral_coin`: Coin used as collateral
74071- `margin_call`
74072- `order_id`: Mandatory when collateralCoin is empty. Send either orderId or collateralCoin, if both parameters are sent, take orderId only.
74073- `recv_window`: The value cannot be greater than 60000
74074- `signature`: Signature
74075- `timestamp`: UTC timestamp in ms
74076*/
74077 pub async fn loan_customize_margin_call<'a>(
74078 &'a self,
74079 collateral_coin: Option<&'a str>,
74080 margin_call: f32,
74081 order_id: Option<i64>,
74082 recv_window: Option<i64>,
74083 signature: &'a str,
74084 timestamp: i64,
74085 ) -> Result<
74086 ResponseValue<types::LoanCustomizeMarginCallResponse>,
74087 Error<types::Error>,
74088 > {
74089 let url = format!("{}/sapi/v1/loan/customize/margin_call", self.baseurl,);
74090 let mut query = Vec::with_capacity(6usize);
74091 if let Some(v) = &collateral_coin {
74092 query.push(("collateralCoin", v.to_string()));
74093 }
74094 query.push(("marginCall", margin_call.to_string()));
74095 if let Some(v) = &order_id {
74096 query.push(("orderId", v.to_string()));
74097 }
74098 if let Some(v) = &recv_window {
74099 query.push(("recvWindow", v.to_string()));
74100 }
74101 query.push(("signature", signature.to_string()));
74102 query.push(("timestamp", timestamp.to_string()));
74103 #[allow(unused_mut)]
74104 let mut request = self
74105 .client
74106 .post(url)
74107 .header(
74108 reqwest::header::ACCEPT,
74109 reqwest::header::HeaderValue::from_static("application/json"),
74110 )
74111 .query(&query)
74112 .build()?;
74113 (crate::pre_hook)(&self.inner, &request);
74114 let result = self.client.execute(request).await;
74115 (crate::post_hook)(&self.inner, &result);
74116 let response = result?;
74117 match response.status().as_u16() {
74118 200u16 => ResponseValue::from_response(response).await,
74119 400u16 => {
74120 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74121 }
74122 401u16 => {
74123 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74124 }
74125 _ => Err(Error::UnexpectedResponse(response)),
74126 }
74127 }
74128 /**Borrow - Flexible Loan Borrow (TRADE)
74129
74130
74131Weight(UID): 6000
74132
74133Sends a `POST` request to `/sapi/v1/loan/flexible/borrow`
74134
74135Arguments:
74136- `collateral_amount`
74137- `collateral_coin`: Coin used as collateral
74138- `loan_amount`: Loan amount
74139- `loan_coin`: Coin loaned
74140- `recv_window`: The value cannot be greater than 60000
74141- `signature`: Signature
74142- `timestamp`: UTC timestamp in ms
74143*/
74144 pub async fn loan_flexible_borrow<'a>(
74145 &'a self,
74146 collateral_amount: Option<f32>,
74147 collateral_coin: Option<&'a str>,
74148 loan_amount: Option<f32>,
74149 loan_coin: Option<&'a str>,
74150 recv_window: Option<i64>,
74151 signature: &'a str,
74152 timestamp: i64,
74153 ) -> Result<ResponseValue<types::LoanFlexibleBorrowResponse>, Error<types::Error>> {
74154 let url = format!("{}/sapi/v1/loan/flexible/borrow", self.baseurl,);
74155 let mut query = Vec::with_capacity(7usize);
74156 if let Some(v) = &collateral_amount {
74157 query.push(("collateralAmount", v.to_string()));
74158 }
74159 if let Some(v) = &collateral_coin {
74160 query.push(("collateralCoin", v.to_string()));
74161 }
74162 if let Some(v) = &loan_amount {
74163 query.push(("loanAmount", v.to_string()));
74164 }
74165 if let Some(v) = &loan_coin {
74166 query.push(("loanCoin", v.to_string()));
74167 }
74168 if let Some(v) = &recv_window {
74169 query.push(("recvWindow", v.to_string()));
74170 }
74171 query.push(("signature", signature.to_string()));
74172 query.push(("timestamp", timestamp.to_string()));
74173 #[allow(unused_mut)]
74174 let mut request = self
74175 .client
74176 .post(url)
74177 .header(
74178 reqwest::header::ACCEPT,
74179 reqwest::header::HeaderValue::from_static("application/json"),
74180 )
74181 .query(&query)
74182 .build()?;
74183 (crate::pre_hook)(&self.inner, &request);
74184 let result = self.client.execute(request).await;
74185 (crate::post_hook)(&self.inner, &result);
74186 let response = result?;
74187 match response.status().as_u16() {
74188 200u16 => ResponseValue::from_response(response).await,
74189 400u16 => {
74190 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74191 }
74192 401u16 => {
74193 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74194 }
74195 _ => Err(Error::UnexpectedResponse(response)),
74196 }
74197 }
74198 /**Borrow - Get Flexible Loan Ongoing Orders (USER_DATA)
74199
74200
74201Weight(IP): 300
74202
74203Sends a `GET` request to `/sapi/v1/loan/flexible/ongoing/orders`
74204
74205Arguments:
74206- `collateral_coin`: Coin used as collateral
74207- `current`: Current querying page. Start from 1. Default:1
74208- `limit`: Default 500; max 1000.
74209- `loan_coin`: Coin loaned
74210- `recv_window`: The value cannot be greater than 60000
74211- `signature`: Signature
74212- `timestamp`: UTC timestamp in ms
74213*/
74214 pub async fn loan_flexible_ongoing_orders<'a>(
74215 &'a self,
74216 collateral_coin: Option<&'a str>,
74217 current: Option<i32>,
74218 limit: Option<i32>,
74219 loan_coin: Option<&'a str>,
74220 recv_window: Option<i64>,
74221 signature: &'a str,
74222 timestamp: i64,
74223 ) -> Result<
74224 ResponseValue<types::LoanFlexibleOngoingOrdersResponse>,
74225 Error<types::Error>,
74226 > {
74227 let url = format!("{}/sapi/v1/loan/flexible/ongoing/orders", self.baseurl,);
74228 let mut query = Vec::with_capacity(7usize);
74229 if let Some(v) = &collateral_coin {
74230 query.push(("collateralCoin", v.to_string()));
74231 }
74232 if let Some(v) = ¤t {
74233 query.push(("current", v.to_string()));
74234 }
74235 if let Some(v) = &limit {
74236 query.push(("limit", v.to_string()));
74237 }
74238 if let Some(v) = &loan_coin {
74239 query.push(("loanCoin", v.to_string()));
74240 }
74241 if let Some(v) = &recv_window {
74242 query.push(("recvWindow", v.to_string()));
74243 }
74244 query.push(("signature", signature.to_string()));
74245 query.push(("timestamp", timestamp.to_string()));
74246 #[allow(unused_mut)]
74247 let mut request = self
74248 .client
74249 .get(url)
74250 .header(
74251 reqwest::header::ACCEPT,
74252 reqwest::header::HeaderValue::from_static("application/json"),
74253 )
74254 .query(&query)
74255 .build()?;
74256 (crate::pre_hook)(&self.inner, &request);
74257 let result = self.client.execute(request).await;
74258 (crate::post_hook)(&self.inner, &result);
74259 let response = result?;
74260 match response.status().as_u16() {
74261 200u16 => ResponseValue::from_response(response).await,
74262 400u16 => {
74263 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74264 }
74265 401u16 => {
74266 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74267 }
74268 _ => Err(Error::UnexpectedResponse(response)),
74269 }
74270 }
74271 /**Borrow - Get Flexible Loan Borrow History (USER_DATA)
74272
74273
74274Weight(IP): 400
74275
74276Sends a `GET` request to `/sapi/v1/loan/flexible/borrow/history`
74277
74278Arguments:
74279- `collateral_coin`: Coin used as collateral
74280- `current`: Current querying page. Start from 1. Default:1
74281- `end_time`: UTC timestamp in ms
74282- `limit`: Default 500; max 1000.
74283- `loan_coin`: Coin loaned
74284- `recv_window`: The value cannot be greater than 60000
74285- `signature`: Signature
74286- `start_time`: UTC timestamp in ms
74287- `timestamp`: UTC timestamp in ms
74288*/
74289 pub async fn loan_flexible_borrow_history<'a>(
74290 &'a self,
74291 collateral_coin: Option<&'a str>,
74292 current: Option<i32>,
74293 end_time: Option<i64>,
74294 limit: Option<i32>,
74295 loan_coin: Option<&'a str>,
74296 recv_window: Option<i64>,
74297 signature: &'a str,
74298 start_time: Option<i64>,
74299 timestamp: i64,
74300 ) -> Result<
74301 ResponseValue<types::LoanFlexibleBorrowHistoryResponse>,
74302 Error<types::Error>,
74303 > {
74304 let url = format!("{}/sapi/v1/loan/flexible/borrow/history", self.baseurl,);
74305 let mut query = Vec::with_capacity(9usize);
74306 if let Some(v) = &collateral_coin {
74307 query.push(("collateralCoin", v.to_string()));
74308 }
74309 if let Some(v) = ¤t {
74310 query.push(("current", v.to_string()));
74311 }
74312 if let Some(v) = &end_time {
74313 query.push(("endTime", v.to_string()));
74314 }
74315 if let Some(v) = &limit {
74316 query.push(("limit", v.to_string()));
74317 }
74318 if let Some(v) = &loan_coin {
74319 query.push(("loanCoin", v.to_string()));
74320 }
74321 if let Some(v) = &recv_window {
74322 query.push(("recvWindow", v.to_string()));
74323 }
74324 query.push(("signature", signature.to_string()));
74325 if let Some(v) = &start_time {
74326 query.push(("startTime", v.to_string()));
74327 }
74328 query.push(("timestamp", timestamp.to_string()));
74329 #[allow(unused_mut)]
74330 let mut request = self
74331 .client
74332 .get(url)
74333 .header(
74334 reqwest::header::ACCEPT,
74335 reqwest::header::HeaderValue::from_static("application/json"),
74336 )
74337 .query(&query)
74338 .build()?;
74339 (crate::pre_hook)(&self.inner, &request);
74340 let result = self.client.execute(request).await;
74341 (crate::post_hook)(&self.inner, &result);
74342 let response = result?;
74343 match response.status().as_u16() {
74344 200u16 => ResponseValue::from_response(response).await,
74345 400u16 => {
74346 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74347 }
74348 401u16 => {
74349 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74350 }
74351 _ => Err(Error::UnexpectedResponse(response)),
74352 }
74353 }
74354 /**Repay - Flexible Loan Repay (TRADE)
74355
74356
74357Weight(IP): 6000
74358
74359Sends a `POST` request to `/sapi/v1/loan/flexible/repay`
74360
74361Arguments:
74362- `collateral_coin`: Coin used as collateral
74363- `collateral_return`
74364- `full_repayment`
74365- `loan_coin`: Coin loaned
74366- `recv_window`: The value cannot be greater than 60000
74367- `repay_amount`: repay amount of loanCoin
74368- `signature`: Signature
74369- `timestamp`: UTC timestamp in ms
74370*/
74371 pub async fn loan_flexible_repay<'a>(
74372 &'a self,
74373 collateral_coin: Option<&'a str>,
74374 collateral_return: Option<bool>,
74375 full_repayment: Option<bool>,
74376 loan_coin: Option<&'a str>,
74377 recv_window: Option<i64>,
74378 repay_amount: f32,
74379 signature: &'a str,
74380 timestamp: i64,
74381 ) -> Result<ResponseValue<types::LoanFlexibleRepayResponse>, Error<types::Error>> {
74382 let url = format!("{}/sapi/v1/loan/flexible/repay", self.baseurl,);
74383 let mut query = Vec::with_capacity(8usize);
74384 if let Some(v) = &collateral_coin {
74385 query.push(("collateralCoin", v.to_string()));
74386 }
74387 if let Some(v) = &collateral_return {
74388 query.push(("collateralReturn", v.to_string()));
74389 }
74390 if let Some(v) = &full_repayment {
74391 query.push(("fullRepayment", v.to_string()));
74392 }
74393 if let Some(v) = &loan_coin {
74394 query.push(("loanCoin", v.to_string()));
74395 }
74396 if let Some(v) = &recv_window {
74397 query.push(("recvWindow", v.to_string()));
74398 }
74399 query.push(("repayAmount", repay_amount.to_string()));
74400 query.push(("signature", signature.to_string()));
74401 query.push(("timestamp", timestamp.to_string()));
74402 #[allow(unused_mut)]
74403 let mut request = self
74404 .client
74405 .post(url)
74406 .header(
74407 reqwest::header::ACCEPT,
74408 reqwest::header::HeaderValue::from_static("application/json"),
74409 )
74410 .query(&query)
74411 .build()?;
74412 (crate::pre_hook)(&self.inner, &request);
74413 let result = self.client.execute(request).await;
74414 (crate::post_hook)(&self.inner, &result);
74415 let response = result?;
74416 match response.status().as_u16() {
74417 200u16 => ResponseValue::from_response(response).await,
74418 400u16 => {
74419 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74420 }
74421 401u16 => {
74422 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74423 }
74424 _ => Err(Error::UnexpectedResponse(response)),
74425 }
74426 }
74427 /**Repay - Get Flexible Loan Repayment History (USER_DATA)
74428
74429
74430Weight(IP): 400
74431
74432Sends a `GET` request to `/sapi/v1/loan/flexible/repay/history`
74433
74434Arguments:
74435- `collateral_coin`: Coin used as collateral
74436- `current`: Current querying page. Start from 1. Default:1
74437- `end_time`: UTC timestamp in ms
74438- `limit`: Default 500; max 1000.
74439- `loan_coin`: Coin loaned
74440- `recv_window`: The value cannot be greater than 60000
74441- `signature`: Signature
74442- `start_time`: UTC timestamp in ms
74443- `timestamp`: UTC timestamp in ms
74444*/
74445 pub async fn loan_flexible_repay_history<'a>(
74446 &'a self,
74447 collateral_coin: Option<&'a str>,
74448 current: Option<i32>,
74449 end_time: Option<i64>,
74450 limit: Option<i32>,
74451 loan_coin: Option<&'a str>,
74452 recv_window: Option<i64>,
74453 signature: &'a str,
74454 start_time: Option<i64>,
74455 timestamp: i64,
74456 ) -> Result<
74457 ResponseValue<types::LoanFlexibleRepayHistoryResponse>,
74458 Error<types::Error>,
74459 > {
74460 let url = format!("{}/sapi/v1/loan/flexible/repay/history", self.baseurl,);
74461 let mut query = Vec::with_capacity(9usize);
74462 if let Some(v) = &collateral_coin {
74463 query.push(("collateralCoin", v.to_string()));
74464 }
74465 if let Some(v) = ¤t {
74466 query.push(("current", v.to_string()));
74467 }
74468 if let Some(v) = &end_time {
74469 query.push(("endTime", v.to_string()));
74470 }
74471 if let Some(v) = &limit {
74472 query.push(("limit", v.to_string()));
74473 }
74474 if let Some(v) = &loan_coin {
74475 query.push(("loanCoin", v.to_string()));
74476 }
74477 if let Some(v) = &recv_window {
74478 query.push(("recvWindow", v.to_string()));
74479 }
74480 query.push(("signature", signature.to_string()));
74481 if let Some(v) = &start_time {
74482 query.push(("startTime", v.to_string()));
74483 }
74484 query.push(("timestamp", timestamp.to_string()));
74485 #[allow(unused_mut)]
74486 let mut request = self
74487 .client
74488 .get(url)
74489 .header(
74490 reqwest::header::ACCEPT,
74491 reqwest::header::HeaderValue::from_static("application/json"),
74492 )
74493 .query(&query)
74494 .build()?;
74495 (crate::pre_hook)(&self.inner, &request);
74496 let result = self.client.execute(request).await;
74497 (crate::post_hook)(&self.inner, &result);
74498 let response = result?;
74499 match response.status().as_u16() {
74500 200u16 => ResponseValue::from_response(response).await,
74501 400u16 => {
74502 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74503 }
74504 401u16 => {
74505 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74506 }
74507 _ => Err(Error::UnexpectedResponse(response)),
74508 }
74509 }
74510 /**Adjust LTV - Flexible Loan Adjust LTV (TRADE)
74511
74512
74513Weight(UID): 6000
74514
74515Sends a `POST` request to `/sapi/v1/loan/flexible/adjust/ltv`
74516
74517Arguments:
74518- `adjustment_amount`
74519- `collateral_coin`: Coin used as collateral
74520- `direction`
74521- `loan_coin`: Coin loaned
74522- `recv_window`: The value cannot be greater than 60000
74523- `signature`: Signature
74524- `timestamp`: UTC timestamp in ms
74525*/
74526 pub async fn loan_flexible_adjust_ltv<'a>(
74527 &'a self,
74528 adjustment_amount: f32,
74529 collateral_coin: Option<&'a str>,
74530 direction: types::LoanFlexibleAdjustLtvDirection,
74531 loan_coin: Option<&'a str>,
74532 recv_window: Option<i64>,
74533 signature: &'a str,
74534 timestamp: i64,
74535 ) -> Result<
74536 ResponseValue<types::LoanFlexibleAdjustLtvResponse>,
74537 Error<types::Error>,
74538 > {
74539 let url = format!("{}/sapi/v1/loan/flexible/adjust/ltv", self.baseurl,);
74540 let mut query = Vec::with_capacity(7usize);
74541 query.push(("adjustmentAmount", adjustment_amount.to_string()));
74542 if let Some(v) = &collateral_coin {
74543 query.push(("collateralCoin", v.to_string()));
74544 }
74545 query.push(("direction", direction.to_string()));
74546 if let Some(v) = &loan_coin {
74547 query.push(("loanCoin", v.to_string()));
74548 }
74549 if let Some(v) = &recv_window {
74550 query.push(("recvWindow", v.to_string()));
74551 }
74552 query.push(("signature", signature.to_string()));
74553 query.push(("timestamp", timestamp.to_string()));
74554 #[allow(unused_mut)]
74555 let mut request = self
74556 .client
74557 .post(url)
74558 .header(
74559 reqwest::header::ACCEPT,
74560 reqwest::header::HeaderValue::from_static("application/json"),
74561 )
74562 .query(&query)
74563 .build()?;
74564 (crate::pre_hook)(&self.inner, &request);
74565 let result = self.client.execute(request).await;
74566 (crate::post_hook)(&self.inner, &result);
74567 let response = result?;
74568 match response.status().as_u16() {
74569 200u16 => ResponseValue::from_response(response).await,
74570 400u16 => {
74571 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74572 }
74573 401u16 => {
74574 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74575 }
74576 _ => Err(Error::UnexpectedResponse(response)),
74577 }
74578 }
74579 /**Adjust LTV - Get Flexible Loan LTV Adjustment History (USER_DATA)
74580
74581
74582Weight(IP): 400
74583
74584Sends a `GET` request to `/sapi/v1/loan/flexible/ltv/adjustment/history`
74585
74586Arguments:
74587- `collateral_coin`: Coin used as collateral
74588- `current`: Current querying page. Start from 1. Default:1
74589- `end_time`: UTC timestamp in ms
74590- `limit`: Default 500; max 1000.
74591- `loan_coin`: Coin loaned
74592- `recv_window`: The value cannot be greater than 60000
74593- `signature`: Signature
74594- `start_time`: UTC timestamp in ms
74595- `timestamp`: UTC timestamp in ms
74596*/
74597 pub async fn loan_flexible_ltv_adjustment_history<'a>(
74598 &'a self,
74599 collateral_coin: Option<&'a str>,
74600 current: Option<i32>,
74601 end_time: Option<i64>,
74602 limit: Option<i32>,
74603 loan_coin: Option<&'a str>,
74604 recv_window: Option<i64>,
74605 signature: &'a str,
74606 start_time: Option<i64>,
74607 timestamp: i64,
74608 ) -> Result<
74609 ResponseValue<types::LoanFlexibleLtvAdjustmentHistoryResponse>,
74610 Error<types::Error>,
74611 > {
74612 let url = format!(
74613 "{}/sapi/v1/loan/flexible/ltv/adjustment/history", self.baseurl,
74614 );
74615 let mut query = Vec::with_capacity(9usize);
74616 if let Some(v) = &collateral_coin {
74617 query.push(("collateralCoin", v.to_string()));
74618 }
74619 if let Some(v) = ¤t {
74620 query.push(("current", v.to_string()));
74621 }
74622 if let Some(v) = &end_time {
74623 query.push(("endTime", v.to_string()));
74624 }
74625 if let Some(v) = &limit {
74626 query.push(("limit", v.to_string()));
74627 }
74628 if let Some(v) = &loan_coin {
74629 query.push(("loanCoin", v.to_string()));
74630 }
74631 if let Some(v) = &recv_window {
74632 query.push(("recvWindow", v.to_string()));
74633 }
74634 query.push(("signature", signature.to_string()));
74635 if let Some(v) = &start_time {
74636 query.push(("startTime", v.to_string()));
74637 }
74638 query.push(("timestamp", timestamp.to_string()));
74639 #[allow(unused_mut)]
74640 let mut request = self
74641 .client
74642 .get(url)
74643 .header(
74644 reqwest::header::ACCEPT,
74645 reqwest::header::HeaderValue::from_static("application/json"),
74646 )
74647 .query(&query)
74648 .build()?;
74649 (crate::pre_hook)(&self.inner, &request);
74650 let result = self.client.execute(request).await;
74651 (crate::post_hook)(&self.inner, &result);
74652 let response = result?;
74653 match response.status().as_u16() {
74654 200u16 => ResponseValue::from_response(response).await,
74655 400u16 => {
74656 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74657 }
74658 401u16 => {
74659 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74660 }
74661 _ => Err(Error::UnexpectedResponse(response)),
74662 }
74663 }
74664 /**Get Flexible Loan Assets Data (USER_DATA)
74665
74666Get interest rate and borrow limit of flexible loanable assets. The borrow limit is shown in USD value.
74667
74668Weight(IP): 400
74669
74670Sends a `GET` request to `/sapi/v1/loan/flexible/loanable/data`
74671
74672Arguments:
74673- `loan_coin`: Coin loaned
74674- `recv_window`: The value cannot be greater than 60000
74675- `signature`: Signature
74676- `timestamp`: UTC timestamp in ms
74677*/
74678 pub async fn loan_flexible_loanable_data<'a>(
74679 &'a self,
74680 loan_coin: Option<&'a str>,
74681 recv_window: Option<i64>,
74682 signature: &'a str,
74683 timestamp: i64,
74684 ) -> Result<
74685 ResponseValue<types::LoanFlexibleLoanableDataResponse>,
74686 Error<types::Error>,
74687 > {
74688 let url = format!("{}/sapi/v1/loan/flexible/loanable/data", self.baseurl,);
74689 let mut query = Vec::with_capacity(4usize);
74690 if let Some(v) = &loan_coin {
74691 query.push(("loanCoin", v.to_string()));
74692 }
74693 if let Some(v) = &recv_window {
74694 query.push(("recvWindow", v.to_string()));
74695 }
74696 query.push(("signature", signature.to_string()));
74697 query.push(("timestamp", timestamp.to_string()));
74698 #[allow(unused_mut)]
74699 let mut request = self
74700 .client
74701 .get(url)
74702 .header(
74703 reqwest::header::ACCEPT,
74704 reqwest::header::HeaderValue::from_static("application/json"),
74705 )
74706 .query(&query)
74707 .build()?;
74708 (crate::pre_hook)(&self.inner, &request);
74709 let result = self.client.execute(request).await;
74710 (crate::post_hook)(&self.inner, &result);
74711 let response = result?;
74712 match response.status().as_u16() {
74713 200u16 => ResponseValue::from_response(response).await,
74714 400u16 => {
74715 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74716 }
74717 401u16 => {
74718 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74719 }
74720 _ => Err(Error::UnexpectedResponse(response)),
74721 }
74722 }
74723 /**Get Flexible Loan Collateral Assets Data (USER_DATA)
74724
74725Get LTV information and collateral limit of flexible loan's collateral assets. The collateral limit is shown in USD value.
74726
74727Weight(IP): 400
74728
74729Sends a `GET` request to `/sapi/v1/loan/flexible/collateral/data`
74730
74731Arguments:
74732- `collateral_coin`: Coin used as collateral
74733- `recv_window`: The value cannot be greater than 60000
74734- `signature`: Signature
74735- `timestamp`: UTC timestamp in ms
74736*/
74737 pub async fn loan_flexible_collateral_data<'a>(
74738 &'a self,
74739 collateral_coin: Option<&'a str>,
74740 recv_window: Option<i64>,
74741 signature: &'a str,
74742 timestamp: i64,
74743 ) -> Result<
74744 ResponseValue<types::LoanFlexibleCollateralDataResponse>,
74745 Error<types::Error>,
74746 > {
74747 let url = format!("{}/sapi/v1/loan/flexible/collateral/data", self.baseurl,);
74748 let mut query = Vec::with_capacity(4usize);
74749 if let Some(v) = &collateral_coin {
74750 query.push(("collateralCoin", v.to_string()));
74751 }
74752 if let Some(v) = &recv_window {
74753 query.push(("recvWindow", v.to_string()));
74754 }
74755 query.push(("signature", signature.to_string()));
74756 query.push(("timestamp", timestamp.to_string()));
74757 #[allow(unused_mut)]
74758 let mut request = self
74759 .client
74760 .get(url)
74761 .header(
74762 reqwest::header::ACCEPT,
74763 reqwest::header::HeaderValue::from_static("application/json"),
74764 )
74765 .query(&query)
74766 .build()?;
74767 (crate::pre_hook)(&self.inner, &request);
74768 let result = self.client.execute(request).await;
74769 (crate::post_hook)(&self.inner, &result);
74770 let response = result?;
74771 match response.status().as_u16() {
74772 200u16 => ResponseValue::from_response(response).await,
74773 400u16 => {
74774 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74775 }
74776 401u16 => {
74777 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74778 }
74779 _ => Err(Error::UnexpectedResponse(response)),
74780 }
74781 }
74782 /**Get Pay Trade History (USER_DATA)
74783
74784- If startTime and endTime are not sent, the recent 90 days' data will be returned.
74785- The max interval between startTime and endTime is 90 days.
74786- Support for querying orders within the last 18 months.
74787
74788Weight(UID): 3000
74789
74790Sends a `GET` request to `/sapi/v1/pay/transactions`
74791
74792Arguments:
74793- `end_time`: UTC timestamp in ms
74794- `limit`: default 100, max 100
74795- `recv_window`: The value cannot be greater than 60000
74796- `signature`: Signature
74797- `start_time`: UTC timestamp in ms
74798- `timestamp`: UTC timestamp in ms
74799*/
74800 pub async fn pay_transactions<'a>(
74801 &'a self,
74802 end_time: Option<i64>,
74803 limit: Option<i32>,
74804 recv_window: Option<i64>,
74805 signature: &'a str,
74806 start_time: Option<i64>,
74807 timestamp: i64,
74808 ) -> Result<ResponseValue<types::PayTransactionsResponse>, Error<types::Error>> {
74809 let url = format!("{}/sapi/v1/pay/transactions", self.baseurl,);
74810 let mut query = Vec::with_capacity(6usize);
74811 if let Some(v) = &end_time {
74812 query.push(("endTime", v.to_string()));
74813 }
74814 if let Some(v) = &limit {
74815 query.push(("limit", v.to_string()));
74816 }
74817 if let Some(v) = &recv_window {
74818 query.push(("recvWindow", v.to_string()));
74819 }
74820 query.push(("signature", signature.to_string()));
74821 if let Some(v) = &start_time {
74822 query.push(("startTime", v.to_string()));
74823 }
74824 query.push(("timestamp", timestamp.to_string()));
74825 #[allow(unused_mut)]
74826 let mut request = self
74827 .client
74828 .get(url)
74829 .header(
74830 reqwest::header::ACCEPT,
74831 reqwest::header::HeaderValue::from_static("application/json"),
74832 )
74833 .query(&query)
74834 .build()?;
74835 (crate::pre_hook)(&self.inner, &request);
74836 let result = self.client.execute(request).await;
74837 (crate::post_hook)(&self.inner, &result);
74838 let response = result?;
74839 match response.status().as_u16() {
74840 200u16 => ResponseValue::from_response(response).await,
74841 400u16 => {
74842 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74843 }
74844 401u16 => {
74845 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74846 }
74847 _ => Err(Error::UnexpectedResponse(response)),
74848 }
74849 }
74850 /**List All Convert Pairs
74851
74852Query for all convertible token pairs and the tokens’ respective upper/lower limits
74853
74854Weight(IP): 3000
74855
74856Sends a `GET` request to `/sapi/v1/convert/exchangeInfo`
74857
74858Arguments:
74859- `from_asset`: User spends coin
74860- `to_asset`: User receives coin
74861*/
74862 pub async fn convert_exchange_info<'a>(
74863 &'a self,
74864 from_asset: Option<&'a str>,
74865 to_asset: Option<&'a str>,
74866 ) -> Result<
74867 ResponseValue<Vec<types::ConvertExchangeInfoResponseItem>>,
74868 Error<types::Error>,
74869 > {
74870 let url = format!("{}/sapi/v1/convert/exchangeInfo", self.baseurl,);
74871 let mut query = Vec::with_capacity(2usize);
74872 if let Some(v) = &from_asset {
74873 query.push(("fromAsset", v.to_string()));
74874 }
74875 if let Some(v) = &to_asset {
74876 query.push(("toAsset", v.to_string()));
74877 }
74878 #[allow(unused_mut)]
74879 let mut request = self
74880 .client
74881 .get(url)
74882 .header(
74883 reqwest::header::ACCEPT,
74884 reqwest::header::HeaderValue::from_static("application/json"),
74885 )
74886 .query(&query)
74887 .build()?;
74888 (crate::pre_hook)(&self.inner, &request);
74889 let result = self.client.execute(request).await;
74890 (crate::post_hook)(&self.inner, &result);
74891 let response = result?;
74892 match response.status().as_u16() {
74893 200u16 => ResponseValue::from_response(response).await,
74894 400u16 => {
74895 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74896 }
74897 401u16 => {
74898 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74899 }
74900 _ => Err(Error::UnexpectedResponse(response)),
74901 }
74902 }
74903 /**Query order quantity precision per asset (USER_DATA)
74904
74905Query for supported asset precision information
74906
74907Weight(IP): 100
74908
74909Sends a `GET` request to `/sapi/v1/convert/assetInfo`
74910
74911Arguments:
74912- `recv_window`: The value cannot be greater than 60000
74913- `signature`: Signature
74914- `timestamp`: UTC timestamp in ms
74915*/
74916 pub async fn convert_asset_info<'a>(
74917 &'a self,
74918 recv_window: Option<i64>,
74919 signature: &'a str,
74920 timestamp: i64,
74921 ) -> Result<
74922 ResponseValue<Vec<types::ConvertAssetInfoResponseItem>>,
74923 Error<types::Error>,
74924 > {
74925 let url = format!("{}/sapi/v1/convert/assetInfo", self.baseurl,);
74926 let mut query = Vec::with_capacity(3usize);
74927 if let Some(v) = &recv_window {
74928 query.push(("recvWindow", v.to_string()));
74929 }
74930 query.push(("signature", signature.to_string()));
74931 query.push(("timestamp", timestamp.to_string()));
74932 #[allow(unused_mut)]
74933 let mut request = self
74934 .client
74935 .get(url)
74936 .header(
74937 reqwest::header::ACCEPT,
74938 reqwest::header::HeaderValue::from_static("application/json"),
74939 )
74940 .query(&query)
74941 .build()?;
74942 (crate::pre_hook)(&self.inner, &request);
74943 let result = self.client.execute(request).await;
74944 (crate::post_hook)(&self.inner, &result);
74945 let response = result?;
74946 match response.status().as_u16() {
74947 200u16 => ResponseValue::from_response(response).await,
74948 400u16 => {
74949 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74950 }
74951 401u16 => {
74952 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
74953 }
74954 _ => Err(Error::UnexpectedResponse(response)),
74955 }
74956 }
74957 /**Send quote request (USER_DATA)
74958
74959Request a quote for the requested token pairs
74960
74961Weight(UID): 200
74962
74963Sends a `POST` request to `/sapi/v1/convert/getQuote`
74964
74965Arguments:
74966- `from_amount`: When specified, it is the amount you will be debited after the conversion
74967- `from_asset`
74968- `recv_window`: The value cannot be greater than 60000
74969- `signature`: Signature
74970- `timestamp`: UTC timestamp in ms
74971- `to_amount`: When specified, it is the amount you will be debited after the conversion
74972- `to_asset`
74973- `valid_time`: 10s, 30s, 1m, 2m, default 10s
74974- `wallet_type`: SPOT or FUNDING. Default is SPOT
74975*/
74976 pub async fn convert_get_quote<'a>(
74977 &'a self,
74978 from_amount: Option<f32>,
74979 from_asset: &'a str,
74980 recv_window: Option<i64>,
74981 signature: &'a str,
74982 timestamp: i64,
74983 to_amount: Option<f32>,
74984 to_asset: &'a str,
74985 valid_time: Option<&'a str>,
74986 wallet_type: Option<&'a str>,
74987 ) -> Result<ResponseValue<types::ConvertGetQuoteResponse>, Error<types::Error>> {
74988 let url = format!("{}/sapi/v1/convert/getQuote", self.baseurl,);
74989 let mut query = Vec::with_capacity(9usize);
74990 if let Some(v) = &from_amount {
74991 query.push(("fromAmount", v.to_string()));
74992 }
74993 query.push(("fromAsset", from_asset.to_string()));
74994 if let Some(v) = &recv_window {
74995 query.push(("recvWindow", v.to_string()));
74996 }
74997 query.push(("signature", signature.to_string()));
74998 query.push(("timestamp", timestamp.to_string()));
74999 if let Some(v) = &to_amount {
75000 query.push(("toAmount", v.to_string()));
75001 }
75002 query.push(("toAsset", to_asset.to_string()));
75003 if let Some(v) = &valid_time {
75004 query.push(("validTime", v.to_string()));
75005 }
75006 if let Some(v) = &wallet_type {
75007 query.push(("walletType", v.to_string()));
75008 }
75009 #[allow(unused_mut)]
75010 let mut request = self
75011 .client
75012 .post(url)
75013 .header(
75014 reqwest::header::ACCEPT,
75015 reqwest::header::HeaderValue::from_static("application/json"),
75016 )
75017 .query(&query)
75018 .build()?;
75019 (crate::pre_hook)(&self.inner, &request);
75020 let result = self.client.execute(request).await;
75021 (crate::post_hook)(&self.inner, &result);
75022 let response = result?;
75023 match response.status().as_u16() {
75024 200u16 => ResponseValue::from_response(response).await,
75025 400u16 => {
75026 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75027 }
75028 401u16 => {
75029 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75030 }
75031 _ => Err(Error::UnexpectedResponse(response)),
75032 }
75033 }
75034 /**Accept Quote (TRADE)
75035
75036Accept the offered quote by quote ID.
75037
75038Weight(UID): 500
75039
75040Sends a `POST` request to `/sapi/v1/convert/acceptQuote`
75041
75042Arguments:
75043- `quote_id`
75044- `recv_window`: The value cannot be greater than 60000
75045- `signature`: Signature
75046- `timestamp`: UTC timestamp in ms
75047*/
75048 pub async fn convert_accept_quote<'a>(
75049 &'a self,
75050 quote_id: &'a str,
75051 recv_window: Option<i64>,
75052 signature: &'a str,
75053 timestamp: i64,
75054 ) -> Result<ResponseValue<types::ConvertAcceptQuoteResponse>, Error<types::Error>> {
75055 let url = format!("{}/sapi/v1/convert/acceptQuote", self.baseurl,);
75056 let mut query = Vec::with_capacity(4usize);
75057 query.push(("quoteId", quote_id.to_string()));
75058 if let Some(v) = &recv_window {
75059 query.push(("recvWindow", v.to_string()));
75060 }
75061 query.push(("signature", signature.to_string()));
75062 query.push(("timestamp", timestamp.to_string()));
75063 #[allow(unused_mut)]
75064 let mut request = self
75065 .client
75066 .post(url)
75067 .header(
75068 reqwest::header::ACCEPT,
75069 reqwest::header::HeaderValue::from_static("application/json"),
75070 )
75071 .query(&query)
75072 .build()?;
75073 (crate::pre_hook)(&self.inner, &request);
75074 let result = self.client.execute(request).await;
75075 (crate::post_hook)(&self.inner, &result);
75076 let response = result?;
75077 match response.status().as_u16() {
75078 200u16 => ResponseValue::from_response(response).await,
75079 400u16 => {
75080 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75081 }
75082 401u16 => {
75083 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75084 }
75085 _ => Err(Error::UnexpectedResponse(response)),
75086 }
75087 }
75088 /**Order status (USER_DATA)
75089
75090Query order status by order ID.
75091
75092Weight(UID): 100
75093
75094Sends a `GET` request to `/sapi/v1/convert/orderStatus`
75095
75096Arguments:
75097- `order_id`
75098- `quote_id`
75099- `recv_window`: The value cannot be greater than 60000
75100- `signature`: Signature
75101- `timestamp`: UTC timestamp in ms
75102*/
75103 pub async fn convert_order_status<'a>(
75104 &'a self,
75105 order_id: Option<&'a str>,
75106 quote_id: Option<&'a str>,
75107 recv_window: Option<i64>,
75108 signature: &'a str,
75109 timestamp: i64,
75110 ) -> Result<ResponseValue<types::ConvertOrderStatusResponse>, Error<types::Error>> {
75111 let url = format!("{}/sapi/v1/convert/orderStatus", self.baseurl,);
75112 let mut query = Vec::with_capacity(5usize);
75113 if let Some(v) = &order_id {
75114 query.push(("orderId", v.to_string()));
75115 }
75116 if let Some(v) = "e_id {
75117 query.push(("quoteId", v.to_string()));
75118 }
75119 if let Some(v) = &recv_window {
75120 query.push(("recvWindow", v.to_string()));
75121 }
75122 query.push(("signature", signature.to_string()));
75123 query.push(("timestamp", timestamp.to_string()));
75124 #[allow(unused_mut)]
75125 let mut request = self
75126 .client
75127 .get(url)
75128 .header(
75129 reqwest::header::ACCEPT,
75130 reqwest::header::HeaderValue::from_static("application/json"),
75131 )
75132 .query(&query)
75133 .build()?;
75134 (crate::pre_hook)(&self.inner, &request);
75135 let result = self.client.execute(request).await;
75136 (crate::post_hook)(&self.inner, &result);
75137 let response = result?;
75138 match response.status().as_u16() {
75139 200u16 => ResponseValue::from_response(response).await,
75140 400u16 => {
75141 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75142 }
75143 401u16 => {
75144 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75145 }
75146 _ => Err(Error::UnexpectedResponse(response)),
75147 }
75148 }
75149 /**Get Convert Trade History (USER_DATA)
75150
75151- The max interval between startTime and endTime is 30 days.
75152
75153Weight(UID): 3000
75154
75155Sends a `GET` request to `/sapi/v1/convert/tradeFlow`
75156
75157Arguments:
75158- `end_time`: UTC timestamp in ms
75159- `limit`: default 100, max 1000
75160- `recv_window`: The value cannot be greater than 60000
75161- `signature`: Signature
75162- `start_time`: UTC timestamp in ms
75163- `timestamp`: UTC timestamp in ms
75164*/
75165 pub async fn convert_trade_flow<'a>(
75166 &'a self,
75167 end_time: i64,
75168 limit: Option<i32>,
75169 recv_window: Option<i64>,
75170 signature: &'a str,
75171 start_time: i64,
75172 timestamp: i64,
75173 ) -> Result<ResponseValue<types::ConvertTradeFlowResponse>, Error<types::Error>> {
75174 let url = format!("{}/sapi/v1/convert/tradeFlow", self.baseurl,);
75175 let mut query = Vec::with_capacity(6usize);
75176 query.push(("endTime", end_time.to_string()));
75177 if let Some(v) = &limit {
75178 query.push(("limit", v.to_string()));
75179 }
75180 if let Some(v) = &recv_window {
75181 query.push(("recvWindow", v.to_string()));
75182 }
75183 query.push(("signature", signature.to_string()));
75184 query.push(("startTime", start_time.to_string()));
75185 query.push(("timestamp", timestamp.to_string()));
75186 #[allow(unused_mut)]
75187 let mut request = self
75188 .client
75189 .get(url)
75190 .header(
75191 reqwest::header::ACCEPT,
75192 reqwest::header::HeaderValue::from_static("application/json"),
75193 )
75194 .query(&query)
75195 .build()?;
75196 (crate::pre_hook)(&self.inner, &request);
75197 let result = self.client.execute(request).await;
75198 (crate::post_hook)(&self.inner, &result);
75199 let response = result?;
75200 match response.status().as_u16() {
75201 200u16 => ResponseValue::from_response(response).await,
75202 400u16 => {
75203 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75204 }
75205 401u16 => {
75206 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75207 }
75208 _ => Err(Error::UnexpectedResponse(response)),
75209 }
75210 }
75211 /**Get Spot Rebate History Records (USER_DATA)
75212
75213- The max interval between startTime and endTime is 90 days.
75214- If startTime and endTime are not sent, the recent 7 days' data will be returned.
75215- The earliest startTime is supported on June 10, 2020
75216
75217Weight(UID): 3000
75218
75219Sends a `GET` request to `/sapi/v1/rebate/taxQuery`
75220
75221Arguments:
75222- `end_time`: UTC timestamp in ms
75223- `page`: default 1
75224- `recv_window`: The value cannot be greater than 60000
75225- `signature`: Signature
75226- `start_time`: UTC timestamp in ms
75227- `timestamp`: UTC timestamp in ms
75228*/
75229 pub async fn rebate_tax_query<'a>(
75230 &'a self,
75231 end_time: Option<i64>,
75232 page: Option<i32>,
75233 recv_window: Option<i64>,
75234 signature: &'a str,
75235 start_time: Option<i64>,
75236 timestamp: i64,
75237 ) -> Result<ResponseValue<types::RebateTaxQueryResponse>, Error<types::Error>> {
75238 let url = format!("{}/sapi/v1/rebate/taxQuery", self.baseurl,);
75239 let mut query = Vec::with_capacity(6usize);
75240 if let Some(v) = &end_time {
75241 query.push(("endTime", v.to_string()));
75242 }
75243 if let Some(v) = &page {
75244 query.push(("page", v.to_string()));
75245 }
75246 if let Some(v) = &recv_window {
75247 query.push(("recvWindow", v.to_string()));
75248 }
75249 query.push(("signature", signature.to_string()));
75250 if let Some(v) = &start_time {
75251 query.push(("startTime", v.to_string()));
75252 }
75253 query.push(("timestamp", timestamp.to_string()));
75254 #[allow(unused_mut)]
75255 let mut request = self
75256 .client
75257 .get(url)
75258 .header(
75259 reqwest::header::ACCEPT,
75260 reqwest::header::HeaderValue::from_static("application/json"),
75261 )
75262 .query(&query)
75263 .build()?;
75264 (crate::pre_hook)(&self.inner, &request);
75265 let result = self.client.execute(request).await;
75266 (crate::post_hook)(&self.inner, &result);
75267 let response = result?;
75268 match response.status().as_u16() {
75269 200u16 => ResponseValue::from_response(response).await,
75270 400u16 => {
75271 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75272 }
75273 401u16 => {
75274 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75275 }
75276 _ => Err(Error::UnexpectedResponse(response)),
75277 }
75278 }
75279 /**Get NFT Transaction History (USER_DATA)
75280
75281- The max interval between startTime and endTime is 90 days.
75282- If startTime and endTime are not sent, the recent 7 days' data will be returned.
75283
75284Weight(UID): 3000
75285
75286Sends a `GET` request to `/sapi/v1/nft/history/transactions`
75287
75288Arguments:
75289- `end_time`: UTC timestamp in ms
75290- `limit`: Default 50, Max 50
75291- `order_type`: 0: purchase order, 1: sell order, 2: royalty income, 3: primary market order, 4: mint fee
75292- `page`: Default 1
75293- `recv_window`: The value cannot be greater than 60000
75294- `signature`: Signature
75295- `start_time`: UTC timestamp in ms
75296- `timestamp`: UTC timestamp in ms
75297*/
75298 pub async fn nft_history_transactions<'a>(
75299 &'a self,
75300 end_time: Option<i64>,
75301 limit: Option<i32>,
75302 order_type: i32,
75303 page: Option<i32>,
75304 recv_window: Option<i64>,
75305 signature: &'a str,
75306 start_time: Option<i64>,
75307 timestamp: i64,
75308 ) -> Result<
75309 ResponseValue<types::NftHistoryTransactionsResponse>,
75310 Error<types::Error>,
75311 > {
75312 let url = format!("{}/sapi/v1/nft/history/transactions", self.baseurl,);
75313 let mut query = Vec::with_capacity(8usize);
75314 if let Some(v) = &end_time {
75315 query.push(("endTime", v.to_string()));
75316 }
75317 if let Some(v) = &limit {
75318 query.push(("limit", v.to_string()));
75319 }
75320 query.push(("orderType", order_type.to_string()));
75321 if let Some(v) = &page {
75322 query.push(("page", v.to_string()));
75323 }
75324 if let Some(v) = &recv_window {
75325 query.push(("recvWindow", v.to_string()));
75326 }
75327 query.push(("signature", signature.to_string()));
75328 if let Some(v) = &start_time {
75329 query.push(("startTime", v.to_string()));
75330 }
75331 query.push(("timestamp", timestamp.to_string()));
75332 #[allow(unused_mut)]
75333 let mut request = self
75334 .client
75335 .get(url)
75336 .header(
75337 reqwest::header::ACCEPT,
75338 reqwest::header::HeaderValue::from_static("application/json"),
75339 )
75340 .query(&query)
75341 .build()?;
75342 (crate::pre_hook)(&self.inner, &request);
75343 let result = self.client.execute(request).await;
75344 (crate::post_hook)(&self.inner, &result);
75345 let response = result?;
75346 match response.status().as_u16() {
75347 200u16 => ResponseValue::from_response(response).await,
75348 400u16 => {
75349 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75350 }
75351 401u16 => {
75352 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75353 }
75354 _ => Err(Error::UnexpectedResponse(response)),
75355 }
75356 }
75357 /**Get NFT Deposit History(USER_DATA)
75358
75359- The max interval between startTime and endTime is 90 days.
75360- If startTime and endTime are not sent, the recent 7 days' data will be returned.
75361
75362Weight(UID): 3000
75363
75364Sends a `GET` request to `/sapi/v1/nft/history/deposit`
75365
75366Arguments:
75367- `end_time`: UTC timestamp in ms
75368- `limit`: Default 50, Max 50
75369- `page`: Default 1
75370- `recv_window`: The value cannot be greater than 60000
75371- `signature`: Signature
75372- `start_time`: UTC timestamp in ms
75373- `timestamp`: UTC timestamp in ms
75374*/
75375 pub async fn nft_history_deposit<'a>(
75376 &'a self,
75377 end_time: Option<i64>,
75378 limit: Option<i32>,
75379 page: Option<i32>,
75380 recv_window: Option<i64>,
75381 signature: &'a str,
75382 start_time: Option<i64>,
75383 timestamp: i64,
75384 ) -> Result<ResponseValue<types::NftHistoryDepositResponse>, Error<types::Error>> {
75385 let url = format!("{}/sapi/v1/nft/history/deposit", self.baseurl,);
75386 let mut query = Vec::with_capacity(7usize);
75387 if let Some(v) = &end_time {
75388 query.push(("endTime", v.to_string()));
75389 }
75390 if let Some(v) = &limit {
75391 query.push(("limit", v.to_string()));
75392 }
75393 if let Some(v) = &page {
75394 query.push(("page", v.to_string()));
75395 }
75396 if let Some(v) = &recv_window {
75397 query.push(("recvWindow", v.to_string()));
75398 }
75399 query.push(("signature", signature.to_string()));
75400 if let Some(v) = &start_time {
75401 query.push(("startTime", v.to_string()));
75402 }
75403 query.push(("timestamp", timestamp.to_string()));
75404 #[allow(unused_mut)]
75405 let mut request = self
75406 .client
75407 .get(url)
75408 .header(
75409 reqwest::header::ACCEPT,
75410 reqwest::header::HeaderValue::from_static("application/json"),
75411 )
75412 .query(&query)
75413 .build()?;
75414 (crate::pre_hook)(&self.inner, &request);
75415 let result = self.client.execute(request).await;
75416 (crate::post_hook)(&self.inner, &result);
75417 let response = result?;
75418 match response.status().as_u16() {
75419 200u16 => ResponseValue::from_response(response).await,
75420 400u16 => {
75421 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75422 }
75423 401u16 => {
75424 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75425 }
75426 _ => Err(Error::UnexpectedResponse(response)),
75427 }
75428 }
75429 /**Get NFT Withdraw History (USER_DATA)
75430
75431- The max interval between startTime and endTime is 90 days.
75432- If startTime and endTime are not sent, the recent 7 days' data will be returned.
75433
75434Weight(UID): 3000
75435
75436Sends a `GET` request to `/sapi/v1/nft/history/withdraw`
75437
75438Arguments:
75439- `end_time`: UTC timestamp in ms
75440- `limit`: Default 50, Max 50
75441- `page`: Default 1
75442- `recv_window`: The value cannot be greater than 60000
75443- `signature`: Signature
75444- `start_time`: UTC timestamp in ms
75445- `timestamp`: UTC timestamp in ms
75446*/
75447 pub async fn nft_history_withdraw<'a>(
75448 &'a self,
75449 end_time: Option<i64>,
75450 limit: Option<i32>,
75451 page: Option<i32>,
75452 recv_window: Option<i64>,
75453 signature: &'a str,
75454 start_time: Option<i64>,
75455 timestamp: i64,
75456 ) -> Result<ResponseValue<types::NftHistoryWithdrawResponse>, Error<types::Error>> {
75457 let url = format!("{}/sapi/v1/nft/history/withdraw", self.baseurl,);
75458 let mut query = Vec::with_capacity(7usize);
75459 if let Some(v) = &end_time {
75460 query.push(("endTime", v.to_string()));
75461 }
75462 if let Some(v) = &limit {
75463 query.push(("limit", v.to_string()));
75464 }
75465 if let Some(v) = &page {
75466 query.push(("page", v.to_string()));
75467 }
75468 if let Some(v) = &recv_window {
75469 query.push(("recvWindow", v.to_string()));
75470 }
75471 query.push(("signature", signature.to_string()));
75472 if let Some(v) = &start_time {
75473 query.push(("startTime", v.to_string()));
75474 }
75475 query.push(("timestamp", timestamp.to_string()));
75476 #[allow(unused_mut)]
75477 let mut request = self
75478 .client
75479 .get(url)
75480 .header(
75481 reqwest::header::ACCEPT,
75482 reqwest::header::HeaderValue::from_static("application/json"),
75483 )
75484 .query(&query)
75485 .build()?;
75486 (crate::pre_hook)(&self.inner, &request);
75487 let result = self.client.execute(request).await;
75488 (crate::post_hook)(&self.inner, &result);
75489 let response = result?;
75490 match response.status().as_u16() {
75491 200u16 => ResponseValue::from_response(response).await,
75492 400u16 => {
75493 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75494 }
75495 401u16 => {
75496 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75497 }
75498 _ => Err(Error::UnexpectedResponse(response)),
75499 }
75500 }
75501 /**Get NFT Asset (USER_DATA)
75502
75503Weight(UID): 3000
75504
75505Sends a `GET` request to `/sapi/v1/nft/user/getAsset`
75506
75507Arguments:
75508- `limit`: Default 50, Max 50
75509- `page`: Default 1
75510- `recv_window`: The value cannot be greater than 60000
75511- `signature`: Signature
75512- `timestamp`: UTC timestamp in ms
75513*/
75514 pub async fn nft_user_get_asset<'a>(
75515 &'a self,
75516 limit: Option<i32>,
75517 page: Option<i32>,
75518 recv_window: Option<i64>,
75519 signature: &'a str,
75520 timestamp: i64,
75521 ) -> Result<ResponseValue<types::NftUserGetAssetResponse>, Error<types::Error>> {
75522 let url = format!("{}/sapi/v1/nft/user/getAsset", self.baseurl,);
75523 let mut query = Vec::with_capacity(5usize);
75524 if let Some(v) = &limit {
75525 query.push(("limit", v.to_string()));
75526 }
75527 if let Some(v) = &page {
75528 query.push(("page", v.to_string()));
75529 }
75530 if let Some(v) = &recv_window {
75531 query.push(("recvWindow", v.to_string()));
75532 }
75533 query.push(("signature", signature.to_string()));
75534 query.push(("timestamp", timestamp.to_string()));
75535 #[allow(unused_mut)]
75536 let mut request = self
75537 .client
75538 .get(url)
75539 .header(
75540 reqwest::header::ACCEPT,
75541 reqwest::header::HeaderValue::from_static("application/json"),
75542 )
75543 .query(&query)
75544 .build()?;
75545 (crate::pre_hook)(&self.inner, &request);
75546 let result = self.client.execute(request).await;
75547 (crate::post_hook)(&self.inner, &result);
75548 let response = result?;
75549 match response.status().as_u16() {
75550 200u16 => ResponseValue::from_response(response).await,
75551 400u16 => {
75552 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75553 }
75554 401u16 => {
75555 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75556 }
75557 _ => Err(Error::UnexpectedResponse(response)),
75558 }
75559 }
75560 /**Create a Binance Code (USER_DATA)
75561
75562This API is for creating a Binance Code. To get started with, please make sure:
75563
75564- You have a Binance account
75565- You have passed kyc
75566- You have a sufficient balance in your Binance funding wallet
75567- You need Enable Withdrawals for the API Key which requests this endpoint.
75568
75569Daily creation volume: 2 BTC / 24H Daily creation times: 200 Codes / 24H
75570
75571Weight(IP): 1
75572
75573Sends a `POST` request to `/sapi/v1/giftcard/createCode`
75574
75575Arguments:
75576- `amount`: The amount of the coin
75577- `recv_window`: The value cannot be greater than 60000
75578- `signature`: Signature
75579- `timestamp`: UTC timestamp in ms
75580- `token`: The coin type contained in the Binance Code
75581*/
75582 pub async fn giftcard_create_code<'a>(
75583 &'a self,
75584 amount: f64,
75585 recv_window: Option<i64>,
75586 signature: &'a str,
75587 timestamp: i64,
75588 token: &'a str,
75589 ) -> Result<ResponseValue<types::GiftcardCreateCodeResponse>, Error<types::Error>> {
75590 let url = format!("{}/sapi/v1/giftcard/createCode", self.baseurl,);
75591 let mut query = Vec::with_capacity(5usize);
75592 query.push(("amount", amount.to_string()));
75593 if let Some(v) = &recv_window {
75594 query.push(("recvWindow", v.to_string()));
75595 }
75596 query.push(("signature", signature.to_string()));
75597 query.push(("timestamp", timestamp.to_string()));
75598 query.push(("token", token.to_string()));
75599 #[allow(unused_mut)]
75600 let mut request = self
75601 .client
75602 .post(url)
75603 .header(
75604 reqwest::header::ACCEPT,
75605 reqwest::header::HeaderValue::from_static("application/json"),
75606 )
75607 .query(&query)
75608 .build()?;
75609 (crate::pre_hook)(&self.inner, &request);
75610 let result = self.client.execute(request).await;
75611 (crate::post_hook)(&self.inner, &result);
75612 let response = result?;
75613 match response.status().as_u16() {
75614 200u16 => ResponseValue::from_response(response).await,
75615 400u16 => {
75616 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75617 }
75618 401u16 => {
75619 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75620 }
75621 _ => Err(Error::UnexpectedResponse(response)),
75622 }
75623 }
75624 /**Redeem a Binance Code (USER_DATA)
75625
75626This API is for redeeming the Binance Code. Once redeemed, the coins will be deposited in your funding wallet.
75627
75628Please note that if you enter the wrong code 5 times within 24 hours, you will no longer be able to redeem any Binance Code that day.
75629
75630Weight(IP): 1
75631
75632Sends a `POST` request to `/sapi/v1/giftcard/redeemCode`
75633
75634Arguments:
75635- `code`: Binance Code
75636- `external_uid`: Each external unique ID represents a unique user on the partner platform. The function helps you to identify the redemption behavior of different users, such as redemption frequency and amount. It also helps risk and limit control of a single account, such as daily limit on redemption volume, frequency, and incorrect number of entries. This will also prevent a single user account reach the partner's daily redemption limits. We strongly recommend you to use this feature and transfer us the User ID of your users if you have different users redeeming Binance codes on your platform. To protect user data privacy, you may choose to transfer the user id in any desired format (max. 400 characters).
75637- `recv_window`: The value cannot be greater than 60000
75638- `signature`: Signature
75639- `timestamp`: UTC timestamp in ms
75640*/
75641 pub async fn giftcard_redeem_code<'a>(
75642 &'a self,
75643 code: &'a str,
75644 external_uid: Option<&'a str>,
75645 recv_window: Option<i64>,
75646 signature: &'a str,
75647 timestamp: i64,
75648 ) -> Result<ResponseValue<types::GiftcardRedeemCodeResponse>, Error<types::Error>> {
75649 let url = format!("{}/sapi/v1/giftcard/redeemCode", self.baseurl,);
75650 let mut query = Vec::with_capacity(5usize);
75651 query.push(("code", code.to_string()));
75652 if let Some(v) = &external_uid {
75653 query.push(("externalUid", v.to_string()));
75654 }
75655 if let Some(v) = &recv_window {
75656 query.push(("recvWindow", v.to_string()));
75657 }
75658 query.push(("signature", signature.to_string()));
75659 query.push(("timestamp", timestamp.to_string()));
75660 #[allow(unused_mut)]
75661 let mut request = self
75662 .client
75663 .post(url)
75664 .header(
75665 reqwest::header::ACCEPT,
75666 reqwest::header::HeaderValue::from_static("application/json"),
75667 )
75668 .query(&query)
75669 .build()?;
75670 (crate::pre_hook)(&self.inner, &request);
75671 let result = self.client.execute(request).await;
75672 (crate::post_hook)(&self.inner, &result);
75673 let response = result?;
75674 match response.status().as_u16() {
75675 200u16 => ResponseValue::from_response(response).await,
75676 400u16 => {
75677 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75678 }
75679 401u16 => {
75680 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75681 }
75682 _ => Err(Error::UnexpectedResponse(response)),
75683 }
75684 }
75685 /**Verify a Binance Code (USER_DATA)
75686
75687This API is for verifying whether the Binance Code is valid or not by entering Binance Code or reference number.
75688
75689Please note that if you enter the wrong binance code 5 times within an hour, you will no longer be able to verify any binance code for that hour.
75690
75691Weight(IP): 1
75692
75693Sends a `GET` request to `/sapi/v1/giftcard/verify`
75694
75695Arguments:
75696- `recv_window`: The value cannot be greater than 60000
75697- `reference_no`: reference number
75698- `signature`: Signature
75699- `timestamp`: UTC timestamp in ms
75700*/
75701 pub async fn giftcard_verify<'a>(
75702 &'a self,
75703 recv_window: Option<i64>,
75704 reference_no: &'a str,
75705 signature: &'a str,
75706 timestamp: i64,
75707 ) -> Result<ResponseValue<types::GiftcardVerifyResponse>, Error<types::Error>> {
75708 let url = format!("{}/sapi/v1/giftcard/verify", self.baseurl,);
75709 let mut query = Vec::with_capacity(4usize);
75710 if let Some(v) = &recv_window {
75711 query.push(("recvWindow", v.to_string()));
75712 }
75713 query.push(("referenceNo", reference_no.to_string()));
75714 query.push(("signature", signature.to_string()));
75715 query.push(("timestamp", timestamp.to_string()));
75716 #[allow(unused_mut)]
75717 let mut request = self
75718 .client
75719 .get(url)
75720 .header(
75721 reqwest::header::ACCEPT,
75722 reqwest::header::HeaderValue::from_static("application/json"),
75723 )
75724 .query(&query)
75725 .build()?;
75726 (crate::pre_hook)(&self.inner, &request);
75727 let result = self.client.execute(request).await;
75728 (crate::post_hook)(&self.inner, &result);
75729 let response = result?;
75730 match response.status().as_u16() {
75731 200u16 => ResponseValue::from_response(response).await,
75732 400u16 => {
75733 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75734 }
75735 401u16 => {
75736 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75737 }
75738 _ => Err(Error::UnexpectedResponse(response)),
75739 }
75740 }
75741 /**Fetch RSA Public Key (USER_DATA)
75742
75743This API is for fetching the RSA Public Key.
75744This RSA Public key will be used to encrypt the card code.
75745Please note that the RSA Public key fetched is valid only for the current day.
75746
75747Weight(IP): 1
75748
75749Sends a `GET` request to `/sapi/v1/giftcard/cryptography/rsa-public-key`
75750
75751Arguments:
75752- `recv_window`: The value cannot be greater than 60000
75753- `signature`: Signature
75754- `timestamp`: UTC timestamp in ms
75755*/
75756 pub async fn giftcard_cryptography_rsa_public_key<'a>(
75757 &'a self,
75758 recv_window: Option<i64>,
75759 signature: &'a str,
75760 timestamp: i64,
75761 ) -> Result<
75762 ResponseValue<types::GiftcardCryptographyRsaPublicKeyResponse>,
75763 Error<types::Error>,
75764 > {
75765 let url = format!(
75766 "{}/sapi/v1/giftcard/cryptography/rsa-public-key", self.baseurl,
75767 );
75768 let mut query = Vec::with_capacity(3usize);
75769 if let Some(v) = &recv_window {
75770 query.push(("recvWindow", v.to_string()));
75771 }
75772 query.push(("signature", signature.to_string()));
75773 query.push(("timestamp", timestamp.to_string()));
75774 #[allow(unused_mut)]
75775 let mut request = self
75776 .client
75777 .get(url)
75778 .header(
75779 reqwest::header::ACCEPT,
75780 reqwest::header::HeaderValue::from_static("application/json"),
75781 )
75782 .query(&query)
75783 .build()?;
75784 (crate::pre_hook)(&self.inner, &request);
75785 let result = self.client.execute(request).await;
75786 (crate::post_hook)(&self.inner, &result);
75787 let response = result?;
75788 match response.status().as_u16() {
75789 200u16 => ResponseValue::from_response(response).await,
75790 400u16 => {
75791 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75792 }
75793 401u16 => {
75794 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75795 }
75796 _ => Err(Error::UnexpectedResponse(response)),
75797 }
75798 }
75799 /**Buy a Binance Code (TRADE)
75800
75801This API is for buying a fixed-value Binance Code, which means your Binance Code will be redeemable to a token that is different to the token that you are paying in. If the token you’re paying and the redeemable token are the same, please use the Create Binance Code endpoint.
75802You can use supported crypto currency or fiat token as baseToken to buy Binance Code that is redeemable to your chosen faceToken.
75803Once successfully purchased, the amount of baseToken would be deducted from your funding wallet.
75804
75805To get started with, please make sure:
75806- You have a Binance account
75807- You have passed kyc
75808- You have a sufficient balance in your Binance funding wallet
75809- You need Enable Withdrawals for the API Key which requests this endpoint.
75810
75811Daily creation volume: 2 BTC / 24H Daily creation times: 200 Codes / 24H
75812
75813Weight(IP): 1
75814
75815Sends a `POST` request to `/sapi/v1/giftcard/buyCode`
75816
75817Arguments:
75818- `base_token`: The token you want to pay, example BUSD
75819- `base_token_amount`: The base token asset quantity, example 1.002
75820- `face_token`: The token you want to buy, example BNB. If faceToken = baseToken, it's the same as createCode endpoint.
75821- `recv_window`: The value cannot be greater than 60000
75822- `signature`: Signature
75823- `timestamp`: UTC timestamp in ms
75824*/
75825 pub async fn giftcard_buy_code<'a>(
75826 &'a self,
75827 base_token: &'a str,
75828 base_token_amount: f64,
75829 face_token: &'a str,
75830 recv_window: Option<i64>,
75831 signature: &'a str,
75832 timestamp: i64,
75833 ) -> Result<ResponseValue<types::GiftcardBuyCodeResponse>, Error<types::Error>> {
75834 let url = format!("{}/sapi/v1/giftcard/buyCode", self.baseurl,);
75835 let mut query = Vec::with_capacity(6usize);
75836 query.push(("baseToken", base_token.to_string()));
75837 query.push(("baseTokenAmount", base_token_amount.to_string()));
75838 query.push(("faceToken", face_token.to_string()));
75839 if let Some(v) = &recv_window {
75840 query.push(("recvWindow", v.to_string()));
75841 }
75842 query.push(("signature", signature.to_string()));
75843 query.push(("timestamp", timestamp.to_string()));
75844 #[allow(unused_mut)]
75845 let mut request = self
75846 .client
75847 .post(url)
75848 .header(
75849 reqwest::header::ACCEPT,
75850 reqwest::header::HeaderValue::from_static("application/json"),
75851 )
75852 .query(&query)
75853 .build()?;
75854 (crate::pre_hook)(&self.inner, &request);
75855 let result = self.client.execute(request).await;
75856 (crate::post_hook)(&self.inner, &result);
75857 let response = result?;
75858 match response.status().as_u16() {
75859 200u16 => ResponseValue::from_response(response).await,
75860 400u16 => {
75861 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75862 }
75863 401u16 => {
75864 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75865 }
75866 _ => Err(Error::UnexpectedResponse(response)),
75867 }
75868 }
75869 /**Fetch Token Limit (USER_DATA)
75870
75871This API is to help you verify which tokens are available for you to purchase fixed-value gift cards as mentioned in section 2 and it's limitation.
75872
75873Weight(IP): 1
75874
75875Sends a `GET` request to `/sapi/v1/giftcard/buyCode/token-limit`
75876
75877Arguments:
75878- `base_token`: The token you want to pay, example BUSD
75879- `recv_window`: The value cannot be greater than 60000
75880- `signature`: Signature
75881- `timestamp`: UTC timestamp in ms
75882*/
75883 pub async fn giftcard_buy_code_token_limit<'a>(
75884 &'a self,
75885 base_token: &'a str,
75886 recv_window: Option<i64>,
75887 signature: &'a str,
75888 timestamp: i64,
75889 ) -> Result<
75890 ResponseValue<types::GiftcardBuyCodeTokenLimitResponse>,
75891 Error<types::Error>,
75892 > {
75893 let url = format!("{}/sapi/v1/giftcard/buyCode/token-limit", self.baseurl,);
75894 let mut query = Vec::with_capacity(4usize);
75895 query.push(("baseToken", base_token.to_string()));
75896 if let Some(v) = &recv_window {
75897 query.push(("recvWindow", v.to_string()));
75898 }
75899 query.push(("signature", signature.to_string()));
75900 query.push(("timestamp", timestamp.to_string()));
75901 #[allow(unused_mut)]
75902 let mut request = self
75903 .client
75904 .get(url)
75905 .header(
75906 reqwest::header::ACCEPT,
75907 reqwest::header::HeaderValue::from_static("application/json"),
75908 )
75909 .query(&query)
75910 .build()?;
75911 (crate::pre_hook)(&self.inner, &request);
75912 let result = self.client.execute(request).await;
75913 (crate::post_hook)(&self.inner, &result);
75914 let response = result?;
75915 match response.status().as_u16() {
75916 200u16 => ResponseValue::from_response(response).await,
75917 400u16 => {
75918 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75919 }
75920 401u16 => {
75921 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75922 }
75923 _ => Err(Error::UnexpectedResponse(response)),
75924 }
75925 }
75926 /**Get target asset list (USER_DATA)
75927
75928Weight(IP): 1
75929
75930Sends a `GET` request to `/sapi/v1/lending/auto-invest/target-asset/list`
75931
75932Arguments:
75933- `current`: Current querying page. Start from 1. Default:1
75934- `recv_window`: The value cannot be greater than 60000
75935- `signature`: Signature
75936- `size`: Default:10 Max:100
75937- `target_asset`
75938- `timestamp`: UTC timestamp in ms
75939*/
75940 pub async fn lending_auto_invest_target_asset_list<'a>(
75941 &'a self,
75942 current: Option<i32>,
75943 recv_window: Option<i64>,
75944 signature: &'a str,
75945 size: Option<i32>,
75946 target_asset: Option<&'a str>,
75947 timestamp: i64,
75948 ) -> Result<
75949 ResponseValue<types::LendingAutoInvestTargetAssetListResponse>,
75950 Error<types::Error>,
75951 > {
75952 let url = format!(
75953 "{}/sapi/v1/lending/auto-invest/target-asset/list", self.baseurl,
75954 );
75955 let mut query = Vec::with_capacity(6usize);
75956 if let Some(v) = ¤t {
75957 query.push(("current", v.to_string()));
75958 }
75959 if let Some(v) = &recv_window {
75960 query.push(("recvWindow", v.to_string()));
75961 }
75962 query.push(("signature", signature.to_string()));
75963 if let Some(v) = &size {
75964 query.push(("size", v.to_string()));
75965 }
75966 if let Some(v) = &target_asset {
75967 query.push(("targetAsset", v.to_string()));
75968 }
75969 query.push(("timestamp", timestamp.to_string()));
75970 #[allow(unused_mut)]
75971 let mut request = self
75972 .client
75973 .get(url)
75974 .header(
75975 reqwest::header::ACCEPT,
75976 reqwest::header::HeaderValue::from_static("application/json"),
75977 )
75978 .query(&query)
75979 .build()?;
75980 (crate::pre_hook)(&self.inner, &request);
75981 let result = self.client.execute(request).await;
75982 (crate::post_hook)(&self.inner, &result);
75983 let response = result?;
75984 match response.status().as_u16() {
75985 200u16 => ResponseValue::from_response(response).await,
75986 400u16 => {
75987 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75988 }
75989 401u16 => {
75990 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
75991 }
75992 _ => Err(Error::UnexpectedResponse(response)),
75993 }
75994 }
75995 /**Get target asset ROI data (USER_DATA)
75996
75997ROI return list for target asset
75998
75999Weight(IP): 1
76000
76001Sends a `GET` request to `/sapi/v1/lending/auto-invest/target-asset/roi/list`
76002
76003Arguments:
76004- `his_roi_type`
76005- `recv_window`: The value cannot be greater than 60000
76006- `signature`: Signature
76007- `target_asset`
76008- `timestamp`: UTC timestamp in ms
76009*/
76010 pub async fn lending_auto_invest_target_asset_roi_list<'a>(
76011 &'a self,
76012 his_roi_type: &'a str,
76013 recv_window: Option<i64>,
76014 signature: &'a str,
76015 target_asset: &'a str,
76016 timestamp: i64,
76017 ) -> Result<
76018 ResponseValue<Vec<types::LendingAutoInvestTargetAssetRoiListResponseItem>>,
76019 Error<types::Error>,
76020 > {
76021 let url = format!(
76022 "{}/sapi/v1/lending/auto-invest/target-asset/roi/list", self.baseurl,
76023 );
76024 let mut query = Vec::with_capacity(5usize);
76025 query.push(("hisRoiType", his_roi_type.to_string()));
76026 if let Some(v) = &recv_window {
76027 query.push(("recvWindow", v.to_string()));
76028 }
76029 query.push(("signature", signature.to_string()));
76030 query.push(("targetAsset", target_asset.to_string()));
76031 query.push(("timestamp", timestamp.to_string()));
76032 #[allow(unused_mut)]
76033 let mut request = self
76034 .client
76035 .get(url)
76036 .header(
76037 reqwest::header::ACCEPT,
76038 reqwest::header::HeaderValue::from_static("application/json"),
76039 )
76040 .query(&query)
76041 .build()?;
76042 (crate::pre_hook)(&self.inner, &request);
76043 let result = self.client.execute(request).await;
76044 (crate::post_hook)(&self.inner, &result);
76045 let response = result?;
76046 match response.status().as_u16() {
76047 200u16 => ResponseValue::from_response(response).await,
76048 400u16 => {
76049 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76050 }
76051 401u16 => {
76052 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76053 }
76054 _ => Err(Error::UnexpectedResponse(response)),
76055 }
76056 }
76057 /**Query all source asset and target asset (USER_DATA)
76058
76059Query all source assets and target assets
76060
76061Weight(IP): 1
76062
76063Sends a `GET` request to `/sapi/v1/lending/auto-invest/all/asset`
76064
76065Arguments:
76066- `recv_window`: The value cannot be greater than 60000
76067- `signature`: Signature
76068- `timestamp`: UTC timestamp in ms
76069*/
76070 pub async fn lending_auto_invest_all_asset<'a>(
76071 &'a self,
76072 recv_window: Option<i64>,
76073 signature: &'a str,
76074 timestamp: i64,
76075 ) -> Result<
76076 ResponseValue<types::LendingAutoInvestAllAssetResponse>,
76077 Error<types::Error>,
76078 > {
76079 let url = format!("{}/sapi/v1/lending/auto-invest/all/asset", self.baseurl,);
76080 let mut query = Vec::with_capacity(3usize);
76081 if let Some(v) = &recv_window {
76082 query.push(("recvWindow", v.to_string()));
76083 }
76084 query.push(("signature", signature.to_string()));
76085 query.push(("timestamp", timestamp.to_string()));
76086 #[allow(unused_mut)]
76087 let mut request = self
76088 .client
76089 .get(url)
76090 .header(
76091 reqwest::header::ACCEPT,
76092 reqwest::header::HeaderValue::from_static("application/json"),
76093 )
76094 .query(&query)
76095 .build()?;
76096 (crate::pre_hook)(&self.inner, &request);
76097 let result = self.client.execute(request).await;
76098 (crate::post_hook)(&self.inner, &result);
76099 let response = result?;
76100 match response.status().as_u16() {
76101 200u16 => ResponseValue::from_response(response).await,
76102 400u16 => {
76103 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76104 }
76105 401u16 => {
76106 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76107 }
76108 _ => Err(Error::UnexpectedResponse(response)),
76109 }
76110 }
76111 /**Query source asset list (USER_DATA)
76112
76113Query Source Asset to be used for investment
76114
76115Weight(IP): 1
76116
76117Sends a `GET` request to `/sapi/v1/lending/auto-invest/source-asset/list`
76118
76119Arguments:
76120- `flexible_allowed_to_use`
76121- `index_id`
76122- `recv_window`: The value cannot be greater than 60000
76123- `signature`: Signature
76124- `target_asset`
76125- `timestamp`: UTC timestamp in ms
76126- `usage_type`
76127*/
76128 pub async fn lending_auto_invest_source_asset_list<'a>(
76129 &'a self,
76130 flexible_allowed_to_use: Option<bool>,
76131 index_id: Option<i64>,
76132 recv_window: Option<i64>,
76133 signature: &'a str,
76134 target_asset: Option<&'a str>,
76135 timestamp: i64,
76136 usage_type: &'a str,
76137 ) -> Result<
76138 ResponseValue<types::LendingAutoInvestSourceAssetListResponse>,
76139 Error<types::Error>,
76140 > {
76141 let url = format!(
76142 "{}/sapi/v1/lending/auto-invest/source-asset/list", self.baseurl,
76143 );
76144 let mut query = Vec::with_capacity(7usize);
76145 if let Some(v) = &flexible_allowed_to_use {
76146 query.push(("flexibleAllowedToUse", v.to_string()));
76147 }
76148 if let Some(v) = &index_id {
76149 query.push(("indexId", v.to_string()));
76150 }
76151 if let Some(v) = &recv_window {
76152 query.push(("recvWindow", v.to_string()));
76153 }
76154 query.push(("signature", signature.to_string()));
76155 if let Some(v) = &target_asset {
76156 query.push(("targetAsset", v.to_string()));
76157 }
76158 query.push(("timestamp", timestamp.to_string()));
76159 query.push(("usageType", usage_type.to_string()));
76160 #[allow(unused_mut)]
76161 let mut request = self
76162 .client
76163 .get(url)
76164 .header(
76165 reqwest::header::ACCEPT,
76166 reqwest::header::HeaderValue::from_static("application/json"),
76167 )
76168 .query(&query)
76169 .build()?;
76170 (crate::pre_hook)(&self.inner, &request);
76171 let result = self.client.execute(request).await;
76172 (crate::post_hook)(&self.inner, &result);
76173 let response = result?;
76174 match response.status().as_u16() {
76175 200u16 => ResponseValue::from_response(response).await,
76176 400u16 => {
76177 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76178 }
76179 401u16 => {
76180 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76181 }
76182 _ => Err(Error::UnexpectedResponse(response)),
76183 }
76184 }
76185 /**Get Simple Earn Flexible Product List (USER_DATA)
76186
76187Get available Simple Earn flexible product list
76188
76189Weight(IP): 150
76190
76191Sends a `GET` request to `/sapi/v1/simple-earn/flexible/list`
76192
76193Arguments:
76194- `asset`
76195- `current`: Current querying page. Start from 1. Default:1
76196- `recv_window`: The value cannot be greater than 60000
76197- `signature`: Signature
76198- `size`: Default:10 Max:100
76199- `timestamp`: UTC timestamp in ms
76200*/
76201 pub async fn simple_earn_flexible_list<'a>(
76202 &'a self,
76203 asset: Option<&'a str>,
76204 current: Option<i32>,
76205 recv_window: Option<i64>,
76206 signature: &'a str,
76207 size: Option<i32>,
76208 timestamp: i64,
76209 ) -> Result<
76210 ResponseValue<types::SimpleEarnFlexibleListResponse>,
76211 Error<types::Error>,
76212 > {
76213 let url = format!("{}/sapi/v1/simple-earn/flexible/list", self.baseurl,);
76214 let mut query = Vec::with_capacity(6usize);
76215 if let Some(v) = &asset {
76216 query.push(("asset", v.to_string()));
76217 }
76218 if let Some(v) = ¤t {
76219 query.push(("current", v.to_string()));
76220 }
76221 if let Some(v) = &recv_window {
76222 query.push(("recvWindow", v.to_string()));
76223 }
76224 query.push(("signature", signature.to_string()));
76225 if let Some(v) = &size {
76226 query.push(("size", v.to_string()));
76227 }
76228 query.push(("timestamp", timestamp.to_string()));
76229 #[allow(unused_mut)]
76230 let mut request = self
76231 .client
76232 .get(url)
76233 .header(
76234 reqwest::header::ACCEPT,
76235 reqwest::header::HeaderValue::from_static("application/json"),
76236 )
76237 .query(&query)
76238 .build()?;
76239 (crate::pre_hook)(&self.inner, &request);
76240 let result = self.client.execute(request).await;
76241 (crate::post_hook)(&self.inner, &result);
76242 let response = result?;
76243 match response.status().as_u16() {
76244 200u16 => ResponseValue::from_response(response).await,
76245 400u16 => {
76246 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76247 }
76248 401u16 => {
76249 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76250 }
76251 _ => Err(Error::UnexpectedResponse(response)),
76252 }
76253 }
76254 /**Get Simple Earn Locked Product List (USER_DATA)
76255
76256Weight(IP): 150
76257
76258Sends a `GET` request to `/sapi/v1/simple-earn/locked/list`
76259
76260Arguments:
76261- `asset`
76262- `current`: Current querying page. Start from 1. Default:1
76263- `recv_window`: The value cannot be greater than 60000
76264- `signature`: Signature
76265- `size`: Default:10 Max:100
76266- `timestamp`: UTC timestamp in ms
76267*/
76268 pub async fn simple_earn_locked_list<'a>(
76269 &'a self,
76270 asset: Option<&'a str>,
76271 current: Option<i32>,
76272 recv_window: Option<i64>,
76273 signature: &'a str,
76274 size: Option<i32>,
76275 timestamp: i64,
76276 ) -> Result<
76277 ResponseValue<types::SimpleEarnLockedListResponse>,
76278 Error<types::Error>,
76279 > {
76280 let url = format!("{}/sapi/v1/simple-earn/locked/list", self.baseurl,);
76281 let mut query = Vec::with_capacity(6usize);
76282 if let Some(v) = &asset {
76283 query.push(("asset", v.to_string()));
76284 }
76285 if let Some(v) = ¤t {
76286 query.push(("current", v.to_string()));
76287 }
76288 if let Some(v) = &recv_window {
76289 query.push(("recvWindow", v.to_string()));
76290 }
76291 query.push(("signature", signature.to_string()));
76292 if let Some(v) = &size {
76293 query.push(("size", v.to_string()));
76294 }
76295 query.push(("timestamp", timestamp.to_string()));
76296 #[allow(unused_mut)]
76297 let mut request = self
76298 .client
76299 .get(url)
76300 .header(
76301 reqwest::header::ACCEPT,
76302 reqwest::header::HeaderValue::from_static("application/json"),
76303 )
76304 .query(&query)
76305 .build()?;
76306 (crate::pre_hook)(&self.inner, &request);
76307 let result = self.client.execute(request).await;
76308 (crate::post_hook)(&self.inner, &result);
76309 let response = result?;
76310 match response.status().as_u16() {
76311 200u16 => ResponseValue::from_response(response).await,
76312 400u16 => {
76313 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76314 }
76315 401u16 => {
76316 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76317 }
76318 _ => Err(Error::UnexpectedResponse(response)),
76319 }
76320 }
76321 /**Subscribe Flexible Product (TRADE)
76322
76323Weight(IP): 1
76324
76325Rate Limit: 1/3s per account
76326
76327Sends a `POST` request to `/sapi/v1/simple-earn/flexible/subscribe`
76328
76329Arguments:
76330- `amount`
76331- `auto_subscribe`: true or false, default true.
76332- `product_id`
76333- `recv_window`: The value cannot be greater than 60000
76334- `signature`: Signature
76335- `source_account`: SPOT,FUND,ALL, default SPOT
76336- `timestamp`: UTC timestamp in ms
76337*/
76338 pub async fn simple_earn_flexible_subscribe<'a>(
76339 &'a self,
76340 amount: f64,
76341 auto_subscribe: Option<bool>,
76342 product_id: &'a str,
76343 recv_window: Option<i64>,
76344 signature: &'a str,
76345 source_account: Option<&'a str>,
76346 timestamp: i64,
76347 ) -> Result<
76348 ResponseValue<types::SimpleEarnFlexibleSubscribeResponse>,
76349 Error<types::Error>,
76350 > {
76351 let url = format!("{}/sapi/v1/simple-earn/flexible/subscribe", self.baseurl,);
76352 let mut query = Vec::with_capacity(7usize);
76353 query.push(("amount", amount.to_string()));
76354 if let Some(v) = &auto_subscribe {
76355 query.push(("autoSubscribe", v.to_string()));
76356 }
76357 query.push(("productId", product_id.to_string()));
76358 if let Some(v) = &recv_window {
76359 query.push(("recvWindow", v.to_string()));
76360 }
76361 query.push(("signature", signature.to_string()));
76362 if let Some(v) = &source_account {
76363 query.push(("sourceAccount", v.to_string()));
76364 }
76365 query.push(("timestamp", timestamp.to_string()));
76366 #[allow(unused_mut)]
76367 let mut request = self
76368 .client
76369 .post(url)
76370 .header(
76371 reqwest::header::ACCEPT,
76372 reqwest::header::HeaderValue::from_static("application/json"),
76373 )
76374 .query(&query)
76375 .build()?;
76376 (crate::pre_hook)(&self.inner, &request);
76377 let result = self.client.execute(request).await;
76378 (crate::post_hook)(&self.inner, &result);
76379 let response = result?;
76380 match response.status().as_u16() {
76381 200u16 => ResponseValue::from_response(response).await,
76382 400u16 => {
76383 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76384 }
76385 401u16 => {
76386 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76387 }
76388 _ => Err(Error::UnexpectedResponse(response)),
76389 }
76390 }
76391 /**Subscribe Locked Product (TRADE)
76392
76393Weight(IP): 1
76394
76395Rate Limit: 1/3s per account
76396
76397Sends a `POST` request to `/sapi/v1/simple-earn/locked/subscribe`
76398
76399Arguments:
76400- `amount`
76401- `auto_subscribe`: true or false, default true.
76402- `project_id`
76403- `recv_window`: The value cannot be greater than 60000
76404- `signature`: Signature
76405- `source_account`: SPOT,FUND,ALL, default SPOT
76406- `timestamp`: UTC timestamp in ms
76407*/
76408 pub async fn simple_earn_locked_subscribe<'a>(
76409 &'a self,
76410 amount: f64,
76411 auto_subscribe: Option<bool>,
76412 project_id: &'a str,
76413 recv_window: Option<i64>,
76414 signature: &'a str,
76415 source_account: Option<&'a str>,
76416 timestamp: i64,
76417 ) -> Result<
76418 ResponseValue<types::SimpleEarnLockedSubscribeResponse>,
76419 Error<types::Error>,
76420 > {
76421 let url = format!("{}/sapi/v1/simple-earn/locked/subscribe", self.baseurl,);
76422 let mut query = Vec::with_capacity(7usize);
76423 query.push(("amount", amount.to_string()));
76424 if let Some(v) = &auto_subscribe {
76425 query.push(("autoSubscribe", v.to_string()));
76426 }
76427 query.push(("projectId", project_id.to_string()));
76428 if let Some(v) = &recv_window {
76429 query.push(("recvWindow", v.to_string()));
76430 }
76431 query.push(("signature", signature.to_string()));
76432 if let Some(v) = &source_account {
76433 query.push(("sourceAccount", v.to_string()));
76434 }
76435 query.push(("timestamp", timestamp.to_string()));
76436 #[allow(unused_mut)]
76437 let mut request = self
76438 .client
76439 .post(url)
76440 .header(
76441 reqwest::header::ACCEPT,
76442 reqwest::header::HeaderValue::from_static("application/json"),
76443 )
76444 .query(&query)
76445 .build()?;
76446 (crate::pre_hook)(&self.inner, &request);
76447 let result = self.client.execute(request).await;
76448 (crate::post_hook)(&self.inner, &result);
76449 let response = result?;
76450 match response.status().as_u16() {
76451 200u16 => ResponseValue::from_response(response).await,
76452 400u16 => {
76453 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76454 }
76455 401u16 => {
76456 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76457 }
76458 _ => Err(Error::UnexpectedResponse(response)),
76459 }
76460 }
76461 /**Redeem Flexible Product (TRADE)
76462
76463Weight(IP): 1
76464
76465Rate Limit: 1/3s per account
76466
76467Sends a `POST` request to `/sapi/v1/simple-earn/flexible/redeem`
76468
76469Arguments:
76470- `amount`: if redeemAll is false, amount is mandatory
76471- `dest_account`: SPOT,FUND,ALL, default SPOT
76472- `product_id`
76473- `recv_window`: The value cannot be greater than 60000
76474- `redeem_all`: true or false, default to false
76475- `signature`: Signature
76476- `timestamp`: UTC timestamp in ms
76477*/
76478 pub async fn simple_earn_flexible_redeem<'a>(
76479 &'a self,
76480 amount: Option<f64>,
76481 dest_account: Option<&'a str>,
76482 product_id: &'a str,
76483 recv_window: Option<i64>,
76484 redeem_all: Option<bool>,
76485 signature: &'a str,
76486 timestamp: i64,
76487 ) -> Result<
76488 ResponseValue<types::SimpleEarnFlexibleRedeemResponse>,
76489 Error<types::Error>,
76490 > {
76491 let url = format!("{}/sapi/v1/simple-earn/flexible/redeem", self.baseurl,);
76492 let mut query = Vec::with_capacity(7usize);
76493 if let Some(v) = &amount {
76494 query.push(("amount", v.to_string()));
76495 }
76496 if let Some(v) = &dest_account {
76497 query.push(("destAccount", v.to_string()));
76498 }
76499 query.push(("productId", product_id.to_string()));
76500 if let Some(v) = &recv_window {
76501 query.push(("recvWindow", v.to_string()));
76502 }
76503 if let Some(v) = &redeem_all {
76504 query.push(("redeemAll", v.to_string()));
76505 }
76506 query.push(("signature", signature.to_string()));
76507 query.push(("timestamp", timestamp.to_string()));
76508 #[allow(unused_mut)]
76509 let mut request = self
76510 .client
76511 .post(url)
76512 .header(
76513 reqwest::header::ACCEPT,
76514 reqwest::header::HeaderValue::from_static("application/json"),
76515 )
76516 .query(&query)
76517 .build()?;
76518 (crate::pre_hook)(&self.inner, &request);
76519 let result = self.client.execute(request).await;
76520 (crate::post_hook)(&self.inner, &result);
76521 let response = result?;
76522 match response.status().as_u16() {
76523 200u16 => ResponseValue::from_response(response).await,
76524 400u16 => {
76525 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76526 }
76527 401u16 => {
76528 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76529 }
76530 _ => Err(Error::UnexpectedResponse(response)),
76531 }
76532 }
76533 /**Redeem Locked Product (TRADE)
76534
76535Weight(IP): 1
76536
76537Rate Limit: 1/3s per account
76538
76539Sends a `POST` request to `/sapi/v1/simple-earn/locked/redeem`
76540
76541Arguments:
76542- `position_id`: 1234
76543- `recv_window`: The value cannot be greater than 60000
76544- `signature`: Signature
76545- `timestamp`: UTC timestamp in ms
76546*/
76547 pub async fn simple_earn_locked_redeem<'a>(
76548 &'a self,
76549 position_id: &'a str,
76550 recv_window: Option<i64>,
76551 signature: &'a str,
76552 timestamp: i64,
76553 ) -> Result<
76554 ResponseValue<types::SimpleEarnLockedRedeemResponse>,
76555 Error<types::Error>,
76556 > {
76557 let url = format!("{}/sapi/v1/simple-earn/locked/redeem", self.baseurl,);
76558 let mut query = Vec::with_capacity(4usize);
76559 query.push(("positionId", position_id.to_string()));
76560 if let Some(v) = &recv_window {
76561 query.push(("recvWindow", v.to_string()));
76562 }
76563 query.push(("signature", signature.to_string()));
76564 query.push(("timestamp", timestamp.to_string()));
76565 #[allow(unused_mut)]
76566 let mut request = self
76567 .client
76568 .post(url)
76569 .header(
76570 reqwest::header::ACCEPT,
76571 reqwest::header::HeaderValue::from_static("application/json"),
76572 )
76573 .query(&query)
76574 .build()?;
76575 (crate::pre_hook)(&self.inner, &request);
76576 let result = self.client.execute(request).await;
76577 (crate::post_hook)(&self.inner, &result);
76578 let response = result?;
76579 match response.status().as_u16() {
76580 200u16 => ResponseValue::from_response(response).await,
76581 400u16 => {
76582 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76583 }
76584 401u16 => {
76585 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76586 }
76587 _ => Err(Error::UnexpectedResponse(response)),
76588 }
76589 }
76590 /**Get Flexible Product Position (USER_DATA)
76591
76592Weight(IP): 150
76593
76594Sends a `GET` request to `/sapi/v1/simple-earn/flexible/position`
76595
76596Arguments:
76597- `asset`
76598- `current`: Current querying page. Start from 1. Default:1
76599- `product_id`
76600- `recv_window`: The value cannot be greater than 60000
76601- `signature`: Signature
76602- `size`: Default:10 Max:100
76603- `timestamp`: UTC timestamp in ms
76604*/
76605 pub async fn simple_earn_flexible_position<'a>(
76606 &'a self,
76607 asset: Option<&'a str>,
76608 current: Option<i32>,
76609 product_id: Option<&'a str>,
76610 recv_window: Option<i64>,
76611 signature: &'a str,
76612 size: Option<i32>,
76613 timestamp: i64,
76614 ) -> Result<
76615 ResponseValue<types::SimpleEarnFlexiblePositionResponse>,
76616 Error<types::Error>,
76617 > {
76618 let url = format!("{}/sapi/v1/simple-earn/flexible/position", self.baseurl,);
76619 let mut query = Vec::with_capacity(7usize);
76620 if let Some(v) = &asset {
76621 query.push(("asset", v.to_string()));
76622 }
76623 if let Some(v) = ¤t {
76624 query.push(("current", v.to_string()));
76625 }
76626 if let Some(v) = &product_id {
76627 query.push(("productId", v.to_string()));
76628 }
76629 if let Some(v) = &recv_window {
76630 query.push(("recvWindow", v.to_string()));
76631 }
76632 query.push(("signature", signature.to_string()));
76633 if let Some(v) = &size {
76634 query.push(("size", v.to_string()));
76635 }
76636 query.push(("timestamp", timestamp.to_string()));
76637 #[allow(unused_mut)]
76638 let mut request = self
76639 .client
76640 .get(url)
76641 .header(
76642 reqwest::header::ACCEPT,
76643 reqwest::header::HeaderValue::from_static("application/json"),
76644 )
76645 .query(&query)
76646 .build()?;
76647 (crate::pre_hook)(&self.inner, &request);
76648 let result = self.client.execute(request).await;
76649 (crate::post_hook)(&self.inner, &result);
76650 let response = result?;
76651 match response.status().as_u16() {
76652 200u16 => ResponseValue::from_response(response).await,
76653 400u16 => {
76654 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76655 }
76656 401u16 => {
76657 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76658 }
76659 _ => Err(Error::UnexpectedResponse(response)),
76660 }
76661 }
76662 /**Get Locked Product Position (USER_DATA)
76663
76664Weight(IP): 150
76665
76666Sends a `GET` request to `/sapi/v1/simple-earn/locked/position`
76667
76668Arguments:
76669- `asset`
76670- `current`: Current querying page. Start from 1. Default:1
76671- `position_id`
76672- `project_id`
76673- `recv_window`: The value cannot be greater than 60000
76674- `signature`: Signature
76675- `size`: Default:10 Max:100
76676- `timestamp`: UTC timestamp in ms
76677*/
76678 pub async fn simple_earn_locked_position<'a>(
76679 &'a self,
76680 asset: Option<&'a str>,
76681 current: Option<i32>,
76682 position_id: Option<&'a str>,
76683 project_id: Option<&'a str>,
76684 recv_window: Option<i64>,
76685 signature: &'a str,
76686 size: Option<i32>,
76687 timestamp: i64,
76688 ) -> Result<
76689 ResponseValue<types::SimpleEarnLockedPositionResponse>,
76690 Error<types::Error>,
76691 > {
76692 let url = format!("{}/sapi/v1/simple-earn/locked/position", self.baseurl,);
76693 let mut query = Vec::with_capacity(8usize);
76694 if let Some(v) = &asset {
76695 query.push(("asset", v.to_string()));
76696 }
76697 if let Some(v) = ¤t {
76698 query.push(("current", v.to_string()));
76699 }
76700 if let Some(v) = &position_id {
76701 query.push(("positionId", v.to_string()));
76702 }
76703 if let Some(v) = &project_id {
76704 query.push(("projectId", v.to_string()));
76705 }
76706 if let Some(v) = &recv_window {
76707 query.push(("recvWindow", v.to_string()));
76708 }
76709 query.push(("signature", signature.to_string()));
76710 if let Some(v) = &size {
76711 query.push(("size", v.to_string()));
76712 }
76713 query.push(("timestamp", timestamp.to_string()));
76714 #[allow(unused_mut)]
76715 let mut request = self
76716 .client
76717 .get(url)
76718 .header(
76719 reqwest::header::ACCEPT,
76720 reqwest::header::HeaderValue::from_static("application/json"),
76721 )
76722 .query(&query)
76723 .build()?;
76724 (crate::pre_hook)(&self.inner, &request);
76725 let result = self.client.execute(request).await;
76726 (crate::post_hook)(&self.inner, &result);
76727 let response = result?;
76728 match response.status().as_u16() {
76729 200u16 => ResponseValue::from_response(response).await,
76730 400u16 => {
76731 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76732 }
76733 401u16 => {
76734 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76735 }
76736 _ => Err(Error::UnexpectedResponse(response)),
76737 }
76738 }
76739 /**Simple Account (USER_DATA)
76740
76741Weight(IP): 150
76742
76743Sends a `GET` request to `/sapi/v1/simple-earn/account`
76744
76745Arguments:
76746- `recv_window`: The value cannot be greater than 60000
76747- `signature`: Signature
76748- `timestamp`: UTC timestamp in ms
76749*/
76750 pub async fn simple_earn_account<'a>(
76751 &'a self,
76752 recv_window: Option<i64>,
76753 signature: &'a str,
76754 timestamp: i64,
76755 ) -> Result<ResponseValue<types::SimpleEarnAccountResponse>, Error<types::Error>> {
76756 let url = format!("{}/sapi/v1/simple-earn/account", self.baseurl,);
76757 let mut query = Vec::with_capacity(3usize);
76758 if let Some(v) = &recv_window {
76759 query.push(("recvWindow", v.to_string()));
76760 }
76761 query.push(("signature", signature.to_string()));
76762 query.push(("timestamp", timestamp.to_string()));
76763 #[allow(unused_mut)]
76764 let mut request = self
76765 .client
76766 .get(url)
76767 .header(
76768 reqwest::header::ACCEPT,
76769 reqwest::header::HeaderValue::from_static("application/json"),
76770 )
76771 .query(&query)
76772 .build()?;
76773 (crate::pre_hook)(&self.inner, &request);
76774 let result = self.client.execute(request).await;
76775 (crate::post_hook)(&self.inner, &result);
76776 let response = result?;
76777 match response.status().as_u16() {
76778 200u16 => ResponseValue::from_response(response).await,
76779 400u16 => {
76780 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76781 }
76782 401u16 => {
76783 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76784 }
76785 _ => Err(Error::UnexpectedResponse(response)),
76786 }
76787 }
76788 /**Get Flexible Subscription Record (USER_DATA)
76789
76790Weight(IP): 150
76791
76792Sends a `GET` request to `/sapi/v1/simple-earn/flexible/history/subscriptionRecord`
76793
76794Arguments:
76795- `asset`
76796- `current`: Current querying page. Start from 1. Default:1
76797- `end_time`: UTC timestamp in ms
76798- `product_id`
76799- `purchase_id`
76800- `recv_window`: The value cannot be greater than 60000
76801- `signature`: Signature
76802- `size`: Default:10 Max:100
76803- `start_time`: UTC timestamp in ms
76804- `timestamp`: UTC timestamp in ms
76805*/
76806 pub async fn simple_earn_flexible_history_subscription_record<'a>(
76807 &'a self,
76808 asset: Option<&'a str>,
76809 current: Option<i32>,
76810 end_time: Option<i64>,
76811 product_id: Option<&'a str>,
76812 purchase_id: Option<&'a str>,
76813 recv_window: Option<i64>,
76814 signature: &'a str,
76815 size: Option<i32>,
76816 start_time: Option<i64>,
76817 timestamp: i64,
76818 ) -> Result<
76819 ResponseValue<types::SimpleEarnFlexibleHistorySubscriptionRecordResponse>,
76820 Error<types::Error>,
76821 > {
76822 let url = format!(
76823 "{}/sapi/v1/simple-earn/flexible/history/subscriptionRecord", self.baseurl,
76824 );
76825 let mut query = Vec::with_capacity(10usize);
76826 if let Some(v) = &asset {
76827 query.push(("asset", v.to_string()));
76828 }
76829 if let Some(v) = ¤t {
76830 query.push(("current", v.to_string()));
76831 }
76832 if let Some(v) = &end_time {
76833 query.push(("endTime", v.to_string()));
76834 }
76835 if let Some(v) = &product_id {
76836 query.push(("productId", v.to_string()));
76837 }
76838 if let Some(v) = &purchase_id {
76839 query.push(("purchaseId", v.to_string()));
76840 }
76841 if let Some(v) = &recv_window {
76842 query.push(("recvWindow", v.to_string()));
76843 }
76844 query.push(("signature", signature.to_string()));
76845 if let Some(v) = &size {
76846 query.push(("size", v.to_string()));
76847 }
76848 if let Some(v) = &start_time {
76849 query.push(("startTime", v.to_string()));
76850 }
76851 query.push(("timestamp", timestamp.to_string()));
76852 #[allow(unused_mut)]
76853 let mut request = self
76854 .client
76855 .get(url)
76856 .header(
76857 reqwest::header::ACCEPT,
76858 reqwest::header::HeaderValue::from_static("application/json"),
76859 )
76860 .query(&query)
76861 .build()?;
76862 (crate::pre_hook)(&self.inner, &request);
76863 let result = self.client.execute(request).await;
76864 (crate::post_hook)(&self.inner, &result);
76865 let response = result?;
76866 match response.status().as_u16() {
76867 200u16 => ResponseValue::from_response(response).await,
76868 400u16 => {
76869 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76870 }
76871 401u16 => {
76872 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76873 }
76874 _ => Err(Error::UnexpectedResponse(response)),
76875 }
76876 }
76877 /**Get Locked Subscription Record (USER_DATA)
76878
76879Weight(IP): 150
76880
76881Sends a `GET` request to `/sapi/v1/simple-earn/locked/history/subscriptionRecord`
76882
76883Arguments:
76884- `asset`
76885- `current`: Current querying page. Start from 1. Default:1
76886- `end_time`: UTC timestamp in ms
76887- `purchase_id`
76888- `recv_window`: The value cannot be greater than 60000
76889- `signature`: Signature
76890- `size`: Default:10 Max:100
76891- `start_time`: UTC timestamp in ms
76892- `timestamp`: UTC timestamp in ms
76893*/
76894 pub async fn simple_earn_locked_history_subscription_record<'a>(
76895 &'a self,
76896 asset: Option<&'a str>,
76897 current: Option<i32>,
76898 end_time: Option<i64>,
76899 purchase_id: Option<&'a str>,
76900 recv_window: Option<i64>,
76901 signature: &'a str,
76902 size: Option<i32>,
76903 start_time: Option<i64>,
76904 timestamp: i64,
76905 ) -> Result<
76906 ResponseValue<types::SimpleEarnLockedHistorySubscriptionRecordResponse>,
76907 Error<types::Error>,
76908 > {
76909 let url = format!(
76910 "{}/sapi/v1/simple-earn/locked/history/subscriptionRecord", self.baseurl,
76911 );
76912 let mut query = Vec::with_capacity(9usize);
76913 if let Some(v) = &asset {
76914 query.push(("asset", v.to_string()));
76915 }
76916 if let Some(v) = ¤t {
76917 query.push(("current", v.to_string()));
76918 }
76919 if let Some(v) = &end_time {
76920 query.push(("endTime", v.to_string()));
76921 }
76922 if let Some(v) = &purchase_id {
76923 query.push(("purchaseId", v.to_string()));
76924 }
76925 if let Some(v) = &recv_window {
76926 query.push(("recvWindow", v.to_string()));
76927 }
76928 query.push(("signature", signature.to_string()));
76929 if let Some(v) = &size {
76930 query.push(("size", v.to_string()));
76931 }
76932 if let Some(v) = &start_time {
76933 query.push(("startTime", v.to_string()));
76934 }
76935 query.push(("timestamp", timestamp.to_string()));
76936 #[allow(unused_mut)]
76937 let mut request = self
76938 .client
76939 .get(url)
76940 .header(
76941 reqwest::header::ACCEPT,
76942 reqwest::header::HeaderValue::from_static("application/json"),
76943 )
76944 .query(&query)
76945 .build()?;
76946 (crate::pre_hook)(&self.inner, &request);
76947 let result = self.client.execute(request).await;
76948 (crate::post_hook)(&self.inner, &result);
76949 let response = result?;
76950 match response.status().as_u16() {
76951 200u16 => ResponseValue::from_response(response).await,
76952 400u16 => {
76953 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76954 }
76955 401u16 => {
76956 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
76957 }
76958 _ => Err(Error::UnexpectedResponse(response)),
76959 }
76960 }
76961 /**Get Flexible Redemption Record (USER_DATA)
76962
76963Weight(IP): 150
76964
76965Sends a `GET` request to `/sapi/v1/simple-earn/flexible/history/redemptionRecord`
76966
76967Arguments:
76968- `asset`
76969- `current`: Current querying page. Start from 1. Default:1
76970- `end_time`: UTC timestamp in ms
76971- `product_id`
76972- `redeem_id`
76973- `size`: Default:10 Max:100
76974- `start_time`: UTC timestamp in ms
76975*/
76976 pub async fn simple_earn_flexible_history_redemption_record<'a>(
76977 &'a self,
76978 asset: Option<&'a str>,
76979 current: Option<i32>,
76980 end_time: Option<i64>,
76981 product_id: Option<&'a str>,
76982 redeem_id: Option<&'a str>,
76983 size: Option<i32>,
76984 start_time: Option<i64>,
76985 ) -> Result<
76986 ResponseValue<types::SimpleEarnFlexibleHistoryRedemptionRecordResponse>,
76987 Error<types::Error>,
76988 > {
76989 let url = format!(
76990 "{}/sapi/v1/simple-earn/flexible/history/redemptionRecord", self.baseurl,
76991 );
76992 let mut query = Vec::with_capacity(7usize);
76993 if let Some(v) = &asset {
76994 query.push(("asset", v.to_string()));
76995 }
76996 if let Some(v) = ¤t {
76997 query.push(("current", v.to_string()));
76998 }
76999 if let Some(v) = &end_time {
77000 query.push(("endTime", v.to_string()));
77001 }
77002 if let Some(v) = &product_id {
77003 query.push(("productId", v.to_string()));
77004 }
77005 if let Some(v) = &redeem_id {
77006 query.push(("redeemId", v.to_string()));
77007 }
77008 if let Some(v) = &size {
77009 query.push(("size", v.to_string()));
77010 }
77011 if let Some(v) = &start_time {
77012 query.push(("startTime", v.to_string()));
77013 }
77014 #[allow(unused_mut)]
77015 let mut request = self
77016 .client
77017 .get(url)
77018 .header(
77019 reqwest::header::ACCEPT,
77020 reqwest::header::HeaderValue::from_static("application/json"),
77021 )
77022 .query(&query)
77023 .build()?;
77024 (crate::pre_hook)(&self.inner, &request);
77025 let result = self.client.execute(request).await;
77026 (crate::post_hook)(&self.inner, &result);
77027 let response = result?;
77028 match response.status().as_u16() {
77029 200u16 => ResponseValue::from_response(response).await,
77030 400u16 => {
77031 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77032 }
77033 401u16 => {
77034 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77035 }
77036 _ => Err(Error::UnexpectedResponse(response)),
77037 }
77038 }
77039 /**Get Locked Redemption Record (USER_DATA)
77040
77041Weight(IP): 150
77042
77043Sends a `GET` request to `/sapi/v1/simple-earn/locked/history/redemptionRecord`
77044
77045Arguments:
77046- `asset`
77047- `current`: Current querying page. Start from 1. Default:1
77048- `end_time`: UTC timestamp in ms
77049- `position_id`
77050- `recv_window`: The value cannot be greater than 60000
77051- `redeem_id`
77052- `signature`: Signature
77053- `size`: Default:10 Max:100
77054- `start_time`: UTC timestamp in ms
77055- `timestamp`: UTC timestamp in ms
77056*/
77057 pub async fn simple_earn_locked_history_redemption_record<'a>(
77058 &'a self,
77059 asset: Option<&'a str>,
77060 current: Option<i32>,
77061 end_time: Option<i64>,
77062 position_id: Option<&'a str>,
77063 recv_window: Option<i64>,
77064 redeem_id: Option<&'a str>,
77065 signature: &'a str,
77066 size: Option<i32>,
77067 start_time: Option<i64>,
77068 timestamp: i64,
77069 ) -> Result<
77070 ResponseValue<types::SimpleEarnLockedHistoryRedemptionRecordResponse>,
77071 Error<types::Error>,
77072 > {
77073 let url = format!(
77074 "{}/sapi/v1/simple-earn/locked/history/redemptionRecord", self.baseurl,
77075 );
77076 let mut query = Vec::with_capacity(10usize);
77077 if let Some(v) = &asset {
77078 query.push(("asset", v.to_string()));
77079 }
77080 if let Some(v) = ¤t {
77081 query.push(("current", v.to_string()));
77082 }
77083 if let Some(v) = &end_time {
77084 query.push(("endTime", v.to_string()));
77085 }
77086 if let Some(v) = &position_id {
77087 query.push(("positionId", v.to_string()));
77088 }
77089 if let Some(v) = &recv_window {
77090 query.push(("recvWindow", v.to_string()));
77091 }
77092 if let Some(v) = &redeem_id {
77093 query.push(("redeemId", v.to_string()));
77094 }
77095 query.push(("signature", signature.to_string()));
77096 if let Some(v) = &size {
77097 query.push(("size", v.to_string()));
77098 }
77099 if let Some(v) = &start_time {
77100 query.push(("startTime", v.to_string()));
77101 }
77102 query.push(("timestamp", timestamp.to_string()));
77103 #[allow(unused_mut)]
77104 let mut request = self
77105 .client
77106 .get(url)
77107 .header(
77108 reqwest::header::ACCEPT,
77109 reqwest::header::HeaderValue::from_static("application/json"),
77110 )
77111 .query(&query)
77112 .build()?;
77113 (crate::pre_hook)(&self.inner, &request);
77114 let result = self.client.execute(request).await;
77115 (crate::post_hook)(&self.inner, &result);
77116 let response = result?;
77117 match response.status().as_u16() {
77118 200u16 => ResponseValue::from_response(response).await,
77119 400u16 => {
77120 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77121 }
77122 401u16 => {
77123 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77124 }
77125 _ => Err(Error::UnexpectedResponse(response)),
77126 }
77127 }
77128 /**Get Flexible Rewards History (USER_DATA)
77129
77130Weight(IP): 150
77131
77132Sends a `GET` request to `/sapi/v1/simple-earn/flexible/history/rewardsRecord`
77133
77134Arguments:
77135- `asset`
77136- `end_time`: UTC timestamp in ms
77137- `product_id`
77138- `start_time`: UTC timestamp in ms
77139- `type_`: "BONUS", "REALTIME", "REWARDS"
77140*/
77141 pub async fn simple_earn_flexible_history_rewards_record<'a>(
77142 &'a self,
77143 asset: Option<&'a str>,
77144 end_time: Option<i64>,
77145 product_id: Option<&'a str>,
77146 start_time: Option<i64>,
77147 type_: &'a str,
77148 ) -> Result<
77149 ResponseValue<types::SimpleEarnFlexibleHistoryRewardsRecordResponse>,
77150 Error<types::Error>,
77151 > {
77152 let url = format!(
77153 "{}/sapi/v1/simple-earn/flexible/history/rewardsRecord", self.baseurl,
77154 );
77155 let mut query = Vec::with_capacity(5usize);
77156 if let Some(v) = &asset {
77157 query.push(("asset", v.to_string()));
77158 }
77159 if let Some(v) = &end_time {
77160 query.push(("endTime", v.to_string()));
77161 }
77162 if let Some(v) = &product_id {
77163 query.push(("productId", v.to_string()));
77164 }
77165 if let Some(v) = &start_time {
77166 query.push(("startTime", v.to_string()));
77167 }
77168 query.push(("type", type_.to_string()));
77169 #[allow(unused_mut)]
77170 let mut request = self
77171 .client
77172 .get(url)
77173 .header(
77174 reqwest::header::ACCEPT,
77175 reqwest::header::HeaderValue::from_static("application/json"),
77176 )
77177 .query(&query)
77178 .build()?;
77179 (crate::pre_hook)(&self.inner, &request);
77180 let result = self.client.execute(request).await;
77181 (crate::post_hook)(&self.inner, &result);
77182 let response = result?;
77183 match response.status().as_u16() {
77184 200u16 => ResponseValue::from_response(response).await,
77185 400u16 => {
77186 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77187 }
77188 401u16 => {
77189 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77190 }
77191 _ => Err(Error::UnexpectedResponse(response)),
77192 }
77193 }
77194 /**Get Locked Rewards History (USER_DATA)
77195
77196Weight(IP): 150
77197
77198Sends a `GET` request to `/sapi/v1/simple-earn/locked/history/rewardsRecord`
77199
77200Arguments:
77201- `asset`
77202- `end_time`: UTC timestamp in ms
77203- `position_id`
77204- `recv_window`: The value cannot be greater than 60000
77205- `signature`: Signature
77206- `size`: Default:10 Max:100
77207- `start_time`: UTC timestamp in ms
77208- `timestamp`: UTC timestamp in ms
77209*/
77210 pub async fn simple_earn_locked_history_rewards_record<'a>(
77211 &'a self,
77212 asset: Option<&'a str>,
77213 end_time: Option<i64>,
77214 position_id: Option<&'a str>,
77215 recv_window: Option<i64>,
77216 signature: &'a str,
77217 size: Option<i32>,
77218 start_time: Option<i64>,
77219 timestamp: i64,
77220 ) -> Result<
77221 ResponseValue<types::SimpleEarnLockedHistoryRewardsRecordResponse>,
77222 Error<types::Error>,
77223 > {
77224 let url = format!(
77225 "{}/sapi/v1/simple-earn/locked/history/rewardsRecord", self.baseurl,
77226 );
77227 let mut query = Vec::with_capacity(8usize);
77228 if let Some(v) = &asset {
77229 query.push(("asset", v.to_string()));
77230 }
77231 if let Some(v) = &end_time {
77232 query.push(("endTime", v.to_string()));
77233 }
77234 if let Some(v) = &position_id {
77235 query.push(("positionId", v.to_string()));
77236 }
77237 if let Some(v) = &recv_window {
77238 query.push(("recvWindow", v.to_string()));
77239 }
77240 query.push(("signature", signature.to_string()));
77241 if let Some(v) = &size {
77242 query.push(("size", v.to_string()));
77243 }
77244 if let Some(v) = &start_time {
77245 query.push(("startTime", v.to_string()));
77246 }
77247 query.push(("timestamp", timestamp.to_string()));
77248 #[allow(unused_mut)]
77249 let mut request = self
77250 .client
77251 .get(url)
77252 .header(
77253 reqwest::header::ACCEPT,
77254 reqwest::header::HeaderValue::from_static("application/json"),
77255 )
77256 .query(&query)
77257 .build()?;
77258 (crate::pre_hook)(&self.inner, &request);
77259 let result = self.client.execute(request).await;
77260 (crate::post_hook)(&self.inner, &result);
77261 let response = result?;
77262 match response.status().as_u16() {
77263 200u16 => ResponseValue::from_response(response).await,
77264 400u16 => {
77265 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77266 }
77267 401u16 => {
77268 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77269 }
77270 _ => Err(Error::UnexpectedResponse(response)),
77271 }
77272 }
77273 /**Set Flexible Auto Subscribe (USER_DATA)
77274
77275Weight(IP): 150
77276
77277Sends a `POST` request to `/sapi/v1/simple-earn/flexible/setAutoSubscribe`
77278
77279Arguments:
77280- `auto_subscribe`: true or false
77281- `product_id`
77282- `recv_window`: The value cannot be greater than 60000
77283- `signature`: Signature
77284- `timestamp`: UTC timestamp in ms
77285*/
77286 pub async fn simple_earn_flexible_set_auto_subscribe<'a>(
77287 &'a self,
77288 auto_subscribe: bool,
77289 product_id: &'a str,
77290 recv_window: Option<i64>,
77291 signature: &'a str,
77292 timestamp: i64,
77293 ) -> Result<
77294 ResponseValue<types::SimpleEarnFlexibleSetAutoSubscribeResponse>,
77295 Error<types::Error>,
77296 > {
77297 let url = format!(
77298 "{}/sapi/v1/simple-earn/flexible/setAutoSubscribe", self.baseurl,
77299 );
77300 let mut query = Vec::with_capacity(5usize);
77301 query.push(("autoSubscribe", auto_subscribe.to_string()));
77302 query.push(("productId", product_id.to_string()));
77303 if let Some(v) = &recv_window {
77304 query.push(("recvWindow", v.to_string()));
77305 }
77306 query.push(("signature", signature.to_string()));
77307 query.push(("timestamp", timestamp.to_string()));
77308 #[allow(unused_mut)]
77309 let mut request = self
77310 .client
77311 .post(url)
77312 .header(
77313 reqwest::header::ACCEPT,
77314 reqwest::header::HeaderValue::from_static("application/json"),
77315 )
77316 .query(&query)
77317 .build()?;
77318 (crate::pre_hook)(&self.inner, &request);
77319 let result = self.client.execute(request).await;
77320 (crate::post_hook)(&self.inner, &result);
77321 let response = result?;
77322 match response.status().as_u16() {
77323 200u16 => ResponseValue::from_response(response).await,
77324 400u16 => {
77325 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77326 }
77327 401u16 => {
77328 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77329 }
77330 _ => Err(Error::UnexpectedResponse(response)),
77331 }
77332 }
77333 /**Set Locked Auto Subscribe (USER_DATA)
77334
77335Weight(IP): 150
77336
77337Sends a `POST` request to `/sapi/v1/simple-earn/locked/setAutoSubscribe`
77338
77339Arguments:
77340- `auto_subscribe`: true or false
77341- `position_id`
77342- `recv_window`: The value cannot be greater than 60000
77343- `signature`: Signature
77344- `timestamp`: UTC timestamp in ms
77345*/
77346 pub async fn simple_earn_locked_set_auto_subscribe<'a>(
77347 &'a self,
77348 auto_subscribe: bool,
77349 position_id: &'a str,
77350 recv_window: Option<i64>,
77351 signature: &'a str,
77352 timestamp: i64,
77353 ) -> Result<
77354 ResponseValue<types::SimpleEarnLockedSetAutoSubscribeResponse>,
77355 Error<types::Error>,
77356 > {
77357 let url = format!(
77358 "{}/sapi/v1/simple-earn/locked/setAutoSubscribe", self.baseurl,
77359 );
77360 let mut query = Vec::with_capacity(5usize);
77361 query.push(("autoSubscribe", auto_subscribe.to_string()));
77362 query.push(("positionId", position_id.to_string()));
77363 if let Some(v) = &recv_window {
77364 query.push(("recvWindow", v.to_string()));
77365 }
77366 query.push(("signature", signature.to_string()));
77367 query.push(("timestamp", timestamp.to_string()));
77368 #[allow(unused_mut)]
77369 let mut request = self
77370 .client
77371 .post(url)
77372 .header(
77373 reqwest::header::ACCEPT,
77374 reqwest::header::HeaderValue::from_static("application/json"),
77375 )
77376 .query(&query)
77377 .build()?;
77378 (crate::pre_hook)(&self.inner, &request);
77379 let result = self.client.execute(request).await;
77380 (crate::post_hook)(&self.inner, &result);
77381 let response = result?;
77382 match response.status().as_u16() {
77383 200u16 => ResponseValue::from_response(response).await,
77384 400u16 => {
77385 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77386 }
77387 401u16 => {
77388 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77389 }
77390 _ => Err(Error::UnexpectedResponse(response)),
77391 }
77392 }
77393 /**Get Flexible Personal Left Quota (USER_DATA)
77394
77395Weight(IP): 150
77396
77397Sends a `GET` request to `/sapi/v1/simple-earn/flexible/personalLeftQuota`
77398
77399Arguments:
77400- `product_id`
77401- `recv_window`: The value cannot be greater than 60000
77402- `signature`: Signature
77403- `timestamp`: UTC timestamp in ms
77404*/
77405 pub async fn simple_earn_flexible_personal_left_quota<'a>(
77406 &'a self,
77407 product_id: &'a str,
77408 recv_window: Option<i64>,
77409 signature: &'a str,
77410 timestamp: i64,
77411 ) -> Result<
77412 ResponseValue<types::SimpleEarnFlexiblePersonalLeftQuotaResponse>,
77413 Error<types::Error>,
77414 > {
77415 let url = format!(
77416 "{}/sapi/v1/simple-earn/flexible/personalLeftQuota", self.baseurl,
77417 );
77418 let mut query = Vec::with_capacity(4usize);
77419 query.push(("productId", product_id.to_string()));
77420 if let Some(v) = &recv_window {
77421 query.push(("recvWindow", v.to_string()));
77422 }
77423 query.push(("signature", signature.to_string()));
77424 query.push(("timestamp", timestamp.to_string()));
77425 #[allow(unused_mut)]
77426 let mut request = self
77427 .client
77428 .get(url)
77429 .header(
77430 reqwest::header::ACCEPT,
77431 reqwest::header::HeaderValue::from_static("application/json"),
77432 )
77433 .query(&query)
77434 .build()?;
77435 (crate::pre_hook)(&self.inner, &request);
77436 let result = self.client.execute(request).await;
77437 (crate::post_hook)(&self.inner, &result);
77438 let response = result?;
77439 match response.status().as_u16() {
77440 200u16 => ResponseValue::from_response(response).await,
77441 400u16 => {
77442 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77443 }
77444 401u16 => {
77445 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77446 }
77447 _ => Err(Error::UnexpectedResponse(response)),
77448 }
77449 }
77450 /**Get Locked Personal Left Quota (USER_DATA)
77451
77452Weight(IP): 150
77453
77454Sends a `GET` request to `/sapi/v1/simple-earn/locked/personalLeftQuota`
77455
77456Arguments:
77457- `project_id`
77458- `recv_window`: The value cannot be greater than 60000
77459- `signature`: Signature
77460- `timestamp`: UTC timestamp in ms
77461*/
77462 pub async fn simple_earn_locked_personal_left_quota<'a>(
77463 &'a self,
77464 project_id: &'a str,
77465 recv_window: Option<i64>,
77466 signature: &'a str,
77467 timestamp: i64,
77468 ) -> Result<
77469 ResponseValue<types::SimpleEarnLockedPersonalLeftQuotaResponse>,
77470 Error<types::Error>,
77471 > {
77472 let url = format!(
77473 "{}/sapi/v1/simple-earn/locked/personalLeftQuota", self.baseurl,
77474 );
77475 let mut query = Vec::with_capacity(4usize);
77476 query.push(("projectId", project_id.to_string()));
77477 if let Some(v) = &recv_window {
77478 query.push(("recvWindow", v.to_string()));
77479 }
77480 query.push(("signature", signature.to_string()));
77481 query.push(("timestamp", timestamp.to_string()));
77482 #[allow(unused_mut)]
77483 let mut request = self
77484 .client
77485 .get(url)
77486 .header(
77487 reqwest::header::ACCEPT,
77488 reqwest::header::HeaderValue::from_static("application/json"),
77489 )
77490 .query(&query)
77491 .build()?;
77492 (crate::pre_hook)(&self.inner, &request);
77493 let result = self.client.execute(request).await;
77494 (crate::post_hook)(&self.inner, &result);
77495 let response = result?;
77496 match response.status().as_u16() {
77497 200u16 => ResponseValue::from_response(response).await,
77498 400u16 => {
77499 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77500 }
77501 401u16 => {
77502 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77503 }
77504 _ => Err(Error::UnexpectedResponse(response)),
77505 }
77506 }
77507 /**Get Flexible Subscription Preview (USER_DATA)
77508
77509Weight(IP): 150
77510
77511Sends a `GET` request to `/sapi/v1/simple-earn/flexible/subscriptionPreview`
77512
77513Arguments:
77514- `amount`
77515- `product_id`
77516- `recv_window`: The value cannot be greater than 60000
77517- `signature`: Signature
77518- `timestamp`: UTC timestamp in ms
77519*/
77520 pub async fn simple_earn_flexible_subscription_preview<'a>(
77521 &'a self,
77522 amount: f64,
77523 product_id: &'a str,
77524 recv_window: Option<i64>,
77525 signature: &'a str,
77526 timestamp: i64,
77527 ) -> Result<
77528 ResponseValue<types::SimpleEarnFlexibleSubscriptionPreviewResponse>,
77529 Error<types::Error>,
77530 > {
77531 let url = format!(
77532 "{}/sapi/v1/simple-earn/flexible/subscriptionPreview", self.baseurl,
77533 );
77534 let mut query = Vec::with_capacity(5usize);
77535 query.push(("amount", amount.to_string()));
77536 query.push(("productId", product_id.to_string()));
77537 if let Some(v) = &recv_window {
77538 query.push(("recvWindow", v.to_string()));
77539 }
77540 query.push(("signature", signature.to_string()));
77541 query.push(("timestamp", timestamp.to_string()));
77542 #[allow(unused_mut)]
77543 let mut request = self
77544 .client
77545 .get(url)
77546 .header(
77547 reqwest::header::ACCEPT,
77548 reqwest::header::HeaderValue::from_static("application/json"),
77549 )
77550 .query(&query)
77551 .build()?;
77552 (crate::pre_hook)(&self.inner, &request);
77553 let result = self.client.execute(request).await;
77554 (crate::post_hook)(&self.inner, &result);
77555 let response = result?;
77556 match response.status().as_u16() {
77557 200u16 => ResponseValue::from_response(response).await,
77558 400u16 => {
77559 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77560 }
77561 401u16 => {
77562 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77563 }
77564 _ => Err(Error::UnexpectedResponse(response)),
77565 }
77566 }
77567 /**Get Locked Subscription Preview (USER_DATA)
77568
77569Weight(IP): 150
77570
77571Sends a `GET` request to `/sapi/v1/simple-earn/locked/subscriptionPreview`
77572
77573Arguments:
77574- `amount`
77575- `auto_subscribe`: true or false, default true.
77576- `project_id`
77577- `recv_window`: The value cannot be greater than 60000
77578- `signature`: Signature
77579- `timestamp`: UTC timestamp in ms
77580*/
77581 pub async fn simple_earn_locked_subscription_preview<'a>(
77582 &'a self,
77583 amount: f64,
77584 auto_subscribe: Option<bool>,
77585 project_id: &'a str,
77586 recv_window: Option<i64>,
77587 signature: &'a str,
77588 timestamp: i64,
77589 ) -> Result<
77590 ResponseValue<Vec<types::SimpleEarnLockedSubscriptionPreviewResponseItem>>,
77591 Error<types::Error>,
77592 > {
77593 let url = format!(
77594 "{}/sapi/v1/simple-earn/locked/subscriptionPreview", self.baseurl,
77595 );
77596 let mut query = Vec::with_capacity(6usize);
77597 query.push(("amount", amount.to_string()));
77598 if let Some(v) = &auto_subscribe {
77599 query.push(("autoSubscribe", v.to_string()));
77600 }
77601 query.push(("projectId", project_id.to_string()));
77602 if let Some(v) = &recv_window {
77603 query.push(("recvWindow", v.to_string()));
77604 }
77605 query.push(("signature", signature.to_string()));
77606 query.push(("timestamp", timestamp.to_string()));
77607 #[allow(unused_mut)]
77608 let mut request = self
77609 .client
77610 .get(url)
77611 .header(
77612 reqwest::header::ACCEPT,
77613 reqwest::header::HeaderValue::from_static("application/json"),
77614 )
77615 .query(&query)
77616 .build()?;
77617 (crate::pre_hook)(&self.inner, &request);
77618 let result = self.client.execute(request).await;
77619 (crate::post_hook)(&self.inner, &result);
77620 let response = result?;
77621 match response.status().as_u16() {
77622 200u16 => ResponseValue::from_response(response).await,
77623 400u16 => {
77624 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77625 }
77626 401u16 => {
77627 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77628 }
77629 _ => Err(Error::UnexpectedResponse(response)),
77630 }
77631 }
77632 /**Get Rate History (USER_DATA)
77633
77634Weight(IP): 150
77635
77636Sends a `GET` request to `/sapi/v1/simple-earn/flexible/history/rateHistory`
77637
77638Arguments:
77639- `current`: Current querying page. Start from 1. Default:1
77640- `end_time`: UTC timestamp in ms
77641- `product_id`
77642- `recv_window`: The value cannot be greater than 60000
77643- `signature`: Signature
77644- `size`: Default:10 Max:100
77645- `start_time`: UTC timestamp in ms
77646- `timestamp`: UTC timestamp in ms
77647*/
77648 pub async fn simple_earn_flexible_history_rate_history<'a>(
77649 &'a self,
77650 current: Option<i32>,
77651 end_time: Option<i64>,
77652 product_id: &'a str,
77653 recv_window: Option<i64>,
77654 signature: &'a str,
77655 size: Option<i32>,
77656 start_time: Option<i64>,
77657 timestamp: i64,
77658 ) -> Result<
77659 ResponseValue<types::SimpleEarnFlexibleHistoryRateHistoryResponse>,
77660 Error<types::Error>,
77661 > {
77662 let url = format!(
77663 "{}/sapi/v1/simple-earn/flexible/history/rateHistory", self.baseurl,
77664 );
77665 let mut query = Vec::with_capacity(8usize);
77666 if let Some(v) = ¤t {
77667 query.push(("current", v.to_string()));
77668 }
77669 if let Some(v) = &end_time {
77670 query.push(("endTime", v.to_string()));
77671 }
77672 query.push(("productId", product_id.to_string()));
77673 if let Some(v) = &recv_window {
77674 query.push(("recvWindow", v.to_string()));
77675 }
77676 query.push(("signature", signature.to_string()));
77677 if let Some(v) = &size {
77678 query.push(("size", v.to_string()));
77679 }
77680 if let Some(v) = &start_time {
77681 query.push(("startTime", v.to_string()));
77682 }
77683 query.push(("timestamp", timestamp.to_string()));
77684 #[allow(unused_mut)]
77685 let mut request = self
77686 .client
77687 .get(url)
77688 .header(
77689 reqwest::header::ACCEPT,
77690 reqwest::header::HeaderValue::from_static("application/json"),
77691 )
77692 .query(&query)
77693 .build()?;
77694 (crate::pre_hook)(&self.inner, &request);
77695 let result = self.client.execute(request).await;
77696 (crate::post_hook)(&self.inner, &result);
77697 let response = result?;
77698 match response.status().as_u16() {
77699 200u16 => ResponseValue::from_response(response).await,
77700 400u16 => {
77701 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77702 }
77703 401u16 => {
77704 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77705 }
77706 _ => Err(Error::UnexpectedResponse(response)),
77707 }
77708 }
77709 /**Get Collateral Record (USER_DATA)
77710
77711Weight(IP): 150
77712
77713Sends a `GET` request to `/sapi/v1/simple-earn/flexible/history/collateralRecord`
77714
77715Arguments:
77716- `current`: Current querying page. Start from 1. Default:1
77717- `end_time`: UTC timestamp in ms
77718- `product_id`
77719- `recv_window`: The value cannot be greater than 60000
77720- `signature`: Signature
77721- `size`: Default:10 Max:100
77722- `start_time`: UTC timestamp in ms
77723- `timestamp`: UTC timestamp in ms
77724*/
77725 pub async fn simple_earn_flexible_history_collateral_record<'a>(
77726 &'a self,
77727 current: Option<i32>,
77728 end_time: Option<i64>,
77729 product_id: Option<&'a str>,
77730 recv_window: Option<i64>,
77731 signature: &'a str,
77732 size: Option<i32>,
77733 start_time: Option<i64>,
77734 timestamp: i64,
77735 ) -> Result<
77736 ResponseValue<types::SimpleEarnFlexibleHistoryCollateralRecordResponse>,
77737 Error<types::Error>,
77738 > {
77739 let url = format!(
77740 "{}/sapi/v1/simple-earn/flexible/history/collateralRecord", self.baseurl,
77741 );
77742 let mut query = Vec::with_capacity(8usize);
77743 if let Some(v) = ¤t {
77744 query.push(("current", v.to_string()));
77745 }
77746 if let Some(v) = &end_time {
77747 query.push(("endTime", v.to_string()));
77748 }
77749 if let Some(v) = &product_id {
77750 query.push(("productId", v.to_string()));
77751 }
77752 if let Some(v) = &recv_window {
77753 query.push(("recvWindow", v.to_string()));
77754 }
77755 query.push(("signature", signature.to_string()));
77756 if let Some(v) = &size {
77757 query.push(("size", v.to_string()));
77758 }
77759 if let Some(v) = &start_time {
77760 query.push(("startTime", v.to_string()));
77761 }
77762 query.push(("timestamp", timestamp.to_string()));
77763 #[allow(unused_mut)]
77764 let mut request = self
77765 .client
77766 .get(url)
77767 .header(
77768 reqwest::header::ACCEPT,
77769 reqwest::header::HeaderValue::from_static("application/json"),
77770 )
77771 .query(&query)
77772 .build()?;
77773 (crate::pre_hook)(&self.inner, &request);
77774 let result = self.client.execute(request).await;
77775 (crate::post_hook)(&self.inner, &result);
77776 let response = result?;
77777 match response.status().as_u16() {
77778 200u16 => ResponseValue::from_response(response).await,
77779 400u16 => {
77780 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77781 }
77782 401u16 => {
77783 Err(Error::ErrorResponse(ResponseValue::from_response(response).await?))
77784 }
77785 _ => Err(Error::UnexpectedResponse(response)),
77786 }
77787 }
77788}
77789/// Items consumers will typically use such as the Client.
77790pub mod prelude {
77791 #[allow(unused_imports)]
77792 pub use super::Client;
77793}