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,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, StrictInt, StrictStr
|
20
|
-
from typing import List, Optional
|
21
|
-
from typing_extensions import Annotated
|
22
18
|
from crypticorn.klines.client.models.market_type import MarketType
|
23
19
|
from crypticorn.klines.client.models.ohlcv import OHLCV
|
24
20
|
from crypticorn.klines.client.models.sort_direction import SortDirection
|
@@ -28,6 +24,24 @@ from crypticorn.klines.client.api_client import ApiClient, RequestSerialized
|
|
28
24
|
from crypticorn.klines.client.api_response import ApiResponse
|
29
25
|
from crypticorn.klines.client.rest import RESTResponseType
|
30
26
|
|
27
|
+
# Import async_to_sync for sync methods
|
28
|
+
try:
|
29
|
+
from asgiref.sync import async_to_sync
|
30
|
+
|
31
|
+
_HAS_ASGIREF = True
|
32
|
+
except ImportError:
|
33
|
+
_HAS_ASGIREF = False
|
34
|
+
|
35
|
+
def async_to_sync(async_func):
|
36
|
+
"""Fallback decorator that raises an error if asgiref is not available."""
|
37
|
+
|
38
|
+
def wrapper(*args, **kwargs):
|
39
|
+
raise ImportError(
|
40
|
+
"asgiref is required for sync methods. Install with: pip install asgiref"
|
41
|
+
)
|
42
|
+
|
43
|
+
return wrapper
|
44
|
+
|
31
45
|
|
32
46
|
class OHLCVDataApi:
|
33
47
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
@@ -36,13 +50,222 @@ class OHLCVDataApi:
|
|
36
50
|
Do not edit the class manually.
|
37
51
|
"""
|
38
52
|
|
39
|
-
def __init__(self, api_client=None) -> None:
|
53
|
+
def __init__(self, api_client=None, is_sync: bool = False) -> None:
|
40
54
|
if api_client is None:
|
41
55
|
api_client = ApiClient.get_default()
|
42
56
|
self.api_client = api_client
|
57
|
+
self.is_sync = is_sync
|
43
58
|
|
44
59
|
@validate_call
|
45
|
-
|
60
|
+
def get_ohlcv(
|
61
|
+
self,
|
62
|
+
market: Annotated[MarketType, Field(description="Market type")],
|
63
|
+
timeframe: Annotated[Timeframe, Field(description="Timeframe for the candles")],
|
64
|
+
symbol: Annotated[
|
65
|
+
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
66
|
+
],
|
67
|
+
start: Annotated[
|
68
|
+
Optional[StrictInt], Field(description="Start timestamp in milliseconds")
|
69
|
+
] = None,
|
70
|
+
end: Annotated[
|
71
|
+
Optional[StrictInt], Field(description="End timestamp in milliseconds")
|
72
|
+
] = None,
|
73
|
+
limit: Annotated[
|
74
|
+
Optional[Annotated[int, Field(strict=True, ge=1)]],
|
75
|
+
Field(description="Number of candles to return"),
|
76
|
+
] = None,
|
77
|
+
sort_direction: Annotated[
|
78
|
+
Optional[SortDirection],
|
79
|
+
Field(
|
80
|
+
description="Sort by timestamp in ascending or descending order. Default is descending."
|
81
|
+
),
|
82
|
+
] = None,
|
83
|
+
_request_timeout: Union[
|
84
|
+
None,
|
85
|
+
Annotated[StrictFloat, Field(gt=0)],
|
86
|
+
Tuple[
|
87
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
88
|
+
],
|
89
|
+
] = None,
|
90
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
91
|
+
_content_type: Optional[StrictStr] = None,
|
92
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
93
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
94
|
+
) -> List[OHLCV]:
|
95
|
+
"""Get Ohlcv"""
|
96
|
+
if self.is_sync:
|
97
|
+
return self._get_ohlcv_sync(
|
98
|
+
market=market,
|
99
|
+
timeframe=timeframe,
|
100
|
+
symbol=symbol,
|
101
|
+
start=start,
|
102
|
+
end=end,
|
103
|
+
limit=limit,
|
104
|
+
sort_direction=sort_direction,
|
105
|
+
_request_timeout=_request_timeout,
|
106
|
+
_request_auth=_request_auth,
|
107
|
+
_content_type=_content_type,
|
108
|
+
_headers=_headers,
|
109
|
+
_host_index=_host_index,
|
110
|
+
)
|
111
|
+
|
112
|
+
else:
|
113
|
+
return self._get_ohlcv_async(
|
114
|
+
market=market,
|
115
|
+
timeframe=timeframe,
|
116
|
+
symbol=symbol,
|
117
|
+
start=start,
|
118
|
+
end=end,
|
119
|
+
limit=limit,
|
120
|
+
sort_direction=sort_direction,
|
121
|
+
_request_timeout=_request_timeout,
|
122
|
+
_request_auth=_request_auth,
|
123
|
+
_content_type=_content_type,
|
124
|
+
_headers=_headers,
|
125
|
+
_host_index=_host_index,
|
126
|
+
)
|
127
|
+
|
128
|
+
@validate_call
|
129
|
+
def get_ohlcv_with_http_info(
|
130
|
+
self,
|
131
|
+
market: Annotated[MarketType, Field(description="Market type")],
|
132
|
+
timeframe: Annotated[Timeframe, Field(description="Timeframe for the candles")],
|
133
|
+
symbol: Annotated[
|
134
|
+
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
135
|
+
],
|
136
|
+
start: Annotated[
|
137
|
+
Optional[StrictInt], Field(description="Start timestamp in milliseconds")
|
138
|
+
] = None,
|
139
|
+
end: Annotated[
|
140
|
+
Optional[StrictInt], Field(description="End timestamp in milliseconds")
|
141
|
+
] = None,
|
142
|
+
limit: Annotated[
|
143
|
+
Optional[Annotated[int, Field(strict=True, ge=1)]],
|
144
|
+
Field(description="Number of candles to return"),
|
145
|
+
] = None,
|
146
|
+
sort_direction: Annotated[
|
147
|
+
Optional[SortDirection],
|
148
|
+
Field(
|
149
|
+
description="Sort by timestamp in ascending or descending order. Default is descending."
|
150
|
+
),
|
151
|
+
] = None,
|
152
|
+
_request_timeout: Union[
|
153
|
+
None,
|
154
|
+
Annotated[StrictFloat, Field(gt=0)],
|
155
|
+
Tuple[
|
156
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
157
|
+
],
|
158
|
+
] = None,
|
159
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
160
|
+
_content_type: Optional[StrictStr] = None,
|
161
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
162
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
163
|
+
) -> ApiResponse[List[OHLCV]]:
|
164
|
+
"""Get Ohlcv with HTTP info"""
|
165
|
+
if self.is_sync:
|
166
|
+
return self._get_ohlcv_sync_with_http_info(
|
167
|
+
market=market,
|
168
|
+
timeframe=timeframe,
|
169
|
+
symbol=symbol,
|
170
|
+
start=start,
|
171
|
+
end=end,
|
172
|
+
limit=limit,
|
173
|
+
sort_direction=sort_direction,
|
174
|
+
_request_timeout=_request_timeout,
|
175
|
+
_request_auth=_request_auth,
|
176
|
+
_content_type=_content_type,
|
177
|
+
_headers=_headers,
|
178
|
+
_host_index=_host_index,
|
179
|
+
)
|
180
|
+
|
181
|
+
else:
|
182
|
+
return self._get_ohlcv_async_with_http_info(
|
183
|
+
market=market,
|
184
|
+
timeframe=timeframe,
|
185
|
+
symbol=symbol,
|
186
|
+
start=start,
|
187
|
+
end=end,
|
188
|
+
limit=limit,
|
189
|
+
sort_direction=sort_direction,
|
190
|
+
_request_timeout=_request_timeout,
|
191
|
+
_request_auth=_request_auth,
|
192
|
+
_content_type=_content_type,
|
193
|
+
_headers=_headers,
|
194
|
+
_host_index=_host_index,
|
195
|
+
)
|
196
|
+
|
197
|
+
@validate_call
|
198
|
+
def get_ohlcv_without_preload_content(
|
199
|
+
self,
|
200
|
+
market: Annotated[MarketType, Field(description="Market type")],
|
201
|
+
timeframe: Annotated[Timeframe, Field(description="Timeframe for the candles")],
|
202
|
+
symbol: Annotated[
|
203
|
+
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
204
|
+
],
|
205
|
+
start: Annotated[
|
206
|
+
Optional[StrictInt], Field(description="Start timestamp in milliseconds")
|
207
|
+
] = None,
|
208
|
+
end: Annotated[
|
209
|
+
Optional[StrictInt], Field(description="End timestamp in milliseconds")
|
210
|
+
] = None,
|
211
|
+
limit: Annotated[
|
212
|
+
Optional[Annotated[int, Field(strict=True, ge=1)]],
|
213
|
+
Field(description="Number of candles to return"),
|
214
|
+
] = None,
|
215
|
+
sort_direction: Annotated[
|
216
|
+
Optional[SortDirection],
|
217
|
+
Field(
|
218
|
+
description="Sort by timestamp in ascending or descending order. Default is descending."
|
219
|
+
),
|
220
|
+
] = None,
|
221
|
+
_request_timeout: Union[
|
222
|
+
None,
|
223
|
+
Annotated[StrictFloat, Field(gt=0)],
|
224
|
+
Tuple[
|
225
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
226
|
+
],
|
227
|
+
] = None,
|
228
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
229
|
+
_content_type: Optional[StrictStr] = None,
|
230
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
231
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
232
|
+
) -> RESTResponseType:
|
233
|
+
"""Get Ohlcv without preloading content"""
|
234
|
+
if self.is_sync:
|
235
|
+
return self._get_ohlcv_sync_without_preload_content(
|
236
|
+
market=market,
|
237
|
+
timeframe=timeframe,
|
238
|
+
symbol=symbol,
|
239
|
+
start=start,
|
240
|
+
end=end,
|
241
|
+
limit=limit,
|
242
|
+
sort_direction=sort_direction,
|
243
|
+
_request_timeout=_request_timeout,
|
244
|
+
_request_auth=_request_auth,
|
245
|
+
_content_type=_content_type,
|
246
|
+
_headers=_headers,
|
247
|
+
_host_index=_host_index,
|
248
|
+
)
|
249
|
+
|
250
|
+
else:
|
251
|
+
return self._get_ohlcv_async_without_preload_content(
|
252
|
+
market=market,
|
253
|
+
timeframe=timeframe,
|
254
|
+
symbol=symbol,
|
255
|
+
start=start,
|
256
|
+
end=end,
|
257
|
+
limit=limit,
|
258
|
+
sort_direction=sort_direction,
|
259
|
+
_request_timeout=_request_timeout,
|
260
|
+
_request_auth=_request_auth,
|
261
|
+
_content_type=_content_type,
|
262
|
+
_headers=_headers,
|
263
|
+
_host_index=_host_index,
|
264
|
+
)
|
265
|
+
|
266
|
+
# Private async implementation methods
|
267
|
+
@validate_call
|
268
|
+
async def _get_ohlcv_async(
|
46
269
|
self,
|
47
270
|
market: Annotated[MarketType, Field(description="Market type")],
|
48
271
|
timeframe: Annotated[Timeframe, Field(description="Timeframe for the candles")],
|
@@ -144,7 +367,7 @@ class OHLCVDataApi:
|
|
144
367
|
).data
|
145
368
|
|
146
369
|
@validate_call
|
147
|
-
async def
|
370
|
+
async def _get_ohlcv_async_with_http_info(
|
148
371
|
self,
|
149
372
|
market: Annotated[MarketType, Field(description="Market type")],
|
150
373
|
timeframe: Annotated[Timeframe, Field(description="Timeframe for the candles")],
|
@@ -241,12 +464,11 @@ class OHLCVDataApi:
|
|
241
464
|
)
|
242
465
|
await response_data.read()
|
243
466
|
return self.api_client.response_deserialize(
|
244
|
-
response_data=response_data,
|
245
|
-
response_types_map=_response_types_map,
|
467
|
+
response_data=response_data, response_types_map=_response_types_map
|
246
468
|
)
|
247
469
|
|
248
470
|
@validate_call
|
249
|
-
async def
|
471
|
+
async def _get_ohlcv_async_without_preload_content(
|
250
472
|
self,
|
251
473
|
market: Annotated[MarketType, Field(description="Market type")],
|
252
474
|
timeframe: Annotated[Timeframe, Field(description="Timeframe for the candles")],
|
@@ -341,7 +563,164 @@ class OHLCVDataApi:
|
|
341
563
|
response_data = await self.api_client.call_api(
|
342
564
|
*_param, _request_timeout=_request_timeout
|
343
565
|
)
|
344
|
-
return response_data
|
566
|
+
return response_data
|
567
|
+
|
568
|
+
# Private sync implementation methods
|
569
|
+
@validate_call
|
570
|
+
def _get_ohlcv_sync(
|
571
|
+
self,
|
572
|
+
market: Annotated[MarketType, Field(description="Market type")],
|
573
|
+
timeframe: Annotated[Timeframe, Field(description="Timeframe for the candles")],
|
574
|
+
symbol: Annotated[
|
575
|
+
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
576
|
+
],
|
577
|
+
start: Annotated[
|
578
|
+
Optional[StrictInt], Field(description="Start timestamp in milliseconds")
|
579
|
+
] = None,
|
580
|
+
end: Annotated[
|
581
|
+
Optional[StrictInt], Field(description="End timestamp in milliseconds")
|
582
|
+
] = None,
|
583
|
+
limit: Annotated[
|
584
|
+
Optional[Annotated[int, Field(strict=True, ge=1)]],
|
585
|
+
Field(description="Number of candles to return"),
|
586
|
+
] = None,
|
587
|
+
sort_direction: Annotated[
|
588
|
+
Optional[SortDirection],
|
589
|
+
Field(
|
590
|
+
description="Sort by timestamp in ascending or descending order. Default is descending."
|
591
|
+
),
|
592
|
+
] = None,
|
593
|
+
_request_timeout: Union[
|
594
|
+
None,
|
595
|
+
Annotated[StrictFloat, Field(gt=0)],
|
596
|
+
Tuple[
|
597
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
598
|
+
],
|
599
|
+
] = None,
|
600
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
601
|
+
_content_type: Optional[StrictStr] = None,
|
602
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
603
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
604
|
+
) -> List[OHLCV]:
|
605
|
+
"""Synchronous version of get_ohlcv"""
|
606
|
+
return async_to_sync(self._get_ohlcv_async)(
|
607
|
+
market=market,
|
608
|
+
timeframe=timeframe,
|
609
|
+
symbol=symbol,
|
610
|
+
start=start,
|
611
|
+
end=end,
|
612
|
+
limit=limit,
|
613
|
+
sort_direction=sort_direction,
|
614
|
+
_request_timeout=_request_timeout,
|
615
|
+
_request_auth=_request_auth,
|
616
|
+
_content_type=_content_type,
|
617
|
+
_headers=_headers,
|
618
|
+
_host_index=_host_index,
|
619
|
+
)
|
620
|
+
|
621
|
+
@validate_call
|
622
|
+
def _get_ohlcv_sync_with_http_info(
|
623
|
+
self,
|
624
|
+
market: Annotated[MarketType, Field(description="Market type")],
|
625
|
+
timeframe: Annotated[Timeframe, Field(description="Timeframe for the candles")],
|
626
|
+
symbol: Annotated[
|
627
|
+
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
628
|
+
],
|
629
|
+
start: Annotated[
|
630
|
+
Optional[StrictInt], Field(description="Start timestamp in milliseconds")
|
631
|
+
] = None,
|
632
|
+
end: Annotated[
|
633
|
+
Optional[StrictInt], Field(description="End timestamp in milliseconds")
|
634
|
+
] = None,
|
635
|
+
limit: Annotated[
|
636
|
+
Optional[Annotated[int, Field(strict=True, ge=1)]],
|
637
|
+
Field(description="Number of candles to return"),
|
638
|
+
] = None,
|
639
|
+
sort_direction: Annotated[
|
640
|
+
Optional[SortDirection],
|
641
|
+
Field(
|
642
|
+
description="Sort by timestamp in ascending or descending order. Default is descending."
|
643
|
+
),
|
644
|
+
] = None,
|
645
|
+
_request_timeout: Union[
|
646
|
+
None,
|
647
|
+
Annotated[StrictFloat, Field(gt=0)],
|
648
|
+
Tuple[
|
649
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
650
|
+
],
|
651
|
+
] = None,
|
652
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
653
|
+
_content_type: Optional[StrictStr] = None,
|
654
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
655
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
656
|
+
) -> ApiResponse[List[OHLCV]]:
|
657
|
+
"""Synchronous version of get_ohlcv_with_http_info"""
|
658
|
+
return async_to_sync(self._get_ohlcv_async_with_http_info)(
|
659
|
+
market=market,
|
660
|
+
timeframe=timeframe,
|
661
|
+
symbol=symbol,
|
662
|
+
start=start,
|
663
|
+
end=end,
|
664
|
+
limit=limit,
|
665
|
+
sort_direction=sort_direction,
|
666
|
+
_request_timeout=_request_timeout,
|
667
|
+
_request_auth=_request_auth,
|
668
|
+
_content_type=_content_type,
|
669
|
+
_headers=_headers,
|
670
|
+
_host_index=_host_index,
|
671
|
+
)
|
672
|
+
|
673
|
+
@validate_call
|
674
|
+
def _get_ohlcv_sync_without_preload_content(
|
675
|
+
self,
|
676
|
+
market: Annotated[MarketType, Field(description="Market type")],
|
677
|
+
timeframe: Annotated[Timeframe, Field(description="Timeframe for the candles")],
|
678
|
+
symbol: Annotated[
|
679
|
+
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
680
|
+
],
|
681
|
+
start: Annotated[
|
682
|
+
Optional[StrictInt], Field(description="Start timestamp in milliseconds")
|
683
|
+
] = None,
|
684
|
+
end: Annotated[
|
685
|
+
Optional[StrictInt], Field(description="End timestamp in milliseconds")
|
686
|
+
] = None,
|
687
|
+
limit: Annotated[
|
688
|
+
Optional[Annotated[int, Field(strict=True, ge=1)]],
|
689
|
+
Field(description="Number of candles to return"),
|
690
|
+
] = None,
|
691
|
+
sort_direction: Annotated[
|
692
|
+
Optional[SortDirection],
|
693
|
+
Field(
|
694
|
+
description="Sort by timestamp in ascending or descending order. Default is descending."
|
695
|
+
),
|
696
|
+
] = None,
|
697
|
+
_request_timeout: Union[
|
698
|
+
None,
|
699
|
+
Annotated[StrictFloat, Field(gt=0)],
|
700
|
+
Tuple[
|
701
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
702
|
+
],
|
703
|
+
] = None,
|
704
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
705
|
+
_content_type: Optional[StrictStr] = None,
|
706
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
707
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
708
|
+
) -> RESTResponseType:
|
709
|
+
"""Synchronous version of get_ohlcv_without_preload_content"""
|
710
|
+
return async_to_sync(self._get_ohlcv_async_without_preload_content)(
|
711
|
+
market=market,
|
712
|
+
timeframe=timeframe,
|
713
|
+
symbol=symbol,
|
714
|
+
start=start,
|
715
|
+
end=end,
|
716
|
+
limit=limit,
|
717
|
+
sort_direction=sort_direction,
|
718
|
+
_request_timeout=_request_timeout,
|
719
|
+
_request_auth=_request_auth,
|
720
|
+
_content_type=_content_type,
|
721
|
+
_headers=_headers,
|
722
|
+
_host_index=_host_index,
|
723
|
+
)
|
345
724
|
|
346
725
|
def _get_ohlcv_serialize(
|
347
726
|
self,
|