crypticorn 2.17.0rc3__py3-none-any.whl → 2.17.0rc5__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/auth/client/api/admin_api.py +0 -2
- crypticorn/auth/client/api/auth_api.py +0 -4
- crypticorn/auth/client/api/service_api.py +0 -4
- crypticorn/auth/client/api/user_api.py +0 -4
- crypticorn/auth/client/api/wallet_api.py +0 -4
- crypticorn/auth/client/api_client.py +0 -5
- crypticorn/auth/client/models/add_wallet_request.py +1 -1
- crypticorn/auth/client/models/authorize_user_request.py +1 -1
- crypticorn/auth/client/models/create_api_key_request.py +1 -1
- crypticorn/auth/client/models/create_user_request.py +1 -1
- crypticorn/auth/client/models/get_api_keys200_response_inner.py +1 -1
- crypticorn/auth/client/models/list_wallets200_response_balances_inner_sale_round.py +1 -1
- crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet.py +1 -1
- crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet_vesting_wallets_inner.py +1 -1
- crypticorn/auth/client/models/list_wallets200_response_data_inner.py +1 -1
- crypticorn/auth/client/models/logout_default_response.py +1 -1
- crypticorn/auth/client/models/oauth_callback200_response_user.py +1 -1
- crypticorn/auth/client/models/refresh_token_info200_response_user_session.py +1 -1
- crypticorn/auth/client/models/rotate_tokens200_response.py +1 -1
- crypticorn/auth/client/models/token_info200_response.py +1 -1
- crypticorn/auth/client/models/update_user_request.py +1 -1
- crypticorn/auth/client/models/user_by_username200_response.py +1 -1
- crypticorn/auth/client/models/verify200_response.py +1 -1
- crypticorn/auth/client/models/verify_email200_response_auth.py +1 -1
- crypticorn/auth/client/models/verify_email200_response_auth_auth.py +1 -1
- crypticorn/auth/client/models/whoami200_response.py +1 -1
- crypticorn/cli/init.py +1 -1
- crypticorn/cli/templates/.env.docker.temp +3 -0
- crypticorn/cli/templates/.env.example.temp +4 -0
- crypticorn/client.py +0 -1
- crypticorn/common/auth.py +5 -16
- crypticorn/common/decorators.py +1 -2
- crypticorn/common/enums.py +0 -2
- crypticorn/common/metrics.py +1 -1
- crypticorn/common/middleware.py +0 -1
- crypticorn/common/pagination.py +135 -22
- crypticorn/common/utils.py +1 -2
- crypticorn/dex/__init__.py +6 -0
- crypticorn/dex/client/__init__.py +49 -0
- crypticorn/dex/client/api/__init__.py +6 -0
- crypticorn/dex/client/api/admin_api.py +3046 -0
- crypticorn/dex/client/api/signals_api.py +1821 -0
- crypticorn/dex/client/api/status_api.py +907 -0
- crypticorn/dex/client/api_client.py +753 -0
- crypticorn/dex/client/api_response.py +20 -0
- crypticorn/dex/client/configuration.py +620 -0
- crypticorn/dex/client/exceptions.py +220 -0
- crypticorn/dex/client/models/__init__.py +30 -0
- crypticorn/dex/client/models/api_error_identifier.py +121 -0
- crypticorn/dex/client/models/api_error_level.py +37 -0
- crypticorn/dex/client/models/api_error_type.py +37 -0
- crypticorn/dex/client/models/exception_detail.py +117 -0
- crypticorn/dex/client/models/log_level.py +38 -0
- crypticorn/dex/client/models/paginated_response_signal_with_token.py +134 -0
- crypticorn/dex/client/models/risk.py +86 -0
- crypticorn/dex/client/models/signal_overview_stats.py +156 -0
- crypticorn/dex/client/models/signal_volume.py +84 -0
- crypticorn/dex/client/models/signal_with_token.py +163 -0
- crypticorn/dex/client/models/token_data.py +127 -0
- crypticorn/dex/client/models/token_detail.py +116 -0
- crypticorn/dex/client/py.typed +0 -0
- crypticorn/dex/client/rest.py +217 -0
- crypticorn/dex/main.py +1 -0
- crypticorn/hive/client/api/admin_api.py +0 -3
- crypticorn/hive/client/api/data_api.py +0 -4
- crypticorn/hive/client/api/models_api.py +1 -4
- crypticorn/hive/client/api/status_api.py +0 -3
- crypticorn/hive/client/api_client.py +0 -5
- crypticorn/hive/client/models/coin_info.py +1 -1
- crypticorn/hive/client/models/exception_detail.py +1 -1
- crypticorn/hive/client/models/target_info.py +1 -1
- crypticorn/hive/utils.py +2 -2
- crypticorn/klines/client/api/admin_api.py +0 -3
- crypticorn/klines/client/api/change_in_timeframe_api.py +0 -4
- crypticorn/klines/client/api/funding_rates_api.py +0 -4
- crypticorn/klines/client/api/ohlcv_data_api.py +0 -4
- crypticorn/klines/client/api/status_api.py +0 -3
- crypticorn/klines/client/api/symbols_api.py +0 -4
- crypticorn/klines/client/api/udf_api.py +0 -2
- crypticorn/klines/client/api_client.py +0 -5
- crypticorn/klines/client/models/exception_detail.py +1 -1
- crypticorn/klines/client/models/ohlcv.py +1 -1
- crypticorn/klines/client/models/symbol_group.py +1 -1
- crypticorn/klines/client/models/udf_config.py +1 -1
- crypticorn/metrics/client/api/admin_api.py +0 -3
- crypticorn/metrics/client/api/exchanges_api.py +0 -4
- crypticorn/metrics/client/api/indicators_api.py +0 -4
- crypticorn/metrics/client/api/logs_api.py +0 -4
- crypticorn/metrics/client/api/marketcap_api.py +0 -4
- crypticorn/metrics/client/api/markets_api.py +0 -4
- crypticorn/metrics/client/api/quote_currencies_api.py +0 -4
- crypticorn/metrics/client/api/status_api.py +0 -3
- crypticorn/metrics/client/api/tokens_api.py +0 -2
- crypticorn/metrics/client/api_client.py +0 -5
- crypticorn/metrics/client/models/exception_detail.py +1 -1
- crypticorn/metrics/client/models/exchange_mapping.py +1 -1
- crypticorn/metrics/client/models/marketcap_ranking.py +1 -1
- crypticorn/metrics/client/models/marketcap_symbol_ranking.py +1 -1
- crypticorn/metrics/client/models/ohlcv.py +1 -1
- crypticorn/pay/client/api/admin_api.py +0 -3
- crypticorn/pay/client/api/now_payments_api.py +0 -4
- crypticorn/pay/client/api/payments_api.py +0 -4
- crypticorn/pay/client/api/products_api.py +0 -4
- crypticorn/pay/client/api/status_api.py +0 -3
- crypticorn/pay/client/api_client.py +0 -5
- crypticorn/pay/client/models/exception_detail.py +1 -1
- crypticorn/pay/client/models/now_create_invoice_req.py +1 -1
- crypticorn/pay/client/models/now_create_invoice_res.py +1 -1
- crypticorn/pay/client/models/product.py +1 -1
- crypticorn/pay/client/models/product_create.py +1 -1
- crypticorn/pay/client/models/product_update.py +1 -1
- crypticorn/trade/client/__init__.py +5 -0
- crypticorn/trade/client/api/admin_api.py +22 -23
- crypticorn/trade/client/api/bots_api.py +4712 -168
- crypticorn/trade/client/api/orders_api.py +220 -106
- crypticorn/trade/client/configuration.py +2 -2
- crypticorn/trade/client/models/__init__.py +5 -0
- crypticorn/trade/client/models/bot.py +7 -18
- crypticorn/trade/client/models/bot_create.py +17 -1
- crypticorn/trade/client/models/bot_update.py +17 -1
- crypticorn/trade/client/models/exchange_key_create.py +17 -1
- crypticorn/trade/client/models/exchange_key_update.py +17 -1
- crypticorn/trade/client/models/notification.py +17 -1
- crypticorn/trade/client/models/notification_create.py +17 -1
- crypticorn/trade/client/models/notification_update.py +17 -1
- crypticorn/trade/client/models/orders_count.py +88 -0
- crypticorn/trade/client/models/paginated_response_order.py +134 -0
- crypticorn/trade/client/models/pn_l.py +95 -0
- crypticorn/trade/client/models/strategy.py +17 -1
- crypticorn/trade/client/models/strategy_create.py +17 -1
- crypticorn/trade/client/models/strategy_update.py +17 -1
- {crypticorn-2.17.0rc3.dist-info → crypticorn-2.17.0rc5.dist-info}/METADATA +1 -1
- {crypticorn-2.17.0rc3.dist-info → crypticorn-2.17.0rc5.dist-info}/RECORD +137 -106
- {crypticorn-2.17.0rc3.dist-info → crypticorn-2.17.0rc5.dist-info}/WHEEL +0 -0
- {crypticorn-2.17.0rc3.dist-info → crypticorn-2.17.0rc5.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.17.0rc3.dist-info → crypticorn-2.17.0rc5.dist-info}/licenses/LICENSE +0 -0
- {crypticorn-2.17.0rc3.dist-info → crypticorn-2.17.0rc5.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,220 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
DEX AI API
|
5
|
+
|
6
|
+
API for DEX AI
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
from typing import Any, Optional
|
15
|
+
from typing_extensions import Self
|
16
|
+
|
17
|
+
|
18
|
+
class OpenApiException(Exception):
|
19
|
+
"""The base exception class for all OpenAPIExceptions"""
|
20
|
+
|
21
|
+
|
22
|
+
class ApiTypeError(OpenApiException, TypeError):
|
23
|
+
def __init__(
|
24
|
+
self, msg, path_to_item=None, valid_classes=None, key_type=None
|
25
|
+
) -> None:
|
26
|
+
"""Raises an exception for TypeErrors
|
27
|
+
|
28
|
+
Args:
|
29
|
+
msg (str): the exception message
|
30
|
+
|
31
|
+
Keyword Args:
|
32
|
+
path_to_item (list): a list of keys an indices to get to the
|
33
|
+
current_item
|
34
|
+
None if unset
|
35
|
+
valid_classes (tuple): the primitive classes that current item
|
36
|
+
should be an instance of
|
37
|
+
None if unset
|
38
|
+
key_type (bool): False if our value is a value in a dict
|
39
|
+
True if it is a key in a dict
|
40
|
+
False if our item is an item in a list
|
41
|
+
None if unset
|
42
|
+
"""
|
43
|
+
self.path_to_item = path_to_item
|
44
|
+
self.valid_classes = valid_classes
|
45
|
+
self.key_type = key_type
|
46
|
+
full_msg = msg
|
47
|
+
if path_to_item:
|
48
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
49
|
+
super(ApiTypeError, self).__init__(full_msg)
|
50
|
+
|
51
|
+
|
52
|
+
class ApiValueError(OpenApiException, ValueError):
|
53
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
54
|
+
"""
|
55
|
+
Args:
|
56
|
+
msg (str): the exception message
|
57
|
+
|
58
|
+
Keyword Args:
|
59
|
+
path_to_item (list) the path to the exception in the
|
60
|
+
received_data dict. None if unset
|
61
|
+
"""
|
62
|
+
|
63
|
+
self.path_to_item = path_to_item
|
64
|
+
full_msg = msg
|
65
|
+
if path_to_item:
|
66
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
67
|
+
super(ApiValueError, self).__init__(full_msg)
|
68
|
+
|
69
|
+
|
70
|
+
class ApiAttributeError(OpenApiException, AttributeError):
|
71
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
72
|
+
"""
|
73
|
+
Raised when an attribute reference or assignment fails.
|
74
|
+
|
75
|
+
Args:
|
76
|
+
msg (str): the exception message
|
77
|
+
|
78
|
+
Keyword Args:
|
79
|
+
path_to_item (None/list) the path to the exception in the
|
80
|
+
received_data dict
|
81
|
+
"""
|
82
|
+
self.path_to_item = path_to_item
|
83
|
+
full_msg = msg
|
84
|
+
if path_to_item:
|
85
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
86
|
+
super(ApiAttributeError, self).__init__(full_msg)
|
87
|
+
|
88
|
+
|
89
|
+
class ApiKeyError(OpenApiException, KeyError):
|
90
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
91
|
+
"""
|
92
|
+
Args:
|
93
|
+
msg (str): the exception message
|
94
|
+
|
95
|
+
Keyword Args:
|
96
|
+
path_to_item (None/list) the path to the exception in the
|
97
|
+
received_data dict
|
98
|
+
"""
|
99
|
+
self.path_to_item = path_to_item
|
100
|
+
full_msg = msg
|
101
|
+
if path_to_item:
|
102
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
103
|
+
super(ApiKeyError, self).__init__(full_msg)
|
104
|
+
|
105
|
+
|
106
|
+
class ApiException(OpenApiException):
|
107
|
+
|
108
|
+
def __init__(
|
109
|
+
self,
|
110
|
+
status=None,
|
111
|
+
reason=None,
|
112
|
+
http_resp=None,
|
113
|
+
*,
|
114
|
+
body: Optional[str] = None,
|
115
|
+
data: Optional[Any] = None,
|
116
|
+
) -> None:
|
117
|
+
self.status = status
|
118
|
+
self.reason = reason
|
119
|
+
self.body = body
|
120
|
+
self.data = data
|
121
|
+
self.headers = None
|
122
|
+
|
123
|
+
if http_resp:
|
124
|
+
if self.status is None:
|
125
|
+
self.status = http_resp.status
|
126
|
+
if self.reason is None:
|
127
|
+
self.reason = http_resp.reason
|
128
|
+
if self.body is None:
|
129
|
+
try:
|
130
|
+
self.body = http_resp.data.decode("utf-8")
|
131
|
+
except Exception:
|
132
|
+
pass
|
133
|
+
self.headers = http_resp.getheaders()
|
134
|
+
|
135
|
+
@classmethod
|
136
|
+
def from_response(
|
137
|
+
cls,
|
138
|
+
*,
|
139
|
+
http_resp,
|
140
|
+
body: Optional[str],
|
141
|
+
data: Optional[Any],
|
142
|
+
) -> Self:
|
143
|
+
if http_resp.status == 400:
|
144
|
+
raise BadRequestException(http_resp=http_resp, body=body, data=data)
|
145
|
+
|
146
|
+
if http_resp.status == 401:
|
147
|
+
raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
|
148
|
+
|
149
|
+
if http_resp.status == 403:
|
150
|
+
raise ForbiddenException(http_resp=http_resp, body=body, data=data)
|
151
|
+
|
152
|
+
if http_resp.status == 404:
|
153
|
+
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
154
|
+
|
155
|
+
# Added new conditions for 409 and 422
|
156
|
+
if http_resp.status == 409:
|
157
|
+
raise ConflictException(http_resp=http_resp, body=body, data=data)
|
158
|
+
|
159
|
+
if http_resp.status == 422:
|
160
|
+
raise UnprocessableEntityException(
|
161
|
+
http_resp=http_resp, body=body, data=data
|
162
|
+
)
|
163
|
+
|
164
|
+
if 500 <= http_resp.status <= 599:
|
165
|
+
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
166
|
+
raise ApiException(http_resp=http_resp, body=body, data=data)
|
167
|
+
|
168
|
+
def __str__(self):
|
169
|
+
"""Custom error messages for exception"""
|
170
|
+
error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason)
|
171
|
+
if self.headers:
|
172
|
+
error_message += "HTTP response headers: {0}\n".format(self.headers)
|
173
|
+
|
174
|
+
if self.data or self.body:
|
175
|
+
error_message += "HTTP response body: {0}\n".format(self.data or self.body)
|
176
|
+
|
177
|
+
return error_message
|
178
|
+
|
179
|
+
|
180
|
+
class BadRequestException(ApiException):
|
181
|
+
pass
|
182
|
+
|
183
|
+
|
184
|
+
class NotFoundException(ApiException):
|
185
|
+
pass
|
186
|
+
|
187
|
+
|
188
|
+
class UnauthorizedException(ApiException):
|
189
|
+
pass
|
190
|
+
|
191
|
+
|
192
|
+
class ForbiddenException(ApiException):
|
193
|
+
pass
|
194
|
+
|
195
|
+
|
196
|
+
class ServiceException(ApiException):
|
197
|
+
pass
|
198
|
+
|
199
|
+
|
200
|
+
class ConflictException(ApiException):
|
201
|
+
"""Exception for HTTP 409 Conflict."""
|
202
|
+
|
203
|
+
pass
|
204
|
+
|
205
|
+
|
206
|
+
class UnprocessableEntityException(ApiException):
|
207
|
+
"""Exception for HTTP 422 Unprocessable Entity."""
|
208
|
+
|
209
|
+
pass
|
210
|
+
|
211
|
+
|
212
|
+
def render_path(path_to_item):
|
213
|
+
"""Returns a string representation of a path"""
|
214
|
+
result = ""
|
215
|
+
for pth in path_to_item:
|
216
|
+
if isinstance(pth, int):
|
217
|
+
result += "[{0}]".format(pth)
|
218
|
+
else:
|
219
|
+
result += "['{0}']".format(pth)
|
220
|
+
return result
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
# flake8: noqa
|
4
|
+
"""
|
5
|
+
DEX AI API
|
6
|
+
|
7
|
+
API for DEX AI
|
8
|
+
|
9
|
+
The version of the OpenAPI document: 1.0.0
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
|
+
|
12
|
+
Do not edit the class manually.
|
13
|
+
""" # noqa: E501
|
14
|
+
|
15
|
+
|
16
|
+
# import models into model package
|
17
|
+
from crypticorn.dex.client.models.api_error_identifier import ApiErrorIdentifier
|
18
|
+
from crypticorn.dex.client.models.api_error_level import ApiErrorLevel
|
19
|
+
from crypticorn.dex.client.models.api_error_type import ApiErrorType
|
20
|
+
from crypticorn.dex.client.models.exception_detail import ExceptionDetail
|
21
|
+
from crypticorn.dex.client.models.log_level import LogLevel
|
22
|
+
from crypticorn.dex.client.models.paginated_response_signal_with_token import (
|
23
|
+
PaginatedResponseSignalWithToken,
|
24
|
+
)
|
25
|
+
from crypticorn.dex.client.models.risk import Risk
|
26
|
+
from crypticorn.dex.client.models.signal_overview_stats import SignalOverviewStats
|
27
|
+
from crypticorn.dex.client.models.signal_volume import SignalVolume
|
28
|
+
from crypticorn.dex.client.models.signal_with_token import SignalWithToken
|
29
|
+
from crypticorn.dex.client.models.token_data import TokenData
|
30
|
+
from crypticorn.dex.client.models.token_detail import TokenDetail
|
@@ -0,0 +1,121 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
DEX AI API
|
5
|
+
|
6
|
+
API for DEX AI
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import json
|
17
|
+
from enum import Enum
|
18
|
+
from typing_extensions import Self
|
19
|
+
|
20
|
+
|
21
|
+
class ApiErrorIdentifier(str, Enum):
|
22
|
+
"""
|
23
|
+
Unique identifier of the API error.
|
24
|
+
"""
|
25
|
+
|
26
|
+
"""
|
27
|
+
allowed enum values
|
28
|
+
"""
|
29
|
+
ALLOCATION_BELOW_CURRENT_EXPOSURE = "allocation_below_current_exposure"
|
30
|
+
ALLOCATION_BELOW_MIN_AMOUNT = "allocation_below_min_amount"
|
31
|
+
ALLOCATION_LIMIT_EXCEEDED = "allocation_limit_exceeded"
|
32
|
+
BLACK_SWAN = "black_swan"
|
33
|
+
BOT_ALREADY_DELETED = "bot_already_deleted"
|
34
|
+
BOT_STOPPING_COMPLETED = "bot_stopping_completed"
|
35
|
+
BOT_STOPPING_STARTED = "bot_stopping_started"
|
36
|
+
CANCELLED_OPEN_ORDER = "cancelled_open_order"
|
37
|
+
CLIENT_ORDER_ID_ALREADY_EXISTS = "client_order_id_already_exists"
|
38
|
+
INVALID_CONTENT_TYPE = "invalid_content_type"
|
39
|
+
DELETE_BOT_ERROR = "delete_bot_error"
|
40
|
+
EXCHANGE_HTTP_REQUEST_ERROR = "exchange_http_request_error"
|
41
|
+
EXCHANGE_INVALID_PARAMETER = "exchange_invalid_parameter"
|
42
|
+
EXCHANGE_INVALID_SIGNATURE = "exchange_invalid_signature"
|
43
|
+
EXCHANGE_INVALID_TIMESTAMP = "exchange_invalid_timestamp"
|
44
|
+
EXCHANGE_IP_ADDRESS_IS_NOT_AUTHORIZED = "exchange_ip_address_is_not_authorized"
|
45
|
+
EXCHANGE_KEY_ALREADY_EXISTS = "exchange_key_already_exists"
|
46
|
+
EXCHANGE_KEY_IN_USE = "exchange_key_in_use"
|
47
|
+
EXCHANGE_SYSTEM_UNDER_MAINTENANCE = "exchange_system_under_maintenance"
|
48
|
+
EXCHANGE_RATE_LIMIT_EXCEEDED = "exchange_rate_limit_exceeded"
|
49
|
+
INSUFFICIENT_PERMISSIONS_SPOT_AND_FUTURES_REQUIRED = (
|
50
|
+
"insufficient_permissions_spot_and_futures_required"
|
51
|
+
)
|
52
|
+
EXCHANGE_SERVICE_TEMPORARILY_UNAVAILABLE = (
|
53
|
+
"exchange_service_temporarily_unavailable"
|
54
|
+
)
|
55
|
+
EXCHANGE_SYSTEM_IS_BUSY = "exchange_system_is_busy"
|
56
|
+
EXCHANGE_SYSTEM_CONFIGURATION_ERROR = "exchange_system_configuration_error"
|
57
|
+
EXCHANGE_INTERNAL_SYSTEM_ERROR = "exchange_internal_system_error"
|
58
|
+
EXCHANGE_USER_ACCOUNT_IS_FROZEN = "exchange_user_account_is_frozen"
|
59
|
+
API_KEY_EXPIRED = "api_key_expired"
|
60
|
+
BEARER_TOKEN_EXPIRED = "bearer_token_expired"
|
61
|
+
FAILED_OPEN_ORDER = "failed_open_order"
|
62
|
+
FORBIDDEN = "forbidden"
|
63
|
+
HEDGE_MODE_NOT_ACTIVE = "hedge_mode_not_active"
|
64
|
+
INSUFFICIENT_BALANCE = "insufficient_balance"
|
65
|
+
INSUFFICIENT_MARGIN = "insufficient_margin"
|
66
|
+
INSUFFICIENT_SCOPES = "insufficient_scopes"
|
67
|
+
INVALID_API_KEY = "invalid_api_key"
|
68
|
+
INVALID_BEARER = "invalid_bearer"
|
69
|
+
INVALID_DATA = "invalid_data"
|
70
|
+
INVALID_DATA_RESPONSE = "invalid_data_response"
|
71
|
+
INVALID_EXCHANGE_KEY = "invalid_exchange_key"
|
72
|
+
INVALID_MODEL_NAME = "invalid_model_name"
|
73
|
+
LEVERAGE_LIMIT_EXCEEDED = "leverage_limit_exceeded"
|
74
|
+
ORDER_VIOLATES_LIQUIDATION_PRICE_CONSTRAINTS = (
|
75
|
+
"order_violates_liquidation_price_constraints"
|
76
|
+
)
|
77
|
+
MARGIN_MODE_CLASH = "margin_mode_clash"
|
78
|
+
NAME_NOT_UNIQUE = "name_not_unique"
|
79
|
+
NO_API_KEY = "no_api_key"
|
80
|
+
NO_BEARER = "no_bearer"
|
81
|
+
NO_CREDENTIALS = "no_credentials"
|
82
|
+
NOW_API_DOWN = "now_api_down"
|
83
|
+
OBJECT_ALREADY_EXISTS = "object_already_exists"
|
84
|
+
OBJECT_CREATED = "object_created"
|
85
|
+
OBJECT_DELETED = "object_deleted"
|
86
|
+
OBJECT_LOCKED = "object_locked"
|
87
|
+
OBJECT_NOT_FOUND = "object_not_found"
|
88
|
+
OBJECT_UPDATED = "object_updated"
|
89
|
+
ORDER_IS_ALREADY_FILLED = "order_is_already_filled"
|
90
|
+
ORDER_IS_BEING_PROCESSED = "order_is_being_processed"
|
91
|
+
ORDER_QUANTITY_LIMIT_EXCEEDED = "order_quantity_limit_exceeded"
|
92
|
+
ORDER_DOES_NOT_EXIST = "order_does_not_exist"
|
93
|
+
ORDER_PRICE_IS_INVALID = "order_price_is_invalid"
|
94
|
+
ORDER_SIZE_TOO_LARGE = "order_size_too_large"
|
95
|
+
ORDER_SIZE_TOO_SMALL = "order_size_too_small"
|
96
|
+
ORPHAN_OPEN_ORDER = "orphan_open_order"
|
97
|
+
ORPHAN_CLOSE_ORDER = "orphan_close_order"
|
98
|
+
POSITION_LIMIT_EXCEEDED = "position_limit_exceeded"
|
99
|
+
POSITION_DOES_NOT_EXIST = "position_does_not_exist"
|
100
|
+
POSITION_OPENING_TEMPORARILY_SUSPENDED = "position_opening_temporarily_suspended"
|
101
|
+
POST_ONLY_ORDER_WOULD_IMMEDIATELY_MATCH = "post_only_order_would_immediately_match"
|
102
|
+
REQUEST_SCOPE_LIMIT_EXCEEDED = "request_scope_limit_exceeded"
|
103
|
+
RISK_LIMIT_EXCEEDED = "risk_limit_exceeded"
|
104
|
+
RPC_TIMEOUT = "rpc_timeout"
|
105
|
+
SYSTEM_SETTLEMENT_IN_PROCESS = "system_settlement_in_process"
|
106
|
+
STRATEGY_DISABLED = "strategy_disabled"
|
107
|
+
STRATEGY_LEVERAGE_MISMATCH = "strategy_leverage_mismatch"
|
108
|
+
STRATEGY_NOT_SUPPORTING_EXCHANGE = "strategy_not_supporting_exchange"
|
109
|
+
SUCCESS = "success"
|
110
|
+
SYMBOL_DOES_NOT_EXIST = "symbol_does_not_exist"
|
111
|
+
TRADING_ACTION_EXPIRED = "trading_action_expired"
|
112
|
+
TRADING_ACTION_SKIPPED_BOT_STOPPING = "trading_action_skipped_bot_stopping"
|
113
|
+
TRADING_HAS_BEEN_LOCKED = "trading_has_been_locked"
|
114
|
+
TRADING_IS_SUSPENDED = "trading_is_suspended"
|
115
|
+
UNKNOWN_ERROR_OCCURRED = "unknown_error_occurred"
|
116
|
+
REQUESTED_RESOURCE_NOT_FOUND = "requested_resource_not_found"
|
117
|
+
|
118
|
+
@classmethod
|
119
|
+
def from_json(cls, json_str: str) -> Self:
|
120
|
+
"""Create an instance of ApiErrorIdentifier from a JSON string"""
|
121
|
+
return cls(json.loads(json_str))
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
DEX AI API
|
5
|
+
|
6
|
+
API for DEX AI
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import json
|
17
|
+
from enum import Enum
|
18
|
+
from typing_extensions import Self
|
19
|
+
|
20
|
+
|
21
|
+
class ApiErrorLevel(str, Enum):
|
22
|
+
"""
|
23
|
+
Level of the API error.
|
24
|
+
"""
|
25
|
+
|
26
|
+
"""
|
27
|
+
allowed enum values
|
28
|
+
"""
|
29
|
+
ERROR = "error"
|
30
|
+
INFO = "info"
|
31
|
+
SUCCESS = "success"
|
32
|
+
WARNING = "warning"
|
33
|
+
|
34
|
+
@classmethod
|
35
|
+
def from_json(cls, json_str: str) -> Self:
|
36
|
+
"""Create an instance of ApiErrorLevel from a JSON string"""
|
37
|
+
return cls(json.loads(json_str))
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
DEX AI API
|
5
|
+
|
6
|
+
API for DEX AI
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import json
|
17
|
+
from enum import Enum
|
18
|
+
from typing_extensions import Self
|
19
|
+
|
20
|
+
|
21
|
+
class ApiErrorType(str, Enum):
|
22
|
+
"""
|
23
|
+
Type of the API error.
|
24
|
+
"""
|
25
|
+
|
26
|
+
"""
|
27
|
+
allowed enum values
|
28
|
+
"""
|
29
|
+
USER_ERROR = "user error"
|
30
|
+
EXCHANGE_ERROR = "exchange error"
|
31
|
+
SERVER_ERROR = "server error"
|
32
|
+
NO_ERROR = "no error"
|
33
|
+
|
34
|
+
@classmethod
|
35
|
+
def from_json(cls, json_str: str) -> Self:
|
36
|
+
"""Create an instance of ApiErrorType from a JSON string"""
|
37
|
+
return cls(json.loads(json_str))
|
@@ -0,0 +1,117 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
DEX AI API
|
5
|
+
|
6
|
+
API for DEX AI
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from crypticorn.dex.client.models.api_error_identifier import ApiErrorIdentifier
|
23
|
+
from crypticorn.dex.client.models.api_error_level import ApiErrorLevel
|
24
|
+
from crypticorn.dex.client.models.api_error_type import ApiErrorType
|
25
|
+
from typing import Set
|
26
|
+
from typing_extensions import Self
|
27
|
+
|
28
|
+
|
29
|
+
class ExceptionDetail(BaseModel):
|
30
|
+
"""
|
31
|
+
Exception details returned to the client.
|
32
|
+
""" # noqa: E501
|
33
|
+
|
34
|
+
message: Optional[StrictStr] = None
|
35
|
+
code: ApiErrorIdentifier = Field(description="The unique error code")
|
36
|
+
type: ApiErrorType = Field(description="The type of error")
|
37
|
+
level: ApiErrorLevel = Field(description="The level of the error")
|
38
|
+
status_code: StrictInt = Field(description="The HTTP status code")
|
39
|
+
details: Optional[Any] = None
|
40
|
+
__properties: ClassVar[List[str]] = [
|
41
|
+
"message",
|
42
|
+
"code",
|
43
|
+
"type",
|
44
|
+
"level",
|
45
|
+
"status_code",
|
46
|
+
"details",
|
47
|
+
]
|
48
|
+
|
49
|
+
model_config = ConfigDict(
|
50
|
+
populate_by_name=True,
|
51
|
+
validate_assignment=True,
|
52
|
+
protected_namespaces=(),
|
53
|
+
)
|
54
|
+
|
55
|
+
def to_str(self) -> str:
|
56
|
+
"""Returns the string representation of the model using alias"""
|
57
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
58
|
+
|
59
|
+
def to_json(self) -> str:
|
60
|
+
"""Returns the JSON representation of the model using alias"""
|
61
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
62
|
+
return json.dumps(self.to_dict())
|
63
|
+
|
64
|
+
@classmethod
|
65
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
66
|
+
"""Create an instance of ExceptionDetail from a JSON string"""
|
67
|
+
return cls.from_dict(json.loads(json_str))
|
68
|
+
|
69
|
+
def to_dict(self) -> Dict[str, Any]:
|
70
|
+
"""Return the dictionary representation of the model using alias.
|
71
|
+
|
72
|
+
This has the following differences from calling pydantic's
|
73
|
+
`self.model_dump(by_alias=True)`:
|
74
|
+
|
75
|
+
* `None` is only added to the output dict for nullable fields that
|
76
|
+
were set at model initialization. Other fields with value `None`
|
77
|
+
are ignored.
|
78
|
+
"""
|
79
|
+
excluded_fields: Set[str] = set([])
|
80
|
+
|
81
|
+
_dict = self.model_dump(
|
82
|
+
by_alias=True,
|
83
|
+
exclude=excluded_fields,
|
84
|
+
exclude_none=True,
|
85
|
+
)
|
86
|
+
# set to None if message (nullable) is None
|
87
|
+
# and model_fields_set contains the field
|
88
|
+
if self.message is None and "message" in self.model_fields_set:
|
89
|
+
_dict["message"] = None
|
90
|
+
|
91
|
+
# set to None if details (nullable) is None
|
92
|
+
# and model_fields_set contains the field
|
93
|
+
if self.details is None and "details" in self.model_fields_set:
|
94
|
+
_dict["details"] = None
|
95
|
+
|
96
|
+
return _dict
|
97
|
+
|
98
|
+
@classmethod
|
99
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
100
|
+
"""Create an instance of ExceptionDetail from a dict"""
|
101
|
+
if obj is None:
|
102
|
+
return None
|
103
|
+
|
104
|
+
if not isinstance(obj, dict):
|
105
|
+
return cls.model_validate(obj)
|
106
|
+
|
107
|
+
_obj = cls.model_validate(
|
108
|
+
{
|
109
|
+
"message": obj.get("message"),
|
110
|
+
"code": obj.get("code"),
|
111
|
+
"type": obj.get("type"),
|
112
|
+
"level": obj.get("level"),
|
113
|
+
"status_code": obj.get("status_code"),
|
114
|
+
"details": obj.get("details"),
|
115
|
+
}
|
116
|
+
)
|
117
|
+
return _obj
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
DEX AI API
|
5
|
+
|
6
|
+
API for DEX AI
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import json
|
17
|
+
from enum import Enum
|
18
|
+
from typing_extensions import Self
|
19
|
+
|
20
|
+
|
21
|
+
class LogLevel(str, Enum):
|
22
|
+
"""
|
23
|
+
LogLevel
|
24
|
+
"""
|
25
|
+
|
26
|
+
"""
|
27
|
+
allowed enum values
|
28
|
+
"""
|
29
|
+
DEBUG = "DEBUG"
|
30
|
+
INFO = "INFO"
|
31
|
+
WARNING = "WARNING"
|
32
|
+
ERROR = "ERROR"
|
33
|
+
CRITICAL = "CRITICAL"
|
34
|
+
|
35
|
+
@classmethod
|
36
|
+
def from_json(cls, json_str: str) -> Self:
|
37
|
+
"""Create an instance of LogLevel from a JSON string"""
|
38
|
+
return cls(json.loads(json_str))
|