crypticorn 2.4.6__py3-none-any.whl → 2.4.7__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/common/auth.py +7 -9
- crypticorn/common/errors.py +5 -0
- crypticorn/common/utils.py +15 -5
- crypticorn/klines/main.py +10 -5
- crypticorn/metrics/main.py +5 -4
- crypticorn/trade/client/__init__.py +6 -8
- crypticorn/trade/client/api/__init__.py +1 -0
- crypticorn/trade/client/api/api_keys_api.py +273 -167
- crypticorn/trade/client/api/bots_api.py +226 -140
- crypticorn/trade/client/api/exchanges_api.py +51 -31
- crypticorn/trade/client/api/futures_trading_panel_api.py +272 -169
- crypticorn/trade/client/api/notifications_api.py +323 -200
- crypticorn/trade/client/api/orders_api.py +60 -40
- crypticorn/trade/client/api/status_api.py +49 -31
- crypticorn/trade/client/api/strategies_api.py +223 -137
- crypticorn/trade/client/api/trading_actions_api.py +170 -106
- crypticorn/trade/client/api_client.py +153 -111
- crypticorn/trade/client/api_response.py +3 -2
- crypticorn/trade/client/configuration.py +115 -128
- crypticorn/trade/client/exceptions.py +21 -25
- crypticorn/trade/client/models/__init__.py +6 -8
- crypticorn/trade/client/models/action_model.py +54 -108
- crypticorn/trade/client/models/api_error_identifier.py +72 -76
- crypticorn/trade/client/models/api_error_level.py +11 -9
- crypticorn/trade/client/models/api_error_type.py +11 -9
- crypticorn/trade/client/models/bot_model.py +36 -57
- crypticorn/trade/client/models/bot_status.py +11 -9
- crypticorn/trade/client/models/exchange.py +9 -7
- crypticorn/trade/client/models/exchange_key_model.py +34 -44
- crypticorn/trade/client/models/execution_ids.py +18 -18
- crypticorn/trade/client/models/futures_balance.py +27 -43
- crypticorn/trade/client/models/futures_trading_action.py +50 -102
- crypticorn/trade/client/models/http_validation_error.py +15 -19
- crypticorn/trade/client/models/margin_mode.py +9 -7
- crypticorn/trade/client/models/market_type.py +9 -7
- crypticorn/trade/client/models/notification_model.py +32 -52
- crypticorn/trade/client/models/order_model.py +72 -112
- crypticorn/trade/client/models/order_status.py +12 -10
- crypticorn/trade/client/models/post_futures_action.py +16 -20
- crypticorn/trade/client/models/strategy_exchange_info.py +16 -15
- crypticorn/trade/client/models/strategy_model_input.py +33 -61
- crypticorn/trade/client/models/strategy_model_output.py +33 -61
- crypticorn/trade/client/models/tpsl.py +25 -39
- crypticorn/trade/client/models/trading_action_type.py +11 -9
- crypticorn/trade/client/models/validation_error.py +18 -24
- crypticorn/trade/client/models/validation_error_loc_inner.py +16 -37
- crypticorn/trade/client/rest.py +38 -23
- {crypticorn-2.4.6.dist-info → crypticorn-2.4.7.dist-info}/METADATA +8 -2
- {crypticorn-2.4.6.dist-info → crypticorn-2.4.7.dist-info}/RECORD +52 -52
- {crypticorn-2.4.6.dist-info → crypticorn-2.4.7.dist-info}/WHEEL +0 -0
- {crypticorn-2.4.6.dist-info → crypticorn-2.4.7.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.4.6.dist-info → crypticorn-2.4.7.dist-info}/top_level.txt +0 -0
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
Trading API
|
4
|
+
Trading API
|
5
5
|
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
7
|
|
8
|
-
The version of the OpenAPI document: 0.1.0
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
Do not edit the class manually.
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -17,15 +17,7 @@ import pprint
|
|
17
17
|
import re # noqa: F401
|
18
18
|
import json
|
19
19
|
|
20
|
-
from pydantic import
|
21
|
-
BaseModel,
|
22
|
-
ConfigDict,
|
23
|
-
Field,
|
24
|
-
StrictBool,
|
25
|
-
StrictFloat,
|
26
|
-
StrictInt,
|
27
|
-
StrictStr,
|
28
|
-
)
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
|
29
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
30
22
|
from typing_extensions import Annotated
|
31
23
|
from crypticorn.trade.client.models.margin_mode import MarginMode
|
@@ -35,12 +27,10 @@ from crypticorn.trade.client.models.trading_action_type import TradingActionType
|
|
35
27
|
from typing import Optional, Set
|
36
28
|
from typing_extensions import Self
|
37
29
|
|
38
|
-
|
39
30
|
class ActionModel(BaseModel):
|
40
31
|
"""
|
41
32
|
ActionModel
|
42
|
-
"""
|
43
|
-
|
33
|
+
""" # noqa: E501
|
44
34
|
created_at: Optional[StrictInt] = None
|
45
35
|
updated_at: Optional[StrictInt] = None
|
46
36
|
id: Optional[StrictStr] = None
|
@@ -50,47 +40,17 @@ class ActionModel(BaseModel):
|
|
50
40
|
action_type: TradingActionType = Field(description="The type of action.")
|
51
41
|
market_type: MarketType = Field(description="The type of market the action is for.")
|
52
42
|
strategy_id: StrictStr = Field(description="UID for the strategy.")
|
53
|
-
symbol: StrictStr = Field(
|
54
|
-
description="Trading symbol or asset pair in format: 'symbol/quote_currency' (see market service for valid symbols)"
|
55
|
-
)
|
43
|
+
symbol: StrictStr = Field(description="Trading symbol or asset pair in format: 'symbol/quote_currency' (see market service for valid symbols)")
|
56
44
|
is_limit: Optional[StrictBool] = None
|
57
45
|
limit_price: Optional[Union[StrictFloat, StrictInt]] = None
|
58
|
-
allocation: Optional[
|
59
|
-
Union[
|
60
|
-
Annotated[float, Field(le=1.0, strict=True)],
|
61
|
-
Annotated[int, Field(le=1, strict=True)],
|
62
|
-
]
|
63
|
-
] = Field(
|
64
|
-
default=None,
|
65
|
-
description="How much of bot's balance to use for the order (for open actions). How much of the reference open order (open_order_execution_id) to close (for close actions). 0=0%, 1=100%.",
|
66
|
-
)
|
46
|
+
allocation: Optional[Union[Annotated[float, Field(le=1.0, strict=True)], Annotated[int, Field(le=1, strict=True)]]] = Field(default=None, description="How much of bot's balance to use for the order (for open actions). How much of the reference open order (open_order_execution_id) to close (for close actions). 0=0%, 1=100%.")
|
67
47
|
take_profit: Optional[List[TPSL]] = None
|
68
48
|
stop_loss: Optional[List[TPSL]] = None
|
69
49
|
expiry_timestamp: Optional[StrictInt] = None
|
70
50
|
position_id: Optional[StrictStr] = None
|
71
51
|
leverage: Optional[Annotated[int, Field(strict=True, ge=1)]]
|
72
52
|
margin_mode: Optional[MarginMode] = None
|
73
|
-
__properties: ClassVar[List[str]] = [
|
74
|
-
"created_at",
|
75
|
-
"updated_at",
|
76
|
-
"id",
|
77
|
-
"execution_id",
|
78
|
-
"open_order_execution_id",
|
79
|
-
"client_order_id",
|
80
|
-
"action_type",
|
81
|
-
"market_type",
|
82
|
-
"strategy_id",
|
83
|
-
"symbol",
|
84
|
-
"is_limit",
|
85
|
-
"limit_price",
|
86
|
-
"allocation",
|
87
|
-
"take_profit",
|
88
|
-
"stop_loss",
|
89
|
-
"expiry_timestamp",
|
90
|
-
"position_id",
|
91
|
-
"leverage",
|
92
|
-
"margin_mode",
|
93
|
-
]
|
53
|
+
__properties: ClassVar[List[str]] = ["created_at", "updated_at", "id", "execution_id", "open_order_execution_id", "client_order_id", "action_type", "market_type", "strategy_id", "symbol", "is_limit", "limit_price", "allocation", "take_profit", "stop_loss", "expiry_timestamp", "position_id", "leverage", "margin_mode"]
|
94
54
|
|
95
55
|
model_config = ConfigDict(
|
96
56
|
populate_by_name=True,
|
@@ -98,6 +58,7 @@ class ActionModel(BaseModel):
|
|
98
58
|
protected_namespaces=(),
|
99
59
|
)
|
100
60
|
|
61
|
+
|
101
62
|
def to_str(self) -> str:
|
102
63
|
"""Returns the string representation of the model using alias"""
|
103
64
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -122,7 +83,8 @@ class ActionModel(BaseModel):
|
|
122
83
|
were set at model initialization. Other fields with value `None`
|
123
84
|
are ignored.
|
124
85
|
"""
|
125
|
-
excluded_fields: Set[str] = set([
|
86
|
+
excluded_fields: Set[str] = set([
|
87
|
+
])
|
126
88
|
|
127
89
|
_dict = self.model_dump(
|
128
90
|
by_alias=True,
|
@@ -135,89 +97,83 @@ class ActionModel(BaseModel):
|
|
135
97
|
for _item_take_profit in self.take_profit:
|
136
98
|
if _item_take_profit:
|
137
99
|
_items.append(_item_take_profit.to_dict())
|
138
|
-
_dict[
|
100
|
+
_dict['take_profit'] = _items
|
139
101
|
# override the default output from pydantic by calling `to_dict()` of each item in stop_loss (list)
|
140
102
|
_items = []
|
141
103
|
if self.stop_loss:
|
142
104
|
for _item_stop_loss in self.stop_loss:
|
143
105
|
if _item_stop_loss:
|
144
106
|
_items.append(_item_stop_loss.to_dict())
|
145
|
-
_dict[
|
107
|
+
_dict['stop_loss'] = _items
|
146
108
|
# set to None if created_at (nullable) is None
|
147
109
|
# and model_fields_set contains the field
|
148
110
|
if self.created_at is None and "created_at" in self.model_fields_set:
|
149
|
-
_dict[
|
111
|
+
_dict['created_at'] = None
|
150
112
|
|
151
113
|
# set to None if updated_at (nullable) is None
|
152
114
|
# and model_fields_set contains the field
|
153
115
|
if self.updated_at is None and "updated_at" in self.model_fields_set:
|
154
|
-
_dict[
|
116
|
+
_dict['updated_at'] = None
|
155
117
|
|
156
118
|
# set to None if id (nullable) is None
|
157
119
|
# and model_fields_set contains the field
|
158
120
|
if self.id is None and "id" in self.model_fields_set:
|
159
|
-
_dict[
|
121
|
+
_dict['id'] = None
|
160
122
|
|
161
123
|
# set to None if execution_id (nullable) is None
|
162
124
|
# and model_fields_set contains the field
|
163
125
|
if self.execution_id is None and "execution_id" in self.model_fields_set:
|
164
|
-
_dict[
|
126
|
+
_dict['execution_id'] = None
|
165
127
|
|
166
128
|
# set to None if open_order_execution_id (nullable) is None
|
167
129
|
# and model_fields_set contains the field
|
168
|
-
if
|
169
|
-
|
170
|
-
and "open_order_execution_id" in self.model_fields_set
|
171
|
-
):
|
172
|
-
_dict["open_order_execution_id"] = None
|
130
|
+
if self.open_order_execution_id is None and "open_order_execution_id" in self.model_fields_set:
|
131
|
+
_dict['open_order_execution_id'] = None
|
173
132
|
|
174
133
|
# set to None if client_order_id (nullable) is None
|
175
134
|
# and model_fields_set contains the field
|
176
135
|
if self.client_order_id is None and "client_order_id" in self.model_fields_set:
|
177
|
-
_dict[
|
136
|
+
_dict['client_order_id'] = None
|
178
137
|
|
179
138
|
# set to None if is_limit (nullable) is None
|
180
139
|
# and model_fields_set contains the field
|
181
140
|
if self.is_limit is None and "is_limit" in self.model_fields_set:
|
182
|
-
_dict[
|
141
|
+
_dict['is_limit'] = None
|
183
142
|
|
184
143
|
# set to None if limit_price (nullable) is None
|
185
144
|
# and model_fields_set contains the field
|
186
145
|
if self.limit_price is None and "limit_price" in self.model_fields_set:
|
187
|
-
_dict[
|
146
|
+
_dict['limit_price'] = None
|
188
147
|
|
189
148
|
# set to None if take_profit (nullable) is None
|
190
149
|
# and model_fields_set contains the field
|
191
150
|
if self.take_profit is None and "take_profit" in self.model_fields_set:
|
192
|
-
_dict[
|
151
|
+
_dict['take_profit'] = None
|
193
152
|
|
194
153
|
# set to None if stop_loss (nullable) is None
|
195
154
|
# and model_fields_set contains the field
|
196
155
|
if self.stop_loss is None and "stop_loss" in self.model_fields_set:
|
197
|
-
_dict[
|
156
|
+
_dict['stop_loss'] = None
|
198
157
|
|
199
158
|
# set to None if expiry_timestamp (nullable) is None
|
200
159
|
# and model_fields_set contains the field
|
201
|
-
if
|
202
|
-
|
203
|
-
and "expiry_timestamp" in self.model_fields_set
|
204
|
-
):
|
205
|
-
_dict["expiry_timestamp"] = None
|
160
|
+
if self.expiry_timestamp is None and "expiry_timestamp" in self.model_fields_set:
|
161
|
+
_dict['expiry_timestamp'] = None
|
206
162
|
|
207
163
|
# set to None if position_id (nullable) is None
|
208
164
|
# and model_fields_set contains the field
|
209
165
|
if self.position_id is None and "position_id" in self.model_fields_set:
|
210
|
-
_dict[
|
166
|
+
_dict['position_id'] = None
|
211
167
|
|
212
168
|
# set to None if leverage (nullable) is None
|
213
169
|
# and model_fields_set contains the field
|
214
170
|
if self.leverage is None and "leverage" in self.model_fields_set:
|
215
|
-
_dict[
|
171
|
+
_dict['leverage'] = None
|
216
172
|
|
217
173
|
# set to None if margin_mode (nullable) is None
|
218
174
|
# and model_fields_set contains the field
|
219
175
|
if self.margin_mode is None and "margin_mode" in self.model_fields_set:
|
220
|
-
_dict[
|
176
|
+
_dict['margin_mode'] = None
|
221
177
|
|
222
178
|
return _dict
|
223
179
|
|
@@ -230,37 +186,27 @@ class ActionModel(BaseModel):
|
|
230
186
|
if not isinstance(obj, dict):
|
231
187
|
return cls.model_validate(obj)
|
232
188
|
|
233
|
-
_obj = cls.model_validate(
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
[TPSL.from_dict(_item) for _item in obj["stop_loss"]]
|
255
|
-
if obj.get("stop_loss") is not None
|
256
|
-
else None
|
257
|
-
),
|
258
|
-
"expiry_timestamp": obj.get("expiry_timestamp"),
|
259
|
-
"position_id": obj.get("position_id"),
|
260
|
-
"leverage": (
|
261
|
-
obj.get("leverage") if obj.get("leverage") is not None else 1
|
262
|
-
),
|
263
|
-
"margin_mode": obj.get("margin_mode"),
|
264
|
-
}
|
265
|
-
)
|
189
|
+
_obj = cls.model_validate({
|
190
|
+
"created_at": obj.get("created_at"),
|
191
|
+
"updated_at": obj.get("updated_at"),
|
192
|
+
"id": obj.get("id"),
|
193
|
+
"execution_id": obj.get("execution_id"),
|
194
|
+
"open_order_execution_id": obj.get("open_order_execution_id"),
|
195
|
+
"client_order_id": obj.get("client_order_id"),
|
196
|
+
"action_type": obj.get("action_type"),
|
197
|
+
"market_type": obj.get("market_type"),
|
198
|
+
"strategy_id": obj.get("strategy_id"),
|
199
|
+
"symbol": obj.get("symbol"),
|
200
|
+
"is_limit": obj.get("is_limit"),
|
201
|
+
"limit_price": obj.get("limit_price"),
|
202
|
+
"allocation": obj.get("allocation"),
|
203
|
+
"take_profit": [TPSL.from_dict(_item) for _item in obj["take_profit"]] if obj.get("take_profit") is not None else None,
|
204
|
+
"stop_loss": [TPSL.from_dict(_item) for _item in obj["stop_loss"]] if obj.get("stop_loss") is not None else None,
|
205
|
+
"expiry_timestamp": obj.get("expiry_timestamp"),
|
206
|
+
"position_id": obj.get("position_id"),
|
207
|
+
"leverage": obj.get("leverage") if obj.get("leverage") is not None else 1,
|
208
|
+
"margin_mode": obj.get("margin_mode")
|
209
|
+
})
|
266
210
|
return _obj
|
211
|
+
|
212
|
+
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
Trading API
|
4
|
+
Trading API
|
5
5
|
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
7
|
|
8
|
-
The version of the OpenAPI document: 0.1.0
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
Do not edit the class manually.
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -26,79 +26,75 @@ class ApiErrorIdentifier(str, Enum):
|
|
26
26
|
"""
|
27
27
|
allowed enum values
|
28
28
|
"""
|
29
|
-
ALLOCATION_BELOW_CURRENT_EXPOSURE =
|
30
|
-
ALLOCATION_BELOW_MIN_AMOUNT =
|
31
|
-
BLACK_SWAN =
|
32
|
-
BOT_ALREADY_DELETED =
|
33
|
-
BOT_DISABLED =
|
34
|
-
BOT_STOPPING_COMPLETED =
|
35
|
-
CLIENT_ORDER_ID_ALREADY_EXISTS =
|
36
|
-
INVALID_CONTENT_TYPE =
|
37
|
-
DELETE_BOT_ERROR =
|
38
|
-
EXCHANGE_INVALID_SIGNATURE =
|
39
|
-
EXCHANGE_INVALID_TIMESTAMP =
|
40
|
-
EXCHANGE_IP_ADDRESS_IS_NOT_AUTHORIZED =
|
41
|
-
EXCHANGE_KEY_ALREADY_EXISTS =
|
42
|
-
EXCHANGE_KEY_IN_USE =
|
43
|
-
EXCHANGE_SYSTEM_UNDER_MAINTENANCE =
|
44
|
-
EXCHANGE_RATE_LIMIT_EXCEEDED =
|
45
|
-
INSUFFICIENT_PERMISSIONS_SPOT_AND_FUTURES_REQUIRED =
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
TRADING_ACTION_EXPIRED = "trading_action_expired"
|
95
|
-
TRADING_ACTION_SKIPPED = "trading_action_skipped"
|
96
|
-
TRADING_HAS_BEEN_LOCKED = "trading_has_been_locked"
|
97
|
-
TRADING_IS_SUSPENDED = "trading_is_suspended"
|
98
|
-
UNKNOWN_ERROR_OCCURRED = "unknown_error_occurred"
|
99
|
-
REQUESTED_RESOURCE_NOT_FOUND = "requested_resource_not_found"
|
29
|
+
ALLOCATION_BELOW_CURRENT_EXPOSURE = 'allocation_below_current_exposure'
|
30
|
+
ALLOCATION_BELOW_MIN_AMOUNT = 'allocation_below_min_amount'
|
31
|
+
BLACK_SWAN = 'black_swan'
|
32
|
+
BOT_ALREADY_DELETED = 'bot_already_deleted'
|
33
|
+
BOT_DISABLED = 'bot_disabled'
|
34
|
+
BOT_STOPPING_COMPLETED = 'bot_stopping_completed'
|
35
|
+
CLIENT_ORDER_ID_ALREADY_EXISTS = 'client_order_id_already_exists'
|
36
|
+
INVALID_CONTENT_TYPE = 'invalid_content_type'
|
37
|
+
DELETE_BOT_ERROR = 'delete_bot_error'
|
38
|
+
EXCHANGE_INVALID_SIGNATURE = 'exchange_invalid_signature'
|
39
|
+
EXCHANGE_INVALID_TIMESTAMP = 'exchange_invalid_timestamp'
|
40
|
+
EXCHANGE_IP_ADDRESS_IS_NOT_AUTHORIZED = 'exchange_ip_address_is_not_authorized'
|
41
|
+
EXCHANGE_KEY_ALREADY_EXISTS = 'exchange_key_already_exists'
|
42
|
+
EXCHANGE_KEY_IN_USE = 'exchange_key_in_use'
|
43
|
+
EXCHANGE_SYSTEM_UNDER_MAINTENANCE = 'exchange_system_under_maintenance'
|
44
|
+
EXCHANGE_RATE_LIMIT_EXCEEDED = 'exchange_rate_limit_exceeded'
|
45
|
+
INSUFFICIENT_PERMISSIONS_SPOT_AND_FUTURES_REQUIRED = 'insufficient_permissions_spot_and_futures_required'
|
46
|
+
EXCHANGE_SERVICE_TEMPORARILY_UNAVAILABLE = 'exchange_service_temporarily_unavailable'
|
47
|
+
EXCHANGE_SYSTEM_IS_BUSY = 'exchange_system_is_busy'
|
48
|
+
EXCHANGE_SYSTEM_CONFIGURATION_ERROR = 'exchange_system_configuration_error'
|
49
|
+
EXCHANGE_INTERNAL_SYSTEM_ERROR = 'exchange_internal_system_error'
|
50
|
+
EXCHANGE_USER_ACCOUNT_IS_FROZEN = 'exchange_user_account_is_frozen'
|
51
|
+
HEDGE_MODE_NOT_ACTIVE = 'hedge_mode_not_active'
|
52
|
+
HTTP_REQUEST_ERROR = 'http_request_error'
|
53
|
+
INSUFFICIENT_BALANCE = 'insufficient_balance'
|
54
|
+
INSUFFICIENT_MARGIN = 'insufficient_margin'
|
55
|
+
INSUFFICIENT_SCOPES = 'insufficient_scopes'
|
56
|
+
INVALID_API_KEY = 'invalid_api_key'
|
57
|
+
INVALID_BEARER = 'invalid_bearer'
|
58
|
+
INVALID_EXCHANGE_KEY = 'invalid_exchange_key'
|
59
|
+
INVALID_MARGIN_MODE = 'invalid_margin_mode'
|
60
|
+
INVALID_PARAMETER_PROVIDED = 'invalid_parameter_provided'
|
61
|
+
JWT_EXPIRED = 'jwt_expired'
|
62
|
+
LEVERAGE_LIMIT_EXCEEDED = 'leverage_limit_exceeded'
|
63
|
+
ORDER_VIOLATES_LIQUIDATION_PRICE_CONSTRAINTS = 'order_violates_liquidation_price_constraints'
|
64
|
+
NO_CREDENTIALS = 'no_credentials'
|
65
|
+
NOW_API_DOWN = 'now_api_down'
|
66
|
+
OBJECT_NOT_FOUND = 'object_not_found'
|
67
|
+
OBJECT_ALREADY_EXISTS = 'object_already_exists'
|
68
|
+
ORDER_IS_ALREADY_FILLED = 'order_is_already_filled'
|
69
|
+
ORDER_IS_BEING_PROCESSED = 'order_is_being_processed'
|
70
|
+
ORDER_QUANTITY_LIMIT_EXCEEDED = 'order_quantity_limit_exceeded'
|
71
|
+
ORDER_DOES_NOT_EXIST = 'order_does_not_exist'
|
72
|
+
ORDER_PRICE_IS_INVALID = 'order_price_is_invalid'
|
73
|
+
ORDER_SIZE_TOO_LARGE = 'order_size_too_large'
|
74
|
+
ORDER_SIZE_TOO_SMALL = 'order_size_too_small'
|
75
|
+
POSITION_LIMIT_EXCEEDED = 'position_limit_exceeded'
|
76
|
+
POSITION_DOES_NOT_EXIST = 'position_does_not_exist'
|
77
|
+
POSITION_OPENING_TEMPORARILY_SUSPENDED = 'position_opening_temporarily_suspended'
|
78
|
+
POST_ONLY_ORDER_WOULD_IMMEDIATELY_MATCH = 'post_only_order_would_immediately_match'
|
79
|
+
REQUEST_SCOPE_LIMIT_EXCEEDED = 'request_scope_limit_exceeded'
|
80
|
+
RISK_LIMIT_EXCEEDED = 'risk_limit_exceeded'
|
81
|
+
RPC_TIMEOUT = 'rpc_timeout'
|
82
|
+
SYSTEM_SETTLEMENT_IN_PROCESS = 'system_settlement_in_process'
|
83
|
+
STRATEGY_DISABLED = 'strategy_disabled'
|
84
|
+
STRATEGY_LEVERAGE_MISMATCH = 'strategy_leverage_mismatch'
|
85
|
+
STRATEGY_NOT_SUPPORTING_EXCHANGE = 'strategy_not_supporting_exchange'
|
86
|
+
SUCCESS = 'success'
|
87
|
+
SYMBOL_DOES_NOT_EXIST = 'symbol_does_not_exist'
|
88
|
+
TRADING_ACTION_EXPIRED = 'trading_action_expired'
|
89
|
+
TRADING_ACTION_SKIPPED = 'trading_action_skipped'
|
90
|
+
TRADING_HAS_BEEN_LOCKED = 'trading_has_been_locked'
|
91
|
+
TRADING_IS_SUSPENDED = 'trading_is_suspended'
|
92
|
+
UNKNOWN_ERROR_OCCURRED = 'unknown_error_occurred'
|
93
|
+
REQUESTED_RESOURCE_NOT_FOUND = 'requested_resource_not_found'
|
100
94
|
|
101
95
|
@classmethod
|
102
96
|
def from_json(cls, json_str: str) -> Self:
|
103
97
|
"""Create an instance of ApiErrorIdentifier from a JSON string"""
|
104
98
|
return cls(json.loads(json_str))
|
99
|
+
|
100
|
+
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
Trading API
|
4
|
+
Trading API
|
5
5
|
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
7
|
|
8
|
-
The version of the OpenAPI document: 0.1.0
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
Do not edit the class manually.
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -26,12 +26,14 @@ class ApiErrorLevel(str, Enum):
|
|
26
26
|
"""
|
27
27
|
allowed enum values
|
28
28
|
"""
|
29
|
-
ERROR =
|
30
|
-
INFO =
|
31
|
-
SUCCESS =
|
32
|
-
WARNING =
|
29
|
+
ERROR = 'error'
|
30
|
+
INFO = 'info'
|
31
|
+
SUCCESS = 'success'
|
32
|
+
WARNING = 'warning'
|
33
33
|
|
34
34
|
@classmethod
|
35
35
|
def from_json(cls, json_str: str) -> Self:
|
36
36
|
"""Create an instance of ApiErrorLevel 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
|
-
Trading API
|
4
|
+
Trading API
|
5
5
|
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
7
|
|
8
|
-
The version of the OpenAPI document: 0.1.0
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
Do not edit the class manually.
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -26,12 +26,14 @@ class ApiErrorType(str, Enum):
|
|
26
26
|
"""
|
27
27
|
allowed enum values
|
28
28
|
"""
|
29
|
-
USER_ERROR =
|
30
|
-
EXCHANGE_ERROR =
|
31
|
-
SERVER_ERROR =
|
32
|
-
NO_ERROR =
|
29
|
+
USER_ERROR = 'user error'
|
30
|
+
EXCHANGE_ERROR = 'exchange error'
|
31
|
+
SERVER_ERROR = 'server error'
|
32
|
+
NO_ERROR = 'no error'
|
33
33
|
|
34
34
|
@classmethod
|
35
35
|
def from_json(cls, json_str: str) -> Self:
|
36
36
|
"""Create an instance of ApiErrorType from a JSON string"""
|
37
37
|
return cls(json.loads(json_str))
|
38
|
+
|
39
|
+
|