crypticorn 2.15.0__py3-none-any.whl → 2.17.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/__init__.py +2 -2
- crypticorn/auth/client/api/admin_api.py +397 -13
- crypticorn/auth/client/api/auth_api.py +3610 -341
- crypticorn/auth/client/api/service_api.py +249 -7
- crypticorn/auth/client/api/user_api.py +2295 -179
- crypticorn/auth/client/api/wallet_api.py +1468 -81
- crypticorn/auth/client/configuration.py +2 -2
- crypticorn/auth/client/models/create_api_key_request.py +2 -1
- crypticorn/auth/client/models/get_api_keys200_response_inner.py +2 -1
- crypticorn/auth/client/rest.py +23 -4
- crypticorn/auth/main.py +8 -5
- crypticorn/cli/init.py +1 -1
- crypticorn/cli/templates/.env.docker.temp +3 -0
- crypticorn/cli/templates/.env.example.temp +4 -0
- crypticorn/cli/templates/Dockerfile +5 -2
- crypticorn/client.py +226 -59
- crypticorn/common/__init__.py +1 -0
- crypticorn/common/auth.py +45 -14
- crypticorn/common/decorators.py +1 -2
- crypticorn/common/enums.py +0 -2
- crypticorn/common/errors.py +10 -0
- crypticorn/common/metrics.py +30 -0
- crypticorn/common/middleware.py +94 -1
- crypticorn/common/pagination.py +252 -18
- crypticorn/common/router/admin_router.py +2 -2
- crypticorn/common/router/status_router.py +40 -2
- crypticorn/common/scopes.py +2 -0
- crypticorn/common/warnings.py +8 -0
- 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 +2986 -0
- crypticorn/dex/client/api/signals_api.py +1798 -0
- crypticorn/dex/client/api/status_api.py +892 -0
- crypticorn/dex/client/api_client.py +758 -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 +158 -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 +1173 -47
- crypticorn/hive/client/api/data_api.py +499 -17
- crypticorn/hive/client/api/models_api.py +1595 -87
- crypticorn/hive/client/api/status_api.py +397 -16
- crypticorn/hive/client/api_client.py +0 -5
- crypticorn/hive/client/models/api_error_identifier.py +1 -1
- 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/client/rest.py +23 -4
- crypticorn/hive/main.py +99 -25
- crypticorn/hive/utils.py +2 -2
- crypticorn/klines/client/api/admin_api.py +1173 -47
- crypticorn/klines/client/api/change_in_timeframe_api.py +269 -11
- crypticorn/klines/client/api/funding_rates_api.py +315 -11
- crypticorn/klines/client/api/ohlcv_data_api.py +390 -11
- crypticorn/klines/client/api/status_api.py +397 -16
- crypticorn/klines/client/api/symbols_api.py +216 -11
- crypticorn/klines/client/api/udf_api.py +1268 -51
- crypticorn/klines/client/api_client.py +0 -5
- crypticorn/klines/client/models/api_error_identifier.py +3 -1
- 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/klines/client/rest.py +23 -4
- crypticorn/klines/main.py +89 -12
- crypticorn/metrics/client/api/admin_api.py +1173 -47
- crypticorn/metrics/client/api/exchanges_api.py +1370 -145
- crypticorn/metrics/client/api/indicators_api.py +622 -17
- crypticorn/metrics/client/api/logs_api.py +296 -11
- crypticorn/metrics/client/api/marketcap_api.py +1207 -67
- crypticorn/metrics/client/api/markets_api.py +343 -11
- crypticorn/metrics/client/api/quote_currencies_api.py +228 -11
- crypticorn/metrics/client/api/status_api.py +397 -16
- crypticorn/metrics/client/api/tokens_api.py +382 -15
- crypticorn/metrics/client/api_client.py +0 -5
- crypticorn/metrics/client/configuration.py +4 -2
- 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/metrics/client/rest.py +23 -4
- crypticorn/metrics/main.py +113 -19
- crypticorn/pay/client/api/admin_api.py +1585 -57
- crypticorn/pay/client/api/now_payments_api.py +961 -39
- crypticorn/pay/client/api/payments_api.py +562 -17
- crypticorn/pay/client/api/products_api.py +880 -30
- crypticorn/pay/client/api/status_api.py +397 -16
- crypticorn/pay/client/api_client.py +0 -5
- crypticorn/pay/client/configuration.py +2 -2
- crypticorn/pay/client/models/api_error_identifier.py +7 -7
- 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/pay/client/models/scope.py +1 -0
- crypticorn/pay/client/rest.py +23 -4
- crypticorn/pay/main.py +10 -6
- crypticorn/trade/client/__init__.py +11 -1
- crypticorn/trade/client/api/__init__.py +0 -1
- crypticorn/trade/client/api/admin_api.py +1184 -55
- crypticorn/trade/client/api/api_keys_api.py +1678 -162
- crypticorn/trade/client/api/bots_api.py +7563 -187
- crypticorn/trade/client/api/exchanges_api.py +565 -19
- crypticorn/trade/client/api/notifications_api.py +1290 -116
- crypticorn/trade/client/api/orders_api.py +393 -55
- crypticorn/trade/client/api/status_api.py +397 -13
- crypticorn/trade/client/api/strategies_api.py +1133 -77
- crypticorn/trade/client/api/trading_actions_api.py +786 -65
- crypticorn/trade/client/models/__init__.py +11 -0
- crypticorn/trade/client/models/actions_count.py +88 -0
- crypticorn/trade/client/models/api_error_identifier.py +8 -7
- 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.py +6 -1
- crypticorn/trade/client/models/exchange_key.py +1 -1
- crypticorn/trade/client/models/exchange_key_balance.py +111 -0
- crypticorn/trade/client/models/exchange_key_create.py +17 -1
- crypticorn/trade/client/models/exchange_key_update.py +17 -1
- crypticorn/trade/client/models/execution_ids.py +1 -1
- crypticorn/trade/client/models/futures_balance.py +27 -25
- crypticorn/trade/client/models/futures_trading_action.py +6 -28
- crypticorn/trade/client/models/futures_trading_action_create.py +10 -13
- crypticorn/trade/client/models/notification.py +17 -1
- crypticorn/trade/client/models/notification_create.py +18 -2
- crypticorn/trade/client/models/notification_update.py +17 -1
- crypticorn/trade/client/models/order.py +2 -14
- crypticorn/trade/client/models/orders_count.py +88 -0
- crypticorn/trade/client/models/paginated_response_futures_trading_action.py +134 -0
- crypticorn/trade/client/models/paginated_response_order.py +134 -0
- crypticorn/trade/client/models/pn_l.py +95 -0
- crypticorn/trade/client/models/post_futures_action.py +1 -1
- crypticorn/trade/client/models/spot_balance.py +109 -0
- crypticorn/trade/client/models/spot_trading_action_create.py +4 -1
- crypticorn/trade/client/models/strategy.py +22 -4
- crypticorn/trade/client/models/strategy_create.py +23 -5
- crypticorn/trade/client/models/strategy_exchange_info.py +16 -4
- crypticorn/trade/client/models/strategy_update.py +19 -3
- crypticorn/trade/client/models/tpsl.py +4 -27
- crypticorn/trade/client/models/tpsl_create.py +6 -19
- crypticorn/trade/client/rest.py +23 -4
- crypticorn/trade/main.py +15 -12
- {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/METADATA +65 -20
- {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/RECORD +167 -132
- crypticorn/trade/client/api/futures_trading_panel_api.py +0 -1285
- {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/WHEEL +0 -0
- {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/licenses/LICENSE +0 -0
- {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/top_level.txt +0 -0
@@ -11,17 +11,33 @@ Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
11
|
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
|
-
import warnings
|
15
14
|
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
16
15
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
17
16
|
from typing_extensions import Annotated
|
18
17
|
|
19
|
-
from typing import Any, Dict, List
|
20
18
|
|
21
19
|
from crypticorn.metrics.client.api_client import ApiClient, RequestSerialized
|
22
20
|
from crypticorn.metrics.client.api_response import ApiResponse
|
23
21
|
from crypticorn.metrics.client.rest import RESTResponseType
|
24
22
|
|
23
|
+
# Import async_to_sync for sync methods
|
24
|
+
try:
|
25
|
+
from asgiref.sync import async_to_sync
|
26
|
+
|
27
|
+
_HAS_ASGIREF = True
|
28
|
+
except ImportError:
|
29
|
+
_HAS_ASGIREF = False
|
30
|
+
|
31
|
+
def async_to_sync(async_func):
|
32
|
+
"""Fallback decorator that raises an error if asgiref is not available."""
|
33
|
+
|
34
|
+
def wrapper(*args, **kwargs):
|
35
|
+
raise ImportError(
|
36
|
+
"asgiref is required for sync methods. Install with: pip install asgiref"
|
37
|
+
)
|
38
|
+
|
39
|
+
return wrapper
|
40
|
+
|
25
41
|
|
26
42
|
class TokensApi:
|
27
43
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
@@ -30,13 +46,117 @@ class TokensApi:
|
|
30
46
|
Do not edit the class manually.
|
31
47
|
"""
|
32
48
|
|
33
|
-
def __init__(self, api_client=None) -> None:
|
49
|
+
def __init__(self, api_client=None, is_sync: bool = False) -> None:
|
34
50
|
if api_client is None:
|
35
51
|
api_client = ApiClient.get_default()
|
36
52
|
self.api_client = api_client
|
53
|
+
self.is_sync = is_sync
|
54
|
+
|
55
|
+
@validate_call
|
56
|
+
def get_stable_tokens(
|
57
|
+
self,
|
58
|
+
_request_timeout: Union[
|
59
|
+
None,
|
60
|
+
Annotated[StrictFloat, Field(gt=0)],
|
61
|
+
Tuple[
|
62
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
63
|
+
],
|
64
|
+
] = None,
|
65
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
66
|
+
_content_type: Optional[StrictStr] = None,
|
67
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
68
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
69
|
+
) -> List[Dict[str, object]]:
|
70
|
+
"""Get Stable Tokens"""
|
71
|
+
if self.is_sync:
|
72
|
+
return self._get_stable_tokens_sync(
|
73
|
+
_request_timeout=_request_timeout,
|
74
|
+
_request_auth=_request_auth,
|
75
|
+
_content_type=_content_type,
|
76
|
+
_headers=_headers,
|
77
|
+
_host_index=_host_index,
|
78
|
+
)
|
79
|
+
|
80
|
+
else:
|
81
|
+
return self._get_stable_tokens_async(
|
82
|
+
_request_timeout=_request_timeout,
|
83
|
+
_request_auth=_request_auth,
|
84
|
+
_content_type=_content_type,
|
85
|
+
_headers=_headers,
|
86
|
+
_host_index=_host_index,
|
87
|
+
)
|
88
|
+
|
89
|
+
@validate_call
|
90
|
+
def get_stable_tokens_with_http_info(
|
91
|
+
self,
|
92
|
+
_request_timeout: Union[
|
93
|
+
None,
|
94
|
+
Annotated[StrictFloat, Field(gt=0)],
|
95
|
+
Tuple[
|
96
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
97
|
+
],
|
98
|
+
] = None,
|
99
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
100
|
+
_content_type: Optional[StrictStr] = None,
|
101
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
102
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
103
|
+
) -> ApiResponse[List[Dict[str, object]]]:
|
104
|
+
"""Get Stable Tokens with HTTP info"""
|
105
|
+
if self.is_sync:
|
106
|
+
return self._get_stable_tokens_sync_with_http_info(
|
107
|
+
_request_timeout=_request_timeout,
|
108
|
+
_request_auth=_request_auth,
|
109
|
+
_content_type=_content_type,
|
110
|
+
_headers=_headers,
|
111
|
+
_host_index=_host_index,
|
112
|
+
)
|
113
|
+
|
114
|
+
else:
|
115
|
+
return self._get_stable_tokens_async_with_http_info(
|
116
|
+
_request_timeout=_request_timeout,
|
117
|
+
_request_auth=_request_auth,
|
118
|
+
_content_type=_content_type,
|
119
|
+
_headers=_headers,
|
120
|
+
_host_index=_host_index,
|
121
|
+
)
|
122
|
+
|
123
|
+
@validate_call
|
124
|
+
def get_stable_tokens_without_preload_content(
|
125
|
+
self,
|
126
|
+
_request_timeout: Union[
|
127
|
+
None,
|
128
|
+
Annotated[StrictFloat, Field(gt=0)],
|
129
|
+
Tuple[
|
130
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
131
|
+
],
|
132
|
+
] = None,
|
133
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
134
|
+
_content_type: Optional[StrictStr] = None,
|
135
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
136
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
137
|
+
) -> RESTResponseType:
|
138
|
+
"""Get Stable Tokens without preloading content"""
|
139
|
+
if self.is_sync:
|
140
|
+
return self._get_stable_tokens_sync_without_preload_content(
|
141
|
+
_request_timeout=_request_timeout,
|
142
|
+
_request_auth=_request_auth,
|
143
|
+
_content_type=_content_type,
|
144
|
+
_headers=_headers,
|
145
|
+
_host_index=_host_index,
|
146
|
+
)
|
147
|
+
|
148
|
+
else:
|
149
|
+
return self._get_stable_tokens_async_without_preload_content(
|
150
|
+
_request_timeout=_request_timeout,
|
151
|
+
_request_auth=_request_auth,
|
152
|
+
_content_type=_content_type,
|
153
|
+
_headers=_headers,
|
154
|
+
_host_index=_host_index,
|
155
|
+
)
|
37
156
|
|
157
|
+
# Private async implementation methods
|
38
158
|
@validate_call
|
39
|
-
async def
|
159
|
+
async def _get_stable_tokens_async(
|
40
160
|
self,
|
41
161
|
_request_timeout: Union[
|
42
162
|
None,
|
@@ -96,7 +216,7 @@ class TokensApi:
|
|
96
216
|
).data
|
97
217
|
|
98
218
|
@validate_call
|
99
|
-
async def
|
219
|
+
async def _get_stable_tokens_async_with_http_info(
|
100
220
|
self,
|
101
221
|
_request_timeout: Union[
|
102
222
|
None,
|
@@ -151,12 +271,11 @@ class TokensApi:
|
|
151
271
|
)
|
152
272
|
await response_data.read()
|
153
273
|
return self.api_client.response_deserialize(
|
154
|
-
response_data=response_data,
|
155
|
-
response_types_map=_response_types_map,
|
274
|
+
response_data=response_data, response_types_map=_response_types_map
|
156
275
|
)
|
157
276
|
|
158
277
|
@validate_call
|
159
|
-
async def
|
278
|
+
async def _get_stable_tokens_async_without_preload_content(
|
160
279
|
self,
|
161
280
|
_request_timeout: Union[
|
162
281
|
None,
|
@@ -209,7 +328,80 @@ class TokensApi:
|
|
209
328
|
response_data = await self.api_client.call_api(
|
210
329
|
*_param, _request_timeout=_request_timeout
|
211
330
|
)
|
212
|
-
return response_data
|
331
|
+
return response_data
|
332
|
+
|
333
|
+
# Private sync implementation methods
|
334
|
+
@validate_call
|
335
|
+
def _get_stable_tokens_sync(
|
336
|
+
self,
|
337
|
+
_request_timeout: Union[
|
338
|
+
None,
|
339
|
+
Annotated[StrictFloat, Field(gt=0)],
|
340
|
+
Tuple[
|
341
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
342
|
+
],
|
343
|
+
] = None,
|
344
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
345
|
+
_content_type: Optional[StrictStr] = None,
|
346
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
347
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
348
|
+
) -> List[Dict[str, object]]:
|
349
|
+
"""Synchronous version of get_stable_tokens"""
|
350
|
+
return async_to_sync(self._get_stable_tokens_async)(
|
351
|
+
_request_timeout=_request_timeout,
|
352
|
+
_request_auth=_request_auth,
|
353
|
+
_content_type=_content_type,
|
354
|
+
_headers=_headers,
|
355
|
+
_host_index=_host_index,
|
356
|
+
)
|
357
|
+
|
358
|
+
@validate_call
|
359
|
+
def _get_stable_tokens_sync_with_http_info(
|
360
|
+
self,
|
361
|
+
_request_timeout: Union[
|
362
|
+
None,
|
363
|
+
Annotated[StrictFloat, Field(gt=0)],
|
364
|
+
Tuple[
|
365
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
366
|
+
],
|
367
|
+
] = None,
|
368
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
369
|
+
_content_type: Optional[StrictStr] = None,
|
370
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
371
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
372
|
+
) -> ApiResponse[List[Dict[str, object]]]:
|
373
|
+
"""Synchronous version of get_stable_tokens_with_http_info"""
|
374
|
+
return async_to_sync(self._get_stable_tokens_async_with_http_info)(
|
375
|
+
_request_timeout=_request_timeout,
|
376
|
+
_request_auth=_request_auth,
|
377
|
+
_content_type=_content_type,
|
378
|
+
_headers=_headers,
|
379
|
+
_host_index=_host_index,
|
380
|
+
)
|
381
|
+
|
382
|
+
@validate_call
|
383
|
+
def _get_stable_tokens_sync_without_preload_content(
|
384
|
+
self,
|
385
|
+
_request_timeout: Union[
|
386
|
+
None,
|
387
|
+
Annotated[StrictFloat, Field(gt=0)],
|
388
|
+
Tuple[
|
389
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
390
|
+
],
|
391
|
+
] = None,
|
392
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
393
|
+
_content_type: Optional[StrictStr] = None,
|
394
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
395
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
396
|
+
) -> RESTResponseType:
|
397
|
+
"""Synchronous version of get_stable_tokens_without_preload_content"""
|
398
|
+
return async_to_sync(self._get_stable_tokens_async_without_preload_content)(
|
399
|
+
_request_timeout=_request_timeout,
|
400
|
+
_request_auth=_request_auth,
|
401
|
+
_content_type=_content_type,
|
402
|
+
_headers=_headers,
|
403
|
+
_host_index=_host_index,
|
404
|
+
)
|
213
405
|
|
214
406
|
def _get_stable_tokens_serialize(
|
215
407
|
self,
|
@@ -263,7 +455,110 @@ class TokensApi:
|
|
263
455
|
)
|
264
456
|
|
265
457
|
@validate_call
|
266
|
-
|
458
|
+
def get_wrapped_tokens(
|
459
|
+
self,
|
460
|
+
_request_timeout: Union[
|
461
|
+
None,
|
462
|
+
Annotated[StrictFloat, Field(gt=0)],
|
463
|
+
Tuple[
|
464
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
465
|
+
],
|
466
|
+
] = None,
|
467
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
468
|
+
_content_type: Optional[StrictStr] = None,
|
469
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
470
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
471
|
+
) -> List[Dict[str, object]]:
|
472
|
+
"""Get Wrapped Tokens"""
|
473
|
+
if self.is_sync:
|
474
|
+
return self._get_wrapped_tokens_sync(
|
475
|
+
_request_timeout=_request_timeout,
|
476
|
+
_request_auth=_request_auth,
|
477
|
+
_content_type=_content_type,
|
478
|
+
_headers=_headers,
|
479
|
+
_host_index=_host_index,
|
480
|
+
)
|
481
|
+
|
482
|
+
else:
|
483
|
+
return self._get_wrapped_tokens_async(
|
484
|
+
_request_timeout=_request_timeout,
|
485
|
+
_request_auth=_request_auth,
|
486
|
+
_content_type=_content_type,
|
487
|
+
_headers=_headers,
|
488
|
+
_host_index=_host_index,
|
489
|
+
)
|
490
|
+
|
491
|
+
@validate_call
|
492
|
+
def get_wrapped_tokens_with_http_info(
|
493
|
+
self,
|
494
|
+
_request_timeout: Union[
|
495
|
+
None,
|
496
|
+
Annotated[StrictFloat, Field(gt=0)],
|
497
|
+
Tuple[
|
498
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
499
|
+
],
|
500
|
+
] = None,
|
501
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
502
|
+
_content_type: Optional[StrictStr] = None,
|
503
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
504
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
505
|
+
) -> ApiResponse[List[Dict[str, object]]]:
|
506
|
+
"""Get Wrapped Tokens with HTTP info"""
|
507
|
+
if self.is_sync:
|
508
|
+
return self._get_wrapped_tokens_sync_with_http_info(
|
509
|
+
_request_timeout=_request_timeout,
|
510
|
+
_request_auth=_request_auth,
|
511
|
+
_content_type=_content_type,
|
512
|
+
_headers=_headers,
|
513
|
+
_host_index=_host_index,
|
514
|
+
)
|
515
|
+
|
516
|
+
else:
|
517
|
+
return self._get_wrapped_tokens_async_with_http_info(
|
518
|
+
_request_timeout=_request_timeout,
|
519
|
+
_request_auth=_request_auth,
|
520
|
+
_content_type=_content_type,
|
521
|
+
_headers=_headers,
|
522
|
+
_host_index=_host_index,
|
523
|
+
)
|
524
|
+
|
525
|
+
@validate_call
|
526
|
+
def get_wrapped_tokens_without_preload_content(
|
527
|
+
self,
|
528
|
+
_request_timeout: Union[
|
529
|
+
None,
|
530
|
+
Annotated[StrictFloat, Field(gt=0)],
|
531
|
+
Tuple[
|
532
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
533
|
+
],
|
534
|
+
] = None,
|
535
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
536
|
+
_content_type: Optional[StrictStr] = None,
|
537
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
538
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
539
|
+
) -> RESTResponseType:
|
540
|
+
"""Get Wrapped Tokens without preloading content"""
|
541
|
+
if self.is_sync:
|
542
|
+
return self._get_wrapped_tokens_sync_without_preload_content(
|
543
|
+
_request_timeout=_request_timeout,
|
544
|
+
_request_auth=_request_auth,
|
545
|
+
_content_type=_content_type,
|
546
|
+
_headers=_headers,
|
547
|
+
_host_index=_host_index,
|
548
|
+
)
|
549
|
+
|
550
|
+
else:
|
551
|
+
return self._get_wrapped_tokens_async_without_preload_content(
|
552
|
+
_request_timeout=_request_timeout,
|
553
|
+
_request_auth=_request_auth,
|
554
|
+
_content_type=_content_type,
|
555
|
+
_headers=_headers,
|
556
|
+
_host_index=_host_index,
|
557
|
+
)
|
558
|
+
|
559
|
+
# Private async implementation methods
|
560
|
+
@validate_call
|
561
|
+
async def _get_wrapped_tokens_async(
|
267
562
|
self,
|
268
563
|
_request_timeout: Union[
|
269
564
|
None,
|
@@ -323,7 +618,7 @@ class TokensApi:
|
|
323
618
|
).data
|
324
619
|
|
325
620
|
@validate_call
|
326
|
-
async def
|
621
|
+
async def _get_wrapped_tokens_async_with_http_info(
|
327
622
|
self,
|
328
623
|
_request_timeout: Union[
|
329
624
|
None,
|
@@ -378,12 +673,11 @@ class TokensApi:
|
|
378
673
|
)
|
379
674
|
await response_data.read()
|
380
675
|
return self.api_client.response_deserialize(
|
381
|
-
response_data=response_data,
|
382
|
-
response_types_map=_response_types_map,
|
676
|
+
response_data=response_data, response_types_map=_response_types_map
|
383
677
|
)
|
384
678
|
|
385
679
|
@validate_call
|
386
|
-
async def
|
680
|
+
async def _get_wrapped_tokens_async_without_preload_content(
|
387
681
|
self,
|
388
682
|
_request_timeout: Union[
|
389
683
|
None,
|
@@ -436,7 +730,80 @@ class TokensApi:
|
|
436
730
|
response_data = await self.api_client.call_api(
|
437
731
|
*_param, _request_timeout=_request_timeout
|
438
732
|
)
|
439
|
-
return response_data
|
733
|
+
return response_data
|
734
|
+
|
735
|
+
# Private sync implementation methods
|
736
|
+
@validate_call
|
737
|
+
def _get_wrapped_tokens_sync(
|
738
|
+
self,
|
739
|
+
_request_timeout: Union[
|
740
|
+
None,
|
741
|
+
Annotated[StrictFloat, Field(gt=0)],
|
742
|
+
Tuple[
|
743
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
744
|
+
],
|
745
|
+
] = None,
|
746
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
747
|
+
_content_type: Optional[StrictStr] = None,
|
748
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
749
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
750
|
+
) -> List[Dict[str, object]]:
|
751
|
+
"""Synchronous version of get_wrapped_tokens"""
|
752
|
+
return async_to_sync(self._get_wrapped_tokens_async)(
|
753
|
+
_request_timeout=_request_timeout,
|
754
|
+
_request_auth=_request_auth,
|
755
|
+
_content_type=_content_type,
|
756
|
+
_headers=_headers,
|
757
|
+
_host_index=_host_index,
|
758
|
+
)
|
759
|
+
|
760
|
+
@validate_call
|
761
|
+
def _get_wrapped_tokens_sync_with_http_info(
|
762
|
+
self,
|
763
|
+
_request_timeout: Union[
|
764
|
+
None,
|
765
|
+
Annotated[StrictFloat, Field(gt=0)],
|
766
|
+
Tuple[
|
767
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
768
|
+
],
|
769
|
+
] = None,
|
770
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
771
|
+
_content_type: Optional[StrictStr] = None,
|
772
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
773
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
774
|
+
) -> ApiResponse[List[Dict[str, object]]]:
|
775
|
+
"""Synchronous version of get_wrapped_tokens_with_http_info"""
|
776
|
+
return async_to_sync(self._get_wrapped_tokens_async_with_http_info)(
|
777
|
+
_request_timeout=_request_timeout,
|
778
|
+
_request_auth=_request_auth,
|
779
|
+
_content_type=_content_type,
|
780
|
+
_headers=_headers,
|
781
|
+
_host_index=_host_index,
|
782
|
+
)
|
783
|
+
|
784
|
+
@validate_call
|
785
|
+
def _get_wrapped_tokens_sync_without_preload_content(
|
786
|
+
self,
|
787
|
+
_request_timeout: Union[
|
788
|
+
None,
|
789
|
+
Annotated[StrictFloat, Field(gt=0)],
|
790
|
+
Tuple[
|
791
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
792
|
+
],
|
793
|
+
] = None,
|
794
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
795
|
+
_content_type: Optional[StrictStr] = None,
|
796
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
797
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
798
|
+
) -> RESTResponseType:
|
799
|
+
"""Synchronous version of get_wrapped_tokens_without_preload_content"""
|
800
|
+
return async_to_sync(self._get_wrapped_tokens_async_without_preload_content)(
|
801
|
+
_request_timeout=_request_timeout,
|
802
|
+
_request_auth=_request_auth,
|
803
|
+
_content_type=_content_type,
|
804
|
+
_headers=_headers,
|
805
|
+
_host_index=_host_index,
|
806
|
+
)
|
440
807
|
|
441
808
|
def _get_wrapped_tokens_serialize(
|
442
809
|
self,
|
@@ -33,11 +33,6 @@ from crypticorn.metrics.client import rest
|
|
33
33
|
from crypticorn.metrics.client.exceptions import (
|
34
34
|
ApiValueError,
|
35
35
|
ApiException,
|
36
|
-
BadRequestException,
|
37
|
-
UnauthorizedException,
|
38
|
-
ForbiddenException,
|
39
|
-
NotFoundException,
|
40
|
-
ServiceException,
|
41
36
|
)
|
42
37
|
|
43
38
|
RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]]
|
@@ -215,7 +215,9 @@ class Configuration:
|
|
215
215
|
debug: Optional[bool] = None,
|
216
216
|
) -> None:
|
217
217
|
"""Constructor"""
|
218
|
-
self._base_path =
|
218
|
+
self._base_path = (
|
219
|
+
"https://api.crypticorn.dev/v1/metrics" if host is None else host
|
220
|
+
)
|
219
221
|
"""Default Base url
|
220
222
|
"""
|
221
223
|
self.server_index = 0 if server_index is None and host is None else server_index
|
@@ -557,7 +559,7 @@ class Configuration:
|
|
557
559
|
"""
|
558
560
|
return [
|
559
561
|
{
|
560
|
-
"url": "
|
562
|
+
"url": "https://api.crypticorn.dev/v1/metrics",
|
561
563
|
"description": "No description provided",
|
562
564
|
}
|
563
565
|
]
|
@@ -22,7 +22,7 @@ from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from crypticorn.metrics.client.models.api_error_identifier import ApiErrorIdentifier
|
23
23
|
from crypticorn.metrics.client.models.api_error_level import ApiErrorLevel
|
24
24
|
from crypticorn.metrics.client.models.api_error_type import ApiErrorType
|
25
|
-
from typing import
|
25
|
+
from typing import Set
|
26
26
|
from typing_extensions import Self
|
27
27
|
|
28
28
|
|
@@ -21,7 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
22
22
|
from crypticorn.metrics.client.models.market_type import MarketType
|
23
23
|
from crypticorn.metrics.client.models.trading_status import TradingStatus
|
24
|
-
from typing import
|
24
|
+
from typing import Set
|
25
25
|
from typing_extensions import Self
|
26
26
|
|
27
27
|
|
@@ -77,6 +77,7 @@ class RESTClientObject:
|
|
77
77
|
|
78
78
|
self.pool_manager: Optional[aiohttp.ClientSession] = None
|
79
79
|
self.retry_client: Optional[aiohttp_retry.RetryClient] = None
|
80
|
+
self.is_sync: bool = False # Track whether this is sync or async mode
|
80
81
|
|
81
82
|
async def close(self) -> None:
|
82
83
|
if self.pool_manager:
|
@@ -170,7 +171,9 @@ class RESTClientObject:
|
|
170
171
|
|
171
172
|
pool_manager: Union[aiohttp.ClientSession, aiohttp_retry.RetryClient]
|
172
173
|
|
173
|
-
#
|
174
|
+
# For sync operations, always use a fresh session
|
175
|
+
should_close_session = False
|
176
|
+
|
174
177
|
if self.pool_manager is None:
|
175
178
|
self.pool_manager = aiohttp.ClientSession(
|
176
179
|
connector=aiohttp.TCPConnector(
|
@@ -178,6 +181,9 @@ class RESTClientObject:
|
|
178
181
|
),
|
179
182
|
trust_env=True,
|
180
183
|
)
|
184
|
+
# Only close session automatically in sync mode
|
185
|
+
should_close_session = self.is_sync
|
186
|
+
|
181
187
|
pool_manager = self.pool_manager
|
182
188
|
|
183
189
|
if self.retries is not None and method in ALLOW_RETRY_METHODS:
|
@@ -193,6 +199,19 @@ class RESTClientObject:
|
|
193
199
|
)
|
194
200
|
pool_manager = self.retry_client
|
195
201
|
|
196
|
-
|
197
|
-
|
198
|
-
|
202
|
+
try:
|
203
|
+
r = await pool_manager.request(**args)
|
204
|
+
# For sessions we're about to close, read the data immediately
|
205
|
+
if should_close_session:
|
206
|
+
response = RESTResponse(r)
|
207
|
+
await response.read() # Read data before closing session
|
208
|
+
return response
|
209
|
+
else:
|
210
|
+
return RESTResponse(r)
|
211
|
+
finally:
|
212
|
+
if should_close_session:
|
213
|
+
if self.retry_client is not None:
|
214
|
+
await self.retry_client.close()
|
215
|
+
self.retry_client = None
|
216
|
+
await self.pool_manager.close()
|
217
|
+
self.pool_manager = None
|