crypticorn 2.15.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 (168) 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 -18
  25. crypticorn/common/router/admin_router.py +2 -2
  26. crypticorn/common/router/status_router.py +40 -2
  27. crypticorn/common/scopes.py +2 -0
  28. crypticorn/common/warnings.py +8 -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 +8 -7
  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/futures_trading_action.py +6 -28
  142. crypticorn/trade/client/models/futures_trading_action_create.py +10 -13
  143. crypticorn/trade/client/models/notification.py +17 -1
  144. crypticorn/trade/client/models/notification_create.py +18 -2
  145. crypticorn/trade/client/models/notification_update.py +17 -1
  146. crypticorn/trade/client/models/order.py +2 -14
  147. crypticorn/trade/client/models/orders_count.py +88 -0
  148. crypticorn/trade/client/models/paginated_response_futures_trading_action.py +134 -0
  149. crypticorn/trade/client/models/paginated_response_order.py +134 -0
  150. crypticorn/trade/client/models/pn_l.py +95 -0
  151. crypticorn/trade/client/models/post_futures_action.py +1 -1
  152. crypticorn/trade/client/models/spot_balance.py +109 -0
  153. crypticorn/trade/client/models/spot_trading_action_create.py +4 -1
  154. crypticorn/trade/client/models/strategy.py +22 -4
  155. crypticorn/trade/client/models/strategy_create.py +23 -5
  156. crypticorn/trade/client/models/strategy_exchange_info.py +16 -4
  157. crypticorn/trade/client/models/strategy_update.py +19 -3
  158. crypticorn/trade/client/models/tpsl.py +4 -27
  159. crypticorn/trade/client/models/tpsl_create.py +6 -19
  160. crypticorn/trade/client/rest.py +23 -4
  161. crypticorn/trade/main.py +15 -12
  162. {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/METADATA +65 -20
  163. {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/RECORD +167 -132
  164. crypticorn/trade/client/api/futures_trading_panel_api.py +0 -1285
  165. {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/WHEEL +0 -0
  166. {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/entry_points.txt +0 -0
  167. {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/licenses/LICENSE +0 -0
  168. {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/top_level.txt +0 -0
@@ -11,14 +11,10 @@ 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 Field
20
- from typing import List, Optional
21
- from typing_extensions import Annotated
22
18
  from crypticorn.klines.client.models.change_in_timeframe import ChangeInTimeframe
23
19
  from crypticorn.klines.client.models.market_type import MarketType
24
20
  from crypticorn.klines.client.models.timeframe import Timeframe
@@ -27,6 +23,24 @@ from crypticorn.klines.client.api_client import ApiClient, RequestSerialized
27
23
  from crypticorn.klines.client.api_response import ApiResponse
28
24
  from crypticorn.klines.client.rest import RESTResponseType
29
25
 
26
+ # Import async_to_sync for sync methods
27
+ try:
28
+ from asgiref.sync import async_to_sync
29
+
30
+ _HAS_ASGIREF = True
31
+ except ImportError:
32
+ _HAS_ASGIREF = False
33
+
34
+ def async_to_sync(async_func):
35
+ """Fallback decorator that raises an error if asgiref is not available."""
36
+
37
+ def wrapper(*args, **kwargs):
38
+ raise ImportError(
39
+ "asgiref is required for sync methods. Install with: pip install asgiref"
40
+ )
41
+
42
+ return wrapper
43
+
30
44
 
31
45
  class ChangeInTimeframeApi:
32
46
  """NOTE: This class is auto generated by OpenAPI Generator
@@ -35,13 +49,153 @@ class ChangeInTimeframeApi:
35
49
  Do not edit the class manually.
36
50
  """
37
51
 
38
- def __init__(self, api_client=None) -> None:
52
+ def __init__(self, api_client=None, is_sync: bool = False) -> None:
39
53
  if api_client is None:
40
54
  api_client = ApiClient.get_default()
41
55
  self.api_client = api_client
56
+ self.is_sync = is_sync
42
57
 
43
58
  @validate_call
44
- async def get_change_in_timeframe(
59
+ def get_change_in_timeframe(
60
+ self,
61
+ market: Annotated[
62
+ Optional[MarketType],
63
+ Field(description="The market to calculate the change in"),
64
+ ] = None,
65
+ timeframe: Annotated[
66
+ Optional[Timeframe],
67
+ Field(description="The timeframe to calculate the change in"),
68
+ ] = None,
69
+ _request_timeout: Union[
70
+ None,
71
+ Annotated[StrictFloat, Field(gt=0)],
72
+ Tuple[
73
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
74
+ ],
75
+ ] = None,
76
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
77
+ _content_type: Optional[StrictStr] = None,
78
+ _headers: Optional[Dict[StrictStr, Any]] = None,
79
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
80
+ ) -> List[ChangeInTimeframe]:
81
+ """Get Change In Timeframe"""
82
+ if self.is_sync:
83
+ return self._get_change_in_timeframe_sync(
84
+ market=market,
85
+ timeframe=timeframe,
86
+ _request_timeout=_request_timeout,
87
+ _request_auth=_request_auth,
88
+ _content_type=_content_type,
89
+ _headers=_headers,
90
+ _host_index=_host_index,
91
+ )
92
+
93
+ else:
94
+ return self._get_change_in_timeframe_async(
95
+ market=market,
96
+ timeframe=timeframe,
97
+ _request_timeout=_request_timeout,
98
+ _request_auth=_request_auth,
99
+ _content_type=_content_type,
100
+ _headers=_headers,
101
+ _host_index=_host_index,
102
+ )
103
+
104
+ @validate_call
105
+ def get_change_in_timeframe_with_http_info(
106
+ self,
107
+ market: Annotated[
108
+ Optional[MarketType],
109
+ Field(description="The market to calculate the change in"),
110
+ ] = None,
111
+ timeframe: Annotated[
112
+ Optional[Timeframe],
113
+ Field(description="The timeframe to calculate the change in"),
114
+ ] = None,
115
+ _request_timeout: Union[
116
+ None,
117
+ Annotated[StrictFloat, Field(gt=0)],
118
+ Tuple[
119
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
120
+ ],
121
+ ] = None,
122
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
123
+ _content_type: Optional[StrictStr] = None,
124
+ _headers: Optional[Dict[StrictStr, Any]] = None,
125
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
126
+ ) -> ApiResponse[List[ChangeInTimeframe]]:
127
+ """Get Change In Timeframe with HTTP info"""
128
+ if self.is_sync:
129
+ return self._get_change_in_timeframe_sync_with_http_info(
130
+ market=market,
131
+ timeframe=timeframe,
132
+ _request_timeout=_request_timeout,
133
+ _request_auth=_request_auth,
134
+ _content_type=_content_type,
135
+ _headers=_headers,
136
+ _host_index=_host_index,
137
+ )
138
+
139
+ else:
140
+ return self._get_change_in_timeframe_async_with_http_info(
141
+ market=market,
142
+ timeframe=timeframe,
143
+ _request_timeout=_request_timeout,
144
+ _request_auth=_request_auth,
145
+ _content_type=_content_type,
146
+ _headers=_headers,
147
+ _host_index=_host_index,
148
+ )
149
+
150
+ @validate_call
151
+ def get_change_in_timeframe_without_preload_content(
152
+ self,
153
+ market: Annotated[
154
+ Optional[MarketType],
155
+ Field(description="The market to calculate the change in"),
156
+ ] = None,
157
+ timeframe: Annotated[
158
+ Optional[Timeframe],
159
+ Field(description="The timeframe to calculate the change in"),
160
+ ] = None,
161
+ _request_timeout: Union[
162
+ None,
163
+ Annotated[StrictFloat, Field(gt=0)],
164
+ Tuple[
165
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
166
+ ],
167
+ ] = None,
168
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
169
+ _content_type: Optional[StrictStr] = None,
170
+ _headers: Optional[Dict[StrictStr, Any]] = None,
171
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
172
+ ) -> RESTResponseType:
173
+ """Get Change In Timeframe without preloading content"""
174
+ if self.is_sync:
175
+ return self._get_change_in_timeframe_sync_without_preload_content(
176
+ market=market,
177
+ timeframe=timeframe,
178
+ _request_timeout=_request_timeout,
179
+ _request_auth=_request_auth,
180
+ _content_type=_content_type,
181
+ _headers=_headers,
182
+ _host_index=_host_index,
183
+ )
184
+
185
+ else:
186
+ return self._get_change_in_timeframe_async_without_preload_content(
187
+ market=market,
188
+ timeframe=timeframe,
189
+ _request_timeout=_request_timeout,
190
+ _request_auth=_request_auth,
191
+ _content_type=_content_type,
192
+ _headers=_headers,
193
+ _host_index=_host_index,
194
+ )
195
+
196
+ # Private async implementation methods
197
+ @validate_call
198
+ async def _get_change_in_timeframe_async(
45
199
  self,
46
200
  market: Annotated[
47
201
  Optional[MarketType],
@@ -115,7 +269,7 @@ class ChangeInTimeframeApi:
115
269
  ).data
116
270
 
117
271
  @validate_call
118
- async def get_change_in_timeframe_with_http_info(
272
+ async def _get_change_in_timeframe_async_with_http_info(
119
273
  self,
120
274
  market: Annotated[
121
275
  Optional[MarketType],
@@ -184,12 +338,11 @@ class ChangeInTimeframeApi:
184
338
  )
185
339
  await response_data.read()
186
340
  return self.api_client.response_deserialize(
187
- response_data=response_data,
188
- response_types_map=_response_types_map,
341
+ response_data=response_data, response_types_map=_response_types_map
189
342
  )
190
343
 
191
344
  @validate_call
192
- async def get_change_in_timeframe_without_preload_content(
345
+ async def _get_change_in_timeframe_async_without_preload_content(
193
346
  self,
194
347
  market: Annotated[
195
348
  Optional[MarketType],
@@ -256,7 +409,112 @@ class ChangeInTimeframeApi:
256
409
  response_data = await self.api_client.call_api(
257
410
  *_param, _request_timeout=_request_timeout
258
411
  )
259
- return response_data.response
412
+ return response_data
413
+
414
+ # Private sync implementation methods
415
+ @validate_call
416
+ def _get_change_in_timeframe_sync(
417
+ self,
418
+ market: Annotated[
419
+ Optional[MarketType],
420
+ Field(description="The market to calculate the change in"),
421
+ ] = None,
422
+ timeframe: Annotated[
423
+ Optional[Timeframe],
424
+ Field(description="The timeframe to calculate the change in"),
425
+ ] = None,
426
+ _request_timeout: Union[
427
+ None,
428
+ Annotated[StrictFloat, Field(gt=0)],
429
+ Tuple[
430
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
431
+ ],
432
+ ] = None,
433
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
434
+ _content_type: Optional[StrictStr] = None,
435
+ _headers: Optional[Dict[StrictStr, Any]] = None,
436
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
437
+ ) -> List[ChangeInTimeframe]:
438
+ """Synchronous version of get_change_in_timeframe"""
439
+ return async_to_sync(self._get_change_in_timeframe_async)(
440
+ market=market,
441
+ timeframe=timeframe,
442
+ _request_timeout=_request_timeout,
443
+ _request_auth=_request_auth,
444
+ _content_type=_content_type,
445
+ _headers=_headers,
446
+ _host_index=_host_index,
447
+ )
448
+
449
+ @validate_call
450
+ def _get_change_in_timeframe_sync_with_http_info(
451
+ self,
452
+ market: Annotated[
453
+ Optional[MarketType],
454
+ Field(description="The market to calculate the change in"),
455
+ ] = None,
456
+ timeframe: Annotated[
457
+ Optional[Timeframe],
458
+ Field(description="The timeframe to calculate the change in"),
459
+ ] = None,
460
+ _request_timeout: Union[
461
+ None,
462
+ Annotated[StrictFloat, Field(gt=0)],
463
+ Tuple[
464
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
465
+ ],
466
+ ] = None,
467
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
468
+ _content_type: Optional[StrictStr] = None,
469
+ _headers: Optional[Dict[StrictStr, Any]] = None,
470
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
471
+ ) -> ApiResponse[List[ChangeInTimeframe]]:
472
+ """Synchronous version of get_change_in_timeframe_with_http_info"""
473
+ return async_to_sync(self._get_change_in_timeframe_async_with_http_info)(
474
+ market=market,
475
+ timeframe=timeframe,
476
+ _request_timeout=_request_timeout,
477
+ _request_auth=_request_auth,
478
+ _content_type=_content_type,
479
+ _headers=_headers,
480
+ _host_index=_host_index,
481
+ )
482
+
483
+ @validate_call
484
+ def _get_change_in_timeframe_sync_without_preload_content(
485
+ self,
486
+ market: Annotated[
487
+ Optional[MarketType],
488
+ Field(description="The market to calculate the change in"),
489
+ ] = None,
490
+ timeframe: Annotated[
491
+ Optional[Timeframe],
492
+ Field(description="The timeframe to calculate the change in"),
493
+ ] = None,
494
+ _request_timeout: Union[
495
+ None,
496
+ Annotated[StrictFloat, Field(gt=0)],
497
+ Tuple[
498
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
499
+ ],
500
+ ] = None,
501
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
502
+ _content_type: Optional[StrictStr] = None,
503
+ _headers: Optional[Dict[StrictStr, Any]] = None,
504
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
505
+ ) -> RESTResponseType:
506
+ """Synchronous version of get_change_in_timeframe_without_preload_content"""
507
+ return async_to_sync(
508
+ self._get_change_in_timeframe_async_without_preload_content
509
+ )(
510
+ market=market,
511
+ timeframe=timeframe,
512
+ _request_timeout=_request_timeout,
513
+ _request_auth=_request_auth,
514
+ _content_type=_content_type,
515
+ _headers=_headers,
516
+ _host_index=_host_index,
517
+ )
260
518
 
261
519
  def _get_change_in_timeframe_serialize(
262
520
  self,
@@ -11,20 +11,34 @@ 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 Field, StrictInt, StrictStr
20
- from typing import Optional
21
- from typing_extensions import Annotated
22
18
  from crypticorn.klines.client.models.funding_rate_response import FundingRateResponse
23
19
 
24
20
  from crypticorn.klines.client.api_client import ApiClient, RequestSerialized
25
21
  from crypticorn.klines.client.api_response import ApiResponse
26
22
  from crypticorn.klines.client.rest import RESTResponseType
27
23
 
24
+ # Import async_to_sync for sync methods
25
+ try:
26
+ from asgiref.sync import async_to_sync
27
+
28
+ _HAS_ASGIREF = True
29
+ except ImportError:
30
+ _HAS_ASGIREF = False
31
+
32
+ def async_to_sync(async_func):
33
+ """Fallback decorator that raises an error if asgiref is not available."""
34
+
35
+ def wrapper(*args, **kwargs):
36
+ raise ImportError(
37
+ "asgiref is required for sync methods. Install with: pip install asgiref"
38
+ )
39
+
40
+ return wrapper
41
+
28
42
 
29
43
  class FundingRatesApi:
30
44
  """NOTE: This class is auto generated by OpenAPI Generator
@@ -33,13 +47,180 @@ class FundingRatesApi:
33
47
  Do not edit the class manually.
34
48
  """
35
49
 
36
- def __init__(self, api_client=None) -> None:
50
+ def __init__(self, api_client=None, is_sync: bool = False) -> None:
37
51
  if api_client is None:
38
52
  api_client = ApiClient.get_default()
39
53
  self.api_client = api_client
54
+ self.is_sync = is_sync
40
55
 
41
56
  @validate_call
42
- async def get_funding_rates(
57
+ def get_funding_rates(
58
+ self,
59
+ symbol: Annotated[
60
+ StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
61
+ ],
62
+ start: Annotated[
63
+ Optional[StrictInt], Field(description="Start timestamp in milliseconds")
64
+ ] = None,
65
+ end: Annotated[
66
+ Optional[StrictInt], Field(description="End timestamp in milliseconds")
67
+ ] = None,
68
+ limit: Annotated[
69
+ Optional[Annotated[int, Field(strict=True, ge=1)]],
70
+ Field(description="Number of funding rates to return"),
71
+ ] = None,
72
+ _request_timeout: Union[
73
+ None,
74
+ Annotated[StrictFloat, Field(gt=0)],
75
+ Tuple[
76
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
77
+ ],
78
+ ] = None,
79
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
80
+ _content_type: Optional[StrictStr] = None,
81
+ _headers: Optional[Dict[StrictStr, Any]] = None,
82
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
83
+ ) -> FundingRateResponse:
84
+ """Funding Rate"""
85
+ if self.is_sync:
86
+ return self._get_funding_rates_sync(
87
+ symbol=symbol,
88
+ start=start,
89
+ end=end,
90
+ limit=limit,
91
+ _request_timeout=_request_timeout,
92
+ _request_auth=_request_auth,
93
+ _content_type=_content_type,
94
+ _headers=_headers,
95
+ _host_index=_host_index,
96
+ )
97
+
98
+ else:
99
+ return self._get_funding_rates_async(
100
+ symbol=symbol,
101
+ start=start,
102
+ end=end,
103
+ limit=limit,
104
+ _request_timeout=_request_timeout,
105
+ _request_auth=_request_auth,
106
+ _content_type=_content_type,
107
+ _headers=_headers,
108
+ _host_index=_host_index,
109
+ )
110
+
111
+ @validate_call
112
+ def get_funding_rates_with_http_info(
113
+ self,
114
+ symbol: Annotated[
115
+ StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
116
+ ],
117
+ start: Annotated[
118
+ Optional[StrictInt], Field(description="Start timestamp in milliseconds")
119
+ ] = None,
120
+ end: Annotated[
121
+ Optional[StrictInt], Field(description="End timestamp in milliseconds")
122
+ ] = None,
123
+ limit: Annotated[
124
+ Optional[Annotated[int, Field(strict=True, ge=1)]],
125
+ Field(description="Number of funding rates to return"),
126
+ ] = None,
127
+ _request_timeout: Union[
128
+ None,
129
+ Annotated[StrictFloat, Field(gt=0)],
130
+ Tuple[
131
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
132
+ ],
133
+ ] = None,
134
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
135
+ _content_type: Optional[StrictStr] = None,
136
+ _headers: Optional[Dict[StrictStr, Any]] = None,
137
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
138
+ ) -> ApiResponse[FundingRateResponse]:
139
+ """Funding Rate with HTTP info"""
140
+ if self.is_sync:
141
+ return self._get_funding_rates_sync_with_http_info(
142
+ symbol=symbol,
143
+ start=start,
144
+ end=end,
145
+ limit=limit,
146
+ _request_timeout=_request_timeout,
147
+ _request_auth=_request_auth,
148
+ _content_type=_content_type,
149
+ _headers=_headers,
150
+ _host_index=_host_index,
151
+ )
152
+
153
+ else:
154
+ return self._get_funding_rates_async_with_http_info(
155
+ symbol=symbol,
156
+ start=start,
157
+ end=end,
158
+ limit=limit,
159
+ _request_timeout=_request_timeout,
160
+ _request_auth=_request_auth,
161
+ _content_type=_content_type,
162
+ _headers=_headers,
163
+ _host_index=_host_index,
164
+ )
165
+
166
+ @validate_call
167
+ def get_funding_rates_without_preload_content(
168
+ self,
169
+ symbol: Annotated[
170
+ StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
171
+ ],
172
+ start: Annotated[
173
+ Optional[StrictInt], Field(description="Start timestamp in milliseconds")
174
+ ] = None,
175
+ end: Annotated[
176
+ Optional[StrictInt], Field(description="End timestamp in milliseconds")
177
+ ] = None,
178
+ limit: Annotated[
179
+ Optional[Annotated[int, Field(strict=True, ge=1)]],
180
+ Field(description="Number of funding rates to return"),
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
+ """Funding Rate without preloading content"""
195
+ if self.is_sync:
196
+ return self._get_funding_rates_sync_without_preload_content(
197
+ symbol=symbol,
198
+ start=start,
199
+ end=end,
200
+ limit=limit,
201
+ _request_timeout=_request_timeout,
202
+ _request_auth=_request_auth,
203
+ _content_type=_content_type,
204
+ _headers=_headers,
205
+ _host_index=_host_index,
206
+ )
207
+
208
+ else:
209
+ return self._get_funding_rates_async_without_preload_content(
210
+ symbol=symbol,
211
+ start=start,
212
+ end=end,
213
+ limit=limit,
214
+ _request_timeout=_request_timeout,
215
+ _request_auth=_request_auth,
216
+ _content_type=_content_type,
217
+ _headers=_headers,
218
+ _host_index=_host_index,
219
+ )
220
+
221
+ # Private async implementation methods
222
+ @validate_call
223
+ async def _get_funding_rates_async(
43
224
  self,
44
225
  symbol: Annotated[
45
226
  StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
@@ -124,7 +305,7 @@ class FundingRatesApi:
124
305
  ).data
125
306
 
126
307
  @validate_call
127
- async def get_funding_rates_with_http_info(
308
+ async def _get_funding_rates_async_with_http_info(
128
309
  self,
129
310
  symbol: Annotated[
130
311
  StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
@@ -204,12 +385,11 @@ class FundingRatesApi:
204
385
  )
205
386
  await response_data.read()
206
387
  return self.api_client.response_deserialize(
207
- response_data=response_data,
208
- response_types_map=_response_types_map,
388
+ response_data=response_data, response_types_map=_response_types_map
209
389
  )
210
390
 
211
391
  @validate_call
212
- async def get_funding_rates_without_preload_content(
392
+ async def _get_funding_rates_async_without_preload_content(
213
393
  self,
214
394
  symbol: Annotated[
215
395
  StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
@@ -287,7 +467,131 @@ class FundingRatesApi:
287
467
  response_data = await self.api_client.call_api(
288
468
  *_param, _request_timeout=_request_timeout
289
469
  )
290
- return response_data.response
470
+ return response_data
471
+
472
+ # Private sync implementation methods
473
+ @validate_call
474
+ def _get_funding_rates_sync(
475
+ self,
476
+ symbol: Annotated[
477
+ StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
478
+ ],
479
+ start: Annotated[
480
+ Optional[StrictInt], Field(description="Start timestamp in milliseconds")
481
+ ] = None,
482
+ end: Annotated[
483
+ Optional[StrictInt], Field(description="End timestamp in milliseconds")
484
+ ] = None,
485
+ limit: Annotated[
486
+ Optional[Annotated[int, Field(strict=True, ge=1)]],
487
+ Field(description="Number of funding rates to return"),
488
+ ] = None,
489
+ _request_timeout: Union[
490
+ None,
491
+ Annotated[StrictFloat, Field(gt=0)],
492
+ Tuple[
493
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
494
+ ],
495
+ ] = None,
496
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
497
+ _content_type: Optional[StrictStr] = None,
498
+ _headers: Optional[Dict[StrictStr, Any]] = None,
499
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
500
+ ) -> FundingRateResponse:
501
+ """Synchronous version of get_funding_rates"""
502
+ return async_to_sync(self._get_funding_rates_async)(
503
+ symbol=symbol,
504
+ start=start,
505
+ end=end,
506
+ limit=limit,
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
+ @validate_call
515
+ def _get_funding_rates_sync_with_http_info(
516
+ self,
517
+ symbol: Annotated[
518
+ StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
519
+ ],
520
+ start: Annotated[
521
+ Optional[StrictInt], Field(description="Start timestamp in milliseconds")
522
+ ] = None,
523
+ end: Annotated[
524
+ Optional[StrictInt], Field(description="End timestamp in milliseconds")
525
+ ] = None,
526
+ limit: Annotated[
527
+ Optional[Annotated[int, Field(strict=True, ge=1)]],
528
+ Field(description="Number of funding rates to return"),
529
+ ] = None,
530
+ _request_timeout: Union[
531
+ None,
532
+ Annotated[StrictFloat, Field(gt=0)],
533
+ Tuple[
534
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
535
+ ],
536
+ ] = None,
537
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
538
+ _content_type: Optional[StrictStr] = None,
539
+ _headers: Optional[Dict[StrictStr, Any]] = None,
540
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
541
+ ) -> ApiResponse[FundingRateResponse]:
542
+ """Synchronous version of get_funding_rates_with_http_info"""
543
+ return async_to_sync(self._get_funding_rates_async_with_http_info)(
544
+ symbol=symbol,
545
+ start=start,
546
+ end=end,
547
+ limit=limit,
548
+ _request_timeout=_request_timeout,
549
+ _request_auth=_request_auth,
550
+ _content_type=_content_type,
551
+ _headers=_headers,
552
+ _host_index=_host_index,
553
+ )
554
+
555
+ @validate_call
556
+ def _get_funding_rates_sync_without_preload_content(
557
+ self,
558
+ symbol: Annotated[
559
+ StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
560
+ ],
561
+ start: Annotated[
562
+ Optional[StrictInt], Field(description="Start timestamp in milliseconds")
563
+ ] = None,
564
+ end: Annotated[
565
+ Optional[StrictInt], Field(description="End timestamp in milliseconds")
566
+ ] = None,
567
+ limit: Annotated[
568
+ Optional[Annotated[int, Field(strict=True, ge=1)]],
569
+ Field(description="Number of funding rates to return"),
570
+ ] = None,
571
+ _request_timeout: Union[
572
+ None,
573
+ Annotated[StrictFloat, Field(gt=0)],
574
+ Tuple[
575
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
576
+ ],
577
+ ] = None,
578
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
579
+ _content_type: Optional[StrictStr] = None,
580
+ _headers: Optional[Dict[StrictStr, Any]] = None,
581
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
582
+ ) -> RESTResponseType:
583
+ """Synchronous version of get_funding_rates_without_preload_content"""
584
+ return async_to_sync(self._get_funding_rates_async_without_preload_content)(
585
+ symbol=symbol,
586
+ start=start,
587
+ end=end,
588
+ limit=limit,
589
+ _request_timeout=_request_timeout,
590
+ _request_auth=_request_auth,
591
+ _content_type=_content_type,
592
+ _headers=_headers,
593
+ _host_index=_host_index,
594
+ )
291
595
 
292
596
  def _get_funding_rates_serialize(
293
597
  self,