crypticorn 2.4.7__py3-none-any.whl → 2.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- crypticorn/cli/init.py +7 -4
- crypticorn/common/__init__.py +1 -0
- crypticorn/common/auth.py +7 -3
- crypticorn/common/errors.py +21 -0
- crypticorn/common/exceptions.py +83 -0
- crypticorn/common/utils.py +11 -4
- crypticorn/klines/client/__init__.py +10 -3
- crypticorn/klines/client/api/__init__.py +1 -0
- crypticorn/klines/client/api/change_in_timeframe_api.py +331 -0
- crypticorn/klines/client/api/funding_rates_api.py +13 -13
- crypticorn/klines/client/api/health_check_api.py +8 -8
- crypticorn/klines/client/api/ohlcv_data_api.py +38 -26
- crypticorn/klines/client/api/symbols_api.py +26 -20
- crypticorn/klines/client/api/udf_api.py +229 -229
- crypticorn/klines/client/api_client.py +8 -5
- crypticorn/klines/client/configuration.py +80 -37
- crypticorn/klines/client/models/__init__.py +9 -3
- crypticorn/klines/client/models/base_response_list_change_in_timeframe_response.py +123 -0
- crypticorn/klines/client/models/change_in_timeframe_response.py +86 -0
- crypticorn/klines/client/models/market_type.py +35 -0
- crypticorn/klines/client/models/response_get_udf_history.py +198 -0
- crypticorn/klines/client/rest.py +111 -159
- crypticorn/klines/main.py +32 -22
- crypticorn/metrics/main.py +39 -40
- crypticorn/pay/client/__init__.py +0 -3
- crypticorn/pay/client/api/now_payments_api.py +1 -53
- crypticorn/pay/client/models/__init__.py +0 -3
- crypticorn/pay/client/models/payment.py +3 -3
- crypticorn/pay/client/models/scope.py +6 -1
- crypticorn/trade/client/__init__.py +8 -6
- crypticorn/trade/client/api/__init__.py +0 -1
- crypticorn/trade/client/api/api_keys_api.py +167 -273
- crypticorn/trade/client/api/bots_api.py +140 -226
- crypticorn/trade/client/api/exchanges_api.py +31 -51
- crypticorn/trade/client/api/futures_trading_panel_api.py +169 -272
- crypticorn/trade/client/api/notifications_api.py +200 -323
- crypticorn/trade/client/api/orders_api.py +40 -60
- crypticorn/trade/client/api/status_api.py +31 -49
- crypticorn/trade/client/api/strategies_api.py +137 -223
- crypticorn/trade/client/api/trading_actions_api.py +106 -170
- crypticorn/trade/client/api_client.py +111 -153
- crypticorn/trade/client/api_response.py +2 -3
- crypticorn/trade/client/configuration.py +128 -115
- crypticorn/trade/client/exceptions.py +25 -21
- crypticorn/trade/client/models/__init__.py +8 -6
- crypticorn/trade/client/models/action_model.py +108 -54
- crypticorn/trade/client/models/api_error_identifier.py +76 -72
- crypticorn/trade/client/models/api_error_level.py +9 -11
- crypticorn/trade/client/models/api_error_type.py +9 -11
- crypticorn/trade/client/models/bot_model.py +57 -36
- crypticorn/trade/client/models/bot_status.py +9 -11
- crypticorn/trade/client/models/exchange.py +7 -9
- crypticorn/trade/client/models/exchange_key_model.py +43 -32
- crypticorn/trade/client/models/execution_ids.py +18 -18
- crypticorn/trade/client/models/futures_balance.py +43 -27
- crypticorn/trade/client/models/futures_trading_action.py +102 -50
- crypticorn/trade/client/models/http_validation_error.py +19 -15
- crypticorn/trade/client/models/margin_mode.py +7 -9
- crypticorn/trade/client/models/market_type.py +7 -9
- crypticorn/trade/client/models/notification_model.py +52 -32
- crypticorn/trade/client/models/order_model.py +112 -72
- crypticorn/trade/client/models/order_status.py +10 -12
- crypticorn/trade/client/models/post_futures_action.py +20 -16
- crypticorn/trade/client/models/strategy_exchange_info.py +15 -16
- crypticorn/trade/client/models/strategy_model_input.py +61 -33
- crypticorn/trade/client/models/strategy_model_output.py +61 -33
- crypticorn/trade/client/models/tpsl.py +39 -25
- crypticorn/trade/client/models/trading_action_type.py +9 -11
- crypticorn/trade/client/models/validation_error.py +24 -18
- crypticorn/trade/client/models/validation_error_loc_inner.py +37 -16
- crypticorn/trade/client/rest.py +23 -38
- {crypticorn-2.4.7.dist-info → crypticorn-2.5.0.dist-info}/METADATA +1 -1
- {crypticorn-2.4.7.dist-info → crypticorn-2.5.0.dist-info}/RECORD +76 -70
- {crypticorn-2.4.7.dist-info → crypticorn-2.5.0.dist-info}/WHEEL +1 -1
- {crypticorn-2.4.7.dist-info → crypticorn-2.5.0.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.4.7.dist-info → crypticorn-2.5.0.dist-info}/top_level.txt +0 -0
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Trading API
|
5
5
|
|
6
|
-
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -24,15 +24,19 @@ from crypticorn.trade.client.models.bot_status import BotStatus
|
|
24
24
|
from typing import Optional, Set
|
25
25
|
from typing_extensions import Self
|
26
26
|
|
27
|
+
|
27
28
|
class BotModel(BaseModel):
|
28
29
|
"""
|
29
30
|
BotModel
|
30
|
-
"""
|
31
|
+
""" # noqa: E501
|
32
|
+
|
31
33
|
created_at: Optional[StrictInt] = None
|
32
34
|
updated_at: Optional[StrictInt] = None
|
33
35
|
id: Optional[StrictStr] = None
|
34
36
|
name: StrictStr = Field(description="Name of the bot")
|
35
|
-
strategy_id: StrictStr = Field(
|
37
|
+
strategy_id: StrictStr = Field(
|
38
|
+
description="UID for the trading strategy used by the bot"
|
39
|
+
)
|
36
40
|
api_key_id: StrictStr = Field(description="UID for the API key")
|
37
41
|
allocation: StrictInt = Field(description="Initial allocation for the bot")
|
38
42
|
status: BotStatus = Field(description="Status of the bot")
|
@@ -40,7 +44,20 @@ class BotModel(BaseModel):
|
|
40
44
|
user_id: Optional[StrictStr] = None
|
41
45
|
current_allocation: Optional[Union[StrictFloat, StrictInt]] = None
|
42
46
|
current_exposure: Optional[Union[StrictFloat, StrictInt]] = None
|
43
|
-
__properties: ClassVar[List[str]] = [
|
47
|
+
__properties: ClassVar[List[str]] = [
|
48
|
+
"created_at",
|
49
|
+
"updated_at",
|
50
|
+
"id",
|
51
|
+
"name",
|
52
|
+
"strategy_id",
|
53
|
+
"api_key_id",
|
54
|
+
"allocation",
|
55
|
+
"status",
|
56
|
+
"status_code",
|
57
|
+
"user_id",
|
58
|
+
"current_allocation",
|
59
|
+
"current_exposure",
|
60
|
+
]
|
44
61
|
|
45
62
|
model_config = ConfigDict(
|
46
63
|
populate_by_name=True,
|
@@ -48,7 +65,6 @@ class BotModel(BaseModel):
|
|
48
65
|
protected_namespaces=(),
|
49
66
|
)
|
50
67
|
|
51
|
-
|
52
68
|
def to_str(self) -> str:
|
53
69
|
"""Returns the string representation of the model using alias"""
|
54
70
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -73,8 +89,7 @@ class BotModel(BaseModel):
|
|
73
89
|
were set at model initialization. Other fields with value `None`
|
74
90
|
are ignored.
|
75
91
|
"""
|
76
|
-
excluded_fields: Set[str] = set([
|
77
|
-
])
|
92
|
+
excluded_fields: Set[str] = set([])
|
78
93
|
|
79
94
|
_dict = self.model_dump(
|
80
95
|
by_alias=True,
|
@@ -84,37 +99,43 @@ class BotModel(BaseModel):
|
|
84
99
|
# set to None if created_at (nullable) is None
|
85
100
|
# and model_fields_set contains the field
|
86
101
|
if self.created_at is None and "created_at" in self.model_fields_set:
|
87
|
-
_dict[
|
102
|
+
_dict["created_at"] = None
|
88
103
|
|
89
104
|
# set to None if updated_at (nullable) is None
|
90
105
|
# and model_fields_set contains the field
|
91
106
|
if self.updated_at is None and "updated_at" in self.model_fields_set:
|
92
|
-
_dict[
|
107
|
+
_dict["updated_at"] = None
|
93
108
|
|
94
109
|
# set to None if id (nullable) is None
|
95
110
|
# and model_fields_set contains the field
|
96
111
|
if self.id is None and "id" in self.model_fields_set:
|
97
|
-
_dict[
|
112
|
+
_dict["id"] = None
|
98
113
|
|
99
114
|
# set to None if status_code (nullable) is None
|
100
115
|
# and model_fields_set contains the field
|
101
116
|
if self.status_code is None and "status_code" in self.model_fields_set:
|
102
|
-
_dict[
|
117
|
+
_dict["status_code"] = None
|
103
118
|
|
104
119
|
# set to None if user_id (nullable) is None
|
105
120
|
# and model_fields_set contains the field
|
106
121
|
if self.user_id is None and "user_id" in self.model_fields_set:
|
107
|
-
_dict[
|
122
|
+
_dict["user_id"] = None
|
108
123
|
|
109
124
|
# set to None if current_allocation (nullable) is None
|
110
125
|
# and model_fields_set contains the field
|
111
|
-
if
|
112
|
-
|
126
|
+
if (
|
127
|
+
self.current_allocation is None
|
128
|
+
and "current_allocation" in self.model_fields_set
|
129
|
+
):
|
130
|
+
_dict["current_allocation"] = None
|
113
131
|
|
114
132
|
# set to None if current_exposure (nullable) is None
|
115
133
|
# and model_fields_set contains the field
|
116
|
-
if
|
117
|
-
|
134
|
+
if (
|
135
|
+
self.current_exposure is None
|
136
|
+
and "current_exposure" in self.model_fields_set
|
137
|
+
):
|
138
|
+
_dict["current_exposure"] = None
|
118
139
|
|
119
140
|
return _dict
|
120
141
|
|
@@ -127,20 +148,20 @@ class BotModel(BaseModel):
|
|
127
148
|
if not isinstance(obj, dict):
|
128
149
|
return cls.model_validate(obj)
|
129
150
|
|
130
|
-
_obj = cls.model_validate(
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
151
|
+
_obj = cls.model_validate(
|
152
|
+
{
|
153
|
+
"created_at": obj.get("created_at"),
|
154
|
+
"updated_at": obj.get("updated_at"),
|
155
|
+
"id": obj.get("id"),
|
156
|
+
"name": obj.get("name"),
|
157
|
+
"strategy_id": obj.get("strategy_id"),
|
158
|
+
"api_key_id": obj.get("api_key_id"),
|
159
|
+
"allocation": obj.get("allocation"),
|
160
|
+
"status": obj.get("status"),
|
161
|
+
"status_code": obj.get("status_code"),
|
162
|
+
"user_id": obj.get("user_id"),
|
163
|
+
"current_allocation": obj.get("current_allocation"),
|
164
|
+
"current_exposure": obj.get("current_exposure"),
|
165
|
+
}
|
166
|
+
)
|
144
167
|
return _obj
|
145
|
-
|
146
|
-
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Trading API
|
5
5
|
|
6
|
-
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -26,14 +26,12 @@ class BotStatus(str, Enum):
|
|
26
26
|
"""
|
27
27
|
allowed enum values
|
28
28
|
"""
|
29
|
-
RUNNING =
|
30
|
-
STOPPING =
|
31
|
-
STOPPED =
|
32
|
-
DELETED =
|
29
|
+
RUNNING = "running"
|
30
|
+
STOPPING = "stopping"
|
31
|
+
STOPPED = "stopped"
|
32
|
+
DELETED = "deleted"
|
33
33
|
|
34
34
|
@classmethod
|
35
35
|
def from_json(cls, json_str: str) -> Self:
|
36
36
|
"""Create an instance of BotStatus from a JSON string"""
|
37
37
|
return cls(json.loads(json_str))
|
38
|
-
|
39
|
-
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Trading API
|
5
5
|
|
6
|
-
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -26,12 +26,10 @@ class Exchange(str, Enum):
|
|
26
26
|
"""
|
27
27
|
allowed enum values
|
28
28
|
"""
|
29
|
-
KUCOIN =
|
30
|
-
BINGX =
|
29
|
+
KUCOIN = "kucoin"
|
30
|
+
BINGX = "bingx"
|
31
31
|
|
32
32
|
@classmethod
|
33
33
|
def from_json(cls, json_str: str) -> Self:
|
34
34
|
"""Create an instance of Exchange from a JSON string"""
|
35
35
|
return cls(json.loads(json_str))
|
36
|
-
|
37
|
-
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Trading API
|
5
5
|
|
6
|
-
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -23,10 +23,12 @@ from crypticorn.trade.client.models.exchange import Exchange
|
|
23
23
|
from typing import Optional, Set
|
24
24
|
from typing_extensions import Self
|
25
25
|
|
26
|
+
|
26
27
|
class ExchangeKeyModel(BaseModel):
|
27
28
|
"""
|
28
29
|
ExchangeKeyModel
|
29
|
-
"""
|
30
|
+
""" # noqa: E501
|
31
|
+
|
30
32
|
created_at: Optional[StrictInt] = None
|
31
33
|
updated_at: Optional[StrictInt] = None
|
32
34
|
id: Optional[StrictStr] = None
|
@@ -37,7 +39,18 @@ class ExchangeKeyModel(BaseModel):
|
|
37
39
|
label: StrictStr = Field(description="Label for the API key")
|
38
40
|
enabled: Optional[StrictBool] = None
|
39
41
|
user_id: Optional[StrictStr] = None
|
40
|
-
__properties: ClassVar[List[str]] = [
|
42
|
+
__properties: ClassVar[List[str]] = [
|
43
|
+
"created_at",
|
44
|
+
"updated_at",
|
45
|
+
"id",
|
46
|
+
"exchange",
|
47
|
+
"api_key",
|
48
|
+
"secret",
|
49
|
+
"passphrase",
|
50
|
+
"label",
|
51
|
+
"enabled",
|
52
|
+
"user_id",
|
53
|
+
]
|
41
54
|
|
42
55
|
model_config = ConfigDict(
|
43
56
|
populate_by_name=True,
|
@@ -45,7 +58,6 @@ class ExchangeKeyModel(BaseModel):
|
|
45
58
|
protected_namespaces=(),
|
46
59
|
)
|
47
60
|
|
48
|
-
|
49
61
|
def to_str(self) -> str:
|
50
62
|
"""Returns the string representation of the model using alias"""
|
51
63
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -70,8 +82,7 @@ class ExchangeKeyModel(BaseModel):
|
|
70
82
|
were set at model initialization. Other fields with value `None`
|
71
83
|
are ignored.
|
72
84
|
"""
|
73
|
-
excluded_fields: Set[str] = set([
|
74
|
-
])
|
85
|
+
excluded_fields: Set[str] = set([])
|
75
86
|
|
76
87
|
_dict = self.model_dump(
|
77
88
|
by_alias=True,
|
@@ -81,42 +92,42 @@ class ExchangeKeyModel(BaseModel):
|
|
81
92
|
# set to None if created_at (nullable) is None
|
82
93
|
# and model_fields_set contains the field
|
83
94
|
if self.created_at is None and "created_at" in self.model_fields_set:
|
84
|
-
_dict[
|
95
|
+
_dict["created_at"] = None
|
85
96
|
|
86
97
|
# set to None if updated_at (nullable) is None
|
87
98
|
# and model_fields_set contains the field
|
88
99
|
if self.updated_at is None and "updated_at" in self.model_fields_set:
|
89
|
-
_dict[
|
100
|
+
_dict["updated_at"] = None
|
90
101
|
|
91
102
|
# set to None if id (nullable) is None
|
92
103
|
# and model_fields_set contains the field
|
93
104
|
if self.id is None and "id" in self.model_fields_set:
|
94
|
-
_dict[
|
105
|
+
_dict["id"] = None
|
95
106
|
|
96
107
|
# set to None if api_key (nullable) is None
|
97
108
|
# and model_fields_set contains the field
|
98
109
|
if self.api_key is None and "api_key" in self.model_fields_set:
|
99
|
-
_dict[
|
110
|
+
_dict["api_key"] = None
|
100
111
|
|
101
112
|
# set to None if secret (nullable) is None
|
102
113
|
# and model_fields_set contains the field
|
103
114
|
if self.secret is None and "secret" in self.model_fields_set:
|
104
|
-
_dict[
|
115
|
+
_dict["secret"] = None
|
105
116
|
|
106
117
|
# set to None if passphrase (nullable) is None
|
107
118
|
# and model_fields_set contains the field
|
108
119
|
if self.passphrase is None and "passphrase" in self.model_fields_set:
|
109
|
-
_dict[
|
120
|
+
_dict["passphrase"] = None
|
110
121
|
|
111
122
|
# set to None if enabled (nullable) is None
|
112
123
|
# and model_fields_set contains the field
|
113
124
|
if self.enabled is None and "enabled" in self.model_fields_set:
|
114
|
-
_dict[
|
125
|
+
_dict["enabled"] = None
|
115
126
|
|
116
127
|
# set to None if user_id (nullable) is None
|
117
128
|
# and model_fields_set contains the field
|
118
129
|
if self.user_id is None and "user_id" in self.model_fields_set:
|
119
|
-
_dict[
|
130
|
+
_dict["user_id"] = None
|
120
131
|
|
121
132
|
return _dict
|
122
133
|
|
@@ -129,18 +140,18 @@ class ExchangeKeyModel(BaseModel):
|
|
129
140
|
if not isinstance(obj, dict):
|
130
141
|
return cls.model_validate(obj)
|
131
142
|
|
132
|
-
_obj = cls.model_validate(
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
143
|
+
_obj = cls.model_validate(
|
144
|
+
{
|
145
|
+
"created_at": obj.get("created_at"),
|
146
|
+
"updated_at": obj.get("updated_at"),
|
147
|
+
"id": obj.get("id"),
|
148
|
+
"exchange": obj.get("exchange"),
|
149
|
+
"api_key": obj.get("api_key"),
|
150
|
+
"secret": obj.get("secret"),
|
151
|
+
"passphrase": obj.get("passphrase"),
|
152
|
+
"label": obj.get("label"),
|
153
|
+
"enabled": obj.get("enabled"),
|
154
|
+
"user_id": obj.get("user_id"),
|
155
|
+
}
|
156
|
+
)
|
144
157
|
return _obj
|
145
|
-
|
146
|
-
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Trading API
|
5
5
|
|
6
|
-
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -22,13 +22,19 @@ from typing import Any, ClassVar, Dict, List
|
|
22
22
|
from typing import Optional, Set
|
23
23
|
from typing_extensions import Self
|
24
24
|
|
25
|
+
|
25
26
|
class ExecutionIds(BaseModel):
|
26
27
|
"""
|
27
28
|
ExecutionIds
|
28
|
-
"""
|
29
|
+
""" # noqa: E501
|
30
|
+
|
29
31
|
main: List[StrictStr] = Field(description="Main execution ID. List with one item.")
|
30
|
-
sl: List[StrictStr] = Field(
|
31
|
-
|
32
|
+
sl: List[StrictStr] = Field(
|
33
|
+
description="Stop loss execution IDs. List with multiple items ordered by the next stop loss, e.g. price = 10000 => SLs: ['900', '700', '500']."
|
34
|
+
)
|
35
|
+
tp: List[StrictStr] = Field(
|
36
|
+
description="Take profit execution IDs. List with multiple items ordered by the next take profit, e.g. price = 10000 => TPs: ['1100', '1300', '1500']."
|
37
|
+
)
|
32
38
|
__properties: ClassVar[List[str]] = ["main", "sl", "tp"]
|
33
39
|
|
34
40
|
model_config = ConfigDict(
|
@@ -37,7 +43,6 @@ class ExecutionIds(BaseModel):
|
|
37
43
|
protected_namespaces=(),
|
38
44
|
)
|
39
45
|
|
40
|
-
|
41
46
|
def to_str(self) -> str:
|
42
47
|
"""Returns the string representation of the model using alias"""
|
43
48
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -62,8 +67,7 @@ class ExecutionIds(BaseModel):
|
|
62
67
|
were set at model initialization. Other fields with value `None`
|
63
68
|
are ignored.
|
64
69
|
"""
|
65
|
-
excluded_fields: Set[str] = set([
|
66
|
-
])
|
70
|
+
excluded_fields: Set[str] = set([])
|
67
71
|
|
68
72
|
_dict = self.model_dump(
|
69
73
|
by_alias=True,
|
@@ -81,11 +85,7 @@ class ExecutionIds(BaseModel):
|
|
81
85
|
if not isinstance(obj, dict):
|
82
86
|
return cls.model_validate(obj)
|
83
87
|
|
84
|
-
_obj = cls.model_validate(
|
85
|
-
"main": obj.get("main"),
|
86
|
-
|
87
|
-
"tp": obj.get("tp")
|
88
|
-
})
|
88
|
+
_obj = cls.model_validate(
|
89
|
+
{"main": obj.get("main"), "sl": obj.get("sl"), "tp": obj.get("tp")}
|
90
|
+
)
|
89
91
|
return _obj
|
90
|
-
|
91
|
-
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Trading API
|
5
5
|
|
6
|
-
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -22,18 +22,36 @@ from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
22
|
from typing import Optional, Set
|
23
23
|
from typing_extensions import Self
|
24
24
|
|
25
|
+
|
25
26
|
class FuturesBalance(BaseModel):
|
26
27
|
"""
|
27
28
|
Model for futures balance
|
28
|
-
"""
|
29
|
+
""" # noqa: E501
|
30
|
+
|
29
31
|
api_key_id: StrictStr = Field(description="API key ID", alias="apiKeyId")
|
30
32
|
asset: StrictStr = Field(description="Asset/Currency code")
|
31
33
|
balance: Union[StrictFloat, StrictInt] = Field(description="Total balance/equity")
|
32
|
-
available: Union[StrictFloat, StrictInt] = Field(
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
available: Union[StrictFloat, StrictInt] = Field(
|
35
|
+
description="Available balance for trading/withdrawal"
|
36
|
+
)
|
37
|
+
unrealized_pnl: Union[StrictFloat, StrictInt] = Field(
|
38
|
+
description="Unrealized profit and loss", alias="unrealizedPnl"
|
39
|
+
)
|
40
|
+
used_margin: Optional[Union[StrictFloat, StrictInt]] = Field(
|
41
|
+
default=None, alias="usedMargin"
|
42
|
+
)
|
43
|
+
frozen_amount: Optional[Union[StrictFloat, StrictInt]] = Field(
|
44
|
+
default=None, alias="frozenAmount"
|
45
|
+
)
|
46
|
+
__properties: ClassVar[List[str]] = [
|
47
|
+
"apiKeyId",
|
48
|
+
"asset",
|
49
|
+
"balance",
|
50
|
+
"available",
|
51
|
+
"unrealizedPnl",
|
52
|
+
"usedMargin",
|
53
|
+
"frozenAmount",
|
54
|
+
]
|
37
55
|
|
38
56
|
model_config = ConfigDict(
|
39
57
|
populate_by_name=True,
|
@@ -41,7 +59,6 @@ class FuturesBalance(BaseModel):
|
|
41
59
|
protected_namespaces=(),
|
42
60
|
)
|
43
61
|
|
44
|
-
|
45
62
|
def to_str(self) -> str:
|
46
63
|
"""Returns the string representation of the model using alias"""
|
47
64
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -66,8 +83,7 @@ class FuturesBalance(BaseModel):
|
|
66
83
|
were set at model initialization. Other fields with value `None`
|
67
84
|
are ignored.
|
68
85
|
"""
|
69
|
-
excluded_fields: Set[str] = set([
|
70
|
-
])
|
86
|
+
excluded_fields: Set[str] = set([])
|
71
87
|
|
72
88
|
_dict = self.model_dump(
|
73
89
|
by_alias=True,
|
@@ -77,12 +93,12 @@ class FuturesBalance(BaseModel):
|
|
77
93
|
# set to None if used_margin (nullable) is None
|
78
94
|
# and model_fields_set contains the field
|
79
95
|
if self.used_margin is None and "used_margin" in self.model_fields_set:
|
80
|
-
_dict[
|
96
|
+
_dict["usedMargin"] = None
|
81
97
|
|
82
98
|
# set to None if frozen_amount (nullable) is None
|
83
99
|
# and model_fields_set contains the field
|
84
100
|
if self.frozen_amount is None and "frozen_amount" in self.model_fields_set:
|
85
|
-
_dict[
|
101
|
+
_dict["frozenAmount"] = None
|
86
102
|
|
87
103
|
return _dict
|
88
104
|
|
@@ -95,15 +111,15 @@ class FuturesBalance(BaseModel):
|
|
95
111
|
if not isinstance(obj, dict):
|
96
112
|
return cls.model_validate(obj)
|
97
113
|
|
98
|
-
_obj = cls.model_validate(
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
114
|
+
_obj = cls.model_validate(
|
115
|
+
{
|
116
|
+
"apiKeyId": obj.get("apiKeyId"),
|
117
|
+
"asset": obj.get("asset"),
|
118
|
+
"balance": obj.get("balance"),
|
119
|
+
"available": obj.get("available"),
|
120
|
+
"unrealizedPnl": obj.get("unrealizedPnl"),
|
121
|
+
"usedMargin": obj.get("usedMargin"),
|
122
|
+
"frozenAmount": obj.get("frozenAmount"),
|
123
|
+
}
|
124
|
+
)
|
107
125
|
return _obj
|
108
|
-
|
109
|
-
|