crypticorn 1.0.0__py3-none-any.whl → 1.0.2rc1__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 (160) hide show
  1. crypticorn/__init__.py +3 -3
  2. crypticorn/client.py +722 -0
  3. crypticorn/{api.py → hive/main.py} +6 -6
  4. crypticorn/hive/requirements.txt +4 -0
  5. crypticorn/{utils.py → hive/utils.py} +2 -2
  6. crypticorn/klines/client/__init__.py +62 -0
  7. crypticorn/klines/client/api/__init__.py +9 -0
  8. crypticorn/klines/client/api/funding_rates_api.py +362 -0
  9. crypticorn/klines/client/api/health_check_api.py +281 -0
  10. crypticorn/klines/client/api/ohlcv_data_api.py +409 -0
  11. crypticorn/klines/client/api/symbols_api.py +308 -0
  12. crypticorn/klines/client/api/udf_api.py +1929 -0
  13. crypticorn/klines/client/api_client.py +797 -0
  14. crypticorn/klines/client/api_response.py +21 -0
  15. crypticorn/klines/client/configuration.py +565 -0
  16. crypticorn/klines/client/exceptions.py +216 -0
  17. crypticorn/klines/client/models/__init__.py +41 -0
  18. crypticorn/klines/client/models/base_response_health_check_response.py +108 -0
  19. crypticorn/klines/client/models/base_response_list_funding_rate_response.py +112 -0
  20. crypticorn/klines/client/models/base_response_list_str.py +104 -0
  21. crypticorn/klines/client/models/base_response_ohlcv_response.py +108 -0
  22. crypticorn/klines/client/models/error_response.py +101 -0
  23. crypticorn/klines/client/models/exchange.py +91 -0
  24. crypticorn/klines/client/models/funding_rate_response.py +92 -0
  25. crypticorn/klines/client/models/health_check_response.py +89 -0
  26. crypticorn/klines/client/models/history_error_response.py +89 -0
  27. crypticorn/klines/client/models/history_no_data_response.py +99 -0
  28. crypticorn/klines/client/models/history_success_response.py +99 -0
  29. crypticorn/klines/client/models/http_validation_error.py +95 -0
  30. crypticorn/klines/client/models/market.py +37 -0
  31. crypticorn/klines/client/models/ohlcv_response.py +98 -0
  32. crypticorn/klines/client/models/resolution.py +40 -0
  33. crypticorn/klines/client/models/response_get_history_udf_history_get.py +149 -0
  34. crypticorn/klines/client/models/search_symbol_response.py +97 -0
  35. crypticorn/klines/client/models/sort_direction.py +37 -0
  36. crypticorn/klines/client/models/symbol_group_response.py +87 -0
  37. crypticorn/klines/client/models/symbol_info_response.py +115 -0
  38. crypticorn/klines/client/models/symbol_type.py +89 -0
  39. crypticorn/klines/client/models/timeframe.py +40 -0
  40. crypticorn/klines/client/models/udf_config_response.py +121 -0
  41. crypticorn/klines/client/models/validation_error.py +99 -0
  42. crypticorn/klines/client/models/validation_error_loc_inner.py +138 -0
  43. crypticorn/klines/client/py.typed +0 -0
  44. crypticorn/klines/client/rest.py +257 -0
  45. crypticorn/klines/main.py +42 -0
  46. crypticorn/klines/requirements.txt +4 -0
  47. crypticorn/klines/test/__init__.py +0 -0
  48. crypticorn/klines/test/test_base_response_health_check_response.py +56 -0
  49. crypticorn/klines/test/test_base_response_list_funding_rate_response.py +59 -0
  50. crypticorn/klines/test/test_base_response_list_str.py +56 -0
  51. crypticorn/klines/test/test_base_response_ohlcv_response.py +72 -0
  52. crypticorn/klines/test/test_error_response.py +57 -0
  53. crypticorn/klines/test/test_exchange.py +56 -0
  54. crypticorn/klines/test/test_funding_rate_response.py +56 -0
  55. crypticorn/klines/test/test_funding_rates_api.py +38 -0
  56. crypticorn/klines/test/test_health_check_api.py +38 -0
  57. crypticorn/klines/test/test_health_check_response.py +52 -0
  58. crypticorn/klines/test/test_history_error_response.py +53 -0
  59. crypticorn/klines/test/test_history_no_data_response.py +69 -0
  60. crypticorn/klines/test/test_history_success_response.py +87 -0
  61. crypticorn/klines/test/test_http_validation_error.py +58 -0
  62. crypticorn/klines/test/test_market.py +33 -0
  63. crypticorn/klines/test/test_ohlcv_data_api.py +38 -0
  64. crypticorn/klines/test/test_ohlcv_response.py +86 -0
  65. crypticorn/klines/test/test_resolution.py +33 -0
  66. crypticorn/klines/test/test_response_get_history_udf_history_get.py +89 -0
  67. crypticorn/klines/test/test_search_symbol_response.py +62 -0
  68. crypticorn/klines/test/test_sort_direction.py +33 -0
  69. crypticorn/klines/test/test_symbol_group_response.py +53 -0
  70. crypticorn/klines/test/test_symbol_info_response.py +84 -0
  71. crypticorn/klines/test/test_symbol_type.py +54 -0
  72. crypticorn/klines/test/test_symbols_api.py +38 -0
  73. crypticorn/klines/test/test_timeframe.py +33 -0
  74. crypticorn/klines/test/test_udf_api.py +80 -0
  75. crypticorn/klines/test/test_udf_config_response.py +95 -0
  76. crypticorn/klines/test/test_validation_error.py +60 -0
  77. crypticorn/klines/test/test_validation_error_loc_inner.py +50 -0
  78. crypticorn/trade/client/__init__.py +63 -0
  79. crypticorn/trade/client/api/__init__.py +13 -0
  80. crypticorn/trade/client/api/api_keys_api.py +1468 -0
  81. crypticorn/trade/client/api/bots_api.py +1211 -0
  82. crypticorn/trade/client/api/exchanges_api.py +297 -0
  83. crypticorn/trade/client/api/futures_trading_panel_api.py +1463 -0
  84. crypticorn/trade/client/api/notifications_api.py +1767 -0
  85. crypticorn/trade/client/api/orders_api.py +331 -0
  86. crypticorn/trade/client/api/status_api.py +278 -0
  87. crypticorn/trade/client/api/strategies_api.py +331 -0
  88. crypticorn/trade/client/api/trading_actions_api.py +898 -0
  89. crypticorn/trade/client/api_client.py +797 -0
  90. crypticorn/trade/client/api_response.py +21 -0
  91. crypticorn/trade/client/configuration.py +574 -0
  92. crypticorn/trade/client/exceptions.py +216 -0
  93. crypticorn/trade/client/models/__init__.py +38 -0
  94. crypticorn/trade/client/models/action_model.py +202 -0
  95. crypticorn/trade/client/models/api_error_identifier.py +83 -0
  96. crypticorn/trade/client/models/api_key_model.py +135 -0
  97. crypticorn/trade/client/models/bot_model.py +122 -0
  98. crypticorn/trade/client/models/exchange.py +37 -0
  99. crypticorn/trade/client/models/execution_ids.py +91 -0
  100. crypticorn/trade/client/models/futures_balance.py +109 -0
  101. crypticorn/trade/client/models/futures_trading_action.py +198 -0
  102. crypticorn/trade/client/models/http_validation_error.py +95 -0
  103. crypticorn/trade/client/models/margin_mode.py +37 -0
  104. crypticorn/trade/client/models/market_type.py +37 -0
  105. crypticorn/trade/client/models/notification_model.py +113 -0
  106. crypticorn/trade/client/models/notification_type.py +39 -0
  107. crypticorn/trade/client/models/order_model.py +263 -0
  108. crypticorn/trade/client/models/order_status.py +40 -0
  109. crypticorn/trade/client/models/post_futures_action.py +93 -0
  110. crypticorn/trade/client/models/strategy_exchange_info.py +90 -0
  111. crypticorn/trade/client/models/strategy_model.py +119 -0
  112. crypticorn/trade/client/models/tpsl.py +116 -0
  113. crypticorn/trade/client/models/trading_action_type.py +39 -0
  114. crypticorn/trade/client/models/update_notification.py +91 -0
  115. crypticorn/trade/client/models/validation_error.py +99 -0
  116. crypticorn/trade/client/models/validation_error_loc_inner.py +138 -0
  117. crypticorn/trade/client/py.typed +0 -0
  118. crypticorn/trade/client/rest.py +257 -0
  119. crypticorn/trade/main.py +38 -0
  120. crypticorn/trade/requirements.txt +4 -0
  121. crypticorn/trade/test/__init__.py +0 -0
  122. crypticorn/trade/test/test_action_model.py +87 -0
  123. crypticorn/trade/test/test_api_error_identifier.py +33 -0
  124. crypticorn/trade/test/test_api_key_model.py +61 -0
  125. crypticorn/trade/test/test_api_keys_api.py +66 -0
  126. crypticorn/trade/test/test_bot_model.py +64 -0
  127. crypticorn/trade/test/test_bots_api.py +59 -0
  128. crypticorn/trade/test/test_exchange.py +33 -0
  129. crypticorn/trade/test/test_exchanges_api.py +38 -0
  130. crypticorn/trade/test/test_execution_ids.py +68 -0
  131. crypticorn/trade/test/test_futures_balance.py +62 -0
  132. crypticorn/trade/test/test_futures_trading_action.py +86 -0
  133. crypticorn/trade/test/test_futures_trading_panel_api.py +66 -0
  134. crypticorn/trade/test/test_http_validation_error.py +58 -0
  135. crypticorn/trade/test/test_margin_mode.py +33 -0
  136. crypticorn/trade/test/test_market_type.py +33 -0
  137. crypticorn/trade/test/test_notification_model.py +59 -0
  138. crypticorn/trade/test/test_notification_type.py +33 -0
  139. crypticorn/trade/test/test_notifications_api.py +73 -0
  140. crypticorn/trade/test/test_order_model.py +75 -0
  141. crypticorn/trade/test/test_order_status.py +33 -0
  142. crypticorn/trade/test/test_orders_api.py +38 -0
  143. crypticorn/trade/test/test_post_futures_action.py +72 -0
  144. crypticorn/trade/test/test_status_api.py +38 -0
  145. crypticorn/trade/test/test_strategies_api.py +38 -0
  146. crypticorn/trade/test/test_strategy_exchange_info.py +54 -0
  147. crypticorn/trade/test/test_strategy_model.py +73 -0
  148. crypticorn/trade/test/test_tpsl.py +56 -0
  149. crypticorn/trade/test/test_trading_action_type.py +33 -0
  150. crypticorn/trade/test/test_trading_actions_api.py +52 -0
  151. crypticorn/trade/test/test_update_notification.py +54 -0
  152. crypticorn/trade/test/test_validation_error.py +60 -0
  153. crypticorn/trade/test/test_validation_error_loc_inner.py +50 -0
  154. crypticorn-1.0.2rc1.dist-info/METADATA +47 -0
  155. crypticorn-1.0.2rc1.dist-info/RECORD +158 -0
  156. {crypticorn-1.0.0.dist-info → crypticorn-1.0.2rc1.dist-info}/WHEEL +1 -1
  157. crypticorn-1.0.0.dist-info/METADATA +0 -34
  158. crypticorn-1.0.0.dist-info/RECORD +0 -8
  159. {crypticorn-1.0.0.dist-info → crypticorn-1.0.2rc1.dist-info}/LICENSE.md +0 -0
  160. {crypticorn-1.0.0.dist-info → crypticorn-1.0.2rc1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,281 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Klines Service API
5
+
6
+ API for retrieving OHLCV data, funding rates, and symbol information from Binance. ## WebSocket Support Connect to `/ws` to receive real-time OHLCV updates. Example subscription message: ```json { \"action\": \"subscribe\", \"market\": \"spot\", \"symbol\": \"BTCUSDT\", \"timeframe\": \"15m\" } ```
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from crypticorn.klines.client.models.base_response_health_check_response import BaseResponseHealthCheckResponse
20
+
21
+ from crypticorn.klines.client.api_client import ApiClient, RequestSerialized
22
+ from crypticorn.klines.client.api_response import ApiResponse
23
+ from crypticorn.klines.client.rest import RESTResponseType
24
+
25
+
26
+ class HealthCheckApi:
27
+ """NOTE: This class is auto generated by OpenAPI Generator
28
+ Ref: https://openapi-generator.tech
29
+
30
+ Do not edit the class manually.
31
+ """
32
+
33
+ def __init__(self, api_client=None) -> None:
34
+ if api_client is None:
35
+ api_client = ApiClient.get_default()
36
+ self.api_client = api_client
37
+
38
+
39
+ @validate_call
40
+ def index_get(
41
+ self,
42
+ _request_timeout: Union[
43
+ None,
44
+ Annotated[StrictFloat, Field(gt=0)],
45
+ Tuple[
46
+ Annotated[StrictFloat, Field(gt=0)],
47
+ Annotated[StrictFloat, Field(gt=0)]
48
+ ]
49
+ ] = None,
50
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
51
+ _content_type: Optional[StrictStr] = None,
52
+ _headers: Optional[Dict[StrictStr, Any]] = None,
53
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
54
+ ) -> BaseResponseHealthCheckResponse:
55
+ """Index
56
+
57
+ Health check endpoint to verify if the API is running.
58
+
59
+ :param _request_timeout: timeout setting for this request. If one
60
+ number provided, it will be total request
61
+ timeout. It can also be a pair (tuple) of
62
+ (connection, read) timeouts.
63
+ :type _request_timeout: int, tuple(int, int), optional
64
+ :param _request_auth: set to override the auth_settings for an a single
65
+ request; this effectively ignores the
66
+ authentication in the spec for a single request.
67
+ :type _request_auth: dict, optional
68
+ :param _content_type: force content-type for the request.
69
+ :type _content_type: str, Optional
70
+ :param _headers: set to override the headers for a single
71
+ request; this effectively ignores the headers
72
+ in the spec for a single request.
73
+ :type _headers: dict, optional
74
+ :param _host_index: set to override the host_index for a single
75
+ request; this effectively ignores the host_index
76
+ in the spec for a single request.
77
+ :type _host_index: int, optional
78
+ :return: Returns the result object.
79
+ """ # noqa: E501
80
+
81
+ _param = self._index_get_serialize(
82
+ _request_auth=_request_auth,
83
+ _content_type=_content_type,
84
+ _headers=_headers,
85
+ _host_index=_host_index
86
+ )
87
+
88
+ _response_types_map: Dict[str, Optional[str]] = {
89
+ '200': "BaseResponseHealthCheckResponse",
90
+ }
91
+ response_data = self.api_client.call_api(
92
+ *_param,
93
+ _request_timeout=_request_timeout
94
+ )
95
+ response_data.read()
96
+ return self.api_client.response_deserialize(
97
+ response_data=response_data,
98
+ response_types_map=_response_types_map,
99
+ ).data
100
+
101
+
102
+ @validate_call
103
+ def index_get_with_http_info(
104
+ self,
105
+ _request_timeout: Union[
106
+ None,
107
+ Annotated[StrictFloat, Field(gt=0)],
108
+ Tuple[
109
+ Annotated[StrictFloat, Field(gt=0)],
110
+ Annotated[StrictFloat, Field(gt=0)]
111
+ ]
112
+ ] = None,
113
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
114
+ _content_type: Optional[StrictStr] = None,
115
+ _headers: Optional[Dict[StrictStr, Any]] = None,
116
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
117
+ ) -> ApiResponse[BaseResponseHealthCheckResponse]:
118
+ """Index
119
+
120
+ Health check endpoint to verify if the API is running.
121
+
122
+ :param _request_timeout: timeout setting for this request. If one
123
+ number provided, it will be total request
124
+ timeout. It can also be a pair (tuple) of
125
+ (connection, read) timeouts.
126
+ :type _request_timeout: int, tuple(int, int), optional
127
+ :param _request_auth: set to override the auth_settings for an a single
128
+ request; this effectively ignores the
129
+ authentication in the spec for a single request.
130
+ :type _request_auth: dict, optional
131
+ :param _content_type: force content-type for the request.
132
+ :type _content_type: str, Optional
133
+ :param _headers: set to override the headers for a single
134
+ request; this effectively ignores the headers
135
+ in the spec for a single request.
136
+ :type _headers: dict, optional
137
+ :param _host_index: set to override the host_index for a single
138
+ request; this effectively ignores the host_index
139
+ in the spec for a single request.
140
+ :type _host_index: int, optional
141
+ :return: Returns the result object.
142
+ """ # noqa: E501
143
+
144
+ _param = self._index_get_serialize(
145
+ _request_auth=_request_auth,
146
+ _content_type=_content_type,
147
+ _headers=_headers,
148
+ _host_index=_host_index
149
+ )
150
+
151
+ _response_types_map: Dict[str, Optional[str]] = {
152
+ '200': "BaseResponseHealthCheckResponse",
153
+ }
154
+ response_data = self.api_client.call_api(
155
+ *_param,
156
+ _request_timeout=_request_timeout
157
+ )
158
+ response_data.read()
159
+ return self.api_client.response_deserialize(
160
+ response_data=response_data,
161
+ response_types_map=_response_types_map,
162
+ )
163
+
164
+
165
+ @validate_call
166
+ def index_get_without_preload_content(
167
+ self,
168
+ _request_timeout: Union[
169
+ None,
170
+ Annotated[StrictFloat, Field(gt=0)],
171
+ Tuple[
172
+ Annotated[StrictFloat, Field(gt=0)],
173
+ Annotated[StrictFloat, Field(gt=0)]
174
+ ]
175
+ ] = None,
176
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
177
+ _content_type: Optional[StrictStr] = None,
178
+ _headers: Optional[Dict[StrictStr, Any]] = None,
179
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
180
+ ) -> RESTResponseType:
181
+ """Index
182
+
183
+ Health check endpoint to verify if the API is running.
184
+
185
+ :param _request_timeout: timeout setting for this request. If one
186
+ number provided, it will be total request
187
+ timeout. It can also be a pair (tuple) of
188
+ (connection, read) timeouts.
189
+ :type _request_timeout: int, tuple(int, int), optional
190
+ :param _request_auth: set to override the auth_settings for an a single
191
+ request; this effectively ignores the
192
+ authentication in the spec for a single request.
193
+ :type _request_auth: dict, optional
194
+ :param _content_type: force content-type for the request.
195
+ :type _content_type: str, Optional
196
+ :param _headers: set to override the headers for a single
197
+ request; this effectively ignores the headers
198
+ in the spec for a single request.
199
+ :type _headers: dict, optional
200
+ :param _host_index: set to override the host_index for a single
201
+ request; this effectively ignores the host_index
202
+ in the spec for a single request.
203
+ :type _host_index: int, optional
204
+ :return: Returns the result object.
205
+ """ # noqa: E501
206
+
207
+ _param = self._index_get_serialize(
208
+ _request_auth=_request_auth,
209
+ _content_type=_content_type,
210
+ _headers=_headers,
211
+ _host_index=_host_index
212
+ )
213
+
214
+ _response_types_map: Dict[str, Optional[str]] = {
215
+ '200': "BaseResponseHealthCheckResponse",
216
+ }
217
+ response_data = self.api_client.call_api(
218
+ *_param,
219
+ _request_timeout=_request_timeout
220
+ )
221
+ return response_data.response
222
+
223
+
224
+ def _index_get_serialize(
225
+ self,
226
+ _request_auth,
227
+ _content_type,
228
+ _headers,
229
+ _host_index,
230
+ ) -> RequestSerialized:
231
+
232
+ _host = None
233
+
234
+ _collection_formats: Dict[str, str] = {
235
+ }
236
+
237
+ _path_params: Dict[str, str] = {}
238
+ _query_params: List[Tuple[str, str]] = []
239
+ _header_params: Dict[str, Optional[str]] = _headers or {}
240
+ _form_params: List[Tuple[str, str]] = []
241
+ _files: Dict[
242
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
243
+ ] = {}
244
+ _body_params: Optional[bytes] = None
245
+
246
+ # process the path parameters
247
+ # process the query parameters
248
+ # process the header parameters
249
+ # process the form parameters
250
+ # process the body parameter
251
+
252
+
253
+ # set the HTTP header `Accept`
254
+ if 'Accept' not in _header_params:
255
+ _header_params['Accept'] = self.api_client.select_header_accept(
256
+ [
257
+ 'application/json'
258
+ ]
259
+ )
260
+
261
+
262
+ # authentication setting
263
+ _auth_settings: List[str] = [
264
+ ]
265
+
266
+ return self.api_client.param_serialize(
267
+ method='GET',
268
+ resource_path='/',
269
+ path_params=_path_params,
270
+ query_params=_query_params,
271
+ header_params=_header_params,
272
+ body=_body_params,
273
+ post_params=_form_params,
274
+ files=_files,
275
+ auth_settings=_auth_settings,
276
+ collection_formats=_collection_formats,
277
+ _host=_host,
278
+ _request_auth=_request_auth
279
+ )
280
+
281
+
@@ -0,0 +1,409 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Klines Service API
5
+
6
+ API for retrieving OHLCV data, funding rates, and symbol information from Binance. ## WebSocket Support Connect to `/ws` to receive real-time OHLCV updates. Example subscription message: ```json { \"action\": \"subscribe\", \"market\": \"spot\", \"symbol\": \"BTCUSDT\", \"timeframe\": \"15m\" } ```
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import Field, StrictInt, StrictStr
20
+ from typing import Any, Optional
21
+ from typing_extensions import Annotated
22
+ from crypticorn.klines.client.models.base_response_ohlcv_response import BaseResponseOHLCVResponse
23
+
24
+ from crypticorn.klines.client.api_client import ApiClient, RequestSerialized
25
+ from crypticorn.klines.client.api_response import ApiResponse
26
+ from crypticorn.klines.client.rest import RESTResponseType
27
+
28
+
29
+ class OHLCVDataApi:
30
+ """NOTE: This class is auto generated by OpenAPI Generator
31
+ Ref: https://openapi-generator.tech
32
+
33
+ Do not edit the class manually.
34
+ """
35
+
36
+ def __init__(self, api_client=None) -> None:
37
+ if api_client is None:
38
+ api_client = ApiClient.get_default()
39
+ self.api_client = api_client
40
+
41
+
42
+ @validate_call
43
+ def get_ohlcv_market_timeframe_symbol_get(
44
+ self,
45
+ market: Annotated[Any, Field(description="Market type (spot or futures)")],
46
+ timeframe: Annotated[Any, Field(description="Timeframe for the candles")],
47
+ symbol: Annotated[StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")],
48
+ start: Annotated[Optional[StrictInt], Field(description="Start timestamp in milliseconds")] = None,
49
+ end: Annotated[Optional[StrictInt], Field(description="End timestamp in milliseconds")] = None,
50
+ limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Number of candles to return")] = None,
51
+ sort_direction: Annotated[Optional[Any], Field(description="Klines sort direction (asc or desc)")] = None,
52
+ _request_timeout: Union[
53
+ None,
54
+ Annotated[StrictFloat, Field(gt=0)],
55
+ Tuple[
56
+ Annotated[StrictFloat, Field(gt=0)],
57
+ Annotated[StrictFloat, Field(gt=0)]
58
+ ]
59
+ ] = None,
60
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
61
+ _content_type: Optional[StrictStr] = None,
62
+ _headers: Optional[Dict[StrictStr, Any]] = None,
63
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
64
+ ) -> BaseResponseOHLCVResponse:
65
+ """Get Ohlcv
66
+
67
+ Retrieve OHLCV (Open, High, Low, Close, Volume) data for a specific market, timeframe, and symbol.
68
+
69
+ :param market: Market type (spot or futures) (required)
70
+ :type market: Market
71
+ :param timeframe: Timeframe for the candles (required)
72
+ :type timeframe: Timeframe
73
+ :param symbol: Trading pair symbol (e.g., BTCUSDT) (required)
74
+ :type symbol: str
75
+ :param start: Start timestamp in milliseconds
76
+ :type start: int
77
+ :param end: End timestamp in milliseconds
78
+ :type end: int
79
+ :param limit: Number of candles to return
80
+ :type limit: int
81
+ :param sort_direction: Klines sort direction (asc or desc)
82
+ :type sort_direction: SortDirection
83
+ :param _request_timeout: timeout setting for this request. If one
84
+ number provided, it will be total request
85
+ timeout. It can also be a pair (tuple) of
86
+ (connection, read) timeouts.
87
+ :type _request_timeout: int, tuple(int, int), optional
88
+ :param _request_auth: set to override the auth_settings for an a single
89
+ request; this effectively ignores the
90
+ authentication in the spec for a single request.
91
+ :type _request_auth: dict, optional
92
+ :param _content_type: force content-type for the request.
93
+ :type _content_type: str, Optional
94
+ :param _headers: set to override the headers for a single
95
+ request; this effectively ignores the headers
96
+ in the spec for a single request.
97
+ :type _headers: dict, optional
98
+ :param _host_index: set to override the host_index for a single
99
+ request; this effectively ignores the host_index
100
+ in the spec for a single request.
101
+ :type _host_index: int, optional
102
+ :return: Returns the result object.
103
+ """ # noqa: E501
104
+
105
+ _param = self._get_ohlcv_market_timeframe_symbol_get_serialize(
106
+ market=market,
107
+ timeframe=timeframe,
108
+ symbol=symbol,
109
+ start=start,
110
+ end=end,
111
+ limit=limit,
112
+ sort_direction=sort_direction,
113
+ _request_auth=_request_auth,
114
+ _content_type=_content_type,
115
+ _headers=_headers,
116
+ _host_index=_host_index
117
+ )
118
+
119
+ _response_types_map: Dict[str, Optional[str]] = {
120
+ '200': "BaseResponseOHLCVResponse",
121
+ '400': "ErrorResponse",
122
+ '404': "ErrorResponse",
123
+ '500': "ErrorResponse",
124
+ '422': "HTTPValidationError",
125
+ }
126
+ response_data = self.api_client.call_api(
127
+ *_param,
128
+ _request_timeout=_request_timeout
129
+ )
130
+ response_data.read()
131
+ return self.api_client.response_deserialize(
132
+ response_data=response_data,
133
+ response_types_map=_response_types_map,
134
+ ).data
135
+
136
+
137
+ @validate_call
138
+ def get_ohlcv_market_timeframe_symbol_get_with_http_info(
139
+ self,
140
+ market: Annotated[Any, Field(description="Market type (spot or futures)")],
141
+ timeframe: Annotated[Any, Field(description="Timeframe for the candles")],
142
+ symbol: Annotated[StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")],
143
+ start: Annotated[Optional[StrictInt], Field(description="Start timestamp in milliseconds")] = None,
144
+ end: Annotated[Optional[StrictInt], Field(description="End timestamp in milliseconds")] = None,
145
+ limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Number of candles to return")] = None,
146
+ sort_direction: Annotated[Optional[Any], Field(description="Klines sort direction (asc or desc)")] = None,
147
+ _request_timeout: Union[
148
+ None,
149
+ Annotated[StrictFloat, Field(gt=0)],
150
+ Tuple[
151
+ Annotated[StrictFloat, Field(gt=0)],
152
+ Annotated[StrictFloat, Field(gt=0)]
153
+ ]
154
+ ] = None,
155
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
156
+ _content_type: Optional[StrictStr] = None,
157
+ _headers: Optional[Dict[StrictStr, Any]] = None,
158
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
159
+ ) -> ApiResponse[BaseResponseOHLCVResponse]:
160
+ """Get Ohlcv
161
+
162
+ Retrieve OHLCV (Open, High, Low, Close, Volume) data for a specific market, timeframe, and symbol.
163
+
164
+ :param market: Market type (spot or futures) (required)
165
+ :type market: Market
166
+ :param timeframe: Timeframe for the candles (required)
167
+ :type timeframe: Timeframe
168
+ :param symbol: Trading pair symbol (e.g., BTCUSDT) (required)
169
+ :type symbol: str
170
+ :param start: Start timestamp in milliseconds
171
+ :type start: int
172
+ :param end: End timestamp in milliseconds
173
+ :type end: int
174
+ :param limit: Number of candles to return
175
+ :type limit: int
176
+ :param sort_direction: Klines sort direction (asc or desc)
177
+ :type sort_direction: SortDirection
178
+ :param _request_timeout: timeout setting for this request. If one
179
+ number provided, it will be total request
180
+ timeout. It can also be a pair (tuple) of
181
+ (connection, read) timeouts.
182
+ :type _request_timeout: int, tuple(int, int), optional
183
+ :param _request_auth: set to override the auth_settings for an a single
184
+ request; this effectively ignores the
185
+ authentication in the spec for a single request.
186
+ :type _request_auth: dict, optional
187
+ :param _content_type: force content-type for the request.
188
+ :type _content_type: str, Optional
189
+ :param _headers: set to override the headers for a single
190
+ request; this effectively ignores the headers
191
+ in the spec for a single request.
192
+ :type _headers: dict, optional
193
+ :param _host_index: set to override the host_index for a single
194
+ request; this effectively ignores the host_index
195
+ in the spec for a single request.
196
+ :type _host_index: int, optional
197
+ :return: Returns the result object.
198
+ """ # noqa: E501
199
+
200
+ _param = self._get_ohlcv_market_timeframe_symbol_get_serialize(
201
+ market=market,
202
+ timeframe=timeframe,
203
+ symbol=symbol,
204
+ start=start,
205
+ end=end,
206
+ limit=limit,
207
+ sort_direction=sort_direction,
208
+ _request_auth=_request_auth,
209
+ _content_type=_content_type,
210
+ _headers=_headers,
211
+ _host_index=_host_index
212
+ )
213
+
214
+ _response_types_map: Dict[str, Optional[str]] = {
215
+ '200': "BaseResponseOHLCVResponse",
216
+ '400': "ErrorResponse",
217
+ '404': "ErrorResponse",
218
+ '500': "ErrorResponse",
219
+ '422': "HTTPValidationError",
220
+ }
221
+ response_data = self.api_client.call_api(
222
+ *_param,
223
+ _request_timeout=_request_timeout
224
+ )
225
+ response_data.read()
226
+ return self.api_client.response_deserialize(
227
+ response_data=response_data,
228
+ response_types_map=_response_types_map,
229
+ )
230
+
231
+
232
+ @validate_call
233
+ def get_ohlcv_market_timeframe_symbol_get_without_preload_content(
234
+ self,
235
+ market: Annotated[Any, Field(description="Market type (spot or futures)")],
236
+ timeframe: Annotated[Any, Field(description="Timeframe for the candles")],
237
+ symbol: Annotated[StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")],
238
+ start: Annotated[Optional[StrictInt], Field(description="Start timestamp in milliseconds")] = None,
239
+ end: Annotated[Optional[StrictInt], Field(description="End timestamp in milliseconds")] = None,
240
+ limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Number of candles to return")] = None,
241
+ sort_direction: Annotated[Optional[Any], Field(description="Klines sort direction (asc or desc)")] = None,
242
+ _request_timeout: Union[
243
+ None,
244
+ Annotated[StrictFloat, Field(gt=0)],
245
+ Tuple[
246
+ Annotated[StrictFloat, Field(gt=0)],
247
+ Annotated[StrictFloat, Field(gt=0)]
248
+ ]
249
+ ] = None,
250
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
251
+ _content_type: Optional[StrictStr] = None,
252
+ _headers: Optional[Dict[StrictStr, Any]] = None,
253
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
254
+ ) -> RESTResponseType:
255
+ """Get Ohlcv
256
+
257
+ Retrieve OHLCV (Open, High, Low, Close, Volume) data for a specific market, timeframe, and symbol.
258
+
259
+ :param market: Market type (spot or futures) (required)
260
+ :type market: Market
261
+ :param timeframe: Timeframe for the candles (required)
262
+ :type timeframe: Timeframe
263
+ :param symbol: Trading pair symbol (e.g., BTCUSDT) (required)
264
+ :type symbol: str
265
+ :param start: Start timestamp in milliseconds
266
+ :type start: int
267
+ :param end: End timestamp in milliseconds
268
+ :type end: int
269
+ :param limit: Number of candles to return
270
+ :type limit: int
271
+ :param sort_direction: Klines sort direction (asc or desc)
272
+ :type sort_direction: SortDirection
273
+ :param _request_timeout: timeout setting for this request. If one
274
+ number provided, it will be total request
275
+ timeout. It can also be a pair (tuple) of
276
+ (connection, read) timeouts.
277
+ :type _request_timeout: int, tuple(int, int), optional
278
+ :param _request_auth: set to override the auth_settings for an a single
279
+ request; this effectively ignores the
280
+ authentication in the spec for a single request.
281
+ :type _request_auth: dict, optional
282
+ :param _content_type: force content-type for the request.
283
+ :type _content_type: str, Optional
284
+ :param _headers: set to override the headers for a single
285
+ request; this effectively ignores the headers
286
+ in the spec for a single request.
287
+ :type _headers: dict, optional
288
+ :param _host_index: set to override the host_index for a single
289
+ request; this effectively ignores the host_index
290
+ in the spec for a single request.
291
+ :type _host_index: int, optional
292
+ :return: Returns the result object.
293
+ """ # noqa: E501
294
+
295
+ _param = self._get_ohlcv_market_timeframe_symbol_get_serialize(
296
+ market=market,
297
+ timeframe=timeframe,
298
+ symbol=symbol,
299
+ start=start,
300
+ end=end,
301
+ limit=limit,
302
+ sort_direction=sort_direction,
303
+ _request_auth=_request_auth,
304
+ _content_type=_content_type,
305
+ _headers=_headers,
306
+ _host_index=_host_index
307
+ )
308
+
309
+ _response_types_map: Dict[str, Optional[str]] = {
310
+ '200': "BaseResponseOHLCVResponse",
311
+ '400': "ErrorResponse",
312
+ '404': "ErrorResponse",
313
+ '500': "ErrorResponse",
314
+ '422': "HTTPValidationError",
315
+ }
316
+ response_data = self.api_client.call_api(
317
+ *_param,
318
+ _request_timeout=_request_timeout
319
+ )
320
+ return response_data.response
321
+
322
+
323
+ def _get_ohlcv_market_timeframe_symbol_get_serialize(
324
+ self,
325
+ market,
326
+ timeframe,
327
+ symbol,
328
+ start,
329
+ end,
330
+ limit,
331
+ sort_direction,
332
+ _request_auth,
333
+ _content_type,
334
+ _headers,
335
+ _host_index,
336
+ ) -> RequestSerialized:
337
+
338
+ _host = None
339
+
340
+ _collection_formats: Dict[str, str] = {
341
+ }
342
+
343
+ _path_params: Dict[str, str] = {}
344
+ _query_params: List[Tuple[str, str]] = []
345
+ _header_params: Dict[str, Optional[str]] = _headers or {}
346
+ _form_params: List[Tuple[str, str]] = []
347
+ _files: Dict[
348
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
349
+ ] = {}
350
+ _body_params: Optional[bytes] = None
351
+
352
+ # process the path parameters
353
+ if market is not None:
354
+ _path_params['market'] = market.value
355
+ if timeframe is not None:
356
+ _path_params['timeframe'] = timeframe.value
357
+ if symbol is not None:
358
+ _path_params['symbol'] = symbol
359
+ # process the query parameters
360
+ if start is not None:
361
+
362
+ _query_params.append(('start', start))
363
+
364
+ if end is not None:
365
+
366
+ _query_params.append(('end', end))
367
+
368
+ if limit is not None:
369
+
370
+ _query_params.append(('limit', limit))
371
+
372
+ if sort_direction is not None:
373
+
374
+ _query_params.append(('sort_direction', sort_direction.value))
375
+
376
+ # process the header parameters
377
+ # process the form parameters
378
+ # process the body parameter
379
+
380
+
381
+ # set the HTTP header `Accept`
382
+ if 'Accept' not in _header_params:
383
+ _header_params['Accept'] = self.api_client.select_header_accept(
384
+ [
385
+ 'application/json'
386
+ ]
387
+ )
388
+
389
+
390
+ # authentication setting
391
+ _auth_settings: List[str] = [
392
+ ]
393
+
394
+ return self.api_client.param_serialize(
395
+ method='GET',
396
+ resource_path='/{market}/{timeframe}/{symbol}',
397
+ path_params=_path_params,
398
+ query_params=_query_params,
399
+ header_params=_header_params,
400
+ body=_body_params,
401
+ post_params=_form_params,
402
+ files=_files,
403
+ auth_settings=_auth_settings,
404
+ collection_formats=_collection_formats,
405
+ _host=_host,
406
+ _request_auth=_request_auth
407
+ )
408
+
409
+