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,331 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
FastAPI
|
5
|
+
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1.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 StrictInt, StrictStr
|
20
|
+
from typing import List, Optional
|
21
|
+
from crypticorn.trade.client.models.strategy_model import StrategyModel
|
22
|
+
|
23
|
+
from crypticorn.trade.client.api_client import ApiClient, RequestSerialized
|
24
|
+
from crypticorn.trade.client.api_response import ApiResponse
|
25
|
+
from crypticorn.trade.client.rest import RESTResponseType
|
26
|
+
|
27
|
+
|
28
|
+
class StrategiesApi:
|
29
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
30
|
+
Ref: https://openapi-generator.tech
|
31
|
+
|
32
|
+
Do not edit the class manually.
|
33
|
+
"""
|
34
|
+
|
35
|
+
def __init__(self, api_client=None) -> None:
|
36
|
+
if api_client is None:
|
37
|
+
api_client = ApiClient.get_default()
|
38
|
+
self.api_client = api_client
|
39
|
+
|
40
|
+
|
41
|
+
@validate_call
|
42
|
+
def get_strategies(
|
43
|
+
self,
|
44
|
+
limit: Optional[StrictInt] = None,
|
45
|
+
offset: Optional[StrictInt] = None,
|
46
|
+
access_token: Optional[StrictStr] = None,
|
47
|
+
_request_timeout: Union[
|
48
|
+
None,
|
49
|
+
Annotated[StrictFloat, Field(gt=0)],
|
50
|
+
Tuple[
|
51
|
+
Annotated[StrictFloat, Field(gt=0)],
|
52
|
+
Annotated[StrictFloat, Field(gt=0)]
|
53
|
+
]
|
54
|
+
] = None,
|
55
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
56
|
+
_content_type: Optional[StrictStr] = None,
|
57
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
58
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
59
|
+
) -> List[StrategyModel]:
|
60
|
+
"""Get Strategies
|
61
|
+
|
62
|
+
|
63
|
+
:param limit:
|
64
|
+
:type limit: int
|
65
|
+
:param offset:
|
66
|
+
:type offset: int
|
67
|
+
:param access_token:
|
68
|
+
:type access_token: str
|
69
|
+
:param _request_timeout: timeout setting for this request. If one
|
70
|
+
number provided, it will be total request
|
71
|
+
timeout. It can also be a pair (tuple) of
|
72
|
+
(connection, read) timeouts.
|
73
|
+
:type _request_timeout: int, tuple(int, int), optional
|
74
|
+
:param _request_auth: set to override the auth_settings for an a single
|
75
|
+
request; this effectively ignores the
|
76
|
+
authentication in the spec for a single request.
|
77
|
+
:type _request_auth: dict, optional
|
78
|
+
:param _content_type: force content-type for the request.
|
79
|
+
:type _content_type: str, Optional
|
80
|
+
:param _headers: set to override the headers for a single
|
81
|
+
request; this effectively ignores the headers
|
82
|
+
in the spec for a single request.
|
83
|
+
:type _headers: dict, optional
|
84
|
+
:param _host_index: set to override the host_index for a single
|
85
|
+
request; this effectively ignores the host_index
|
86
|
+
in the spec for a single request.
|
87
|
+
:type _host_index: int, optional
|
88
|
+
:return: Returns the result object.
|
89
|
+
""" # noqa: E501
|
90
|
+
|
91
|
+
_param = self._get_strategies_serialize(
|
92
|
+
limit=limit,
|
93
|
+
offset=offset,
|
94
|
+
access_token=access_token,
|
95
|
+
_request_auth=_request_auth,
|
96
|
+
_content_type=_content_type,
|
97
|
+
_headers=_headers,
|
98
|
+
_host_index=_host_index
|
99
|
+
)
|
100
|
+
|
101
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
102
|
+
'200': "List[StrategyModel]",
|
103
|
+
'422': "HTTPValidationError",
|
104
|
+
}
|
105
|
+
response_data = self.api_client.call_api(
|
106
|
+
*_param,
|
107
|
+
_request_timeout=_request_timeout
|
108
|
+
)
|
109
|
+
response_data.read()
|
110
|
+
return self.api_client.response_deserialize(
|
111
|
+
response_data=response_data,
|
112
|
+
response_types_map=_response_types_map,
|
113
|
+
).data
|
114
|
+
|
115
|
+
|
116
|
+
@validate_call
|
117
|
+
def get_strategies_with_http_info(
|
118
|
+
self,
|
119
|
+
limit: Optional[StrictInt] = None,
|
120
|
+
offset: Optional[StrictInt] = None,
|
121
|
+
access_token: Optional[StrictStr] = None,
|
122
|
+
_request_timeout: Union[
|
123
|
+
None,
|
124
|
+
Annotated[StrictFloat, Field(gt=0)],
|
125
|
+
Tuple[
|
126
|
+
Annotated[StrictFloat, Field(gt=0)],
|
127
|
+
Annotated[StrictFloat, Field(gt=0)]
|
128
|
+
]
|
129
|
+
] = None,
|
130
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
131
|
+
_content_type: Optional[StrictStr] = None,
|
132
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
133
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
134
|
+
) -> ApiResponse[List[StrategyModel]]:
|
135
|
+
"""Get Strategies
|
136
|
+
|
137
|
+
|
138
|
+
:param limit:
|
139
|
+
:type limit: int
|
140
|
+
:param offset:
|
141
|
+
:type offset: int
|
142
|
+
:param access_token:
|
143
|
+
:type access_token: str
|
144
|
+
:param _request_timeout: timeout setting for this request. If one
|
145
|
+
number provided, it will be total request
|
146
|
+
timeout. It can also be a pair (tuple) of
|
147
|
+
(connection, read) timeouts.
|
148
|
+
:type _request_timeout: int, tuple(int, int), optional
|
149
|
+
:param _request_auth: set to override the auth_settings for an a single
|
150
|
+
request; this effectively ignores the
|
151
|
+
authentication in the spec for a single request.
|
152
|
+
:type _request_auth: dict, optional
|
153
|
+
:param _content_type: force content-type for the request.
|
154
|
+
:type _content_type: str, Optional
|
155
|
+
:param _headers: set to override the headers for a single
|
156
|
+
request; this effectively ignores the headers
|
157
|
+
in the spec for a single request.
|
158
|
+
:type _headers: dict, optional
|
159
|
+
:param _host_index: set to override the host_index for a single
|
160
|
+
request; this effectively ignores the host_index
|
161
|
+
in the spec for a single request.
|
162
|
+
:type _host_index: int, optional
|
163
|
+
:return: Returns the result object.
|
164
|
+
""" # noqa: E501
|
165
|
+
|
166
|
+
_param = self._get_strategies_serialize(
|
167
|
+
limit=limit,
|
168
|
+
offset=offset,
|
169
|
+
access_token=access_token,
|
170
|
+
_request_auth=_request_auth,
|
171
|
+
_content_type=_content_type,
|
172
|
+
_headers=_headers,
|
173
|
+
_host_index=_host_index
|
174
|
+
)
|
175
|
+
|
176
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
177
|
+
'200': "List[StrategyModel]",
|
178
|
+
'422': "HTTPValidationError",
|
179
|
+
}
|
180
|
+
response_data = self.api_client.call_api(
|
181
|
+
*_param,
|
182
|
+
_request_timeout=_request_timeout
|
183
|
+
)
|
184
|
+
response_data.read()
|
185
|
+
return self.api_client.response_deserialize(
|
186
|
+
response_data=response_data,
|
187
|
+
response_types_map=_response_types_map,
|
188
|
+
)
|
189
|
+
|
190
|
+
|
191
|
+
@validate_call
|
192
|
+
def get_strategies_without_preload_content(
|
193
|
+
self,
|
194
|
+
limit: Optional[StrictInt] = None,
|
195
|
+
offset: Optional[StrictInt] = None,
|
196
|
+
access_token: Optional[StrictStr] = None,
|
197
|
+
_request_timeout: Union[
|
198
|
+
None,
|
199
|
+
Annotated[StrictFloat, Field(gt=0)],
|
200
|
+
Tuple[
|
201
|
+
Annotated[StrictFloat, Field(gt=0)],
|
202
|
+
Annotated[StrictFloat, Field(gt=0)]
|
203
|
+
]
|
204
|
+
] = None,
|
205
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
206
|
+
_content_type: Optional[StrictStr] = None,
|
207
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
208
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
209
|
+
) -> RESTResponseType:
|
210
|
+
"""Get Strategies
|
211
|
+
|
212
|
+
|
213
|
+
:param limit:
|
214
|
+
:type limit: int
|
215
|
+
:param offset:
|
216
|
+
:type offset: int
|
217
|
+
:param access_token:
|
218
|
+
:type access_token: str
|
219
|
+
:param _request_timeout: timeout setting for this request. If one
|
220
|
+
number provided, it will be total request
|
221
|
+
timeout. It can also be a pair (tuple) of
|
222
|
+
(connection, read) timeouts.
|
223
|
+
:type _request_timeout: int, tuple(int, int), optional
|
224
|
+
:param _request_auth: set to override the auth_settings for an a single
|
225
|
+
request; this effectively ignores the
|
226
|
+
authentication in the spec for a single request.
|
227
|
+
:type _request_auth: dict, optional
|
228
|
+
:param _content_type: force content-type for the request.
|
229
|
+
:type _content_type: str, Optional
|
230
|
+
:param _headers: set to override the headers for a single
|
231
|
+
request; this effectively ignores the headers
|
232
|
+
in the spec for a single request.
|
233
|
+
:type _headers: dict, optional
|
234
|
+
:param _host_index: set to override the host_index for a single
|
235
|
+
request; this effectively ignores the host_index
|
236
|
+
in the spec for a single request.
|
237
|
+
:type _host_index: int, optional
|
238
|
+
:return: Returns the result object.
|
239
|
+
""" # noqa: E501
|
240
|
+
|
241
|
+
_param = self._get_strategies_serialize(
|
242
|
+
limit=limit,
|
243
|
+
offset=offset,
|
244
|
+
access_token=access_token,
|
245
|
+
_request_auth=_request_auth,
|
246
|
+
_content_type=_content_type,
|
247
|
+
_headers=_headers,
|
248
|
+
_host_index=_host_index
|
249
|
+
)
|
250
|
+
|
251
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
252
|
+
'200': "List[StrategyModel]",
|
253
|
+
'422': "HTTPValidationError",
|
254
|
+
}
|
255
|
+
response_data = self.api_client.call_api(
|
256
|
+
*_param,
|
257
|
+
_request_timeout=_request_timeout
|
258
|
+
)
|
259
|
+
return response_data.response
|
260
|
+
|
261
|
+
|
262
|
+
def _get_strategies_serialize(
|
263
|
+
self,
|
264
|
+
limit,
|
265
|
+
offset,
|
266
|
+
access_token,
|
267
|
+
_request_auth,
|
268
|
+
_content_type,
|
269
|
+
_headers,
|
270
|
+
_host_index,
|
271
|
+
) -> RequestSerialized:
|
272
|
+
|
273
|
+
_host = None
|
274
|
+
|
275
|
+
_collection_formats: Dict[str, str] = {
|
276
|
+
}
|
277
|
+
|
278
|
+
_path_params: Dict[str, str] = {}
|
279
|
+
_query_params: List[Tuple[str, str]] = []
|
280
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
281
|
+
_form_params: List[Tuple[str, str]] = []
|
282
|
+
_files: Dict[
|
283
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
284
|
+
] = {}
|
285
|
+
_body_params: Optional[bytes] = None
|
286
|
+
|
287
|
+
# process the path parameters
|
288
|
+
# process the query parameters
|
289
|
+
if limit is not None:
|
290
|
+
|
291
|
+
_query_params.append(('limit', limit))
|
292
|
+
|
293
|
+
if offset is not None:
|
294
|
+
|
295
|
+
_query_params.append(('offset', offset))
|
296
|
+
|
297
|
+
# process the header parameters
|
298
|
+
# process the form parameters
|
299
|
+
# process the body parameter
|
300
|
+
|
301
|
+
|
302
|
+
# set the HTTP header `Accept`
|
303
|
+
if 'Accept' not in _header_params:
|
304
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
305
|
+
[
|
306
|
+
'application/json'
|
307
|
+
]
|
308
|
+
)
|
309
|
+
|
310
|
+
|
311
|
+
# authentication setting
|
312
|
+
_auth_settings: List[str] = [
|
313
|
+
'OAuth2PasswordBearer'
|
314
|
+
]
|
315
|
+
|
316
|
+
return self.api_client.param_serialize(
|
317
|
+
method='GET',
|
318
|
+
resource_path='/strategies',
|
319
|
+
path_params=_path_params,
|
320
|
+
query_params=_query_params,
|
321
|
+
header_params=_header_params,
|
322
|
+
body=_body_params,
|
323
|
+
post_params=_form_params,
|
324
|
+
files=_files,
|
325
|
+
auth_settings=_auth_settings,
|
326
|
+
collection_formats=_collection_formats,
|
327
|
+
_host=_host,
|
328
|
+
_request_auth=_request_auth
|
329
|
+
)
|
330
|
+
|
331
|
+
|