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.metrics.client.api_client import ApiClient, RequestSerialized
25
25
  from crypticorn.metrics.client.api_response import ApiResponse
26
26
  from crypticorn.metrics.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 LogsApi:
30
48
  """NOTE: This class is auto generated by OpenAPI Generator
@@ -33,13 +51,177 @@ class LogsApi:
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
59
+
60
+ @validate_call
61
+ def get_metrics_error_logs(
62
+ self,
63
+ severity: Annotated[
64
+ Optional[Severity], Field(description="Severity level of errors to fetch")
65
+ ] = None,
66
+ start_timestamp: Annotated[
67
+ Optional[StrictInt],
68
+ Field(description="Start timestamp for which to fetch error logs"),
69
+ ] = None,
70
+ end_timestamp: Annotated[
71
+ Optional[StrictInt],
72
+ Field(description="End timestamp for which to fetch error logs"),
73
+ ] = None,
74
+ _request_timeout: Union[
75
+ None,
76
+ Annotated[StrictFloat, Field(gt=0)],
77
+ Tuple[
78
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
79
+ ],
80
+ ] = None,
81
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
82
+ _content_type: Optional[StrictStr] = None,
83
+ _headers: Optional[Dict[StrictStr, Any]] = None,
84
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
85
+ ) -> List[Dict[str, object]]:
86
+ """Get Error Logs
87
+
88
+ This method can work in both sync and async modes based on the is_sync flag.
89
+ """
90
+ if self.is_sync:
91
+ return self._get_metrics_error_logs_sync(
92
+ severity=severity,
93
+ start_timestamp=start_timestamp,
94
+ end_timestamp=end_timestamp,
95
+ _request_timeout=_request_timeout,
96
+ _request_auth=_request_auth,
97
+ _content_type=_content_type,
98
+ _headers=_headers,
99
+ _host_index=_host_index,
100
+ )
101
+
102
+ else:
103
+ return self._get_metrics_error_logs_async(
104
+ severity=severity,
105
+ start_timestamp=start_timestamp,
106
+ end_timestamp=end_timestamp,
107
+ _request_timeout=_request_timeout,
108
+ _request_auth=_request_auth,
109
+ _content_type=_content_type,
110
+ _headers=_headers,
111
+ _host_index=_host_index,
112
+ )
113
+
114
+ @validate_call
115
+ def get_metrics_error_logs_with_http_info(
116
+ self,
117
+ severity: Annotated[
118
+ Optional[Severity], Field(description="Severity level of errors to fetch")
119
+ ] = None,
120
+ start_timestamp: Annotated[
121
+ Optional[StrictInt],
122
+ Field(description="Start timestamp for which to fetch error logs"),
123
+ ] = None,
124
+ end_timestamp: Annotated[
125
+ Optional[StrictInt],
126
+ Field(description="End timestamp for which to fetch error logs"),
127
+ ] = None,
128
+ _request_timeout: Union[
129
+ None,
130
+ Annotated[StrictFloat, Field(gt=0)],
131
+ Tuple[
132
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
133
+ ],
134
+ ] = None,
135
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
136
+ _content_type: Optional[StrictStr] = None,
137
+ _headers: Optional[Dict[StrictStr, Any]] = None,
138
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
139
+ ) -> ApiResponse[List[Dict[str, object]]]:
140
+ """Get Error Logs with HTTP info
141
+
142
+ This method can work in both sync and async modes based on the is_sync flag.
143
+ """
144
+ if self.is_sync:
145
+ return self._get_metrics_error_logs_sync_with_http_info(
146
+ severity=severity,
147
+ start_timestamp=start_timestamp,
148
+ end_timestamp=end_timestamp,
149
+ _request_timeout=_request_timeout,
150
+ _request_auth=_request_auth,
151
+ _content_type=_content_type,
152
+ _headers=_headers,
153
+ _host_index=_host_index,
154
+ )
155
+
156
+ else:
157
+ return self._get_metrics_error_logs_async_with_http_info(
158
+ severity=severity,
159
+ start_timestamp=start_timestamp,
160
+ end_timestamp=end_timestamp,
161
+ _request_timeout=_request_timeout,
162
+ _request_auth=_request_auth,
163
+ _content_type=_content_type,
164
+ _headers=_headers,
165
+ _host_index=_host_index,
166
+ )
167
+
168
+ @validate_call
169
+ def get_metrics_error_logs_without_preload_content(
170
+ self,
171
+ severity: Annotated[
172
+ Optional[Severity], Field(description="Severity level of errors to fetch")
173
+ ] = None,
174
+ start_timestamp: Annotated[
175
+ Optional[StrictInt],
176
+ Field(description="Start timestamp for which to fetch error logs"),
177
+ ] = None,
178
+ end_timestamp: Annotated[
179
+ Optional[StrictInt],
180
+ Field(description="End timestamp for which to fetch error logs"),
181
+ ] = None,
182
+ _request_timeout: Union[
183
+ None,
184
+ Annotated[StrictFloat, Field(gt=0)],
185
+ Tuple[
186
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
187
+ ],
188
+ ] = None,
189
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
190
+ _content_type: Optional[StrictStr] = None,
191
+ _headers: Optional[Dict[StrictStr, Any]] = None,
192
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
193
+ ) -> RESTResponseType:
194
+ """Get Error Logs without preloading content
195
+
196
+ This method can work in both sync and async modes based on the is_sync flag.
197
+ """
198
+ if self.is_sync:
199
+ return self._get_metrics_error_logs_sync_without_preload_content(
200
+ severity=severity,
201
+ start_timestamp=start_timestamp,
202
+ end_timestamp=end_timestamp,
203
+ _request_timeout=_request_timeout,
204
+ _request_auth=_request_auth,
205
+ _content_type=_content_type,
206
+ _headers=_headers,
207
+ _host_index=_host_index,
208
+ )
209
+
210
+ else:
211
+ return self._get_metrics_error_logs_async_without_preload_content(
212
+ severity=severity,
213
+ start_timestamp=start_timestamp,
214
+ end_timestamp=end_timestamp,
215
+ _request_timeout=_request_timeout,
216
+ _request_auth=_request_auth,
217
+ _content_type=_content_type,
218
+ _headers=_headers,
219
+ _host_index=_host_index,
220
+ )
40
221
 
222
+ # Private async implementation methods
41
223
  @validate_call
42
- async def get_metrics_error_logs(
224
+ async def _get_metrics_error_logs_async(
43
225
  self,
44
226
  severity: Annotated[
45
227
  Optional[Severity], Field(description="Severity level of errors to fetch")
@@ -119,7 +301,7 @@ class LogsApi:
119
301
  ).data
120
302
 
121
303
  @validate_call
122
- async def get_metrics_error_logs_with_http_info(
304
+ async def _get_metrics_error_logs_async_with_http_info(
123
305
  self,
124
306
  severity: Annotated[
125
307
  Optional[Severity], Field(description="Severity level of errors to fetch")
@@ -194,12 +376,11 @@ class LogsApi:
194
376
  )
195
377
  await response_data.read()
196
378
  return self.api_client.response_deserialize(
197
- response_data=response_data,
198
- response_types_map=_response_types_map,
379
+ response_data=response_data, response_types_map=_response_types_map
199
380
  )
200
381
 
201
382
  @validate_call
202
- async def get_metrics_error_logs_without_preload_content(
383
+ async def _get_metrics_error_logs_async_without_preload_content(
203
384
  self,
204
385
  severity: Annotated[
205
386
  Optional[Severity], Field(description="Severity level of errors to fetch")
@@ -272,7 +453,124 @@ class LogsApi:
272
453
  response_data = await self.api_client.call_api(
273
454
  *_param, _request_timeout=_request_timeout
274
455
  )
275
- return response_data.response
456
+ return response_data
457
+
458
+ # Private sync implementation methods
459
+ @validate_call
460
+ def _get_metrics_error_logs_sync(
461
+ self,
462
+ severity: Annotated[
463
+ Optional[Severity], Field(description="Severity level of errors to fetch")
464
+ ] = None,
465
+ start_timestamp: Annotated[
466
+ Optional[StrictInt],
467
+ Field(description="Start timestamp for which to fetch error logs"),
468
+ ] = None,
469
+ end_timestamp: Annotated[
470
+ Optional[StrictInt],
471
+ Field(description="End timestamp for which to fetch error logs"),
472
+ ] = None,
473
+ _request_timeout: Union[
474
+ None,
475
+ Annotated[StrictFloat, Field(gt=0)],
476
+ Tuple[
477
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
478
+ ],
479
+ ] = None,
480
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
481
+ _content_type: Optional[StrictStr] = None,
482
+ _headers: Optional[Dict[StrictStr, Any]] = None,
483
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
484
+ ) -> List[Dict[str, object]]:
485
+ """Synchronous version of get_metrics_error_logs"""
486
+ return async_to_sync(self._get_metrics_error_logs_async)(
487
+ severity=severity,
488
+ start_timestamp=start_timestamp,
489
+ end_timestamp=end_timestamp,
490
+ _request_timeout=_request_timeout,
491
+ _request_auth=_request_auth,
492
+ _content_type=_content_type,
493
+ _headers=_headers,
494
+ _host_index=_host_index,
495
+ )
496
+
497
+ @validate_call
498
+ def _get_metrics_error_logs_sync_with_http_info(
499
+ self,
500
+ severity: Annotated[
501
+ Optional[Severity], Field(description="Severity level of errors to fetch")
502
+ ] = None,
503
+ start_timestamp: Annotated[
504
+ Optional[StrictInt],
505
+ Field(description="Start timestamp for which to fetch error logs"),
506
+ ] = None,
507
+ end_timestamp: Annotated[
508
+ Optional[StrictInt],
509
+ Field(description="End timestamp for which to fetch error logs"),
510
+ ] = None,
511
+ _request_timeout: Union[
512
+ None,
513
+ Annotated[StrictFloat, Field(gt=0)],
514
+ Tuple[
515
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
516
+ ],
517
+ ] = None,
518
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
519
+ _content_type: Optional[StrictStr] = None,
520
+ _headers: Optional[Dict[StrictStr, Any]] = None,
521
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
522
+ ) -> ApiResponse[List[Dict[str, object]]]:
523
+ """Synchronous version of get_metrics_error_logs_with_http_info"""
524
+ return async_to_sync(self._get_metrics_error_logs_async_with_http_info)(
525
+ severity=severity,
526
+ start_timestamp=start_timestamp,
527
+ end_timestamp=end_timestamp,
528
+ _request_timeout=_request_timeout,
529
+ _request_auth=_request_auth,
530
+ _content_type=_content_type,
531
+ _headers=_headers,
532
+ _host_index=_host_index,
533
+ )
534
+
535
+ @validate_call
536
+ def _get_metrics_error_logs_sync_without_preload_content(
537
+ self,
538
+ severity: Annotated[
539
+ Optional[Severity], Field(description="Severity level of errors to fetch")
540
+ ] = None,
541
+ start_timestamp: Annotated[
542
+ Optional[StrictInt],
543
+ Field(description="Start timestamp for which to fetch error logs"),
544
+ ] = None,
545
+ end_timestamp: Annotated[
546
+ Optional[StrictInt],
547
+ Field(description="End timestamp for which to fetch error logs"),
548
+ ] = None,
549
+ _request_timeout: Union[
550
+ None,
551
+ Annotated[StrictFloat, Field(gt=0)],
552
+ Tuple[
553
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
554
+ ],
555
+ ] = None,
556
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
557
+ _content_type: Optional[StrictStr] = None,
558
+ _headers: Optional[Dict[StrictStr, Any]] = None,
559
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
560
+ ) -> RESTResponseType:
561
+ """Synchronous version of get_metrics_error_logs_without_preload_content"""
562
+ return async_to_sync(
563
+ self._get_metrics_error_logs_async_without_preload_content
564
+ )(
565
+ severity=severity,
566
+ start_timestamp=start_timestamp,
567
+ end_timestamp=end_timestamp,
568
+ _request_timeout=_request_timeout,
569
+ _request_auth=_request_auth,
570
+ _content_type=_content_type,
571
+ _headers=_headers,
572
+ _host_index=_host_index,
573
+ )
276
574
 
277
575
  def _get_metrics_error_logs_serialize(
278
576
  self,