crypticorn 2.4.6__py3-none-any.whl → 2.5.0rc1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- crypticorn/cli/init.py +7 -4
- crypticorn/common/__init__.py +1 -0
- crypticorn/common/auth.py +11 -9
- crypticorn/common/errors.py +5 -0
- crypticorn/common/exceptions.py +33 -0
- crypticorn/common/utils.py +20 -5
- crypticorn/klines/client/__init__.py +10 -3
- crypticorn/klines/client/api/__init__.py +1 -0
- crypticorn/klines/client/api/change_in_timeframe_api.py +331 -0
- crypticorn/klines/client/api/funding_rates_api.py +13 -13
- crypticorn/klines/client/api/health_check_api.py +8 -8
- crypticorn/klines/client/api/ohlcv_data_api.py +38 -26
- crypticorn/klines/client/api/symbols_api.py +26 -20
- crypticorn/klines/client/api/udf_api.py +229 -229
- crypticorn/klines/client/api_client.py +8 -5
- crypticorn/klines/client/configuration.py +80 -37
- crypticorn/klines/client/models/__init__.py +9 -3
- crypticorn/klines/client/models/base_response_list_change_in_timeframe_response.py +123 -0
- crypticorn/klines/client/models/change_in_timeframe_response.py +86 -0
- crypticorn/klines/client/models/market_type.py +35 -0
- crypticorn/klines/client/models/response_get_udf_history.py +198 -0
- crypticorn/klines/client/rest.py +111 -159
- crypticorn/klines/main.py +10 -5
- crypticorn/metrics/main.py +5 -3
- crypticorn/pay/client/__init__.py +0 -3
- crypticorn/pay/client/api/now_payments_api.py +1 -53
- crypticorn/pay/client/models/__init__.py +0 -3
- crypticorn/pay/client/models/payment.py +3 -3
- crypticorn/pay/client/models/scope.py +6 -1
- crypticorn/trade/client/models/exchange_key_model.py +2 -1
- {crypticorn-2.4.6.dist-info → crypticorn-2.5.0rc1.dist-info}/METADATA +8 -2
- {crypticorn-2.4.6.dist-info → crypticorn-2.5.0rc1.dist-info}/RECORD +35 -29
- {crypticorn-2.4.6.dist-info → crypticorn-2.5.0rc1.dist-info}/WHEEL +1 -1
- {crypticorn-2.4.6.dist-info → crypticorn-2.5.0rc1.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.4.6.dist-info → crypticorn-2.5.0rc1.dist-info}/top_level.txt +0 -0
@@ -38,7 +38,7 @@ class HealthCheckApi:
|
|
38
38
|
self.api_client = api_client
|
39
39
|
|
40
40
|
@validate_call
|
41
|
-
def index_get(
|
41
|
+
async def index_get(
|
42
42
|
self,
|
43
43
|
_request_timeout: Union[
|
44
44
|
None,
|
@@ -88,17 +88,17 @@ class HealthCheckApi:
|
|
88
88
|
_response_types_map: Dict[str, Optional[str]] = {
|
89
89
|
"200": "BaseResponseHealthCheckResponse",
|
90
90
|
}
|
91
|
-
response_data = self.api_client.call_api(
|
91
|
+
response_data = await self.api_client.call_api(
|
92
92
|
*_param, _request_timeout=_request_timeout
|
93
93
|
)
|
94
|
-
response_data.read()
|
94
|
+
await response_data.read()
|
95
95
|
return self.api_client.response_deserialize(
|
96
96
|
response_data=response_data,
|
97
97
|
response_types_map=_response_types_map,
|
98
98
|
).data
|
99
99
|
|
100
100
|
@validate_call
|
101
|
-
def index_get_with_http_info(
|
101
|
+
async def index_get_with_http_info(
|
102
102
|
self,
|
103
103
|
_request_timeout: Union[
|
104
104
|
None,
|
@@ -148,17 +148,17 @@ class HealthCheckApi:
|
|
148
148
|
_response_types_map: Dict[str, Optional[str]] = {
|
149
149
|
"200": "BaseResponseHealthCheckResponse",
|
150
150
|
}
|
151
|
-
response_data = self.api_client.call_api(
|
151
|
+
response_data = await self.api_client.call_api(
|
152
152
|
*_param, _request_timeout=_request_timeout
|
153
153
|
)
|
154
|
-
response_data.read()
|
154
|
+
await response_data.read()
|
155
155
|
return self.api_client.response_deserialize(
|
156
156
|
response_data=response_data,
|
157
157
|
response_types_map=_response_types_map,
|
158
158
|
)
|
159
159
|
|
160
160
|
@validate_call
|
161
|
-
def index_get_without_preload_content(
|
161
|
+
async def index_get_without_preload_content(
|
162
162
|
self,
|
163
163
|
_request_timeout: Union[
|
164
164
|
None,
|
@@ -208,7 +208,7 @@ class HealthCheckApi:
|
|
208
208
|
_response_types_map: Dict[str, Optional[str]] = {
|
209
209
|
"200": "BaseResponseHealthCheckResponse",
|
210
210
|
}
|
211
|
-
response_data = self.api_client.call_api(
|
211
|
+
response_data = await self.api_client.call_api(
|
212
212
|
*_param, _request_timeout=_request_timeout
|
213
213
|
)
|
214
214
|
return response_data.response
|
@@ -17,11 +17,14 @@ from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
17
|
from typing_extensions import Annotated
|
18
18
|
|
19
19
|
from pydantic import Field, StrictInt, StrictStr
|
20
|
-
from typing import
|
20
|
+
from typing import Optional
|
21
21
|
from typing_extensions import Annotated
|
22
22
|
from crypticorn.klines.client.models.base_response_ohlcv_response import (
|
23
23
|
BaseResponseOHLCVResponse,
|
24
24
|
)
|
25
|
+
from crypticorn.klines.client.models.market_type import MarketType
|
26
|
+
from crypticorn.klines.client.models.sort_direction import SortDirection
|
27
|
+
from crypticorn.klines.client.models.timeframe import Timeframe
|
25
28
|
|
26
29
|
from crypticorn.klines.client.api_client import ApiClient, RequestSerialized
|
27
30
|
from crypticorn.klines.client.api_response import ApiResponse
|
@@ -41,10 +44,12 @@ class OHLCVDataApi:
|
|
41
44
|
self.api_client = api_client
|
42
45
|
|
43
46
|
@validate_call
|
44
|
-
def
|
47
|
+
async def get_ohlcv(
|
45
48
|
self,
|
46
|
-
market: Annotated[
|
47
|
-
|
49
|
+
market: Annotated[
|
50
|
+
MarketType, Field(description="Market type (spot or futures)")
|
51
|
+
],
|
52
|
+
timeframe: Annotated[Timeframe, Field(description="Timeframe for the candles")],
|
48
53
|
symbol: Annotated[
|
49
54
|
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
50
55
|
],
|
@@ -59,7 +64,8 @@ class OHLCVDataApi:
|
|
59
64
|
Field(description="Number of candles to return"),
|
60
65
|
] = None,
|
61
66
|
sort_direction: Annotated[
|
62
|
-
Optional[
|
67
|
+
Optional[SortDirection],
|
68
|
+
Field(description="Klines sort direction (asc or desc)"),
|
63
69
|
] = None,
|
64
70
|
_request_timeout: Union[
|
65
71
|
None,
|
@@ -78,7 +84,7 @@ class OHLCVDataApi:
|
|
78
84
|
Retrieve OHLCV (Open, High, Low, Close, Volume) data for a specific market, timeframe, and symbol.
|
79
85
|
|
80
86
|
:param market: Market type (spot or futures) (required)
|
81
|
-
:type market:
|
87
|
+
:type market: MarketType
|
82
88
|
:param timeframe: Timeframe for the candles (required)
|
83
89
|
:type timeframe: Timeframe
|
84
90
|
:param symbol: Trading pair symbol (e.g., BTCUSDT) (required)
|
@@ -113,7 +119,7 @@ class OHLCVDataApi:
|
|
113
119
|
:return: Returns the result object.
|
114
120
|
""" # noqa: E501
|
115
121
|
|
116
|
-
_param = self.
|
122
|
+
_param = self._get_ohlcv_serialize(
|
117
123
|
market=market,
|
118
124
|
timeframe=timeframe,
|
119
125
|
symbol=symbol,
|
@@ -134,20 +140,22 @@ class OHLCVDataApi:
|
|
134
140
|
"500": "ErrorResponse",
|
135
141
|
"422": "HTTPValidationError",
|
136
142
|
}
|
137
|
-
response_data = self.api_client.call_api(
|
143
|
+
response_data = await self.api_client.call_api(
|
138
144
|
*_param, _request_timeout=_request_timeout
|
139
145
|
)
|
140
|
-
response_data.read()
|
146
|
+
await response_data.read()
|
141
147
|
return self.api_client.response_deserialize(
|
142
148
|
response_data=response_data,
|
143
149
|
response_types_map=_response_types_map,
|
144
150
|
).data
|
145
151
|
|
146
152
|
@validate_call
|
147
|
-
def
|
153
|
+
async def get_ohlcv_with_http_info(
|
148
154
|
self,
|
149
|
-
market: Annotated[
|
150
|
-
|
155
|
+
market: Annotated[
|
156
|
+
MarketType, Field(description="Market type (spot or futures)")
|
157
|
+
],
|
158
|
+
timeframe: Annotated[Timeframe, Field(description="Timeframe for the candles")],
|
151
159
|
symbol: Annotated[
|
152
160
|
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
153
161
|
],
|
@@ -162,7 +170,8 @@ class OHLCVDataApi:
|
|
162
170
|
Field(description="Number of candles to return"),
|
163
171
|
] = None,
|
164
172
|
sort_direction: Annotated[
|
165
|
-
Optional[
|
173
|
+
Optional[SortDirection],
|
174
|
+
Field(description="Klines sort direction (asc or desc)"),
|
166
175
|
] = None,
|
167
176
|
_request_timeout: Union[
|
168
177
|
None,
|
@@ -181,7 +190,7 @@ class OHLCVDataApi:
|
|
181
190
|
Retrieve OHLCV (Open, High, Low, Close, Volume) data for a specific market, timeframe, and symbol.
|
182
191
|
|
183
192
|
:param market: Market type (spot or futures) (required)
|
184
|
-
:type market:
|
193
|
+
:type market: MarketType
|
185
194
|
:param timeframe: Timeframe for the candles (required)
|
186
195
|
:type timeframe: Timeframe
|
187
196
|
:param symbol: Trading pair symbol (e.g., BTCUSDT) (required)
|
@@ -216,7 +225,7 @@ class OHLCVDataApi:
|
|
216
225
|
:return: Returns the result object.
|
217
226
|
""" # noqa: E501
|
218
227
|
|
219
|
-
_param = self.
|
228
|
+
_param = self._get_ohlcv_serialize(
|
220
229
|
market=market,
|
221
230
|
timeframe=timeframe,
|
222
231
|
symbol=symbol,
|
@@ -237,20 +246,22 @@ class OHLCVDataApi:
|
|
237
246
|
"500": "ErrorResponse",
|
238
247
|
"422": "HTTPValidationError",
|
239
248
|
}
|
240
|
-
response_data = self.api_client.call_api(
|
249
|
+
response_data = await self.api_client.call_api(
|
241
250
|
*_param, _request_timeout=_request_timeout
|
242
251
|
)
|
243
|
-
response_data.read()
|
252
|
+
await response_data.read()
|
244
253
|
return self.api_client.response_deserialize(
|
245
254
|
response_data=response_data,
|
246
255
|
response_types_map=_response_types_map,
|
247
256
|
)
|
248
257
|
|
249
258
|
@validate_call
|
250
|
-
def
|
259
|
+
async def get_ohlcv_without_preload_content(
|
251
260
|
self,
|
252
|
-
market: Annotated[
|
253
|
-
|
261
|
+
market: Annotated[
|
262
|
+
MarketType, Field(description="Market type (spot or futures)")
|
263
|
+
],
|
264
|
+
timeframe: Annotated[Timeframe, Field(description="Timeframe for the candles")],
|
254
265
|
symbol: Annotated[
|
255
266
|
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
256
267
|
],
|
@@ -265,7 +276,8 @@ class OHLCVDataApi:
|
|
265
276
|
Field(description="Number of candles to return"),
|
266
277
|
] = None,
|
267
278
|
sort_direction: Annotated[
|
268
|
-
Optional[
|
279
|
+
Optional[SortDirection],
|
280
|
+
Field(description="Klines sort direction (asc or desc)"),
|
269
281
|
] = None,
|
270
282
|
_request_timeout: Union[
|
271
283
|
None,
|
@@ -284,7 +296,7 @@ class OHLCVDataApi:
|
|
284
296
|
Retrieve OHLCV (Open, High, Low, Close, Volume) data for a specific market, timeframe, and symbol.
|
285
297
|
|
286
298
|
:param market: Market type (spot or futures) (required)
|
287
|
-
:type market:
|
299
|
+
:type market: MarketType
|
288
300
|
:param timeframe: Timeframe for the candles (required)
|
289
301
|
:type timeframe: Timeframe
|
290
302
|
:param symbol: Trading pair symbol (e.g., BTCUSDT) (required)
|
@@ -319,7 +331,7 @@ class OHLCVDataApi:
|
|
319
331
|
:return: Returns the result object.
|
320
332
|
""" # noqa: E501
|
321
333
|
|
322
|
-
_param = self.
|
334
|
+
_param = self._get_ohlcv_serialize(
|
323
335
|
market=market,
|
324
336
|
timeframe=timeframe,
|
325
337
|
symbol=symbol,
|
@@ -340,12 +352,12 @@ class OHLCVDataApi:
|
|
340
352
|
"500": "ErrorResponse",
|
341
353
|
"422": "HTTPValidationError",
|
342
354
|
}
|
343
|
-
response_data = self.api_client.call_api(
|
355
|
+
response_data = await self.api_client.call_api(
|
344
356
|
*_param, _request_timeout=_request_timeout
|
345
357
|
)
|
346
358
|
return response_data.response
|
347
359
|
|
348
|
-
def
|
360
|
+
def _get_ohlcv_serialize(
|
349
361
|
self,
|
350
362
|
market,
|
351
363
|
timeframe,
|
@@ -408,7 +420,7 @@ class OHLCVDataApi:
|
|
408
420
|
)
|
409
421
|
|
410
422
|
# authentication setting
|
411
|
-
_auth_settings: List[str] = []
|
423
|
+
_auth_settings: List[str] = ["APIKeyHeader", "HTTPBearer"]
|
412
424
|
|
413
425
|
return self.api_client.param_serialize(
|
414
426
|
method="GET",
|
@@ -17,9 +17,9 @@ from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
17
|
from typing_extensions import Annotated
|
18
18
|
|
19
19
|
from pydantic import Field
|
20
|
-
from typing import Any
|
21
20
|
from typing_extensions import Annotated
|
22
21
|
from crypticorn.klines.client.models.base_response_list_str import BaseResponseListStr
|
22
|
+
from crypticorn.klines.client.models.market_type import MarketType
|
23
23
|
|
24
24
|
from crypticorn.klines.client.api_client import ApiClient, RequestSerialized
|
25
25
|
from crypticorn.klines.client.api_response import ApiResponse
|
@@ -39,9 +39,11 @@ class SymbolsApi:
|
|
39
39
|
self.api_client = api_client
|
40
40
|
|
41
41
|
@validate_call
|
42
|
-
def
|
42
|
+
async def get_klines_symbols(
|
43
43
|
self,
|
44
|
-
market: Annotated[
|
44
|
+
market: Annotated[
|
45
|
+
MarketType, Field(description="Market type (spot or futures)")
|
46
|
+
],
|
45
47
|
_request_timeout: Union[
|
46
48
|
None,
|
47
49
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -59,7 +61,7 @@ class SymbolsApi:
|
|
59
61
|
Retrieve a list of whitelisted symbols for a specific market.
|
60
62
|
|
61
63
|
:param market: Market type (spot or futures) (required)
|
62
|
-
:type market:
|
64
|
+
:type market: MarketType
|
63
65
|
:param _request_timeout: timeout setting for this request. If one
|
64
66
|
number provided, it will be total request
|
65
67
|
timeout. It can also be a pair (tuple) of
|
@@ -82,7 +84,7 @@ class SymbolsApi:
|
|
82
84
|
:return: Returns the result object.
|
83
85
|
""" # noqa: E501
|
84
86
|
|
85
|
-
_param = self.
|
87
|
+
_param = self._get_klines_symbols_serialize(
|
86
88
|
market=market,
|
87
89
|
_request_auth=_request_auth,
|
88
90
|
_content_type=_content_type,
|
@@ -96,19 +98,21 @@ class SymbolsApi:
|
|
96
98
|
"500": "ErrorResponse",
|
97
99
|
"422": "HTTPValidationError",
|
98
100
|
}
|
99
|
-
response_data = self.api_client.call_api(
|
101
|
+
response_data = await self.api_client.call_api(
|
100
102
|
*_param, _request_timeout=_request_timeout
|
101
103
|
)
|
102
|
-
response_data.read()
|
104
|
+
await response_data.read()
|
103
105
|
return self.api_client.response_deserialize(
|
104
106
|
response_data=response_data,
|
105
107
|
response_types_map=_response_types_map,
|
106
108
|
).data
|
107
109
|
|
108
110
|
@validate_call
|
109
|
-
def
|
111
|
+
async def get_klines_symbols_with_http_info(
|
110
112
|
self,
|
111
|
-
market: Annotated[
|
113
|
+
market: Annotated[
|
114
|
+
MarketType, Field(description="Market type (spot or futures)")
|
115
|
+
],
|
112
116
|
_request_timeout: Union[
|
113
117
|
None,
|
114
118
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -126,7 +130,7 @@ class SymbolsApi:
|
|
126
130
|
Retrieve a list of whitelisted symbols for a specific market.
|
127
131
|
|
128
132
|
:param market: Market type (spot or futures) (required)
|
129
|
-
:type market:
|
133
|
+
:type market: MarketType
|
130
134
|
:param _request_timeout: timeout setting for this request. If one
|
131
135
|
number provided, it will be total request
|
132
136
|
timeout. It can also be a pair (tuple) of
|
@@ -149,7 +153,7 @@ class SymbolsApi:
|
|
149
153
|
:return: Returns the result object.
|
150
154
|
""" # noqa: E501
|
151
155
|
|
152
|
-
_param = self.
|
156
|
+
_param = self._get_klines_symbols_serialize(
|
153
157
|
market=market,
|
154
158
|
_request_auth=_request_auth,
|
155
159
|
_content_type=_content_type,
|
@@ -163,19 +167,21 @@ class SymbolsApi:
|
|
163
167
|
"500": "ErrorResponse",
|
164
168
|
"422": "HTTPValidationError",
|
165
169
|
}
|
166
|
-
response_data = self.api_client.call_api(
|
170
|
+
response_data = await self.api_client.call_api(
|
167
171
|
*_param, _request_timeout=_request_timeout
|
168
172
|
)
|
169
|
-
response_data.read()
|
173
|
+
await response_data.read()
|
170
174
|
return self.api_client.response_deserialize(
|
171
175
|
response_data=response_data,
|
172
176
|
response_types_map=_response_types_map,
|
173
177
|
)
|
174
178
|
|
175
179
|
@validate_call
|
176
|
-
def
|
180
|
+
async def get_klines_symbols_without_preload_content(
|
177
181
|
self,
|
178
|
-
market: Annotated[
|
182
|
+
market: Annotated[
|
183
|
+
MarketType, Field(description="Market type (spot or futures)")
|
184
|
+
],
|
179
185
|
_request_timeout: Union[
|
180
186
|
None,
|
181
187
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -193,7 +199,7 @@ class SymbolsApi:
|
|
193
199
|
Retrieve a list of whitelisted symbols for a specific market.
|
194
200
|
|
195
201
|
:param market: Market type (spot or futures) (required)
|
196
|
-
:type market:
|
202
|
+
:type market: MarketType
|
197
203
|
:param _request_timeout: timeout setting for this request. If one
|
198
204
|
number provided, it will be total request
|
199
205
|
timeout. It can also be a pair (tuple) of
|
@@ -216,7 +222,7 @@ class SymbolsApi:
|
|
216
222
|
:return: Returns the result object.
|
217
223
|
""" # noqa: E501
|
218
224
|
|
219
|
-
_param = self.
|
225
|
+
_param = self._get_klines_symbols_serialize(
|
220
226
|
market=market,
|
221
227
|
_request_auth=_request_auth,
|
222
228
|
_content_type=_content_type,
|
@@ -230,12 +236,12 @@ class SymbolsApi:
|
|
230
236
|
"500": "ErrorResponse",
|
231
237
|
"422": "HTTPValidationError",
|
232
238
|
}
|
233
|
-
response_data = self.api_client.call_api(
|
239
|
+
response_data = await self.api_client.call_api(
|
234
240
|
*_param, _request_timeout=_request_timeout
|
235
241
|
)
|
236
242
|
return response_data.response
|
237
243
|
|
238
|
-
def
|
244
|
+
def _get_klines_symbols_serialize(
|
239
245
|
self,
|
240
246
|
market,
|
241
247
|
_request_auth,
|
@@ -272,7 +278,7 @@ class SymbolsApi:
|
|
272
278
|
)
|
273
279
|
|
274
280
|
# authentication setting
|
275
|
-
_auth_settings: List[str] = []
|
281
|
+
_auth_settings: List[str] = ["APIKeyHeader", "HTTPBearer"]
|
276
282
|
|
277
283
|
return self.api_client.param_serialize(
|
278
284
|
method="GET",
|