crypticorn 2.16.0__py3-none-any.whl → 2.17.0rc2__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.
Files changed (86) hide show
  1. crypticorn/__init__.py +2 -2
  2. crypticorn/auth/client/api/admin_api.py +415 -13
  3. crypticorn/auth/client/api/auth_api.py +2622 -113
  4. crypticorn/auth/client/api/service_api.py +258 -7
  5. crypticorn/auth/client/api/user_api.py +2485 -270
  6. crypticorn/auth/client/api/wallet_api.py +1518 -77
  7. crypticorn/auth/client/models/create_api_key_request.py +2 -1
  8. crypticorn/auth/client/models/get_api_keys200_response_inner.py +2 -1
  9. crypticorn/auth/client/rest.py +23 -4
  10. crypticorn/auth/main.py +8 -5
  11. crypticorn/client.py +227 -59
  12. crypticorn/common/__init__.py +1 -0
  13. crypticorn/common/metrics.py +18 -0
  14. crypticorn/common/middleware.py +46 -0
  15. crypticorn/common/pagination.py +137 -18
  16. crypticorn/common/router/admin_router.py +12 -2
  17. crypticorn/common/utils.py +2 -1
  18. crypticorn/common/warnings.py +7 -0
  19. crypticorn/hive/client/api/admin_api.py +1234 -51
  20. crypticorn/hive/client/api/data_api.py +517 -13
  21. crypticorn/hive/client/api/models_api.py +1657 -83
  22. crypticorn/hive/client/api/status_api.py +415 -13
  23. crypticorn/hive/client/models/api_error_identifier.py +1 -1
  24. crypticorn/hive/client/rest.py +23 -4
  25. crypticorn/hive/main.py +99 -25
  26. crypticorn/klines/client/api/admin_api.py +1234 -51
  27. crypticorn/klines/client/api/change_in_timeframe_api.py +278 -7
  28. crypticorn/klines/client/api/funding_rates_api.py +324 -7
  29. crypticorn/klines/client/api/ohlcv_data_api.py +399 -7
  30. crypticorn/klines/client/api/status_api.py +415 -13
  31. crypticorn/klines/client/api/symbols_api.py +225 -7
  32. crypticorn/klines/client/api/udf_api.py +1393 -120
  33. crypticorn/klines/client/models/api_error_identifier.py +3 -1
  34. crypticorn/klines/client/rest.py +23 -4
  35. crypticorn/klines/main.py +89 -12
  36. crypticorn/metrics/client/api/admin_api.py +1234 -51
  37. crypticorn/metrics/client/api/exchanges_api.py +1405 -140
  38. crypticorn/metrics/client/api/indicators_api.py +640 -13
  39. crypticorn/metrics/client/api/logs_api.py +305 -7
  40. crypticorn/metrics/client/api/marketcap_api.py +1240 -60
  41. crypticorn/metrics/client/api/markets_api.py +352 -7
  42. crypticorn/metrics/client/api/quote_currencies_api.py +237 -7
  43. crypticorn/metrics/client/api/status_api.py +415 -13
  44. crypticorn/metrics/client/api/tokens_api.py +400 -13
  45. crypticorn/metrics/client/configuration.py +4 -2
  46. crypticorn/metrics/client/rest.py +23 -4
  47. crypticorn/metrics/main.py +113 -19
  48. crypticorn/pay/client/api/admin_api.py +1720 -126
  49. crypticorn/pay/client/api/now_payments_api.py +1013 -42
  50. crypticorn/pay/client/api/payments_api.py +580 -13
  51. crypticorn/pay/client/api/products_api.py +915 -25
  52. crypticorn/pay/client/api/status_api.py +415 -13
  53. crypticorn/pay/client/configuration.py +2 -2
  54. crypticorn/pay/client/models/api_error_identifier.py +7 -7
  55. crypticorn/pay/client/models/scope.py +1 -0
  56. crypticorn/pay/client/rest.py +23 -4
  57. crypticorn/pay/main.py +10 -6
  58. crypticorn/trade/client/__init__.py +2 -1
  59. crypticorn/trade/client/api/__init__.py +0 -1
  60. crypticorn/trade/client/api/admin_api.py +1718 -123
  61. crypticorn/trade/client/api/api_keys_api.py +1596 -103
  62. crypticorn/trade/client/api/bots_api.py +1106 -47
  63. crypticorn/trade/client/api/exchanges_api.py +592 -19
  64. crypticorn/trade/client/api/notifications_api.py +1340 -112
  65. crypticorn/trade/client/api/orders_api.py +240 -7
  66. crypticorn/trade/client/api/status_api.py +415 -13
  67. crypticorn/trade/client/api/strategies_api.py +1170 -69
  68. crypticorn/trade/client/api/trading_actions_api.py +650 -19
  69. crypticorn/trade/client/models/__init__.py +2 -0
  70. crypticorn/trade/client/models/exchange.py +6 -1
  71. crypticorn/trade/client/models/exchange_key_balance.py +111 -0
  72. crypticorn/trade/client/models/futures_balance.py +27 -25
  73. crypticorn/trade/client/models/spot_balance.py +110 -0
  74. crypticorn/trade/client/models/strategy.py +5 -3
  75. crypticorn/trade/client/models/strategy_create.py +6 -4
  76. crypticorn/trade/client/models/strategy_exchange_info.py +16 -4
  77. crypticorn/trade/client/models/strategy_update.py +2 -2
  78. crypticorn/trade/client/rest.py +23 -4
  79. crypticorn/trade/main.py +15 -12
  80. {crypticorn-2.16.0.dist-info → crypticorn-2.17.0rc2.dist-info}/METADATA +65 -20
  81. {crypticorn-2.16.0.dist-info → crypticorn-2.17.0rc2.dist-info}/RECORD +85 -83
  82. crypticorn/trade/client/api/futures_trading_panel_api.py +0 -1285
  83. {crypticorn-2.16.0.dist-info → crypticorn-2.17.0rc2.dist-info}/WHEEL +0 -0
  84. {crypticorn-2.16.0.dist-info → crypticorn-2.17.0rc2.dist-info}/entry_points.txt +0 -0
  85. {crypticorn-2.16.0.dist-info → crypticorn-2.17.0rc2.dist-info}/licenses/LICENSE +0 -0
  86. {crypticorn-2.16.0.dist-info → crypticorn-2.17.0rc2.dist-info}/top_level.txt +0 -0
