crypticorn 2.16.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 -20
- crypticorn/common/router/admin_router.py +2 -2
- crypticorn/common/router/status_router.py +40 -2
- crypticorn/common/scopes.py +2 -2
- crypticorn/common/warnings.py +7 -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 +1 -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.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/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/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/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 -19
- crypticorn/trade/client/models/tpsl_create.py +6 -19
- crypticorn/trade/client/rest.py +23 -4
- crypticorn/trade/main.py +15 -12
- {crypticorn-2.16.0.dist-info → crypticorn-2.17.0.dist-info}/METADATA +65 -20
- {crypticorn-2.16.0.dist-info → crypticorn-2.17.0.dist-info}/RECORD +163 -128
- crypticorn/trade/client/api/futures_trading_panel_api.py +0 -1285
- {crypticorn-2.16.0.dist-info → crypticorn-2.17.0.dist-info}/WHEEL +0 -0
- {crypticorn-2.16.0.dist-info → crypticorn-2.17.0.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.16.0.dist-info → crypticorn-2.17.0.dist-info}/licenses/LICENSE +0 -0
- {crypticorn-2.16.0.dist-info → crypticorn-2.17.0.dist-info}/top_level.txt +0 -0
@@ -11,14 +11,10 @@ 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 pydantic import Field, StrictStr
|
20
|
-
from typing import Any, Dict, List, Optional
|
21
|
-
from typing_extensions import Annotated
|
22
18
|
from crypticorn.metrics.client.models.market_type import MarketType
|
23
19
|
from crypticorn.metrics.client.models.trading_status import TradingStatus
|
24
20
|
|
@@ -26,6 +22,24 @@ from crypticorn.metrics.client.api_client import ApiClient, RequestSerialized
|
|
26
22
|
from crypticorn.metrics.client.api_response import ApiResponse
|
27
23
|
from crypticorn.metrics.client.rest import RESTResponseType
|
28
24
|
|
25
|
+
# Import async_to_sync for sync methods
|
26
|
+
try:
|
27
|
+
from asgiref.sync import async_to_sync
|
28
|
+
|
29
|
+
_HAS_ASGIREF = True
|
30
|
+
except ImportError:
|
31
|
+
_HAS_ASGIREF = False
|
32
|
+
|
33
|
+
def async_to_sync(async_func):
|
34
|
+
"""Fallback decorator that raises an error if asgiref is not available."""
|
35
|
+
|
36
|
+
def wrapper(*args, **kwargs):
|
37
|
+
raise ImportError(
|
38
|
+
"asgiref is required for sync methods. Install with: pip install asgiref"
|
39
|
+
)
|
40
|
+
|
41
|
+
return wrapper
|
42
|
+
|
29
43
|
|
30
44
|
class MarketsApi:
|
31
45
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
@@ -34,13 +48,192 @@ class MarketsApi:
|
|
34
48
|
Do not edit the class manually.
|
35
49
|
"""
|
36
50
|
|
37
|
-
def __init__(self, api_client=None) -> None:
|
51
|
+
def __init__(self, api_client=None, is_sync: bool = False) -> None:
|
38
52
|
if api_client is None:
|
39
53
|
api_client = ApiClient.get_default()
|
40
54
|
self.api_client = api_client
|
55
|
+
self.is_sync = is_sync
|
41
56
|
|
42
57
|
@validate_call
|
43
|
-
|
58
|
+
def get_available_markets_for_symbol(
|
59
|
+
self,
|
60
|
+
market: Annotated[
|
61
|
+
MarketType, Field(description="Market type (spot or futures)")
|
62
|
+
],
|
63
|
+
ticker: Annotated[
|
64
|
+
StrictStr,
|
65
|
+
Field(
|
66
|
+
description="Ticker to fetch markets for. Strip the quote currency from the ticker."
|
67
|
+
),
|
68
|
+
],
|
69
|
+
quote_currency: Annotated[
|
70
|
+
Optional[StrictStr],
|
71
|
+
Field(description="Quote currency for which to fetch markets"),
|
72
|
+
] = None,
|
73
|
+
status: Annotated[
|
74
|
+
Optional[TradingStatus],
|
75
|
+
Field(description="Trading pair status for which to fetch markets"),
|
76
|
+
] = None,
|
77
|
+
_request_timeout: Union[
|
78
|
+
None,
|
79
|
+
Annotated[StrictFloat, Field(gt=0)],
|
80
|
+
Tuple[
|
81
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
82
|
+
],
|
83
|
+
] = None,
|
84
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
85
|
+
_content_type: Optional[StrictStr] = None,
|
86
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
87
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
88
|
+
) -> List[Dict[str, object]]:
|
89
|
+
"""Get Markets For Symbol"""
|
90
|
+
if self.is_sync:
|
91
|
+
return self._get_available_markets_for_symbol_sync(
|
92
|
+
market=market,
|
93
|
+
ticker=ticker,
|
94
|
+
quote_currency=quote_currency,
|
95
|
+
status=status,
|
96
|
+
_request_timeout=_request_timeout,
|
97
|
+
_request_auth=_request_auth,
|
98
|
+
_content_type=_content_type,
|
99
|
+
_headers=_headers,
|
100
|
+
_host_index=_host_index,
|
101
|
+
)
|
102
|
+
|
103
|
+
else:
|
104
|
+
return self._get_available_markets_for_symbol_async(
|
105
|
+
market=market,
|
106
|
+
ticker=ticker,
|
107
|
+
quote_currency=quote_currency,
|
108
|
+
status=status,
|
109
|
+
_request_timeout=_request_timeout,
|
110
|
+
_request_auth=_request_auth,
|
111
|
+
_content_type=_content_type,
|
112
|
+
_headers=_headers,
|
113
|
+
_host_index=_host_index,
|
114
|
+
)
|
115
|
+
|
116
|
+
@validate_call
|
117
|
+
def get_available_markets_for_symbol_with_http_info(
|
118
|
+
self,
|
119
|
+
market: Annotated[
|
120
|
+
MarketType, Field(description="Market type (spot or futures)")
|
121
|
+
],
|
122
|
+
ticker: Annotated[
|
123
|
+
StrictStr,
|
124
|
+
Field(
|
125
|
+
description="Ticker to fetch markets for. Strip the quote currency from the ticker."
|
126
|
+
),
|
127
|
+
],
|
128
|
+
quote_currency: Annotated[
|
129
|
+
Optional[StrictStr],
|
130
|
+
Field(description="Quote currency for which to fetch markets"),
|
131
|
+
] = None,
|
132
|
+
status: Annotated[
|
133
|
+
Optional[TradingStatus],
|
134
|
+
Field(description="Trading pair status for which to fetch markets"),
|
135
|
+
] = None,
|
136
|
+
_request_timeout: Union[
|
137
|
+
None,
|
138
|
+
Annotated[StrictFloat, Field(gt=0)],
|
139
|
+
Tuple[
|
140
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
141
|
+
],
|
142
|
+
] = None,
|
143
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
144
|
+
_content_type: Optional[StrictStr] = None,
|
145
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
146
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
147
|
+
) -> ApiResponse[List[Dict[str, object]]]:
|
148
|
+
"""Get Markets For Symbol with HTTP info"""
|
149
|
+
if self.is_sync:
|
150
|
+
return self._get_available_markets_for_symbol_sync_with_http_info(
|
151
|
+
market=market,
|
152
|
+
ticker=ticker,
|
153
|
+
quote_currency=quote_currency,
|
154
|
+
status=status,
|
155
|
+
_request_timeout=_request_timeout,
|
156
|
+
_request_auth=_request_auth,
|
157
|
+
_content_type=_content_type,
|
158
|
+
_headers=_headers,
|
159
|
+
_host_index=_host_index,
|
160
|
+
)
|
161
|
+
|
162
|
+
else:
|
163
|
+
return self._get_available_markets_for_symbol_async_with_http_info(
|
164
|
+
market=market,
|
165
|
+
ticker=ticker,
|
166
|
+
quote_currency=quote_currency,
|
167
|
+
status=status,
|
168
|
+
_request_timeout=_request_timeout,
|
169
|
+
_request_auth=_request_auth,
|
170
|
+
_content_type=_content_type,
|
171
|
+
_headers=_headers,
|
172
|
+
_host_index=_host_index,
|
173
|
+
)
|
174
|
+
|
175
|
+
@validate_call
|
176
|
+
def get_available_markets_for_symbol_without_preload_content(
|
177
|
+
self,
|
178
|
+
market: Annotated[
|
179
|
+
MarketType, Field(description="Market type (spot or futures)")
|
180
|
+
],
|
181
|
+
ticker: Annotated[
|
182
|
+
StrictStr,
|
183
|
+
Field(
|
184
|
+
description="Ticker to fetch markets for. Strip the quote currency from the ticker."
|
185
|
+
),
|
186
|
+
],
|
187
|
+
quote_currency: Annotated[
|
188
|
+
Optional[StrictStr],
|
189
|
+
Field(description="Quote currency for which to fetch markets"),
|
190
|
+
] = None,
|
191
|
+
status: Annotated[
|
192
|
+
Optional[TradingStatus],
|
193
|
+
Field(description="Trading pair status for which to fetch markets"),
|
194
|
+
] = None,
|
195
|
+
_request_timeout: Union[
|
196
|
+
None,
|
197
|
+
Annotated[StrictFloat, Field(gt=0)],
|
198
|
+
Tuple[
|
199
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
200
|
+
],
|
201
|
+
] = None,
|
202
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
203
|
+
_content_type: Optional[StrictStr] = None,
|
204
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
205
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
206
|
+
) -> RESTResponseType:
|
207
|
+
"""Get Markets For Symbol without preloading content"""
|
208
|
+
if self.is_sync:
|
209
|
+
return self._get_available_markets_for_symbol_sync_without_preload_content(
|
210
|
+
market=market,
|
211
|
+
ticker=ticker,
|
212
|
+
quote_currency=quote_currency,
|
213
|
+
status=status,
|
214
|
+
_request_timeout=_request_timeout,
|
215
|
+
_request_auth=_request_auth,
|
216
|
+
_content_type=_content_type,
|
217
|
+
_headers=_headers,
|
218
|
+
_host_index=_host_index,
|
219
|
+
)
|
220
|
+
|
221
|
+
else:
|
222
|
+
return self._get_available_markets_for_symbol_async_without_preload_content(
|
223
|
+
market=market,
|
224
|
+
ticker=ticker,
|
225
|
+
quote_currency=quote_currency,
|
226
|
+
status=status,
|
227
|
+
_request_timeout=_request_timeout,
|
228
|
+
_request_auth=_request_auth,
|
229
|
+
_content_type=_content_type,
|
230
|
+
_headers=_headers,
|
231
|
+
_host_index=_host_index,
|
232
|
+
)
|
233
|
+
|
234
|
+
# Private async implementation methods
|
235
|
+
@validate_call
|
236
|
+
async def _get_available_markets_for_symbol_async(
|
44
237
|
self,
|
45
238
|
market: Annotated[
|
46
239
|
MarketType, Field(description="Market type (spot or futures)")
|
@@ -129,7 +322,7 @@ class MarketsApi:
|
|
129
322
|
).data
|
130
323
|
|
131
324
|
@validate_call
|
132
|
-
async def
|
325
|
+
async def _get_available_markets_for_symbol_async_with_http_info(
|
133
326
|
self,
|
134
327
|
market: Annotated[
|
135
328
|
MarketType, Field(description="Market type (spot or futures)")
|
@@ -213,12 +406,11 @@ class MarketsApi:
|
|
213
406
|
)
|
214
407
|
await response_data.read()
|
215
408
|
return self.api_client.response_deserialize(
|
216
|
-
response_data=response_data,
|
217
|
-
response_types_map=_response_types_map,
|
409
|
+
response_data=response_data, response_types_map=_response_types_map
|
218
410
|
)
|
219
411
|
|
220
412
|
@validate_call
|
221
|
-
async def
|
413
|
+
async def _get_available_markets_for_symbol_async_without_preload_content(
|
222
414
|
self,
|
223
415
|
market: Annotated[
|
224
416
|
MarketType, Field(description="Market type (spot or futures)")
|
@@ -300,7 +492,147 @@ class MarketsApi:
|
|
300
492
|
response_data = await self.api_client.call_api(
|
301
493
|
*_param, _request_timeout=_request_timeout
|
302
494
|
)
|
303
|
-
return response_data
|
495
|
+
return response_data
|
496
|
+
|
497
|
+
# Private sync implementation methods
|
498
|
+
@validate_call
|
499
|
+
def _get_available_markets_for_symbol_sync(
|
500
|
+
self,
|
501
|
+
market: Annotated[
|
502
|
+
MarketType, Field(description="Market type (spot or futures)")
|
503
|
+
],
|
504
|
+
ticker: Annotated[
|
505
|
+
StrictStr,
|
506
|
+
Field(
|
507
|
+
description="Ticker to fetch markets for. Strip the quote currency from the ticker."
|
508
|
+
),
|
509
|
+
],
|
510
|
+
quote_currency: Annotated[
|
511
|
+
Optional[StrictStr],
|
512
|
+
Field(description="Quote currency for which to fetch markets"),
|
513
|
+
] = None,
|
514
|
+
status: Annotated[
|
515
|
+
Optional[TradingStatus],
|
516
|
+
Field(description="Trading pair status for which to fetch markets"),
|
517
|
+
] = None,
|
518
|
+
_request_timeout: Union[
|
519
|
+
None,
|
520
|
+
Annotated[StrictFloat, Field(gt=0)],
|
521
|
+
Tuple[
|
522
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
523
|
+
],
|
524
|
+
] = None,
|
525
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
526
|
+
_content_type: Optional[StrictStr] = None,
|
527
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
528
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
529
|
+
) -> List[Dict[str, object]]:
|
530
|
+
"""Synchronous version of get_available_markets_for_symbol"""
|
531
|
+
return async_to_sync(self._get_available_markets_for_symbol_async)(
|
532
|
+
market=market,
|
533
|
+
ticker=ticker,
|
534
|
+
quote_currency=quote_currency,
|
535
|
+
status=status,
|
536
|
+
_request_timeout=_request_timeout,
|
537
|
+
_request_auth=_request_auth,
|
538
|
+
_content_type=_content_type,
|
539
|
+
_headers=_headers,
|
540
|
+
_host_index=_host_index,
|
541
|
+
)
|
542
|
+
|
543
|
+
@validate_call
|
544
|
+
def _get_available_markets_for_symbol_sync_with_http_info(
|
545
|
+
self,
|
546
|
+
market: Annotated[
|
547
|
+
MarketType, Field(description="Market type (spot or futures)")
|
548
|
+
],
|
549
|
+
ticker: Annotated[
|
550
|
+
StrictStr,
|
551
|
+
Field(
|
552
|
+
description="Ticker to fetch markets for. Strip the quote currency from the ticker."
|
553
|
+
),
|
554
|
+
],
|
555
|
+
quote_currency: Annotated[
|
556
|
+
Optional[StrictStr],
|
557
|
+
Field(description="Quote currency for which to fetch markets"),
|
558
|
+
] = None,
|
559
|
+
status: Annotated[
|
560
|
+
Optional[TradingStatus],
|
561
|
+
Field(description="Trading pair status for which to fetch markets"),
|
562
|
+
] = None,
|
563
|
+
_request_timeout: Union[
|
564
|
+
None,
|
565
|
+
Annotated[StrictFloat, Field(gt=0)],
|
566
|
+
Tuple[
|
567
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
568
|
+
],
|
569
|
+
] = None,
|
570
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
571
|
+
_content_type: Optional[StrictStr] = None,
|
572
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
573
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
574
|
+
) -> ApiResponse[List[Dict[str, object]]]:
|
575
|
+
"""Synchronous version of get_available_markets_for_symbol_with_http_info"""
|
576
|
+
return async_to_sync(
|
577
|
+
self._get_available_markets_for_symbol_async_with_http_info
|
578
|
+
)(
|
579
|
+
market=market,
|
580
|
+
ticker=ticker,
|
581
|
+
quote_currency=quote_currency,
|
582
|
+
status=status,
|
583
|
+
_request_timeout=_request_timeout,
|
584
|
+
_request_auth=_request_auth,
|
585
|
+
_content_type=_content_type,
|
586
|
+
_headers=_headers,
|
587
|
+
_host_index=_host_index,
|
588
|
+
)
|
589
|
+
|
590
|
+
@validate_call
|
591
|
+
def _get_available_markets_for_symbol_sync_without_preload_content(
|
592
|
+
self,
|
593
|
+
market: Annotated[
|
594
|
+
MarketType, Field(description="Market type (spot or futures)")
|
595
|
+
],
|
596
|
+
ticker: Annotated[
|
597
|
+
StrictStr,
|
598
|
+
Field(
|
599
|
+
description="Ticker to fetch markets for. Strip the quote currency from the ticker."
|
600
|
+
),
|
601
|
+
],
|
602
|
+
quote_currency: Annotated[
|
603
|
+
Optional[StrictStr],
|
604
|
+
Field(description="Quote currency for which to fetch markets"),
|
605
|
+
] = None,
|
606
|
+
status: Annotated[
|
607
|
+
Optional[TradingStatus],
|
608
|
+
Field(description="Trading pair status for which to fetch markets"),
|
609
|
+
] = None,
|
610
|
+
_request_timeout: Union[
|
611
|
+
None,
|
612
|
+
Annotated[StrictFloat, Field(gt=0)],
|
613
|
+
Tuple[
|
614
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
615
|
+
],
|
616
|
+
] = None,
|
617
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
618
|
+
_content_type: Optional[StrictStr] = None,
|
619
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
620
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
621
|
+
) -> RESTResponseType:
|
622
|
+
"""Synchronous version of get_available_markets_for_symbol_without_preload_content"""
|
623
|
+
return async_to_sync(
|
624
|
+
self._get_available_markets_for_symbol_async_without_preload_content
|
625
|
+
)(
|
626
|
+
market=market,
|
627
|
+
ticker=ticker,
|
628
|
+
quote_currency=quote_currency,
|
629
|
+
status=status,
|
630
|
+
_request_timeout=_request_timeout,
|
631
|
+
_request_auth=_request_auth,
|
632
|
+
_content_type=_content_type,
|
633
|
+
_headers=_headers,
|
634
|
+
_host_index=_host_index,
|
635
|
+
)
|
304
636
|
|
305
637
|
def _get_available_markets_for_symbol_serialize(
|
306
638
|
self,
|
@@ -11,20 +11,34 @@ 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 pydantic import Field, StrictStr
|
20
|
-
from typing import List
|
21
|
-
from typing_extensions import Annotated
|
22
18
|
from crypticorn.metrics.client.models.market_type import MarketType
|
23
19
|
|
24
20
|
from crypticorn.metrics.client.api_client import ApiClient, RequestSerialized
|
25
21
|
from crypticorn.metrics.client.api_response import ApiResponse
|
26
22
|
from crypticorn.metrics.client.rest import RESTResponseType
|
27
23
|
|
24
|
+
# Import async_to_sync for sync methods
|
25
|
+
try:
|
26
|
+
from asgiref.sync import async_to_sync
|
27
|
+
|
28
|
+
_HAS_ASGIREF = True
|
29
|
+
except ImportError:
|
30
|
+
_HAS_ASGIREF = False
|
31
|
+
|
32
|
+
def async_to_sync(async_func):
|
33
|
+
"""Fallback decorator that raises an error if asgiref is not available."""
|
34
|
+
|
35
|
+
def wrapper(*args, **kwargs):
|
36
|
+
raise ImportError(
|
37
|
+
"asgiref is required for sync methods. Install with: pip install asgiref"
|
38
|
+
)
|
39
|
+
|
40
|
+
return wrapper
|
41
|
+
|
28
42
|
|
29
43
|
class QuoteCurrenciesApi:
|
30
44
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
@@ -33,13 +47,132 @@ class QuoteCurrenciesApi:
|
|
33
47
|
Do not edit the class manually.
|
34
48
|
"""
|
35
49
|
|
36
|
-
def __init__(self, api_client=None) -> None:
|
50
|
+
def __init__(self, api_client=None, is_sync: bool = False) -> None:
|
37
51
|
if api_client is None:
|
38
52
|
api_client = ApiClient.get_default()
|
39
53
|
self.api_client = api_client
|
54
|
+
self.is_sync = is_sync
|
55
|
+
|
56
|
+
@validate_call
|
57
|
+
def get_quote_currencies(
|
58
|
+
self,
|
59
|
+
market: Annotated[
|
60
|
+
MarketType, Field(description="Market type (spot or futures)")
|
61
|
+
],
|
62
|
+
_request_timeout: Union[
|
63
|
+
None,
|
64
|
+
Annotated[StrictFloat, Field(gt=0)],
|
65
|
+
Tuple[
|
66
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
67
|
+
],
|
68
|
+
] = None,
|
69
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
70
|
+
_content_type: Optional[StrictStr] = None,
|
71
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
72
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
73
|
+
) -> List[str]:
|
74
|
+
"""Get Quote Currencies"""
|
75
|
+
if self.is_sync:
|
76
|
+
return self._get_quote_currencies_sync(
|
77
|
+
market=market,
|
78
|
+
_request_timeout=_request_timeout,
|
79
|
+
_request_auth=_request_auth,
|
80
|
+
_content_type=_content_type,
|
81
|
+
_headers=_headers,
|
82
|
+
_host_index=_host_index,
|
83
|
+
)
|
84
|
+
|
85
|
+
else:
|
86
|
+
return self._get_quote_currencies_async(
|
87
|
+
market=market,
|
88
|
+
_request_timeout=_request_timeout,
|
89
|
+
_request_auth=_request_auth,
|
90
|
+
_content_type=_content_type,
|
91
|
+
_headers=_headers,
|
92
|
+
_host_index=_host_index,
|
93
|
+
)
|
94
|
+
|
95
|
+
@validate_call
|
96
|
+
def get_quote_currencies_with_http_info(
|
97
|
+
self,
|
98
|
+
market: Annotated[
|
99
|
+
MarketType, Field(description="Market type (spot or futures)")
|
100
|
+
],
|
101
|
+
_request_timeout: Union[
|
102
|
+
None,
|
103
|
+
Annotated[StrictFloat, Field(gt=0)],
|
104
|
+
Tuple[
|
105
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
106
|
+
],
|
107
|
+
] = None,
|
108
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
109
|
+
_content_type: Optional[StrictStr] = None,
|
110
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
111
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
112
|
+
) -> ApiResponse[List[str]]:
|
113
|
+
"""Get Quote Currencies with HTTP info"""
|
114
|
+
if self.is_sync:
|
115
|
+
return self._get_quote_currencies_sync_with_http_info(
|
116
|
+
market=market,
|
117
|
+
_request_timeout=_request_timeout,
|
118
|
+
_request_auth=_request_auth,
|
119
|
+
_content_type=_content_type,
|
120
|
+
_headers=_headers,
|
121
|
+
_host_index=_host_index,
|
122
|
+
)
|
123
|
+
|
124
|
+
else:
|
125
|
+
return self._get_quote_currencies_async_with_http_info(
|
126
|
+
market=market,
|
127
|
+
_request_timeout=_request_timeout,
|
128
|
+
_request_auth=_request_auth,
|
129
|
+
_content_type=_content_type,
|
130
|
+
_headers=_headers,
|
131
|
+
_host_index=_host_index,
|
132
|
+
)
|
133
|
+
|
134
|
+
@validate_call
|
135
|
+
def get_quote_currencies_without_preload_content(
|
136
|
+
self,
|
137
|
+
market: Annotated[
|
138
|
+
MarketType, Field(description="Market type (spot or futures)")
|
139
|
+
],
|
140
|
+
_request_timeout: Union[
|
141
|
+
None,
|
142
|
+
Annotated[StrictFloat, Field(gt=0)],
|
143
|
+
Tuple[
|
144
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
145
|
+
],
|
146
|
+
] = None,
|
147
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
148
|
+
_content_type: Optional[StrictStr] = None,
|
149
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
150
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
151
|
+
) -> RESTResponseType:
|
152
|
+
"""Get Quote Currencies without preloading content"""
|
153
|
+
if self.is_sync:
|
154
|
+
return self._get_quote_currencies_sync_without_preload_content(
|
155
|
+
market=market,
|
156
|
+
_request_timeout=_request_timeout,
|
157
|
+
_request_auth=_request_auth,
|
158
|
+
_content_type=_content_type,
|
159
|
+
_headers=_headers,
|
160
|
+
_host_index=_host_index,
|
161
|
+
)
|
40
162
|
|
163
|
+
else:
|
164
|
+
return self._get_quote_currencies_async_without_preload_content(
|
165
|
+
market=market,
|
166
|
+
_request_timeout=_request_timeout,
|
167
|
+
_request_auth=_request_auth,
|
168
|
+
_content_type=_content_type,
|
169
|
+
_headers=_headers,
|
170
|
+
_host_index=_host_index,
|
171
|
+
)
|
172
|
+
|
173
|
+
# Private async implementation methods
|
41
174
|
@validate_call
|
42
|
-
async def
|
175
|
+
async def _get_quote_currencies_async(
|
43
176
|
self,
|
44
177
|
market: Annotated[
|
45
178
|
MarketType, Field(description="Market type (spot or futures)")
|
@@ -105,7 +238,7 @@ class QuoteCurrenciesApi:
|
|
105
238
|
).data
|
106
239
|
|
107
240
|
@validate_call
|
108
|
-
async def
|
241
|
+
async def _get_quote_currencies_async_with_http_info(
|
109
242
|
self,
|
110
243
|
market: Annotated[
|
111
244
|
MarketType, Field(description="Market type (spot or futures)")
|
@@ -166,12 +299,11 @@ class QuoteCurrenciesApi:
|
|
166
299
|
)
|
167
300
|
await response_data.read()
|
168
301
|
return self.api_client.response_deserialize(
|
169
|
-
response_data=response_data,
|
170
|
-
response_types_map=_response_types_map,
|
302
|
+
response_data=response_data, response_types_map=_response_types_map
|
171
303
|
)
|
172
304
|
|
173
305
|
@validate_call
|
174
|
-
async def
|
306
|
+
async def _get_quote_currencies_async_without_preload_content(
|
175
307
|
self,
|
176
308
|
market: Annotated[
|
177
309
|
MarketType, Field(description="Market type (spot or futures)")
|
@@ -230,7 +362,92 @@ class QuoteCurrenciesApi:
|
|
230
362
|
response_data = await self.api_client.call_api(
|
231
363
|
*_param, _request_timeout=_request_timeout
|
232
364
|
)
|
233
|
-
return response_data
|
365
|
+
return response_data
|
366
|
+
|
367
|
+
# Private sync implementation methods
|
368
|
+
@validate_call
|
369
|
+
def _get_quote_currencies_sync(
|
370
|
+
self,
|
371
|
+
market: Annotated[
|
372
|
+
MarketType, Field(description="Market type (spot or futures)")
|
373
|
+
],
|
374
|
+
_request_timeout: Union[
|
375
|
+
None,
|
376
|
+
Annotated[StrictFloat, Field(gt=0)],
|
377
|
+
Tuple[
|
378
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
379
|
+
],
|
380
|
+
] = None,
|
381
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
382
|
+
_content_type: Optional[StrictStr] = None,
|
383
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
384
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
385
|
+
) -> List[str]:
|
386
|
+
"""Synchronous version of get_quote_currencies"""
|
387
|
+
return async_to_sync(self._get_quote_currencies_async)(
|
388
|
+
market=market,
|
389
|
+
_request_timeout=_request_timeout,
|
390
|
+
_request_auth=_request_auth,
|
391
|
+
_content_type=_content_type,
|
392
|
+
_headers=_headers,
|
393
|
+
_host_index=_host_index,
|
394
|
+
)
|
395
|
+
|
396
|
+
@validate_call
|
397
|
+
def _get_quote_currencies_sync_with_http_info(
|
398
|
+
self,
|
399
|
+
market: Annotated[
|
400
|
+
MarketType, Field(description="Market type (spot or futures)")
|
401
|
+
],
|
402
|
+
_request_timeout: Union[
|
403
|
+
None,
|
404
|
+
Annotated[StrictFloat, Field(gt=0)],
|
405
|
+
Tuple[
|
406
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
407
|
+
],
|
408
|
+
] = None,
|
409
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
410
|
+
_content_type: Optional[StrictStr] = None,
|
411
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
412
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
413
|
+
) -> ApiResponse[List[str]]:
|
414
|
+
"""Synchronous version of get_quote_currencies_with_http_info"""
|
415
|
+
return async_to_sync(self._get_quote_currencies_async_with_http_info)(
|
416
|
+
market=market,
|
417
|
+
_request_timeout=_request_timeout,
|
418
|
+
_request_auth=_request_auth,
|
419
|
+
_content_type=_content_type,
|
420
|
+
_headers=_headers,
|
421
|
+
_host_index=_host_index,
|
422
|
+
)
|
423
|
+
|
424
|
+
@validate_call
|
425
|
+
def _get_quote_currencies_sync_without_preload_content(
|
426
|
+
self,
|
427
|
+
market: Annotated[
|
428
|
+
MarketType, Field(description="Market type (spot or futures)")
|
429
|
+
],
|
430
|
+
_request_timeout: Union[
|
431
|
+
None,
|
432
|
+
Annotated[StrictFloat, Field(gt=0)],
|
433
|
+
Tuple[
|
434
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
435
|
+
],
|
436
|
+
] = None,
|
437
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
438
|
+
_content_type: Optional[StrictStr] = None,
|
439
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
440
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
441
|
+
) -> RESTResponseType:
|
442
|
+
"""Synchronous version of get_quote_currencies_without_preload_content"""
|
443
|
+
return async_to_sync(self._get_quote_currencies_async_without_preload_content)(
|
444
|
+
market=market,
|
445
|
+
_request_timeout=_request_timeout,
|
446
|
+
_request_auth=_request_auth,
|
447
|
+
_content_type=_content_type,
|
448
|
+
_headers=_headers,
|
449
|
+
_host_index=_host_index,
|
450
|
+
)
|
234
451
|
|
235
452
|
def _get_quote_currencies_serialize(
|
236
453
|
self,
|