crypticorn 2.14.0__py3-none-any.whl → 2.15.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/templates/auth.py +1 -6
- crypticorn/client.py +4 -2
- crypticorn/common/enums.py +18 -1
- crypticorn/common/router/status_router.py +1 -1
- crypticorn/common/warnings.py +6 -0
- crypticorn/metrics/client/configuration.py +2 -4
- crypticorn/metrics/client/models/api_error_identifier.py +7 -7
- {crypticorn-2.14.0.dist-info → crypticorn-2.15.0.dist-info}/METADATA +1 -1
- {crypticorn-2.14.0.dist-info → crypticorn-2.15.0.dist-info}/RECORD +13 -13
- {crypticorn-2.14.0.dist-info → crypticorn-2.15.0.dist-info}/WHEEL +1 -1
- {crypticorn-2.14.0.dist-info → crypticorn-2.15.0.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.14.0.dist-info → crypticorn-2.15.0.dist-info}/licenses/LICENSE +0 -0
- {crypticorn-2.14.0.dist-info → crypticorn-2.15.0.dist-info}/top_level.txt +0 -0
crypticorn/cli/templates/auth.py
CHANGED
@@ -14,14 +14,9 @@ dotenv.load_dotenv()
|
|
14
14
|
|
15
15
|
logger = logging.getLogger(__name__)
|
16
16
|
|
17
|
-
DOCKER_ENV = os.getenv("IS_DOCKER")
|
17
|
+
DOCKER_ENV = os.getenv("IS_DOCKER", "0")
|
18
18
|
API_ENV = os.getenv("API_ENV")
|
19
19
|
|
20
|
-
if not DOCKER_ENV:
|
21
|
-
raise ValueError(
|
22
|
-
"IS_DOCKER is not set. Please set it to '0' in .env and '1' in the docker-compose.yml file."
|
23
|
-
)
|
24
|
-
|
25
20
|
if not API_ENV:
|
26
21
|
raise ValueError(
|
27
22
|
"API_ENV is not set. Please set it to 'prod', 'dev' or 'local' in .env (of type ApiEnv)."
|
crypticorn/client.py
CHANGED
@@ -37,7 +37,7 @@ class ApiClient:
|
|
37
37
|
"""The version of the client."""
|
38
38
|
|
39
39
|
self._http_client = http_client
|
40
|
-
self._owns_http_client = http_client is None
|
40
|
+
self._owns_http_client = http_client is None # whether we own the http client
|
41
41
|
self._service_classes: dict[Service, type[SubClient]] = {
|
42
42
|
Service.HIVE: HiveClient,
|
43
43
|
Service.TRADE: TradeClient,
|
@@ -116,7 +116,9 @@ class ApiClient:
|
|
116
116
|
headers={"User-Agent": f"crypticorn/python/{self.version}"},
|
117
117
|
)
|
118
118
|
for service in self._services.values():
|
119
|
-
if hasattr(service,
|
119
|
+
if hasattr(service, "base_client") and hasattr(
|
120
|
+
service.base_client, "rest_client"
|
121
|
+
):
|
120
122
|
service.base_client.rest_client.pool_manager = self._http_client
|
121
123
|
|
122
124
|
def _get_default_config(self, service, version=None):
|
crypticorn/common/enums.py
CHANGED
@@ -5,15 +5,24 @@ try:
|
|
5
5
|
except ImportError:
|
6
6
|
from strenum import StrEnum
|
7
7
|
|
8
|
+
from enum import Enum
|
9
|
+
import warnings
|
10
|
+
import typing_extensions
|
8
11
|
from crypticorn.common.mixins import ValidateEnumMixin
|
12
|
+
from crypticorn.common.warnings import CrypticornDeprecatedSince215
|
9
13
|
|
10
14
|
|
11
15
|
class Exchange(ValidateEnumMixin, StrEnum):
|
12
|
-
"""
|
16
|
+
"""All exchanges used in the crypticorn ecosystem. Refer to the APIs for support for a specific usecase (data, trading, etc.)."""
|
13
17
|
|
14
18
|
KUCOIN = "kucoin"
|
15
19
|
BINGX = "bingx"
|
20
|
+
BINANCE = "binance"
|
21
|
+
BYBIT = "bybit"
|
16
22
|
HYPERLIQUID = "hyperliquid"
|
23
|
+
BITGET = "bitget"
|
24
|
+
GATEIO = "gateio"
|
25
|
+
BITSTAMP = "bitstamp"
|
17
26
|
|
18
27
|
|
19
28
|
class InternalExchange(ValidateEnumMixin, StrEnum):
|
@@ -26,6 +35,14 @@ class InternalExchange(ValidateEnumMixin, StrEnum):
|
|
26
35
|
HYPERLIQUID = "hyperliquid"
|
27
36
|
BITGET = "bitget"
|
28
37
|
|
38
|
+
@classmethod
|
39
|
+
def __getattr__(cls, name):
|
40
|
+
warnings.warn(
|
41
|
+
"The `InternalExchange` enum is deprecated; use `Exchange` instead.",
|
42
|
+
category=CrypticornDeprecatedSince215,
|
43
|
+
)
|
44
|
+
return super().__getattr__(name)
|
45
|
+
|
29
46
|
|
30
47
|
class MarketType(ValidateEnumMixin, StrEnum):
|
31
48
|
"""
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"""
|
2
2
|
This module contains the status router for the API.
|
3
3
|
It provides endpoints for checking the status of the API and get the server's time.
|
4
|
-
SHOULD ALLOW ACCESS TO THIS ROUTER WITHOUT.
|
4
|
+
SHOULD ALLOW ACCESS TO THIS ROUTER WITHOUT AUTH.
|
5
5
|
>>> app.include_router(status_router)
|
6
6
|
"""
|
7
7
|
|
crypticorn/common/warnings.py
CHANGED
@@ -55,6 +55,12 @@ class CrypticornDeprecatedSince28(CrypticornDeprecationWarning):
|
|
55
55
|
def __init__(self, message: str, *args: object) -> None:
|
56
56
|
super().__init__(message, *args, since=(2, 8), expected_removal=(3, 0))
|
57
57
|
|
58
|
+
class CrypticornDeprecatedSince215(CrypticornDeprecationWarning):
|
59
|
+
"""A specific `CrypticornDeprecationWarning` subclass defining functionality deprecated since Crypticorn 2.15."""
|
60
|
+
|
61
|
+
def __init__(self, message: str, *args: object) -> None:
|
62
|
+
super().__init__(message, *args, since=(2, 15), expected_removal=(3, 0))
|
63
|
+
|
58
64
|
|
59
65
|
class CrypticornExperimentalWarning(Warning):
|
60
66
|
"""A Crypticorn specific experimental functionality warning.
|
@@ -215,9 +215,7 @@ class Configuration:
|
|
215
215
|
debug: Optional[bool] = None,
|
216
216
|
) -> None:
|
217
217
|
"""Constructor"""
|
218
|
-
self._base_path =
|
219
|
-
"https://api.crypticorn.dev/v1/metrics" if host is None else host
|
220
|
-
)
|
218
|
+
self._base_path = "http://localhost/v1/metrics" if host is None else host
|
221
219
|
"""Default Base url
|
222
220
|
"""
|
223
221
|
self.server_index = 0 if server_index is None and host is None else server_index
|
@@ -559,7 +557,7 @@ class Configuration:
|
|
559
557
|
"""
|
560
558
|
return [
|
561
559
|
{
|
562
|
-
"url": "
|
560
|
+
"url": "http://localhost/v1/metrics",
|
563
561
|
"description": "No description provided",
|
564
562
|
}
|
565
563
|
]
|
@@ -28,15 +28,17 @@ class ApiErrorIdentifier(str, Enum):
|
|
28
28
|
"""
|
29
29
|
ALLOCATION_BELOW_CURRENT_EXPOSURE = "allocation_below_current_exposure"
|
30
30
|
ALLOCATION_BELOW_MIN_AMOUNT = "allocation_below_min_amount"
|
31
|
+
ALLOCATION_LIMIT_EXCEEDED = "allocation_limit_exceeded"
|
31
32
|
BLACK_SWAN = "black_swan"
|
32
33
|
BOT_ALREADY_DELETED = "bot_already_deleted"
|
33
|
-
BOT_DISABLED = "bot_disabled"
|
34
34
|
BOT_STOPPING_COMPLETED = "bot_stopping_completed"
|
35
35
|
BOT_STOPPING_STARTED = "bot_stopping_started"
|
36
36
|
CANCELLED_OPEN_ORDER = "cancelled_open_order"
|
37
37
|
CLIENT_ORDER_ID_ALREADY_EXISTS = "client_order_id_already_exists"
|
38
38
|
INVALID_CONTENT_TYPE = "invalid_content_type"
|
39
39
|
DELETE_BOT_ERROR = "delete_bot_error"
|
40
|
+
EXCHANGE_HTTP_REQUEST_ERROR = "exchange_http_request_error"
|
41
|
+
EXCHANGE_INVALID_PARAMETER = "exchange_invalid_parameter"
|
40
42
|
EXCHANGE_INVALID_SIGNATURE = "exchange_invalid_signature"
|
41
43
|
EXCHANGE_INVALID_TIMESTAMP = "exchange_invalid_timestamp"
|
42
44
|
EXCHANGE_IP_ADDRESS_IS_NOT_AUTHORIZED = "exchange_ip_address_is_not_authorized"
|
@@ -56,10 +58,9 @@ class ApiErrorIdentifier(str, Enum):
|
|
56
58
|
EXCHANGE_USER_ACCOUNT_IS_FROZEN = "exchange_user_account_is_frozen"
|
57
59
|
API_KEY_EXPIRED = "api_key_expired"
|
58
60
|
BEARER_TOKEN_EXPIRED = "bearer_token_expired"
|
59
|
-
|
61
|
+
FAILED_OPEN_ORDER = "failed_open_order"
|
60
62
|
FORBIDDEN = "forbidden"
|
61
63
|
HEDGE_MODE_NOT_ACTIVE = "hedge_mode_not_active"
|
62
|
-
HTTP_REQUEST_ERROR = "http_request_error"
|
63
64
|
INSUFFICIENT_BALANCE = "insufficient_balance"
|
64
65
|
INSUFFICIENT_MARGIN = "insufficient_margin"
|
65
66
|
INSUFFICIENT_SCOPES = "insufficient_scopes"
|
@@ -68,15 +69,15 @@ class ApiErrorIdentifier(str, Enum):
|
|
68
69
|
INVALID_DATA = "invalid_data"
|
69
70
|
INVALID_DATA_RESPONSE = "invalid_data_response"
|
70
71
|
INVALID_EXCHANGE_KEY = "invalid_exchange_key"
|
71
|
-
INVALID_MARGIN_MODE = "invalid_margin_mode"
|
72
72
|
INVALID_MODEL_NAME = "invalid_model_name"
|
73
|
-
INVALID_PARAMETER_PROVIDED = "exchange_invalid_parameter"
|
74
73
|
LEVERAGE_LIMIT_EXCEEDED = "leverage_limit_exceeded"
|
75
74
|
ORDER_VIOLATES_LIQUIDATION_PRICE_CONSTRAINTS = (
|
76
75
|
"order_violates_liquidation_price_constraints"
|
77
76
|
)
|
78
77
|
MARGIN_MODE_CLASH = "margin_mode_clash"
|
79
78
|
NAME_NOT_UNIQUE = "name_not_unique"
|
79
|
+
NO_API_KEY = "no_api_key"
|
80
|
+
NO_BEARER = "no_bearer"
|
80
81
|
NO_CREDENTIALS = "no_credentials"
|
81
82
|
NOW_API_DOWN = "now_api_down"
|
82
83
|
OBJECT_ALREADY_EXISTS = "object_already_exists"
|
@@ -102,14 +103,13 @@ class ApiErrorIdentifier(str, Enum):
|
|
102
103
|
RISK_LIMIT_EXCEEDED = "risk_limit_exceeded"
|
103
104
|
RPC_TIMEOUT = "rpc_timeout"
|
104
105
|
SYSTEM_SETTLEMENT_IN_PROCESS = "system_settlement_in_process"
|
105
|
-
STRATEGY_ALREADY_EXISTS = "strategy_already_exists"
|
106
106
|
STRATEGY_DISABLED = "strategy_disabled"
|
107
107
|
STRATEGY_LEVERAGE_MISMATCH = "strategy_leverage_mismatch"
|
108
108
|
STRATEGY_NOT_SUPPORTING_EXCHANGE = "strategy_not_supporting_exchange"
|
109
109
|
SUCCESS = "success"
|
110
110
|
SYMBOL_DOES_NOT_EXIST = "symbol_does_not_exist"
|
111
111
|
TRADING_ACTION_EXPIRED = "trading_action_expired"
|
112
|
-
TRADING_ACTION_SKIPPED_BOT_STOPPING = "
|
112
|
+
TRADING_ACTION_SKIPPED_BOT_STOPPING = "trading_action_skipped_bot_stopping"
|
113
113
|
TRADING_HAS_BEEN_LOCKED = "trading_has_been_locked"
|
114
114
|
TRADING_IS_SUSPENDED = "trading_is_suspended"
|
115
115
|
UNKNOWN_ERROR_OCCURRED = "unknown_error_occurred"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
crypticorn/__init__.py,sha256=ctrwe5CQtYhnetHYPgSmC0CIHa4xbDsLZvpY38tfEow,423
|
2
|
-
crypticorn/client.py,sha256=
|
2
|
+
crypticorn/client.py,sha256=eGEk-AuoVFCuXdygMXqCivj6G56O_I_JH14C8lKW3Dk,6062
|
3
3
|
crypticorn/auth/__init__.py,sha256=JAl1tBLK9pYLr_-YKaj581c-c94PWLoqnatTIVAVvMM,81
|
4
4
|
crypticorn/auth/main.py,sha256=FHLsAbp2mXDlmcPmLKc29qaD1dBev65V3DNKLyfz4Tw,1012
|
5
5
|
crypticorn/auth/client/__init__.py,sha256=do16xS84uXvVoJuWERjb9RwlOaLy4UF4uKBZWczFC3c,5291
|
@@ -61,7 +61,7 @@ crypticorn/cli/init.py,sha256=-ZVXbrHb_Yg8a4bKyflgi9Om5GHVYo3vX91X44b90ZA,4100
|
|
61
61
|
crypticorn/cli/version.py,sha256=OVDxeL80eMgZsFgw2cDSzFfuaRToDfnYAVOQTpkoMWs,206
|
62
62
|
crypticorn/cli/templates/Dockerfile,sha256=89KlphaXJH51L7Vs4B928WmwYcMtpvLmKGyoDAhOcMw,726
|
63
63
|
crypticorn/cli/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
64
|
-
crypticorn/cli/templates/auth.py,sha256=
|
64
|
+
crypticorn/cli/templates/auth.py,sha256=i27-Ts-Eiyv6_WRshOp7NV5OYUNbw2-kiN5Ll0k2UOA,839
|
65
65
|
crypticorn/cli/templates/dependabot.yml,sha256=ct5ieB8KAV1KLzoYKUNm6dZ9wKG_P_JQHgRjZUfT54w,861
|
66
66
|
crypticorn/cli/templates/merge-env.sh,sha256=BNPrDTihII0yG2gehBkWwWj0GqHmb6xwmrAgwFpl8dA,554
|
67
67
|
crypticorn/cli/templates/ruff.yml,sha256=gWicFFTzC4nToSmRkIIGipos8CZ447YG0kebBCJhtJE,319
|
@@ -69,7 +69,7 @@ crypticorn/common/__init__.py,sha256=DXEuUU_kaLBSBcvpiFie_ROuK5XEZuTMIfsg-BZE0iE
|
|
69
69
|
crypticorn/common/ansi_colors.py,sha256=-tMlUTE8NI7TPv7uj0kGRe-SI2hGaUNPKBFI_dfiZy0,1392
|
70
70
|
crypticorn/common/auth.py,sha256=b7jhR8k7bQFfgokI_Eqji0MpfiyD4EhCoddefUSqs6Y,9925
|
71
71
|
crypticorn/common/decorators.py,sha256=t5Y3vSJ-gt0n2vOYYjYN0dtzNXvZxrJs2SEItpzG8oo,1127
|
72
|
-
crypticorn/common/enums.py,sha256=
|
72
|
+
crypticorn/common/enums.py,sha256=x-2xe0NUI8kB6DNg9GLjqAjYOsFAGwP-jdM1YgIt9AI,1381
|
73
73
|
crypticorn/common/errors.py,sha256=qPCYpmxw0uZNmQw9RYj9vUsg-_R5aRn7fYE8qxTAnyA,30129
|
74
74
|
crypticorn/common/exceptions.py,sha256=4oT58wcL9zQuqYU8op_36uZ1Kzt7JRCccu-o_usgqtU,6392
|
75
75
|
crypticorn/common/logging.py,sha256=n-qaYreRNFVAFRUd91hzYoaTExNLysd9cgEXm-v6eJY,4440
|
@@ -80,9 +80,9 @@ crypticorn/common/pagination.py,sha256=BYMNB4JUW9eeiTw1q3CyHXaT_-hk_BrSXAOqvif08
|
|
80
80
|
crypticorn/common/scopes.py,sha256=H-ow744XhArgN2Zb7SESP5ZZ6fNjA5oY1eHuZsuF4Gw,2827
|
81
81
|
crypticorn/common/urls.py,sha256=v23H2gevTNZ6HMRXDPiuc8znBbNdNqj0JTAdm5Hhms8,1223
|
82
82
|
crypticorn/common/utils.py,sha256=LcWudhcjZtULg87yYghh5muTYdHvk3UmkEAXmX7xgLk,3073
|
83
|
-
crypticorn/common/warnings.py,sha256=
|
83
|
+
crypticorn/common/warnings.py,sha256=oPfiggFiRPASwkUCn_SIikhgY0q1FV9hpa93ZepvfEY,2754
|
84
84
|
crypticorn/common/router/admin_router.py,sha256=x81s1gxhH7nLf7txqAIjVxrNgQmXsA1YG7g9v9KJwHA,3740
|
85
|
-
crypticorn/common/router/status_router.py,sha256=
|
85
|
+
crypticorn/common/router/status_router.py,sha256=NpLaCF2a1jApo95iolKzzUKuyHbpf4Xwc0sM7dxQ9DE,873
|
86
86
|
crypticorn/hive/__init__.py,sha256=hRfTlEzEql4msytdUC_04vfaHzVKG5CGZle1M-9QFgY,81
|
87
87
|
crypticorn/hive/main.py,sha256=bSOY2PBi4VV_mvN1c0FQAI-En28f8HnmoZDm3g9X6lU,3103
|
88
88
|
crypticorn/hive/utils.py,sha256=5T2GYnIFazXgAdUlO03xWqcMWhWkM82cfWvwsO8geHE,2040
|
@@ -164,7 +164,7 @@ crypticorn/metrics/main.py,sha256=hVOlPsn2_1rrAGBxUO95KO2rpVlJUmIdzdUAs0ORgXw,35
|
|
164
164
|
crypticorn/metrics/client/__init__.py,sha256=bu9LdJkG7vljgmLVKhoSY08ooOuEo0AhoHt7-zDVyek,2720
|
165
165
|
crypticorn/metrics/client/api_client.py,sha256=pGWJuO-mgxlUdhJGwkScf7CviGzjDrmUAiU0LXasQY4,26934
|
166
166
|
crypticorn/metrics/client/api_response.py,sha256=WhxwYDSMm6wPixp9CegO8dJzjFxDz3JF1yCq9s0ZqKE,639
|
167
|
-
crypticorn/metrics/client/configuration.py,sha256=
|
167
|
+
crypticorn/metrics/client/configuration.py,sha256=wA1hBWEINMM_AlZg-DAv1AelmkjBERB5d2gA66aEwSM,19158
|
168
168
|
crypticorn/metrics/client/exceptions.py,sha256=UegnYftFlQDXAQv8BmD20yRzTtWpjTHcuOymTBWmgeE,6421
|
169
169
|
crypticorn/metrics/client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
170
170
|
crypticorn/metrics/client/rest.py,sha256=pWeYnpTfTV7L5U6Kli3b7i8VrmqdG8sskqSnTHPIoQo,7025
|
@@ -179,7 +179,7 @@ crypticorn/metrics/client/api/quote_currencies_api.py,sha256=H4c3zOp5eTTUrRMlMH-
|
|
179
179
|
crypticorn/metrics/client/api/status_api.py,sha256=_Ou_EGmjPyv32G-S4QKfRemdpGG6FUsgOkbGDfYaFp0,19633
|
180
180
|
crypticorn/metrics/client/api/tokens_api.py,sha256=x5a-YAeAgFJm-pN4K3-lOM-WPVYAxoBr-AYb-oxhysM,19522
|
181
181
|
crypticorn/metrics/client/models/__init__.py,sha256=hPPLh2kQc3KNHCLeOT7AS2HXu04LEeSp_G4ME7BCmW4,1475
|
182
|
-
crypticorn/metrics/client/models/api_error_identifier.py,sha256=
|
182
|
+
crypticorn/metrics/client/models/api_error_identifier.py,sha256=S55hnVdp469PkfdWCcpKlpEfO9_gLzQZPuY-gKwOuBA,5238
|
183
183
|
crypticorn/metrics/client/models/api_error_level.py,sha256=soxtGExzlBja-Jux_jguro-1taLAGcKmGSHlxTKTYR4,772
|
184
184
|
crypticorn/metrics/client/models/api_error_type.py,sha256=Y8pCAtdcS4zfTetTZj9x60BFJwSXD6ro-8NU38aEDyQ,811
|
185
185
|
crypticorn/metrics/client/models/exception_detail.py,sha256=GIIa_LNZrtXlWCMLh1OAgEO6UoBo3m0kiCk788wMbuA,3853
|
@@ -279,9 +279,9 @@ crypticorn/trade/client/models/strategy_update.py,sha256=f7UsKSlNardj5h6uqHYbacj
|
|
279
279
|
crypticorn/trade/client/models/tpsl.py,sha256=lLPVSvLETgLMFqH9wEBUTQXY6aaydMifEt47mYbfw-A,4111
|
280
280
|
crypticorn/trade/client/models/tpsl_create.py,sha256=nX4i2BGWv5rmu3SLgRngfvEMFOWa3CIy0G3fyoxI-e4,3351
|
281
281
|
crypticorn/trade/client/models/trading_action_type.py,sha256=BysUEOl85zs79EA2zOcDN1EExcpQdABaJ4Jz08_z8VU,857
|
282
|
-
crypticorn-2.
|
283
|
-
crypticorn-2.
|
284
|
-
crypticorn-2.
|
285
|
-
crypticorn-2.
|
286
|
-
crypticorn-2.
|
287
|
-
crypticorn-2.
|
282
|
+
crypticorn-2.15.0.dist-info/licenses/LICENSE,sha256=HonAVvzFXkP2C1d7D3ByIKPwjGH8NcHTAQvKH7uvOHQ,1856
|
283
|
+
crypticorn-2.15.0.dist-info/METADATA,sha256=i0iH4qz70QhkjI5fn4C0MaI--zdLu_uX4vR2MuO4MIE,9993
|
284
|
+
crypticorn-2.15.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
285
|
+
crypticorn-2.15.0.dist-info/entry_points.txt,sha256=d_xHsGvUTebPveVUK0SrpDFQ5ZRSjlI7lNCc11sn2PM,59
|
286
|
+
crypticorn-2.15.0.dist-info/top_level.txt,sha256=EP3NY216qIBYfmvGl0L2Zc9ItP0DjGSkiYqd9xJwGcM,11
|
287
|
+
crypticorn-2.15.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|