@@ -25,6 +25,24 @@ from crypticorn.klines.client.api_client import ApiClient, RequestSerialized
25
25
  from crypticorn.klines.client.api_response import ApiResponse
26
26
  from crypticorn.klines.client.rest import RESTResponseType
27
27
 
28
+ # Import async_to_sync for sync methods
29
+ try:
30
+ from asgiref.sync import async_to_sync
31
+
32
+ _HAS_ASGIREF = True
33
+ except ImportError:
34
+ _HAS_ASGIREF = False
35
+
36
+ def async_to_sync(async_func):
37
+ """Fallback decorator that raises an error if asgiref is not available."""
38
+
39
+ def wrapper(*args, **kwargs):
40
+ raise ImportError(
41
+ "asgiref is required for sync methods. Install with: pip install asgiref"
42
+ )
43
+
44
+ return wrapper
45
+
28
46
 
29
47
  class SymbolsApi:
30
48
  """NOTE: This class is auto generated by OpenAPI Generator
@@ -33,13 +51,135 @@ class SymbolsApi:
33
51
  Do not edit the class manually.
34
52
  """
35
53
 
36
- def __init__(self, api_client=None) -> None:
54
+ def __init__(self, api_client=None, is_sync: bool = False) -> None:
37
55
  if api_client is None:
38
56
  api_client = ApiClient.get_default()
39
57
  self.api_client = api_client
58
+ self.is_sync = is_sync
40
59
 
41
60
  @validate_call
