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.
- crypticorn/__init__.py +3 -3
- crypticorn/client.py +722 -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/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/klines/client/models/exchange.py +91 -0
- crypticorn/klines/client/models/funding_rate_response.py +92 -0
- crypticorn/klines/client/models/health_check_response.py +89 -0
- crypticorn/klines/client/models/history_error_response.py +89 -0
- 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/klines/client/models/symbol_group_response.py +87 -0
- crypticorn/klines/client/models/symbol_info_response.py +115 -0
- crypticorn/klines/client/models/symbol_type.py +89 -0
- 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/klines/client/models/validation_error_loc_inner.py +138 -0
- 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/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/trade/client/models/action_model.py +202 -0
- crypticorn/trade/client/models/api_error_identifier.py +83 -0
- crypticorn/trade/client/models/api_key_model.py +135 -0
- crypticorn/trade/client/models/bot_model.py +122 -0
- crypticorn/trade/client/models/exchange.py +37 -0
- crypticorn/trade/client/models/execution_ids.py +91 -0
- crypticorn/trade/client/models/futures_balance.py +109 -0
- crypticorn/trade/client/models/futures_trading_action.py +198 -0
- crypticorn/trade/client/models/http_validation_error.py +95 -0
- crypticorn/trade/client/models/margin_mode.py +37 -0
- crypticorn/trade/client/models/market_type.py +37 -0
- crypticorn/trade/client/models/notification_model.py +113 -0
- crypticorn/trade/client/models/notification_type.py +39 -0
- crypticorn/trade/client/models/order_model.py +263 -0
- crypticorn/trade/client/models/order_status.py +40 -0
- crypticorn/trade/client/models/post_futures_action.py +93 -0
- crypticorn/trade/client/models/strategy_exchange_info.py +90 -0
- crypticorn/trade/client/models/strategy_model.py +119 -0
- crypticorn/trade/client/models/tpsl.py +116 -0
- crypticorn/trade/client/models/trading_action_type.py +39 -0
- crypticorn/trade/client/models/update_notification.py +91 -0
- crypticorn/trade/client/models/validation_error.py +99 -0
- crypticorn/trade/client/models/validation_error_loc_inner.py +138 -0
- crypticorn/trade/client/py.typed +0 -0
- crypticorn/trade/client/rest.py +257 -0
- crypticorn/trade/main.py +38 -0
- crypticorn/trade/requirements.txt +4 -0
- crypticorn/trade/test/__init__.py +0 -0
- crypticorn/trade/test/test_action_model.py +87 -0
- crypticorn/trade/test/test_api_error_identifier.py +33 -0
- crypticorn/trade/test/test_api_key_model.py +61 -0
- crypticorn/trade/test/test_api_keys_api.py +66 -0
- crypticorn/trade/test/test_bot_model.py +64 -0
- crypticorn/trade/test/test_bots_api.py +59 -0
- crypticorn/trade/test/test_exchange.py +33 -0
- crypticorn/trade/test/test_exchanges_api.py +38 -0
- crypticorn/trade/test/test_execution_ids.py +68 -0
- crypticorn/trade/test/test_futures_balance.py +62 -0
- crypticorn/trade/test/test_futures_trading_action.py +86 -0
- crypticorn/trade/test/test_futures_trading_panel_api.py +66 -0
- crypticorn/trade/test/test_http_validation_error.py +58 -0
- crypticorn/trade/test/test_margin_mode.py +33 -0
- crypticorn/trade/test/test_market_type.py +33 -0
- crypticorn/trade/test/test_notification_model.py +59 -0
- crypticorn/trade/test/test_notification_type.py +33 -0
- crypticorn/trade/test/test_notifications_api.py +73 -0
- crypticorn/trade/test/test_order_model.py +75 -0
- crypticorn/trade/test/test_order_status.py +33 -0
- crypticorn/trade/test/test_orders_api.py +38 -0
- crypticorn/trade/test/test_post_futures_action.py +72 -0
- crypticorn/trade/test/test_status_api.py +38 -0
- crypticorn/trade/test/test_strategies_api.py +38 -0
- crypticorn/trade/test/test_strategy_exchange_info.py +54 -0
- crypticorn/trade/test/test_strategy_model.py +73 -0
- crypticorn/trade/test/test_tpsl.py +56 -0
- crypticorn/trade/test/test_trading_action_type.py +33 -0
- crypticorn/trade/test/test_trading_actions_api.py +52 -0
- crypticorn/trade/test/test_update_notification.py +54 -0
- crypticorn/trade/test/test_validation_error.py +60 -0
- crypticorn/trade/test/test_validation_error_loc_inner.py +50 -0
- crypticorn-1.0.2rc1.dist-info/METADATA +47 -0
- crypticorn-1.0.2rc1.dist-info/RECORD +158 -0
- {crypticorn-1.0.0.dist-info → crypticorn-1.0.2rc1.dist-info}/WHEEL +1 -1
- crypticorn-1.0.0.dist-info/METADATA +0 -34
- crypticorn-1.0.0.dist-info/RECORD +0 -8
- {crypticorn-1.0.0.dist-info → crypticorn-1.0.2rc1.dist-info}/LICENSE.md +0 -0
- {crypticorn-1.0.0.dist-info → crypticorn-1.0.2rc1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,216 @@
|
|
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
|
+
from typing import Any, Optional
|
15
|
+
from typing_extensions import Self
|
16
|
+
|
17
|
+
class OpenApiException(Exception):
|
18
|
+
"""The base exception class for all OpenAPIExceptions"""
|
19
|
+
|
20
|
+
|
21
|
+
class ApiTypeError(OpenApiException, TypeError):
|
22
|
+
def __init__(self, msg, path_to_item=None, valid_classes=None,
|
23
|
+
key_type=None) -> None:
|
24
|
+
""" Raises an exception for TypeErrors
|
25
|
+
|
26
|
+
Args:
|
27
|
+
msg (str): the exception message
|
28
|
+
|
29
|
+
Keyword Args:
|
30
|
+
path_to_item (list): a list of keys an indices to get to the
|
31
|
+
current_item
|
32
|
+
None if unset
|
33
|
+
valid_classes (tuple): the primitive classes that current item
|
34
|
+
should be an instance of
|
35
|
+
None if unset
|
36
|
+
key_type (bool): False if our value is a value in a dict
|
37
|
+
True if it is a key in a dict
|
38
|
+
False if our item is an item in a list
|
39
|
+
None if unset
|
40
|
+
"""
|
41
|
+
self.path_to_item = path_to_item
|
42
|
+
self.valid_classes = valid_classes
|
43
|
+
self.key_type = key_type
|
44
|
+
full_msg = msg
|
45
|
+
if path_to_item:
|
46
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
47
|
+
super(ApiTypeError, self).__init__(full_msg)
|
48
|
+
|
49
|
+
|
50
|
+
class ApiValueError(OpenApiException, ValueError):
|
51
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
52
|
+
"""
|
53
|
+
Args:
|
54
|
+
msg (str): the exception message
|
55
|
+
|
56
|
+
Keyword Args:
|
57
|
+
path_to_item (list) the path to the exception in the
|
58
|
+
received_data dict. None if unset
|
59
|
+
"""
|
60
|
+
|
61
|
+
self.path_to_item = path_to_item
|
62
|
+
full_msg = msg
|
63
|
+
if path_to_item:
|
64
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
65
|
+
super(ApiValueError, self).__init__(full_msg)
|
66
|
+
|
67
|
+
|
68
|
+
class ApiAttributeError(OpenApiException, AttributeError):
|
69
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
70
|
+
"""
|
71
|
+
Raised when an attribute reference or assignment fails.
|
72
|
+
|
73
|
+
Args:
|
74
|
+
msg (str): the exception message
|
75
|
+
|
76
|
+
Keyword Args:
|
77
|
+
path_to_item (None/list) the path to the exception in the
|
78
|
+
received_data dict
|
79
|
+
"""
|
80
|
+
self.path_to_item = path_to_item
|
81
|
+
full_msg = msg
|
82
|
+
if path_to_item:
|
83
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
84
|
+
super(ApiAttributeError, self).__init__(full_msg)
|
85
|
+
|
86
|
+
|
87
|
+
class ApiKeyError(OpenApiException, KeyError):
|
88
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
89
|
+
"""
|
90
|
+
Args:
|
91
|
+
msg (str): the exception message
|
92
|
+
|
93
|
+
Keyword Args:
|
94
|
+
path_to_item (None/list) the path to the exception in the
|
95
|
+
received_data dict
|
96
|
+
"""
|
97
|
+
self.path_to_item = path_to_item
|
98
|
+
full_msg = msg
|
99
|
+
if path_to_item:
|
100
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
101
|
+
super(ApiKeyError, self).__init__(full_msg)
|
102
|
+
|
103
|
+
|
104
|
+
class ApiException(OpenApiException):
|
105
|
+
|
106
|
+
def __init__(
|
107
|
+
self,
|
108
|
+
status=None,
|
109
|
+
reason=None,
|
110
|
+
http_resp=None,
|
111
|
+
*,
|
112
|
+
body: Optional[str] = None,
|
113
|
+
data: Optional[Any] = None,
|
114
|
+
) -> None:
|
115
|
+
self.status = status
|
116
|
+
self.reason = reason
|
117
|
+
self.body = body
|
118
|
+
self.data = data
|
119
|
+
self.headers = None
|
120
|
+
|
121
|
+
if http_resp:
|
122
|
+
if self.status is None:
|
123
|
+
self.status = http_resp.status
|
124
|
+
if self.reason is None:
|
125
|
+
self.reason = http_resp.reason
|
126
|
+
if self.body is None:
|
127
|
+
try:
|
128
|
+
self.body = http_resp.data.decode('utf-8')
|
129
|
+
except Exception:
|
130
|
+
pass
|
131
|
+
self.headers = http_resp.getheaders()
|
132
|
+
|
133
|
+
@classmethod
|
134
|
+
def from_response(
|
135
|
+
cls,
|
136
|
+
*,
|
137
|
+
http_resp,
|
138
|
+
body: Optional[str],
|
139
|
+
data: Optional[Any],
|
140
|
+
) -> Self:
|
141
|
+
if http_resp.status == 400:
|
142
|
+
raise BadRequestException(http_resp=http_resp, body=body, data=data)
|
143
|
+
|
144
|
+
if http_resp.status == 401:
|
145
|
+
raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
|
146
|
+
|
147
|
+
if http_resp.status == 403:
|
148
|
+
raise ForbiddenException(http_resp=http_resp, body=body, data=data)
|
149
|
+
|
150
|
+
if http_resp.status == 404:
|
151
|
+
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
152
|
+
|
153
|
+
# Added new conditions for 409 and 422
|
154
|
+
if http_resp.status == 409:
|
155
|
+
raise ConflictException(http_resp=http_resp, body=body, data=data)
|
156
|
+
|
157
|
+
if http_resp.status == 422:
|
158
|
+
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
|
159
|
+
|
160
|
+
if 500 <= http_resp.status <= 599:
|
161
|
+
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
162
|
+
raise ApiException(http_resp=http_resp, body=body, data=data)
|
163
|
+
|
164
|
+
def __str__(self):
|
165
|
+
"""Custom error messages for exception"""
|
166
|
+
error_message = "({0})\n"\
|
167
|
+
"Reason: {1}\n".format(self.status, self.reason)
|
168
|
+
if self.headers:
|
169
|
+
error_message += "HTTP response headers: {0}\n".format(
|
170
|
+
self.headers)
|
171
|
+
|
172
|
+
if self.data or self.body:
|
173
|
+
error_message += "HTTP response body: {0}\n".format(self.data or self.body)
|
174
|
+
|
175
|
+
return error_message
|
176
|
+
|
177
|
+
|
178
|
+
class BadRequestException(ApiException):
|
179
|
+
pass
|
180
|
+
|
181
|
+
|
182
|
+
class NotFoundException(ApiException):
|
183
|
+
pass
|
184
|
+
|
185
|
+
|
186
|
+
class UnauthorizedException(ApiException):
|
187
|
+
pass
|
188
|
+
|
189
|
+
|
190
|
+
class ForbiddenException(ApiException):
|
191
|
+
pass
|
192
|
+
|
193
|
+
|
194
|
+
class ServiceException(ApiException):
|
195
|
+
pass
|
196
|
+
|
197
|
+
|
198
|
+
class ConflictException(ApiException):
|
199
|
+
"""Exception for HTTP 409 Conflict."""
|
200
|
+
pass
|
201
|
+
|
202
|
+
|
203
|
+
class UnprocessableEntityException(ApiException):
|
204
|
+
"""Exception for HTTP 422 Unprocessable Entity."""
|
205
|
+
pass
|
206
|
+
|
207
|
+
|
208
|
+
def render_path(path_to_item):
|
209
|
+
"""Returns a string representation of a path"""
|
210
|
+
result = ""
|
211
|
+
for pth in path_to_item:
|
212
|
+
if isinstance(pth, int):
|
213
|
+
result += "[{0}]".format(pth)
|
214
|
+
else:
|
215
|
+
result += "['{0}']".format(pth)
|
216
|
+
return result
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
# flake8: noqa
|
4
|
+
"""
|
5
|
+
Klines Service API
|
6
|
+
|
7
|
+
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\" } ```
|
8
|
+
|
9
|
+
The version of the OpenAPI document: 1.0.0
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
|
+
|
12
|
+
Do not edit the class manually.
|
13
|
+
""" # noqa: E501
|
14
|
+
|
15
|
+
|
16
|
+
# import models into model package
|
17
|
+
from crypticorn.klines.client.models.base_response_health_check_response import BaseResponseHealthCheckResponse
|
18
|
+
from crypticorn.klines.client.models.base_response_list_funding_rate_response import BaseResponseListFundingRateResponse
|
19
|
+
from crypticorn.klines.client.models.base_response_list_str import BaseResponseListStr
|
20
|
+
from crypticorn.klines.client.models.base_response_ohlcv_response import BaseResponseOHLCVResponse
|
21
|
+
from crypticorn.klines.client.models.error_response import ErrorResponse
|
22
|
+
from crypticorn.klines.client.models.exchange import Exchange
|
23
|
+
from crypticorn.klines.client.models.funding_rate_response import FundingRateResponse
|
24
|
+
from crypticorn.klines.client.models.http_validation_error import HTTPValidationError
|
25
|
+
from crypticorn.klines.client.models.health_check_response import HealthCheckResponse
|
26
|
+
from crypticorn.klines.client.models.history_error_response import HistoryErrorResponse
|
27
|
+
from crypticorn.klines.client.models.history_no_data_response import HistoryNoDataResponse
|
28
|
+
from crypticorn.klines.client.models.history_success_response import HistorySuccessResponse
|
29
|
+
from crypticorn.klines.client.models.market import Market
|
30
|
+
from crypticorn.klines.client.models.ohlcv_response import OHLCVResponse
|
31
|
+
from crypticorn.klines.client.models.resolution import Resolution
|
32
|
+
from crypticorn.klines.client.models.response_get_history_udf_history_get import ResponseGetHistoryUdfHistoryGet
|
33
|
+
from crypticorn.klines.client.models.search_symbol_response import SearchSymbolResponse
|
34
|
+
from crypticorn.klines.client.models.sort_direction import SortDirection
|
35
|
+
from crypticorn.klines.client.models.symbol_group_response import SymbolGroupResponse
|
36
|
+
from crypticorn.klines.client.models.symbol_info_response import SymbolInfoResponse
|
37
|
+
from crypticorn.klines.client.models.symbol_type import SymbolType
|
38
|
+
from crypticorn.klines.client.models.timeframe import Timeframe
|
39
|
+
from crypticorn.klines.client.models.udf_config_response import UDFConfigResponse
|
40
|
+
from crypticorn.klines.client.models.validation_error import ValidationError
|
41
|
+
from crypticorn.klines.client.models.validation_error_loc_inner import ValidationErrorLocInner
|
@@ -0,0 +1,108 @@
|
|
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
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from datetime import datetime
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from crypticorn.klines.client.models.health_check_response import HealthCheckResponse
|
24
|
+
from typing import Optional, Set
|
25
|
+
from typing_extensions import Self
|
26
|
+
|
27
|
+
class BaseResponseHealthCheckResponse(BaseModel):
|
28
|
+
"""
|
29
|
+
BaseResponseHealthCheckResponse
|
30
|
+
""" # noqa: E501
|
31
|
+
success: Optional[StrictBool] = True
|
32
|
+
message: Optional[StrictStr] = None
|
33
|
+
data: Optional[HealthCheckResponse] = None
|
34
|
+
timestamp: Optional[datetime] = None
|
35
|
+
__properties: ClassVar[List[str]] = ["success", "message", "data", "timestamp"]
|
36
|
+
|
37
|
+
model_config = ConfigDict(
|
38
|
+
populate_by_name=True,
|
39
|
+
validate_assignment=True,
|
40
|
+
protected_namespaces=(),
|
41
|
+
)
|
42
|
+
|
43
|
+
|
44
|
+
def to_str(self) -> str:
|
45
|
+
"""Returns the string representation of the model using alias"""
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
47
|
+
|
48
|
+
def to_json(self) -> str:
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
51
|
+
return json.dumps(self.to_dict())
|
52
|
+
|
53
|
+
@classmethod
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
55
|
+
"""Create an instance of BaseResponseHealthCheckResponse from a JSON string"""
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
57
|
+
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
60
|
+
|
61
|
+
This has the following differences from calling pydantic's
|
62
|
+
`self.model_dump(by_alias=True)`:
|
63
|
+
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
65
|
+
were set at model initialization. Other fields with value `None`
|
66
|
+
are ignored.
|
67
|
+
"""
|
68
|
+
excluded_fields: Set[str] = set([
|
69
|
+
])
|
70
|
+
|
71
|
+
_dict = self.model_dump(
|
72
|
+
by_alias=True,
|
73
|
+
exclude=excluded_fields,
|
74
|
+
exclude_none=True,
|
75
|
+
)
|
76
|
+
# override the default output from pydantic by calling `to_dict()` of data
|
77
|
+
if self.data:
|
78
|
+
_dict['data'] = self.data.to_dict()
|
79
|
+
# set to None if message (nullable) is None
|
80
|
+
# and model_fields_set contains the field
|
81
|
+
if self.message is None and "message" in self.model_fields_set:
|
82
|
+
_dict['message'] = None
|
83
|
+
|
84
|
+
# set to None if data (nullable) is None
|
85
|
+
# and model_fields_set contains the field
|
86
|
+
if self.data is None and "data" in self.model_fields_set:
|
87
|
+
_dict['data'] = None
|
88
|
+
|
89
|
+
return _dict
|
90
|
+
|
91
|
+
@classmethod
|
92
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
93
|
+
"""Create an instance of BaseResponseHealthCheckResponse from a dict"""
|
94
|
+
if obj is None:
|
95
|
+
return None
|
96
|
+
|
97
|
+
if not isinstance(obj, dict):
|
98
|
+
return cls.model_validate(obj)
|
99
|
+
|
100
|
+
_obj = cls.model_validate({
|
101
|
+
"success": obj.get("success") if obj.get("success") is not None else True,
|
102
|
+
"message": obj.get("message"),
|
103
|
+
"data": HealthCheckResponse.from_dict(obj["data"]) if obj.get("data") is not None else None,
|
104
|
+
"timestamp": obj.get("timestamp")
|
105
|
+
})
|
106
|
+
return _obj
|
107
|
+
|
108
|
+
|
@@ -0,0 +1,112 @@
|
|
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
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from datetime import datetime
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from crypticorn.klines.client.models.funding_rate_response import FundingRateResponse
|
24
|
+
from typing import Optional, Set
|
25
|
+
from typing_extensions import Self
|
26
|
+
|
27
|
+
class BaseResponseListFundingRateResponse(BaseModel):
|
28
|
+
"""
|
29
|
+
BaseResponseListFundingRateResponse
|
30
|
+
""" # noqa: E501
|
31
|
+
success: Optional[StrictBool] = True
|
32
|
+
message: Optional[StrictStr] = None
|
33
|
+
data: Optional[List[FundingRateResponse]] = None
|
34
|
+
timestamp: Optional[datetime] = None
|
35
|
+
__properties: ClassVar[List[str]] = ["success", "message", "data", "timestamp"]
|
36
|
+
|
37
|
+
model_config = ConfigDict(
|
38
|
+
populate_by_name=True,
|
39
|
+
validate_assignment=True,
|
40
|
+
protected_namespaces=(),
|
41
|
+
)
|
42
|
+
|
43
|
+
|
44
|
+
def to_str(self) -> str:
|
45
|
+
"""Returns the string representation of the model using alias"""
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
47
|
+
|
48
|
+
def to_json(self) -> str:
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
51
|
+
return json.dumps(self.to_dict())
|
52
|
+
|
53
|
+
@classmethod
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
55
|
+
"""Create an instance of BaseResponseListFundingRateResponse from a JSON string"""
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
57
|
+
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
60
|
+
|
61
|
+
This has the following differences from calling pydantic's
|
62
|
+
`self.model_dump(by_alias=True)`:
|
63
|
+
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
65
|
+
were set at model initialization. Other fields with value `None`
|
66
|
+
are ignored.
|
67
|
+
"""
|
68
|
+
excluded_fields: Set[str] = set([
|
69
|
+
])
|
70
|
+
|
71
|
+
_dict = self.model_dump(
|
72
|
+
by_alias=True,
|
73
|
+
exclude=excluded_fields,
|
74
|
+
exclude_none=True,
|
75
|
+
)
|
76
|
+
# override the default output from pydantic by calling `to_dict()` of each item in data (list)
|
77
|
+
_items = []
|
78
|
+
if self.data:
|
79
|
+
for _item_data in self.data:
|
80
|
+
if _item_data:
|
81
|
+
_items.append(_item_data.to_dict())
|
82
|
+
_dict['data'] = _items
|
83
|
+
# set to None if message (nullable) is None
|
84
|
+
# and model_fields_set contains the field
|
85
|
+
if self.message is None and "message" in self.model_fields_set:
|
86
|
+
_dict['message'] = None
|
87
|
+
|
88
|
+
# set to None if data (nullable) is None
|
89
|
+
# and model_fields_set contains the field
|
90
|
+
if self.data is None and "data" in self.model_fields_set:
|
91
|
+
_dict['data'] = None
|
92
|
+
|
93
|
+
return _dict
|
94
|
+
|
95
|
+
@classmethod
|
96
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
97
|
+
"""Create an instance of BaseResponseListFundingRateResponse from a dict"""
|
98
|
+
if obj is None:
|
99
|
+
return None
|
100
|
+
|
101
|
+
if not isinstance(obj, dict):
|
102
|
+
return cls.model_validate(obj)
|
103
|
+
|
104
|
+
_obj = cls.model_validate({
|
105
|
+
"success": obj.get("success") if obj.get("success") is not None else True,
|
106
|
+
"message": obj.get("message"),
|
107
|
+
"data": [FundingRateResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None,
|
108
|
+
"timestamp": obj.get("timestamp")
|
109
|
+
})
|
110
|
+
return _obj
|
111
|
+
|
112
|
+
|
@@ -0,0 +1,104 @@
|
|
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
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from datetime import datetime
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class BaseResponseListStr(BaseModel):
|
27
|
+
"""
|
28
|
+
BaseResponseListStr
|
29
|
+
""" # noqa: E501
|
30
|
+
success: Optional[StrictBool] = True
|
31
|
+
message: Optional[StrictStr] = None
|
32
|
+
data: Optional[List[StrictStr]] = None
|
33
|
+
timestamp: Optional[datetime] = None
|
34
|
+
__properties: ClassVar[List[str]] = ["success", "message", "data", "timestamp"]
|
35
|
+
|
36
|
+
model_config = ConfigDict(
|
37
|
+
populate_by_name=True,
|
38
|
+
validate_assignment=True,
|
39
|
+
protected_namespaces=(),
|
40
|
+
)
|
41
|
+
|
42
|
+
|
43
|
+
def to_str(self) -> str:
|
44
|
+
"""Returns the string representation of the model using alias"""
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
46
|
+
|
47
|
+
def to_json(self) -> str:
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
49
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
50
|
+
return json.dumps(self.to_dict())
|
51
|
+
|
52
|
+
@classmethod
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
54
|
+
"""Create an instance of BaseResponseListStr from a JSON string"""
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
56
|
+
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
59
|
+
|
60
|
+
This has the following differences from calling pydantic's
|
61
|
+
`self.model_dump(by_alias=True)`:
|
62
|
+
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
64
|
+
were set at model initialization. Other fields with value `None`
|
65
|
+
are ignored.
|
66
|
+
"""
|
67
|
+
excluded_fields: Set[str] = set([
|
68
|
+
])
|
69
|
+
|
70
|
+
_dict = self.model_dump(
|
71
|
+
by_alias=True,
|
72
|
+
exclude=excluded_fields,
|
73
|
+
exclude_none=True,
|
74
|
+
)
|
75
|
+
# set to None if message (nullable) is None
|
76
|
+
# and model_fields_set contains the field
|
77
|
+
if self.message is None and "message" in self.model_fields_set:
|
78
|
+
_dict['message'] = None
|
79
|
+
|
80
|
+
# set to None if data (nullable) is None
|
81
|
+
# and model_fields_set contains the field
|
82
|
+
if self.data is None and "data" in self.model_fields_set:
|
83
|
+
_dict['data'] = None
|
84
|
+
|
85
|
+
return _dict
|
86
|
+
|
87
|
+
@classmethod
|
88
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
89
|
+
"""Create an instance of BaseResponseListStr from a dict"""
|
90
|
+
if obj is None:
|
91
|
+
return None
|
92
|
+
|
93
|
+
if not isinstance(obj, dict):
|
94
|
+
return cls.model_validate(obj)
|
95
|
+
|
96
|
+
_obj = cls.model_validate({
|
97
|
+
"success": obj.get("success") if obj.get("success") is not None else True,
|
98
|
+
"message": obj.get("message"),
|
99
|
+
"data": obj.get("data"),
|
100
|
+
"timestamp": obj.get("timestamp")
|
101
|
+
})
|
102
|
+
return _obj
|
103
|
+
|
104
|
+
|
@@ -0,0 +1,108 @@
|
|
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
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from datetime import datetime
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from crypticorn.klines.client.models.ohlcv_response import OHLCVResponse
|
24
|
+
from typing import Optional, Set
|
25
|
+
from typing_extensions import Self
|
26
|
+
|
27
|
+
class BaseResponseOHLCVResponse(BaseModel):
|
28
|
+
"""
|
29
|
+
BaseResponseOHLCVResponse
|
30
|
+
""" # noqa: E501
|
31
|
+
success: Optional[StrictBool] = True
|
32
|
+
message: Optional[StrictStr] = None
|
33
|
+
data: Optional[OHLCVResponse] = None
|
34
|
+
timestamp: Optional[datetime] = None
|
35
|
+
__properties: ClassVar[List[str]] = ["success", "message", "data", "timestamp"]
|
36
|
+
|
37
|
+
model_config = ConfigDict(
|
38
|
+
populate_by_name=True,
|
39
|
+
validate_assignment=True,
|
40
|
+
protected_namespaces=(),
|
41
|
+
)
|
42
|
+
|
43
|
+
|
44
|
+
def to_str(self) -> str:
|
45
|
+
"""Returns the string representation of the model using alias"""
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
47
|
+
|
48
|
+
def to_json(self) -> str:
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
51
|
+
return json.dumps(self.to_dict())
|
52
|
+
|
53
|
+
@classmethod
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
55
|
+
"""Create an instance of BaseResponseOHLCVResponse from a JSON string"""
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
57
|
+
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
60
|
+
|
61
|
+
This has the following differences from calling pydantic's
|
62
|
+
`self.model_dump(by_alias=True)`:
|
63
|
+
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
65
|
+
were set at model initialization. Other fields with value `None`
|
66
|
+
are ignored.
|
67
|
+
"""
|
68
|
+
excluded_fields: Set[str] = set([
|
69
|
+
])
|
70
|
+
|
71
|
+
_dict = self.model_dump(
|
72
|
+
by_alias=True,
|
73
|
+
exclude=excluded_fields,
|
74
|
+
exclude_none=True,
|
75
|
+
)
|
76
|
+
# override the default output from pydantic by calling `to_dict()` of data
|
77
|
+
if self.data:
|
78
|
+
_dict['data'] = self.data.to_dict()
|
79
|
+
# set to None if message (nullable) is None
|
80
|
+
# and model_fields_set contains the field
|
81
|
+
if self.message is None and "message" in self.model_fields_set:
|
82
|
+
_dict['message'] = None
|
83
|
+
|
84
|
+
# set to None if data (nullable) is None
|
85
|
+
# and model_fields_set contains the field
|
86
|
+
if self.data is None and "data" in self.model_fields_set:
|
87
|
+
_dict['data'] = None
|
88
|
+
|
89
|
+
return _dict
|
90
|
+
|
91
|
+
@classmethod
|
92
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
93
|
+
"""Create an instance of BaseResponseOHLCVResponse from a dict"""
|
94
|
+
if obj is None:
|
95
|
+
return None
|
96
|
+
|
97
|
+
if not isinstance(obj, dict):
|
98
|
+
return cls.model_validate(obj)
|
99
|
+
|
100
|
+
_obj = cls.model_validate({
|
101
|
+
"success": obj.get("success") if obj.get("success") is not None else True,
|
102
|
+
"message": obj.get("message"),
|
103
|
+
"data": OHLCVResponse.from_dict(obj["data"]) if obj.get("data") is not None else None,
|
104
|
+
"timestamp": obj.get("timestamp")
|
105
|
+
})
|
106
|
+
return _obj
|
107
|
+
|
108
|
+
|