crypticorn 2.16.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.
Files changed (164) hide show
  1. crypticorn/__init__.py +2 -2
  2. crypticorn/auth/client/api/admin_api.py +397 -13
  3. crypticorn/auth/client/api/auth_api.py +3610 -341
  4. crypticorn/auth/client/api/service_api.py +249 -7
  5. crypticorn/auth/client/api/user_api.py +2295 -179
  6. crypticorn/auth/client/api/wallet_api.py +1468 -81
  7. crypticorn/auth/client/configuration.py +2 -2
  8. crypticorn/auth/client/models/create_api_key_request.py +2 -1
  9. crypticorn/auth/client/models/get_api_keys200_response_inner.py +2 -1
  10. crypticorn/auth/client/rest.py +23 -4
  11. crypticorn/auth/main.py +8 -5
  12. crypticorn/cli/init.py +1 -1
  13. crypticorn/cli/templates/.env.docker.temp +3 -0
  14. crypticorn/cli/templates/.env.example.temp +4 -0
  15. crypticorn/cli/templates/Dockerfile +5 -2
  16. crypticorn/client.py +226 -59
  17. crypticorn/common/__init__.py +1 -0
  18. crypticorn/common/auth.py +45 -14
  19. crypticorn/common/decorators.py +1 -2
  20. crypticorn/common/enums.py +0 -2
  21. crypticorn/common/errors.py +10 -0
  22. crypticorn/common/metrics.py +30 -0
  23. crypticorn/common/middleware.py +94 -1
  24. crypticorn/common/pagination.py +252 -20
  25. crypticorn/common/router/admin_router.py +2 -2
  26. crypticorn/common/router/status_router.py +40 -2
  27. crypticorn/common/scopes.py +2 -2
  28. crypticorn/common/warnings.py +7 -0
  29. crypticorn/dex/__init__.py +6 -0
  30. crypticorn/dex/client/__init__.py +49 -0
  31. crypticorn/dex/client/api/__init__.py +6 -0
  32. crypticorn/dex/client/api/admin_api.py +2986 -0
  33. crypticorn/dex/client/api/signals_api.py +1798 -0
  34. crypticorn/dex/client/api/status_api.py +892 -0
  35. crypticorn/dex/client/api_client.py +758 -0
  36. crypticorn/dex/client/api_response.py +20 -0
  37. crypticorn/dex/client/configuration.py +620 -0
  38. crypticorn/dex/client/exceptions.py +220 -0
  39. crypticorn/dex/client/models/__init__.py +30 -0
  40. crypticorn/dex/client/models/api_error_identifier.py +121 -0
  41. crypticorn/dex/client/models/api_error_level.py +37 -0
  42. crypticorn/dex/client/models/api_error_type.py +37 -0
  43. crypticorn/dex/client/models/exception_detail.py +117 -0
  44. crypticorn/dex/client/models/log_level.py +38 -0
  45. crypticorn/dex/client/models/paginated_response_signal_with_token.py +134 -0
  46. crypticorn/dex/client/models/risk.py +86 -0
  47. crypticorn/dex/client/models/signal_overview_stats.py +158 -0
  48. crypticorn/dex/client/models/signal_volume.py +84 -0
  49. crypticorn/dex/client/models/signal_with_token.py +163 -0
  50. crypticorn/dex/client/models/token_data.py +127 -0
  51. crypticorn/dex/client/models/token_detail.py +116 -0
  52. crypticorn/dex/client/py.typed +0 -0
  53. crypticorn/dex/client/rest.py +217 -0
  54. crypticorn/dex/main.py +1 -0
  55. crypticorn/hive/client/api/admin_api.py +1173 -47
  56. crypticorn/hive/client/api/data_api.py +499 -17
  57. crypticorn/hive/client/api/models_api.py +1595 -87
  58. crypticorn/hive/client/api/status_api.py +397 -16
  59. crypticorn/hive/client/api_client.py +0 -5
  60. crypticorn/hive/client/models/api_error_identifier.py +1 -1
  61. crypticorn/hive/client/models/coin_info.py +1 -1
  62. crypticorn/hive/client/models/exception_detail.py +1 -1
  63. crypticorn/hive/client/models/target_info.py +1 -1
  64. crypticorn/hive/client/rest.py +23 -4
  65. crypticorn/hive/main.py +99 -25
  66. crypticorn/hive/utils.py +2 -2
  67. crypticorn/klines/client/api/admin_api.py +1173 -47
  68. crypticorn/klines/client/api/change_in_timeframe_api.py +269 -11
  69. crypticorn/klines/client/api/funding_rates_api.py +315 -11
  70. crypticorn/klines/client/api/ohlcv_data_api.py +390 -11
  71. crypticorn/klines/client/api/status_api.py +397 -16
  72. crypticorn/klines/client/api/symbols_api.py +216 -11
  73. crypticorn/klines/client/api/udf_api.py +1268 -51
  74. crypticorn/klines/client/api_client.py +0 -5
  75. crypticorn/klines/client/models/api_error_identifier.py +3 -1
  76. crypticorn/klines/client/models/exception_detail.py +1 -1
  77. crypticorn/klines/client/models/ohlcv.py +1 -1
  78. crypticorn/klines/client/models/symbol_group.py +1 -1
  79. crypticorn/klines/client/models/udf_config.py +1 -1
  80. crypticorn/klines/client/rest.py +23 -4
  81. crypticorn/klines/main.py +89 -12
  82. crypticorn/metrics/client/api/admin_api.py +1173 -47
  83. crypticorn/metrics/client/api/exchanges_api.py +1370 -145
  84. crypticorn/metrics/client/api/indicators_api.py +622 -17
  85. crypticorn/metrics/client/api/logs_api.py +296 -11
  86. crypticorn/metrics/client/api/marketcap_api.py +1207 -67
  87. crypticorn/metrics/client/api/markets_api.py +343 -11
  88. crypticorn/metrics/client/api/quote_currencies_api.py +228 -11
  89. crypticorn/metrics/client/api/status_api.py +397 -16
  90. crypticorn/metrics/client/api/tokens_api.py +382 -15
  91. crypticorn/metrics/client/api_client.py +0 -5
  92. crypticorn/metrics/client/configuration.py +4 -2
  93. crypticorn/metrics/client/models/exception_detail.py +1 -1
  94. crypticorn/metrics/client/models/exchange_mapping.py +1 -1
  95. crypticorn/metrics/client/models/marketcap_ranking.py +1 -1
  96. crypticorn/metrics/client/models/marketcap_symbol_ranking.py +1 -1
  97. crypticorn/metrics/client/models/ohlcv.py +1 -1
  98. crypticorn/metrics/client/rest.py +23 -4
  99. crypticorn/metrics/main.py +113 -19
  100. crypticorn/pay/client/api/admin_api.py +1585 -57
  101. crypticorn/pay/client/api/now_payments_api.py +961 -39
  102. crypticorn/pay/client/api/payments_api.py +562 -17
  103. crypticorn/pay/client/api/products_api.py +880 -30
  104. crypticorn/pay/client/api/status_api.py +397 -16
  105. crypticorn/pay/client/api_client.py +0 -5
  106. crypticorn/pay/client/configuration.py +2 -2
  107. crypticorn/pay/client/models/api_error_identifier.py +7 -7
  108. crypticorn/pay/client/models/exception_detail.py +1 -1
  109. crypticorn/pay/client/models/now_create_invoice_req.py +1 -1
  110. crypticorn/pay/client/models/now_create_invoice_res.py +1 -1
  111. crypticorn/pay/client/models/product.py +1 -1
  112. crypticorn/pay/client/models/product_create.py +1 -1
  113. crypticorn/pay/client/models/product_update.py +1 -1
  114. crypticorn/pay/client/models/scope.py +1 -0
  115. crypticorn/pay/client/rest.py +23 -4
  116. crypticorn/pay/main.py +10 -6
  117. crypticorn/trade/client/__init__.py +11 -1
  118. crypticorn/trade/client/api/__init__.py +0 -1
  119. crypticorn/trade/client/api/admin_api.py +1184 -55
  120. crypticorn/trade/client/api/api_keys_api.py +1678 -162
  121. crypticorn/trade/client/api/bots_api.py +7563 -187
  122. crypticorn/trade/client/api/exchanges_api.py +565 -19
  123. crypticorn/trade/client/api/notifications_api.py +1290 -116
  124. crypticorn/trade/client/api/orders_api.py +393 -55
  125. crypticorn/trade/client/api/status_api.py +397 -13
  126. crypticorn/trade/client/api/strategies_api.py +1133 -77
  127. crypticorn/trade/client/api/trading_actions_api.py +786 -65
  128. crypticorn/trade/client/models/__init__.py +11 -0
  129. crypticorn/trade/client/models/actions_count.py +88 -0
  130. crypticorn/trade/client/models/api_error_identifier.py +1 -0
  131. crypticorn/trade/client/models/bot.py +7 -18
  132. crypticorn/trade/client/models/bot_create.py +17 -1
  133. crypticorn/trade/client/models/bot_update.py +17 -1
  134. crypticorn/trade/client/models/exchange.py +6 -1
  135. crypticorn/trade/client/models/exchange_key.py +1 -1
  136. crypticorn/trade/client/models/exchange_key_balance.py +111 -0
  137. crypticorn/trade/client/models/exchange_key_create.py +17 -1
  138. crypticorn/trade/client/models/exchange_key_update.py +17 -1
  139. crypticorn/trade/client/models/execution_ids.py +1 -1
  140. crypticorn/trade/client/models/futures_balance.py +27 -25
  141. crypticorn/trade/client/models/notification.py +17 -1
  142. crypticorn/trade/client/models/notification_create.py +18 -2
  143. crypticorn/trade/client/models/notification_update.py +17 -1
  144. crypticorn/trade/client/models/orders_count.py +88 -0
  145. crypticorn/trade/client/models/paginated_response_futures_trading_action.py +134 -0
  146. crypticorn/trade/client/models/paginated_response_order.py +134 -0
  147. crypticorn/trade/client/models/pn_l.py +95 -0
  148. crypticorn/trade/client/models/post_futures_action.py +1 -1
  149. crypticorn/trade/client/models/spot_balance.py +109 -0
  150. crypticorn/trade/client/models/strategy.py +22 -4
  151. crypticorn/trade/client/models/strategy_create.py +23 -5
  152. crypticorn/trade/client/models/strategy_exchange_info.py +16 -4
  153. crypticorn/trade/client/models/strategy_update.py +19 -3
  154. crypticorn/trade/client/models/tpsl.py +4 -19
  155. crypticorn/trade/client/models/tpsl_create.py +6 -19
  156. crypticorn/trade/client/rest.py +23 -4
  157. crypticorn/trade/main.py +15 -12
  158. {crypticorn-2.16.0.dist-info → crypticorn-2.17.0.dist-info}/METADATA +65 -20
  159. {crypticorn-2.16.0.dist-info → crypticorn-2.17.0.dist-info}/RECORD +163 -128
  160. crypticorn/trade/client/api/futures_trading_panel_api.py +0 -1285
  161. {crypticorn-2.16.0.dist-info → crypticorn-2.17.0.dist-info}/WHEEL +0 -0
  162. {crypticorn-2.16.0.dist-info → crypticorn-2.17.0.dist-info}/entry_points.txt +0 -0
  163. {crypticorn-2.16.0.dist-info → crypticorn-2.17.0.dist-info}/licenses/LICENSE +0 -0
  164. {crypticorn-2.16.0.dist-info → crypticorn-2.17.0.dist-info}/top_level.txt +0 -0