42
- async def get_klines_symbols(
61
+ def get_klines_symbols(
62
+ self,
63
+ market: Annotated[MarketType, Field(description="Market type")],
64
+ _request_timeout: Union[
65
+ None,
66
+ Annotated[StrictFloat, Field(gt=0)],
67
+ Tuple[
68
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
69
+ ],
70
+ ] = None,
71
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
72
+ _content_type: Optional[StrictStr] = None,
73
+ _headers: Optional[Dict[StrictStr, Any]] = None,
74
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
75
+ ) -> List[str]:
76
+ """Symbols
77
+
78
+ This method can work in both sync and async modes based on the is_sync flag.
79
+ """
80
+ if self.is_sync:
81
+ return self._get_klines_symbols_sync(
82
+ market=market,
83
+ _request_timeout=_request_timeout,
84
+ _request_auth=_request_auth,
85
+ _content_type=_content_type,
86
+ _headers=_headers,
87
+ _host_index=_host_index,
88
+ )
89
+
90
+ else:
91
+ return self._get_klines_symbols_async(
92
+ market=market,
93
+ _request_timeout=_request_timeout,
94
+ _request_auth=_request_auth,
95
+ _content_type=_content_type,
96
+ _headers=_headers,
97
+ _host_index=_host_index,
98
+ )
99
+
100
+ @validate_call
101
+ def get_klines_symbols_with_http_info(
102
+ self,
103
+ market: Annotated[MarketType, Field(description="Market type")],
104
+ _request_timeout: Union[
105
+ None,
106
+ Annotated[StrictFloat, Field(gt=0)],
107
+ Tuple[
108
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
109
+ ],
110
+ ] = None,
111
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
112
+ _content_type: Optional[StrictStr] = None,
113
+ _headers: Optional[Dict[StrictStr, Any]] = None,
114
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
115
+ ) -> ApiResponse[List[str]]:
116
+ """Symbols with HTTP info
117
+
118
+ This method can work in both sync and async modes based on the is_sync flag.
119
+ """
120
+ if self.is_sync:
121
+ return self._get_klines_symbols_sync_with_http_info(
122
+ market=market,
123
+ _request_timeout=_request_timeout,
124
+ _request_auth=_request_auth,
125
+ _content_type=_content_type,
126
+ _headers=_headers,
127
+ _host_index=_host_index,
128
+ )
129
+
130
+ else:
131
+ return self._get_klines_symbols_async_with_http_info(
132
+ market=market,
133
+ _request_timeout=_request_timeout,
134
+ _request_auth=_request_auth,
135
+ _content_type=_content_type,
136
+ _headers=_headers,
137
+ _host_index=_host_index,
138
+ )
139
+
140
+ @validate_call
141
+ def get_klines_symbols_without_preload_content(
142
+ self,
143
+ market: Annotated[MarketType, Field(description="Market type")],
144
+ _request_timeout: Union[
145
+ None,
146
+ Annotated[StrictFloat, Field(gt=0)],
147
+ Tuple[
148
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
149
+ ],
150
+ ] = None,
151
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
152
+ _content_type: Optional[StrictStr] = None,
153
+ _headers: Optional[Dict[StrictStr, Any]] = None,
154
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
155
+ ) -> RESTResponseType:
156
+ """Symbols without preloading content
157
+
158
+ This method can work in both sync and async modes based on the is_sync flag.
159
+ """
160
+ if self.is_sync:
161
+ return self._get_klines_symbols_sync_without_preload_content(
162
+ market=market,
163
+ _request_timeout=_request_timeout,
164
+ _request_auth=_request_auth,
165
+ _content_type=_content_type,
166
+ _headers=_headers,
167
+ _host_index=_host_index,
168
+ )
169
+
170
+ else:
171
+ return self._get_klines_symbols_async_without_preload_content(
172
+ market=market,
173
+ _request_timeout=_request_timeout,
174
+ _request_auth=_request_auth,
175
+ _content_type=_content_type,
176
+ _headers=_headers,
177
+ _host_index=_host_index,
178
+ )
179
+
180
+ # Private async implementation methods
181
+ @validate_call
182
+ async def _get_klines_symbols_async(
43
183
  self,
44
184
  market: Annotated[MarketType, Field(description="Market type")],
45
185
  _request_timeout: Union[
@@ -103,7 +243,7 @@ class SymbolsApi:
103
243
  ).data
104
244
 
105
245
  @validate_call
106
- async def get_klines_symbols_with_http_info(
246
+ async def _get_klines_symbols_async_with_http_info(
107
247
  self,
108
248
  market: Annotated[MarketType, Field(description="Market type")],
109
249
  _request_timeout: Union[
@@ -162,12 +302,11 @@ class SymbolsApi:
162
302
  )
163
303
  await response_data.read()
164
304
  return self.api_client.response_deserialize(
165
- response_data=response_data,
166
- response_types_map=_response_types_map,
305
+ response_data=response_data, response_types_map=_response_types_map
167
306
  )
168
307
 
169
308
  @validate_call
170
- async def get_klines_symbols_without_preload_content(
309
+ async def _get_klines_symbols_async_without_preload_content(
171
310
  self,
172
311
  market: Annotated[MarketType, Field(description="Market type")],
173
312
  _request_timeout: Union[
@@ -224,7 +363,86 @@ class SymbolsApi:
224
363
  response_data = await self.api_client.call_api(
225
364
  *_param, _request_timeout=_request_timeout
226
365
  )
227
- return response_data.response
366
+ return response_data
367
+
368
+ # Private sync implementation methods
369
+ @validate_call
370
+ def _get_klines_symbols_sync(
371
+ self,
372
+ market: Annotated[MarketType, Field(description="Market type")],
373
+ _request_timeout: Union[
374
+ None,
375
+ Annotated[StrictFloat, Field(gt=0)],
376
+ Tuple[
377
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
378
+ ],
379
+ ] = None,
380
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
381
+ _content_type: Optional[StrictStr] = None,
382
+ _headers: Optional[Dict[StrictStr, Any]] = None,
383
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
384
+ ) -> List[str]:
385
+ """Synchronous version of get_klines_symbols"""
386
+ return async_to_sync(self._get_klines_symbols_async)(
387
+ market=market,
388
+ _request_timeout=_request_timeout,
389
+ _request_auth=_request_auth,
390
+ _content_type=_content_type,
391
+ _headers=_headers,
392
+ _host_index=_host_index,
393
+ )
394
+
395
+ @validate_call
396
+ def _get_klines_symbols_sync_with_http_info(
397
+ self,
398
+ market: Annotated[MarketType, Field(description="Market type")],
399
+ _request_timeout: Union[
400
+ None,
401
+ Annotated[StrictFloat, Field(gt=0)],
402
+ Tuple[
403
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
404
+ ],
405
+ ] = None,
406
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
407
+ _content_type: Optional[StrictStr] = None,
408
+ _headers: Optional[Dict[StrictStr, Any]] = None,
409
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
410
+ ) -> ApiResponse[List[str]]:
411
+ """Synchronous version of get_klines_symbols_with_http_info"""
412
+ return async_to_sync(self._get_klines_symbols_async_with_http_info)(
413
+ market=market,
414
+ _request_timeout=_request_timeout,
415
+ _request_auth=_request_auth,
416
+ _content_type=_content_type,
417
+ _headers=_headers,
418
+ _host_index=_host_index,
419
+ )
420
+
421
+ @validate_call
422
+ def _get_klines_symbols_sync_without_preload_content(
423
+ self,
424
+ market: Annotated[MarketType, Field(description="Market type")],
425
+ _request_timeout: Union[
426
+ None,
427
+ Annotated[StrictFloat, Field(gt=0)],
428
+ Tuple[
429
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
430
+ ],
431
+ ] = None,
432
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
433
+ _content_type: Optional[StrictStr] = None,
434
+ _headers: Optional[Dict[StrictStr, Any]] = None,
435
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
436
+ ) -> RESTResponseType:
437
+ """Synchronous version of get_klines_symbols_without_preload_content"""
438
+ return async_to_sync(self._get_klines_symbols_async_without_preload_content)(
439
+ market=market,
440
+ _request_timeout=_request_timeout,
441
+ _request_auth=_request_auth,
442
+ _content_type=_content_type,
443
+ _headers=_headers,
444
+ _host_index=_host_index,
445
+ )
228
446
 
229
447
  def _get_klines_symbols_serialize(
230
448
  self,