crypticorn 1.0.1__py3-none-any.whl → 1.0.2rc2__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.
- crypticorn/__init__.py +3 -3
- crypticorn/client.py +722 -0
- crypticorn/hive/__init__.py +1 -0
- crypticorn/{api.py → hive/main.py} +6 -6
- crypticorn/hive/requirements.txt +4 -0
- crypticorn/{utils.py → hive/utils.py} +2 -2
- crypticorn/klines/__init__.py +2 -0
- crypticorn/klines/client/__init__.py +62 -0
- crypticorn/klines/client/api/__init__.py +9 -0
- crypticorn/klines/client/api/funding_rates_api.py +362 -0
- crypticorn/klines/client/api/health_check_api.py +281 -0
- crypticorn/klines/client/api/ohlcv_data_api.py +409 -0
- crypticorn/klines/client/api/symbols_api.py +308 -0
- crypticorn/klines/client/api/udf_api.py +1929 -0
- crypticorn/klines/client/api_client.py +797 -0
- crypticorn/klines/client/api_response.py +21 -0
- crypticorn/klines/client/configuration.py +565 -0
- crypticorn/klines/client/exceptions.py +216 -0
- crypticorn/klines/client/models/__init__.py +41 -0
- crypticorn/klines/client/models/base_response_health_check_response.py +108 -0
- crypticorn/klines/client/models/base_response_list_funding_rate_response.py +112 -0
- crypticorn/klines/client/models/base_response_list_str.py +104 -0
- crypticorn/klines/client/models/base_response_ohlcv_response.py +108 -0
- crypticorn/klines/client/models/error_response.py +101 -0
- crypticorn/{models/deleted.py → klines/client/models/exchange.py} +15 -11
- crypticorn/klines/client/models/funding_rate_response.py +92 -0
- crypticorn/klines/client/models/health_check_response.py +89 -0
- crypticorn/{models/create_api_key_response.py → klines/client/models/history_error_response.py} +12 -22
- crypticorn/klines/client/models/history_no_data_response.py +99 -0
- crypticorn/klines/client/models/history_success_response.py +99 -0
- crypticorn/klines/client/models/http_validation_error.py +95 -0
- crypticorn/klines/client/models/market.py +37 -0
- crypticorn/klines/client/models/ohlcv_response.py +98 -0
- crypticorn/klines/client/models/resolution.py +40 -0
- crypticorn/klines/client/models/response_get_history_udf_history_get.py +149 -0
- crypticorn/klines/client/models/search_symbol_response.py +97 -0
- crypticorn/klines/client/models/sort_direction.py +37 -0
- crypticorn/{models/futures_balance_error.py → klines/client/models/symbol_group_response.py} +12 -14
- crypticorn/klines/client/models/symbol_info_response.py +115 -0
- crypticorn/{models/id.py → klines/client/models/symbol_type.py} +13 -11
- crypticorn/klines/client/models/timeframe.py +40 -0
- crypticorn/klines/client/models/udf_config_response.py +121 -0
- crypticorn/klines/client/models/validation_error.py +99 -0
- crypticorn/{models/get_futures_balance200_response_inner.py → klines/client/models/validation_error_loc_inner.py} +39 -35
- crypticorn/klines/client/py.typed +0 -0
- crypticorn/klines/client/rest.py +257 -0
- crypticorn/klines/main.py +42 -0
- crypticorn/klines/requirements.txt +4 -0
- crypticorn/klines/test/__init__.py +0 -0
- crypticorn/klines/test/test_base_response_health_check_response.py +56 -0
- crypticorn/klines/test/test_base_response_list_funding_rate_response.py +59 -0
- crypticorn/klines/test/test_base_response_list_str.py +56 -0
- crypticorn/klines/test/test_base_response_ohlcv_response.py +72 -0
- crypticorn/klines/test/test_error_response.py +57 -0
- crypticorn/klines/test/test_exchange.py +56 -0
- crypticorn/klines/test/test_funding_rate_response.py +56 -0
- crypticorn/klines/test/test_funding_rates_api.py +38 -0
- crypticorn/klines/test/test_health_check_api.py +38 -0
- crypticorn/klines/test/test_health_check_response.py +52 -0
- crypticorn/klines/test/test_history_error_response.py +53 -0
- crypticorn/klines/test/test_history_no_data_response.py +69 -0
- crypticorn/klines/test/test_history_success_response.py +87 -0
- crypticorn/klines/test/test_http_validation_error.py +58 -0
- crypticorn/klines/test/test_market.py +33 -0
- crypticorn/klines/test/test_ohlcv_data_api.py +38 -0
- crypticorn/klines/test/test_ohlcv_response.py +86 -0
- crypticorn/klines/test/test_resolution.py +33 -0
- crypticorn/klines/test/test_response_get_history_udf_history_get.py +89 -0
- crypticorn/klines/test/test_search_symbol_response.py +62 -0
- crypticorn/klines/test/test_sort_direction.py +33 -0
- crypticorn/klines/test/test_symbol_group_response.py +53 -0
- crypticorn/klines/test/test_symbol_info_response.py +84 -0
- crypticorn/klines/test/test_symbol_type.py +54 -0
- crypticorn/klines/test/test_symbols_api.py +38 -0
- crypticorn/klines/test/test_timeframe.py +33 -0
- crypticorn/klines/test/test_udf_api.py +80 -0
- crypticorn/klines/test/test_udf_config_response.py +95 -0
- crypticorn/klines/test/test_validation_error.py +60 -0
- crypticorn/klines/test/test_validation_error_loc_inner.py +50 -0
- crypticorn/trade/__init__.py +2 -0
- crypticorn/trade/client/__init__.py +63 -0
- crypticorn/trade/client/api/__init__.py +13 -0
- crypticorn/trade/client/api/api_keys_api.py +1468 -0
- crypticorn/trade/client/api/bots_api.py +1211 -0
- crypticorn/trade/client/api/exchanges_api.py +297 -0
- crypticorn/trade/client/api/futures_trading_panel_api.py +1463 -0
- crypticorn/trade/client/api/notifications_api.py +1767 -0
- crypticorn/trade/client/api/orders_api.py +331 -0
- crypticorn/trade/client/api/status_api.py +278 -0
- crypticorn/trade/client/api/strategies_api.py +331 -0
- crypticorn/trade/client/api/trading_actions_api.py +898 -0
- crypticorn/trade/client/api_client.py +797 -0
- crypticorn/trade/client/api_response.py +21 -0
- crypticorn/trade/client/configuration.py +574 -0
- crypticorn/trade/client/exceptions.py +216 -0
- crypticorn/trade/client/models/__init__.py +38 -0
- crypticorn/{models → trade/client/models}/action_model.py +17 -20
- crypticorn/{models → trade/client/models}/api_error_identifier.py +3 -1
- crypticorn/{models → trade/client/models}/api_key_model.py +5 -8
- crypticorn/{models → trade/client/models}/bot_model.py +15 -11
- crypticorn/{models → trade/client/models}/futures_trading_action.py +12 -12
- crypticorn/{models → trade/client/models}/http_validation_error.py +1 -1
- crypticorn/{models → trade/client/models}/notification_model.py +8 -6
- crypticorn/{models → trade/client/models}/order_model.py +12 -15
- crypticorn/{models → trade/client/models}/post_futures_action.py +1 -1
- crypticorn/{models → trade/client/models}/strategy_exchange_info.py +1 -1
- crypticorn/{models → trade/client/models}/strategy_model.py +6 -2
- crypticorn/{models → trade/client/models}/validation_error.py +1 -1
- crypticorn/trade/client/py.typed +0 -0
- crypticorn/trade/client/rest.py +257 -0
- crypticorn/trade/main.py +39 -0
- crypticorn/trade/requirements.txt +4 -0
- crypticorn-1.0.2rc2.dist-info/METADATA +47 -0
- crypticorn-1.0.2rc2.dist-info/RECORD +128 -0
- {crypticorn-1.0.1.dist-info → crypticorn-1.0.2rc2.dist-info}/WHEEL +1 -1
- crypticorn/models/__init__.py +0 -31
- crypticorn/models/modified.py +0 -87
- crypticorn-1.0.1.dist-info/METADATA +0 -40
- crypticorn-1.0.1.dist-info/RECORD +0 -38
- /crypticorn/{models → trade/client/models}/exchange.py +0 -0
- /crypticorn/{models → trade/client/models}/execution_ids.py +0 -0
- /crypticorn/{models → trade/client/models}/futures_balance.py +0 -0
- /crypticorn/{models → trade/client/models}/margin_mode.py +0 -0
- /crypticorn/{models → trade/client/models}/market_type.py +0 -0
- /crypticorn/{models → trade/client/models}/notification_type.py +0 -0
- /crypticorn/{models → trade/client/models}/order_status.py +0 -0
- /crypticorn/{models → trade/client/models}/tpsl.py +0 -0
- /crypticorn/{models → trade/client/models}/trading_action_type.py +0 -0
- /crypticorn/{models → trade/client/models}/update_notification.py +0 -0
- /crypticorn/{models → trade/client/models}/validation_error_loc_inner.py +0 -0
- {crypticorn-1.0.1.dist-info → crypticorn-1.0.2rc2.dist-info}/LICENSE.md +0 -0
- {crypticorn-1.0.1.dist-info → crypticorn-1.0.2rc2.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
|
+
|