@@ -11,18 +11,33 @@ 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 StrictStr, field_validator
20
- from typing import Optional
21
18
 
22
19
  from crypticorn.hive.client.api_client import ApiClient, RequestSerialized
23
20
  from crypticorn.hive.client.api_response import ApiResponse
24
21
  from crypticorn.hive.client.rest import RESTResponseType
25
22
 
23
+ # Import async_to_sync for sync methods
24
+ try:
25
+ from asgiref.sync import async_to_sync
26
+
27
+ _HAS_ASGIREF = True
28
+ except ImportError:
29
+ _HAS_ASGIREF = False
30
+
31
+ def async_to_sync(async_func):
32
+ """Fallback decorator that raises an error if asgiref is not available."""
33
+
34
+ def wrapper(*args, **kwargs):
35
+ raise ImportError(
36
+ "asgiref is required for sync methods. Install with: pip install asgiref"
37
+ )
38
+
39
+ return wrapper
40
+
26
41
 
27
42
  class StatusApi:
28
43
  """NOTE: This class is auto generated by OpenAPI Generator
@@ -31,13 +46,126 @@ class StatusApi:
31
46
  Do not edit the class manually.
32
47
  """
33
48
 
34
- def __init__(self, api_client=None) -> None:
49
+ def __init__(self, api_client=None, is_sync: bool = False) -> None:
35
50
  if api_client is None:
36
51
  api_client = ApiClient.get_default()
37
52
  self.api_client = api_client
53
+ self.is_sync = is_sync
54
+
55
+ @validate_call
56
+ def get_time(
57
+ self,
58
+ type: Optional[StrictStr] = None,
59
+ _request_timeout: Union[
60
+ None,
61
+ Annotated[StrictFloat, Field(gt=0)],
62
+ Tuple[
63
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
64
+ ],
65
+ ] = None,
66
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
67
+ _content_type: Optional[StrictStr] = None,
68
+ _headers: Optional[Dict[StrictStr, Any]] = None,
69
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
70
+ ) -> str:
71
+ """Time"""
72
+ if self.is_sync:
73
+ return self._get_time_sync(
74
+ type=type,
75
+ _request_timeout=_request_timeout,
76
+ _request_auth=_request_auth,
77
+ _content_type=_content_type,
78
+ _headers=_headers,
79
+ _host_index=_host_index,
80
+ )
81
+
82
+ else:
83
+ return self._get_time_async(
84
+ type=type,
85
+ _request_timeout=_request_timeout,
86
+ _request_auth=_request_auth,
87
+ _content_type=_content_type,
88
+ _headers=_headers,
89
+ _host_index=_host_index,
90
+ )
91
+
92
+ @validate_call
93
+ def get_time_with_http_info(
94
+ self,
95
+ type: Optional[StrictStr] = None,
96
+ _request_timeout: Union[
97
+ None,
98
+ Annotated[StrictFloat, Field(gt=0)],
99
+ Tuple[
100
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
101
+ ],
102
+ ] = None,
103
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
104
+ _content_type: Optional[StrictStr] = None,
105
+ _headers: Optional[Dict[StrictStr, Any]] = None,
106
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
107
+ ) -> ApiResponse[str]:
108
+ """Time with HTTP info"""
109
+ if self.is_sync:
110
+ return self._get_time_sync_with_http_info(
111
+ type=type,
112
+ _request_timeout=_request_timeout,
113
+ _request_auth=_request_auth,
114
+ _content_type=_content_type,
115
+ _headers=_headers,
116
+ _host_index=_host_index,
117
+ )
118
+
119
+ else:
120
+ return self._get_time_async_with_http_info(
121
+ type=type,
122
+ _request_timeout=_request_timeout,
123
+ _request_auth=_request_auth,
124
+ _content_type=_content_type,
125
+ _headers=_headers,
126
+ _host_index=_host_index,
127
+ )
128
+
129
+ @validate_call
130
+ def get_time_without_preload_content(
131
+ self,
132
+ type: Optional[StrictStr] = None,
133
+ _request_timeout: Union[
134
+ None,
135
+ Annotated[StrictFloat, Field(gt=0)],
136
+ Tuple[
137
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
138
+ ],
139
+ ] = None,
140
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
141
+ _content_type: Optional[StrictStr] = None,
142
+ _headers: Optional[Dict[StrictStr, Any]] = None,
143
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
144
+ ) -> RESTResponseType:
145
+ """Time without preloading content"""
146
+ if self.is_sync:
147
+ return self._get_time_sync_without_preload_content(
148
+ type=type,
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_time_async_without_preload_content(
158
+ type=type,
159
+ _request_timeout=_request_timeout,
160
+ _request_auth=_request_auth,
161
+ _content_type=_content_type,
162
+ _headers=_headers,
163
+ _host_index=_host_index,
164
+ )
38
165
 
166
+ # Private async implementation methods
39
167
  @validate_call
40
- async def get_time(
168
+ async def _get_time_async(
41
169
  self,
42
170
  type: Optional[StrictStr] = None,
43
171
  _request_timeout: Union[
@@ -101,7 +229,7 @@ class StatusApi:
101
229
  ).data
102
230
 
103
231
  @validate_call
104
- async def get_time_with_http_info(
232
+ async def _get_time_async_with_http_info(
105
233
  self,
106
234
  type: Optional[StrictStr] = None,
107
235
  _request_timeout: Union[
@@ -160,12 +288,11 @@ class StatusApi:
160
288
  )
161
289
  await response_data.read()
162
290
  return self.api_client.response_deserialize(
163
- response_data=response_data,
164
- response_types_map=_response_types_map,
291
+ response_data=response_data, response_types_map=_response_types_map
165
292
  )
166
293
 
167
294
  @validate_call
168
- async def get_time_without_preload_content(
295
+ async def _get_time_async_without_preload_content(
169
296
  self,
170
297
  type: Optional[StrictStr] = None,
171
298
  _request_timeout: Union[
@@ -222,7 +349,86 @@ class StatusApi:
222
349
  response_data = await self.api_client.call_api(
223
350
  *_param, _request_timeout=_request_timeout
224
351
  )
225
- return response_data.response
352
+ return response_data
353
+
354
+ # Private sync implementation methods
355
+ @validate_call
356
+ def _get_time_sync(
357
+ self,
358
+ type: Optional[StrictStr] = None,
359
+ _request_timeout: Union[
360
+ None,
361
+ Annotated[StrictFloat, Field(gt=0)],
362
+ Tuple[
363
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
364
+ ],
365
+ ] = None,
366
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
367
+ _content_type: Optional[StrictStr] = None,
368
+ _headers: Optional[Dict[StrictStr, Any]] = None,
369
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
370
+ ) -> str:
371
+ """Synchronous version of get_time"""
372
+ return async_to_sync(self._get_time_async)(
373
+ type=type,
374
+ _request_timeout=_request_timeout,
375
+ _request_auth=_request_auth,
376
+ _content_type=_content_type,
377
+ _headers=_headers,
378
+ _host_index=_host_index,
379
+ )
380
+
381
+ @validate_call
382
+ def _get_time_sync_with_http_info(
383
+ self,
384
+ type: Optional[StrictStr] = None,
385
+ _request_timeout: Union[
386
+ None,
387
+ Annotated[StrictFloat, Field(gt=0)],
388
+ Tuple[
389
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
390
+ ],
391
+ ] = None,
392
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
393
+ _content_type: Optional[StrictStr] = None,
394
+ _headers: Optional[Dict[StrictStr, Any]] = None,
395
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
396
+ ) -> ApiResponse[str]:
397
+ """Synchronous version of get_time_with_http_info"""
398
+ return async_to_sync(self._get_time_async_with_http_info)(
399
+ type=type,
400
+ _request_timeout=_request_timeout,
401
+ _request_auth=_request_auth,
402
+ _content_type=_content_type,
403
+ _headers=_headers,
404
+ _host_index=_host_index,
405
+ )
406
+
407
+ @validate_call
408
+ def _get_time_sync_without_preload_content(
409
+ self,
410
+ type: Optional[StrictStr] = None,
411
+ _request_timeout: Union[
412
+ None,
413
+ Annotated[StrictFloat, Field(gt=0)],
414
+ Tuple[
415
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
416
+ ],
417
+ ] = None,
418
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
419
+ _content_type: Optional[StrictStr] = None,
420
+ _headers: Optional[Dict[StrictStr, Any]] = None,
421
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
422
+ ) -> RESTResponseType:
423
+ """Synchronous version of get_time_without_preload_content"""
424
+ return async_to_sync(self._get_time_async_without_preload_content)(
425
+ type=type,
426
+ _request_timeout=_request_timeout,
427
+ _request_auth=_request_auth,
428
+ _content_type=_content_type,
429
+ _headers=_headers,
430
+ _host_index=_host_index,
431
+ )
226
432
 
227
433
  def _get_time_serialize(
228
434
  self,
@@ -281,7 +487,110 @@ class StatusApi:
281
487
  )
282
488
 
283
489
  @validate_call
284
- async def ping(
490
+ def ping(
491
+ self,
492
+ _request_timeout: Union[
493
+ None,
494
+ Annotated[StrictFloat, Field(gt=0)],
495
+ Tuple[
496
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
497
+ ],
498
+ ] = None,
499
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
500
+ _content_type: Optional[StrictStr] = None,
501
+ _headers: Optional[Dict[StrictStr, Any]] = None,
502
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
503
+ ) -> str:
504
+ """Ping"""
505
+ if self.is_sync:
506
+ return self._ping_sync(
507
+ _request_timeout=_request_timeout,
508
+ _request_auth=_request_auth,
509
+ _content_type=_content_type,
510
+ _headers=_headers,
511
+ _host_index=_host_index,
512
+ )
513
+
514
+ else:
515
+ return self._ping_async(
516
+ _request_timeout=_request_timeout,
517
+ _request_auth=_request_auth,
518
+ _content_type=_content_type,
519
+ _headers=_headers,
520
+ _host_index=_host_index,
521
+ )
522
+
523
+ @validate_call
524
+ def ping_with_http_info(
525
+ self,
526
+ _request_timeout: Union[
527
+ None,
528
+ Annotated[StrictFloat, Field(gt=0)],
529
+ Tuple[
530
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
531
+ ],
532
+ ] = None,
533
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
534
+ _content_type: Optional[StrictStr] = None,
535
+ _headers: Optional[Dict[StrictStr, Any]] = None,
536
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
537
+ ) -> ApiResponse[str]:
538
+ """Ping with HTTP info"""
539
+ if self.is_sync:
540
+ return self._ping_sync_with_http_info(
541
+ _request_timeout=_request_timeout,
542
+ _request_auth=_request_auth,
543
+ _content_type=_content_type,
544
+ _headers=_headers,
545
+ _host_index=_host_index,
546
+ )
547
+
548
+ else:
549
+ return self._ping_async_with_http_info(
550
+ _request_timeout=_request_timeout,
551
+ _request_auth=_request_auth,
552
+ _content_type=_content_type,
553
+ _headers=_headers,
554
+ _host_index=_host_index,
555
+ )
556
+
557
+ @validate_call
558
+ def ping_without_preload_content(
559
+ self,
560
+ _request_timeout: Union[
561
+ None,
562
+ Annotated[StrictFloat, Field(gt=0)],
563
+ Tuple[
564
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
565
+ ],
566
+ ] = None,
567
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
568
+ _content_type: Optional[StrictStr] = None,
569
+ _headers: Optional[Dict[StrictStr, Any]] = None,
570
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
571
+ ) -> RESTResponseType:
572
+ """Ping without preloading content"""
573
+ if self.is_sync:
574
+ return self._ping_sync_without_preload_content(
575
+ _request_timeout=_request_timeout,
576
+ _request_auth=_request_auth,
577
+ _content_type=_content_type,
578
+ _headers=_headers,
579
+ _host_index=_host_index,
580
+ )
581
+
582
+ else:
583
+ return self._ping_async_without_preload_content(
584
+ _request_timeout=_request_timeout,
585
+ _request_auth=_request_auth,
586
+ _content_type=_content_type,
587
+ _headers=_headers,
588
+ _host_index=_host_index,
589
+ )
590
+
591
+ # Private async implementation methods
592
+ @validate_call
593
+ async def _ping_async(
285
594
  self,
286
595
  _request_timeout: Union[
287
596
  None,
@@ -341,7 +650,7 @@ class StatusApi:
341
650
  ).data
342
651
 
343
652
  @validate_call
344
- async def ping_with_http_info(
653
+ async def _ping_async_with_http_info(
345
654
  self,
346
655
  _request_timeout: Union[
347
656
  None,
@@ -396,12 +705,11 @@ class StatusApi:
396
705
  )
397
706
  await response_data.read()
398
707
  return self.api_client.response_deserialize(
399
- response_data=response_data,
400
- response_types_map=_response_types_map,
708
+ response_data=response_data, response_types_map=_response_types_map
401
709
  )
402
710
 
403
711
  @validate_call
404
- async def ping_without_preload_content(
712
+ async def _ping_async_without_preload_content(
405
713
  self,
406
714
  _request_timeout: Union[
407
715
  None,
@@ -454,7 +762,80 @@ class StatusApi:
454
762
  response_data = await self.api_client.call_api(
455
763
  *_param, _request_timeout=_request_timeout
456
764
  )
457
- return response_data.response
765
+ return response_data
766
+
767
+ # Private sync implementation methods
768
+ @validate_call
769
+ def _ping_sync(
770
+ self,
771
+ _request_timeout: Union[
772
+ None,
773
+ Annotated[StrictFloat, Field(gt=0)],
774
+ Tuple[
775
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
776
+ ],
777
+ ] = None,
778
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
779
+ _content_type: Optional[StrictStr] = None,
780
+ _headers: Optional[Dict[StrictStr, Any]] = None,
781
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
782
+ ) -> str:
783
+ """Synchronous version of ping"""
784
+ return async_to_sync(self._ping_async)(
785
+ _request_timeout=_request_timeout,
786
+ _request_auth=_request_auth,
787
+ _content_type=_content_type,
788
+ _headers=_headers,
789
+ _host_index=_host_index,
790
+ )
791
+
792
+ @validate_call
793
+ def _ping_sync_with_http_info(
794
+ self,
795
+ _request_timeout: Union[
796
+ None,
797
+ Annotated[StrictFloat, Field(gt=0)],
798
+ Tuple[
799
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
800
+ ],
801
+ ] = None,
802
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
803
+ _content_type: Optional[StrictStr] = None,
804
+ _headers: Optional[Dict[StrictStr, Any]] = None,
805
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
806
+ ) -> ApiResponse[str]:
807
+ """Synchronous version of ping_with_http_info"""
808
+ return async_to_sync(self._ping_async_with_http_info)(
809
+ _request_timeout=_request_timeout,
810
+ _request_auth=_request_auth,
811
+ _content_type=_content_type,
812
+ _headers=_headers,
813
+ _host_index=_host_index,
814
+ )
815
+
816
+ @validate_call
817
+ def _ping_sync_without_preload_content(
818
+ self,
819
+ _request_timeout: Union[
820
+ None,
821
+ Annotated[StrictFloat, Field(gt=0)],
822
+ Tuple[
823
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
824
+ ],
825
+ ] = None,
826
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
827
+ _content_type: Optional[StrictStr] = None,
828
+ _headers: Optional[Dict[StrictStr, Any]] = None,
829
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
830
+ ) -> RESTResponseType:
831
+ """Synchronous version of ping_without_preload_content"""
832
+ return async_to_sync(self._ping_async_without_preload_content)(
833
+ _request_timeout=_request_timeout,
834
+ _request_auth=_request_auth,
835
+ _content_type=_content_type,
836
+ _headers=_headers,
837
+ _host_index=_host_index,
838
+ )
458
839
 
459
840
  def _ping_serialize(
460
841
  self,
@@ -33,11 +33,6 @@ from crypticorn.hive.client import rest
33
33
  from crypticorn.hive.client.exceptions import (
34
34
  ApiValueError,
35
35
  ApiException,
36
- BadRequestException,
37
- UnauthorizedException,
38
- ForbiddenException,
39
- NotFoundException,
40
- ServiceException,
41
36
  )
42
37
 
43
38
  RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]]
@@ -68,7 +68,7 @@ class ApiErrorIdentifier(str, Enum):
68
68
  INVALID_EXCHANGE_KEY = "invalid_exchange_key"
69
69
  INVALID_MARGIN_MODE = "invalid_margin_mode"
70
70
  INVALID_MODEL_NAME = "invalid_model_name"
71
- INVALID_PARAMETER_PROVIDED = "exchange_invalid_parameter"
71
+ INVALID_PARAMETER_PROVIDED = "invalid_parameter_provided"
72
72
  LEVERAGE_LIMIT_EXCEEDED = "leverage_limit_exceeded"
73
73
  ORDER_VIOLATES_LIQUIDATION_PRICE_CONSTRAINTS = (
74
74
  "order_violates_liquidation_price_constraints"
@@ -21,7 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
22
  from crypticorn.hive.client.models.coins import Coins
23
23
  from crypticorn.hive.client.models.data_version import DataVersion
24
- from typing import Optional, Set
24
+ from typing import Set
25
25
  from typing_extensions import Self
26
26
 
27
27
 
@@ -22,7 +22,7 @@ from typing import Any, ClassVar, Dict, List, Optional
22
22
  from crypticorn.hive.client.models.api_error_identifier import ApiErrorIdentifier
23
23
  from crypticorn.hive.client.models.api_error_level import ApiErrorLevel
24
24
  from crypticorn.hive.client.models.api_error_type import ApiErrorType
25
- from typing import Optional, Set
25
+ from typing import Set
26
26
  from typing_extensions import Self
27
27
 
28
28
 
@@ -22,7 +22,7 @@ from typing import Any, ClassVar, Dict, List, Optional
22
22
  from crypticorn.hive.client.models.data_version import DataVersion
23
23
  from crypticorn.hive.client.models.target import Target
24
24
  from crypticorn.hive.client.models.target_type import TargetType
25
- from typing import Optional, Set
25
+ from typing import Set
26
26
  from typing_extensions import Self
27
27
 
28
28
 
@@ -77,6 +77,7 @@ class RESTClientObject:
77
77
 
78
78
  self.pool_manager: Optional[aiohttp.ClientSession] = None
79
79
  self.retry_client: Optional[aiohttp_retry.RetryClient] = None
80
+ self.is_sync: bool = False # Track whether this is sync or async mode
80
81
 
81
82
  async def close(self) -> None:
82
83
  if self.pool_manager:
@@ -170,7 +171,9 @@ class RESTClientObject:
170
171
 
171
172
  pool_manager: Union[aiohttp.ClientSession, aiohttp_retry.RetryClient]
172
173
 
173
- # https pool manager
174
+ # For sync operations, always use a fresh session
175
+ should_close_session = False
176
+
174
177
  if self.pool_manager is None:
175
178
  self.pool_manager = aiohttp.ClientSession(
176
179
  connector=aiohttp.TCPConnector(
@@ -178,6 +181,9 @@ class RESTClientObject:
178
181
  ),
179
182
  trust_env=True,
180
183
  )
184
+ # Only close session automatically in sync mode
185
+ should_close_session = self.is_sync
186
+
181
187
  pool_manager = self.pool_manager
182
188
 
183
189
  if self.retries is not None and method in ALLOW_RETRY_METHODS:
@@ -193,6 +199,19 @@ class RESTClientObject:
193
199
  )
194
200
  pool_manager = self.retry_client
195
201
 
196
- r = await pool_manager.request(**args)
197
-
198
- return RESTResponse(r)
202
+ try:
203
+ r = await pool_manager.request(**args)
204
+ # For sessions we're about to close, read the data immediately
205
+ if should_close_session:
206
+ response = RESTResponse(r)
207
+ await response.read() # Read data before closing session
208
+ return response
209
+ else:
210
+ return RESTResponse(r)
211
+ finally:
212
+ if should_close_session:
213
+ if self.retry_client is not None:
214
+ await self.retry_client.close()
215
+ self.retry_client = None
216
+ await self.pool_manager.close()
217
+ self.pool_manager = None