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
@@ -24,6 +24,24 @@ from crypticorn.trade.client.api_client import ApiClient, RequestSerialized
24
24
  from crypticorn.trade.client.api_response import ApiResponse
25
25
  from crypticorn.trade.client.rest import RESTResponseType
26
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
+
27
45
 
28
46
  class OrdersApi:
29
47
  """NOTE: This class is auto generated by OpenAPI Generator
@@ -32,13 +50,144 @@ class OrdersApi:
32
50
  Do not edit the class manually.
33
51
  """
34
52
 
35
- def __init__(self, api_client=None) -> None:
53
+ def __init__(self, api_client=None, is_sync: bool = False) -> None:
36
54
  if api_client is None:
37
55
  api_client = ApiClient.get_default()
38
56
  self.api_client = api_client
57
+ self.is_sync = is_sync
39
58
 
40
59
  @validate_call
41
- async def get_orders(
60
+ def get_orders(
61
+ self,
62
+ limit: Optional[StrictInt] = None,
63
+ offset: Optional[StrictInt] = None,
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[Order]:
76
+ """Get Orders
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_orders_sync(
82
+ limit=limit,
83
+ offset=offset,
84
+ _request_timeout=_request_timeout,
85
+ _request_auth=_request_auth,
86
+ _content_type=_content_type,
87
+ _headers=_headers,
88
+ _host_index=_host_index,
89
+ )
90
+
91
+ else:
92
+ return self._get_orders_async(
93
+ limit=limit,
94
+ offset=offset,
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
+ @validate_call
103
+ def get_orders_with_http_info(
104
+ self,
105
+ limit: Optional[StrictInt] = None,
106
+ offset: Optional[StrictInt] = None,
107
+ _request_timeout: Union[
108
+ None,
109
+ Annotated[StrictFloat, Field(gt=0)],
110
+ Tuple[
111
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
112
+ ],
113
+ ] = None,
114
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
115
+ _content_type: Optional[StrictStr] = None,
116
+ _headers: Optional[Dict[StrictStr, Any]] = None,
117
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
118
+ ) -> ApiResponse[List[Order]]:
119
+ """Get Orders with HTTP info
120
+
121
+ This method can work in both sync and async modes based on the is_sync flag.
122
+ """
123
+ if self.is_sync:
124
+ return self._get_orders_sync_with_http_info(
125
+ limit=limit,
126
+ offset=offset,
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
+ else:
135
+ return self._get_orders_async_with_http_info(
136
+ limit=limit,
137
+ offset=offset,
138
+ _request_timeout=_request_timeout,
139
+ _request_auth=_request_auth,
140
+ _content_type=_content_type,
141
+ _headers=_headers,
142
+ _host_index=_host_index,
143
+ )
144
+
145
+ @validate_call
146
+ def get_orders_without_preload_content(
147
+ self,
148
+ limit: Optional[StrictInt] = None,
149
+ offset: Optional[StrictInt] = None,
150
+ _request_timeout: Union[
151
+ None,
152
+ Annotated[StrictFloat, Field(gt=0)],
153
+ Tuple[
154
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
155
+ ],
156
+ ] = None,
157
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
158
+ _content_type: Optional[StrictStr] = None,
159
+ _headers: Optional[Dict[StrictStr, Any]] = None,
160
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
161
+ ) -> RESTResponseType:
162
+ """Get Orders without preloading content
163
+
164
+ This method can work in both sync and async modes based on the is_sync flag.
165
+ """
166
+ if self.is_sync:
167
+ return self._get_orders_sync_without_preload_content(
168
+ limit=limit,
169
+ offset=offset,
170
+ _request_timeout=_request_timeout,
171
+ _request_auth=_request_auth,
172
+ _content_type=_content_type,
173
+ _headers=_headers,
174
+ _host_index=_host_index,
175
+ )
176
+
177
+ else:
178
+ return self._get_orders_async_without_preload_content(
179
+ limit=limit,
180
+ offset=offset,
181
+ _request_timeout=_request_timeout,
182
+ _request_auth=_request_auth,
183
+ _content_type=_content_type,
184
+ _headers=_headers,
185
+ _host_index=_host_index,
186
+ )
187
+
188
+ # Private async implementation methods
189
+ @validate_call
190
+ async def _get_orders_async(
42
191
  self,
43
192
  limit: Optional[StrictInt] = None,
44
193
  offset: Optional[StrictInt] = None,
@@ -106,7 +255,7 @@ class OrdersApi:
106
255
  ).data
107
256
 
108
257
  @validate_call
109
- async def get_orders_with_http_info(
258
+ async def _get_orders_async_with_http_info(
110
259
  self,
111
260
  limit: Optional[StrictInt] = None,
112
261
  offset: Optional[StrictInt] = None,
@@ -169,12 +318,11 @@ class OrdersApi:
169
318
  )
170
319
  await response_data.read()
171
320
  return self.api_client.response_deserialize(
172
- response_data=response_data,
173
- response_types_map=_response_types_map,
321
+ response_data=response_data, response_types_map=_response_types_map
174
322
  )
175
323
 
176
324
  @validate_call
177
- async def get_orders_without_preload_content(
325
+ async def _get_orders_async_without_preload_content(
178
326
  self,
179
327
  limit: Optional[StrictInt] = None,
180
328
  offset: Optional[StrictInt] = None,
@@ -235,7 +383,92 @@ class OrdersApi:
235
383
  response_data = await self.api_client.call_api(
236
384
  *_param, _request_timeout=_request_timeout
237
385
  )
238
- return response_data.response
386
+ return response_data
387
+
388
+ # Private sync implementation methods
389
+ @validate_call
390
+ def _get_orders_sync(
391
+ self,
392
+ limit: Optional[StrictInt] = None,
393
+ offset: Optional[StrictInt] = None,
394
+ _request_timeout: Union[
395
+ None,
396
+ Annotated[StrictFloat, Field(gt=0)],
397
+ Tuple[
398
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
399
+ ],
400
+ ] = None,
401
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
402
+ _content_type: Optional[StrictStr] = None,
403
+ _headers: Optional[Dict[StrictStr, Any]] = None,
404
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
405
+ ) -> List[Order]:
406
+ """Synchronous version of get_orders"""
407
+ return async_to_sync(self._get_orders_async)(
408
+ limit=limit,
409
+ offset=offset,
410
+ _request_timeout=_request_timeout,
411
+ _request_auth=_request_auth,
412
+ _content_type=_content_type,
413
+ _headers=_headers,
414
+ _host_index=_host_index,
415
+ )
416
+
417
+ @validate_call
418
+ def _get_orders_sync_with_http_info(
419
+ self,
420
+ limit: Optional[StrictInt] = None,
421
+ offset: Optional[StrictInt] = None,
422
+ _request_timeout: Union[
423
+ None,
424
+ Annotated[StrictFloat, Field(gt=0)],
425
+ Tuple[
426
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
427
+ ],
428
+ ] = None,
429
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
430
+ _content_type: Optional[StrictStr] = None,
431
+ _headers: Optional[Dict[StrictStr, Any]] = None,
432
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
433
+ ) -> ApiResponse[List[Order]]:
434
+ """Synchronous version of get_orders_with_http_info"""
435
+ return async_to_sync(self._get_orders_async_with_http_info)(
436
+ limit=limit,
437
+ offset=offset,
438
+ _request_timeout=_request_timeout,
439
+ _request_auth=_request_auth,
440
+ _content_type=_content_type,
441
+ _headers=_headers,
442
+ _host_index=_host_index,
443
+ )
444
+
445
+ @validate_call
446
+ def _get_orders_sync_without_preload_content(
447
+ self,
448
+ limit: Optional[StrictInt] = None,
449
+ offset: Optional[StrictInt] = None,
450
+ _request_timeout: Union[
451
+ None,
452
+ Annotated[StrictFloat, Field(gt=0)],
453
+ Tuple[
454
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
455
+ ],
456
+ ] = None,
457
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
458
+ _content_type: Optional[StrictStr] = None,
459
+ _headers: Optional[Dict[StrictStr, Any]] = None,
460
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
461
+ ) -> RESTResponseType:
462
+ """Synchronous version of get_orders_without_preload_content"""
463
+ return async_to_sync(self._get_orders_async_without_preload_content)(
464
+ limit=limit,
465
+ offset=offset,
466
+ _request_timeout=_request_timeout,
467
+ _request_auth=_request_auth,
468
+ _content_type=_content_type,
469
+ _headers=_headers,
470
+ _host_index=_host_index,
471
+ )
239
472
 
240
473
  def _get_orders_serialize(
241
474
  self,