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,257 @@
|
|
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
|
+
|
15
|
+
import io
|
16
|
+
import json
|
17
|
+
import re
|
18
|
+
import ssl
|
19
|
+
|
20
|
+
import urllib3
|
21
|
+
|
22
|
+
from crypticorn.trade.client.exceptions import ApiException, ApiValueError
|
23
|
+
|
24
|
+
SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"}
|
25
|
+
RESTResponseType = urllib3.HTTPResponse
|
26
|
+
|
27
|
+
|
28
|
+
def is_socks_proxy_url(url):
|
29
|
+
if url is None:
|
30
|
+
return False
|
31
|
+
split_section = url.split("://")
|
32
|
+
if len(split_section) < 2:
|
33
|
+
return False
|
34
|
+
else:
|
35
|
+
return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES
|
36
|
+
|
37
|
+
|
38
|
+
class RESTResponse(io.IOBase):
|
39
|
+
|
40
|
+
def __init__(self, resp) -> None:
|
41
|
+
self.response = resp
|
42
|
+
self.status = resp.status
|
43
|
+
self.reason = resp.reason
|
44
|
+
self.data = None
|
45
|
+
|
46
|
+
def read(self):
|
47
|
+
if self.data is None:
|
48
|
+
self.data = self.response.data
|
49
|
+
return self.data
|
50
|
+
|
51
|
+
def getheaders(self):
|
52
|
+
"""Returns a dictionary of the response headers."""
|
53
|
+
return self.response.headers
|
54
|
+
|
55
|
+
def getheader(self, name, default=None):
|
56
|
+
"""Returns a given response header."""
|
57
|
+
return self.response.headers.get(name, default)
|
58
|
+
|
59
|
+
|
60
|
+
class RESTClientObject:
|
61
|
+
|
62
|
+
def __init__(self, configuration) -> None:
|
63
|
+
# urllib3.PoolManager will pass all kw parameters to connectionpool
|
64
|
+
# https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501
|
65
|
+
# https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501
|
66
|
+
# Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501
|
67
|
+
|
68
|
+
# cert_reqs
|
69
|
+
if configuration.verify_ssl:
|
70
|
+
cert_reqs = ssl.CERT_REQUIRED
|
71
|
+
else:
|
72
|
+
cert_reqs = ssl.CERT_NONE
|
73
|
+
|
74
|
+
pool_args = {
|
75
|
+
"cert_reqs": cert_reqs,
|
76
|
+
"ca_certs": configuration.ssl_ca_cert,
|
77
|
+
"cert_file": configuration.cert_file,
|
78
|
+
"key_file": configuration.key_file,
|
79
|
+
}
|
80
|
+
if configuration.assert_hostname is not None:
|
81
|
+
pool_args['assert_hostname'] = (
|
82
|
+
configuration.assert_hostname
|
83
|
+
)
|
84
|
+
|
85
|
+
if configuration.retries is not None:
|
86
|
+
pool_args['retries'] = configuration.retries
|
87
|
+
|
88
|
+
if configuration.tls_server_name:
|
89
|
+
pool_args['server_hostname'] = configuration.tls_server_name
|
90
|
+
|
91
|
+
|
92
|
+
if configuration.socket_options is not None:
|
93
|
+
pool_args['socket_options'] = configuration.socket_options
|
94
|
+
|
95
|
+
if configuration.connection_pool_maxsize is not None:
|
96
|
+
pool_args['maxsize'] = configuration.connection_pool_maxsize
|
97
|
+
|
98
|
+
# https pool manager
|
99
|
+
self.pool_manager: urllib3.PoolManager
|
100
|
+
|
101
|
+
if configuration.proxy:
|
102
|
+
if is_socks_proxy_url(configuration.proxy):
|
103
|
+
from urllib3.contrib.socks import SOCKSProxyManager
|
104
|
+
pool_args["proxy_url"] = configuration.proxy
|
105
|
+
pool_args["headers"] = configuration.proxy_headers
|
106
|
+
self.pool_manager = SOCKSProxyManager(**pool_args)
|
107
|
+
else:
|
108
|
+
pool_args["proxy_url"] = configuration.proxy
|
109
|
+
pool_args["proxy_headers"] = configuration.proxy_headers
|
110
|
+
self.pool_manager = urllib3.ProxyManager(**pool_args)
|
111
|
+
else:
|
112
|
+
self.pool_manager = urllib3.PoolManager(**pool_args)
|
113
|
+
|
114
|
+
def request(
|
115
|
+
self,
|
116
|
+
method,
|
117
|
+
url,
|
118
|
+
headers=None,
|
119
|
+
body=None,
|
120
|
+
post_params=None,
|
121
|
+
_request_timeout=None
|
122
|
+
):
|
123
|
+
"""Perform requests.
|
124
|
+
|
125
|
+
:param method: http request method
|
126
|
+
:param url: http request url
|
127
|
+
:param headers: http request headers
|
128
|
+
:param body: request json body, for `application/json`
|
129
|
+
:param post_params: request post parameters,
|
130
|
+
`application/x-www-form-urlencoded`
|
131
|
+
and `multipart/form-data`
|
132
|
+
:param _request_timeout: timeout setting for this request. If one
|
133
|
+
number provided, it will be total request
|
134
|
+
timeout. It can also be a pair (tuple) of
|
135
|
+
(connection, read) timeouts.
|
136
|
+
"""
|
137
|
+
method = method.upper()
|
138
|
+
assert method in [
|
139
|
+
'GET',
|
140
|
+
'HEAD',
|
141
|
+
'DELETE',
|
142
|
+
'POST',
|
143
|
+
'PUT',
|
144
|
+
'PATCH',
|
145
|
+
'OPTIONS'
|
146
|
+
]
|
147
|
+
|
148
|
+
if post_params and body:
|
149
|
+
raise ApiValueError(
|
150
|
+
"body parameter cannot be used with post_params parameter."
|
151
|
+
)
|
152
|
+
|
153
|
+
post_params = post_params or {}
|
154
|
+
headers = headers or {}
|
155
|
+
|
156
|
+
timeout = None
|
157
|
+
if _request_timeout:
|
158
|
+
if isinstance(_request_timeout, (int, float)):
|
159
|
+
timeout = urllib3.Timeout(total=_request_timeout)
|
160
|
+
elif (
|
161
|
+
isinstance(_request_timeout, tuple)
|
162
|
+
and len(_request_timeout) == 2
|
163
|
+
):
|
164
|
+
timeout = urllib3.Timeout(
|
165
|
+
connect=_request_timeout[0],
|
166
|
+
read=_request_timeout[1]
|
167
|
+
)
|
168
|
+
|
169
|
+
try:
|
170
|
+
# For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
|
171
|
+
if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
|
172
|
+
|
173
|
+
# no content type provided or payload is json
|
174
|
+
content_type = headers.get('Content-Type')
|
175
|
+
if (
|
176
|
+
not content_type
|
177
|
+
or re.search('json', content_type, re.IGNORECASE)
|
178
|
+
):
|
179
|
+
request_body = None
|
180
|
+
if body is not None:
|
181
|
+
request_body = json.dumps(body)
|
182
|
+
r = self.pool_manager.request(
|
183
|
+
method,
|
184
|
+
url,
|
185
|
+
body=request_body,
|
186
|
+
timeout=timeout,
|
187
|
+
headers=headers,
|
188
|
+
preload_content=False
|
189
|
+
)
|
190
|
+
elif content_type == 'application/x-www-form-urlencoded':
|
191
|
+
r = self.pool_manager.request(
|
192
|
+
method,
|
193
|
+
url,
|
194
|
+
fields=post_params,
|
195
|
+
encode_multipart=False,
|
196
|
+
timeout=timeout,
|
197
|
+
headers=headers,
|
198
|
+
preload_content=False
|
199
|
+
)
|
200
|
+
elif content_type == 'multipart/form-data':
|
201
|
+
# must del headers['Content-Type'], or the correct
|
202
|
+
# Content-Type which generated by urllib3 will be
|
203
|
+
# overwritten.
|
204
|
+
del headers['Content-Type']
|
205
|
+
# Ensures that dict objects are serialized
|
206
|
+
post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params]
|
207
|
+
r = self.pool_manager.request(
|
208
|
+
method,
|
209
|
+
url,
|
210
|
+
fields=post_params,
|
211
|
+
encode_multipart=True,
|
212
|
+
timeout=timeout,
|
213
|
+
headers=headers,
|
214
|
+
preload_content=False
|
215
|
+
)
|
216
|
+
# Pass a `string` parameter directly in the body to support
|
217
|
+
# other content types than JSON when `body` argument is
|
218
|
+
# provided in serialized form.
|
219
|
+
elif isinstance(body, str) or isinstance(body, bytes):
|
220
|
+
r = self.pool_manager.request(
|
221
|
+
method,
|
222
|
+
url,
|
223
|
+
body=body,
|
224
|
+
timeout=timeout,
|
225
|
+
headers=headers,
|
226
|
+
preload_content=False
|
227
|
+
)
|
228
|
+
elif headers['Content-Type'].startswith('text/') and isinstance(body, bool):
|
229
|
+
request_body = "true" if body else "false"
|
230
|
+
r = self.pool_manager.request(
|
231
|
+
method,
|
232
|
+
url,
|
233
|
+
body=request_body,
|
234
|
+
preload_content=False,
|
235
|
+
timeout=timeout,
|
236
|
+
headers=headers)
|
237
|
+
else:
|
238
|
+
# Cannot generate the request from given parameters
|
239
|
+
msg = """Cannot prepare a request message for provided
|
240
|
+
arguments. Please check that your arguments match
|
241
|
+
declared content type."""
|
242
|
+
raise ApiException(status=0, reason=msg)
|
243
|
+
# For `GET`, `HEAD`
|
244
|
+
else:
|
245
|
+
r = self.pool_manager.request(
|
246
|
+
method,
|
247
|
+
url,
|
248
|
+
fields={},
|
249
|
+
timeout=timeout,
|
250
|
+
headers=headers,
|
251
|
+
preload_content=False
|
252
|
+
)
|
253
|
+
except urllib3.exceptions.SSLError as e:
|
254
|
+
msg = "\n".join([type(e).__name__, str(e)])
|
255
|
+
raise ApiException(status=0, reason=msg)
|
256
|
+
|
257
|
+
return RESTResponse(r)
|
crypticorn/trade/main.py
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
from crypticorn.trade.client import (
|
2
|
+
BotsApi,
|
3
|
+
ExchangesApi,
|
4
|
+
NotificationsApi,
|
5
|
+
OrdersApi,
|
6
|
+
StatusApi,
|
7
|
+
StrategiesApi,
|
8
|
+
TradingActionsApi,
|
9
|
+
FuturesTradingPanelApi,
|
10
|
+
APIKeysApi,
|
11
|
+
ApiClient,
|
12
|
+
Configuration,
|
13
|
+
)
|
14
|
+
|
15
|
+
|
16
|
+
class TradeClient:
|
17
|
+
"""
|
18
|
+
A client for interacting with the Crypticorn Trade API.
|
19
|
+
"""
|
20
|
+
|
21
|
+
def __init__(self, base_url: str = None, api_key: str = None, jwt: str = None):
|
22
|
+
# Configure Trade client
|
23
|
+
self.host = f"{base_url}/v1/trade"
|
24
|
+
config = Configuration(
|
25
|
+
host=self.host,
|
26
|
+
access_token=jwt, # at the moment we only support JWT auth
|
27
|
+
)
|
28
|
+
base_client = ApiClient(configuration=config)
|
29
|
+
# Instantiate all the endpoint clients
|
30
|
+
self.bots = BotsApi(base_client)
|
31
|
+
self.exchanges = ExchangesApi(base_client)
|
32
|
+
self.notifications = NotificationsApi(base_client)
|
33
|
+
self.orders = OrdersApi(base_client)
|
34
|
+
self.status = StatusApi(base_client)
|
35
|
+
self.strategies = StrategiesApi(base_client)
|
36
|
+
self.trading_actions = TradingActionsApi(base_client)
|
37
|
+
self.futures = FuturesTradingPanelApi(base_client)
|
38
|
+
self.api_keys = APIKeysApi(base_client)
|
File without changes
|
@@ -0,0 +1,87 @@
|
|
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
|
+
|
15
|
+
import unittest
|
16
|
+
|
17
|
+
from crypticorn.trade.client.models.action_model import ActionModel
|
18
|
+
|
19
|
+
class TestActionModel(unittest.TestCase):
|
20
|
+
"""ActionModel unit test stubs"""
|
21
|
+
|
22
|
+
def setUp(self):
|
23
|
+
pass
|
24
|
+
|
25
|
+
def tearDown(self):
|
26
|
+
pass
|
27
|
+
|
28
|
+
def make_instance(self, include_optional) -> ActionModel:
|
29
|
+
"""Test ActionModel
|
30
|
+
include_optional is a boolean, when False only required
|
31
|
+
params are included, when True both required and
|
32
|
+
optional params are included """
|
33
|
+
# uncomment below to create an instance of `ActionModel`
|
34
|
+
"""
|
35
|
+
model = ActionModel()
|
36
|
+
if include_optional:
|
37
|
+
return ActionModel(
|
38
|
+
id = '',
|
39
|
+
execution_id = '',
|
40
|
+
open_order_execution_id = '',
|
41
|
+
position_id = '',
|
42
|
+
client_order_id = '',
|
43
|
+
action_type = 'open_long',
|
44
|
+
market_type = 'spot',
|
45
|
+
strategy_id = '',
|
46
|
+
symbol = '',
|
47
|
+
is_limit = True,
|
48
|
+
limit_price = 1.337,
|
49
|
+
allocation = 1.337,
|
50
|
+
take_profit = [
|
51
|
+
client.models.tpsl.TPSL(
|
52
|
+
price_delta = 0.0,
|
53
|
+
price = 1.337,
|
54
|
+
allocation = 0.0,
|
55
|
+
execution_id = '',
|
56
|
+
client_order_id = '', )
|
57
|
+
],
|
58
|
+
stop_loss = [
|
59
|
+
client.models.tpsl.TPSL(
|
60
|
+
price_delta = 0.0,
|
61
|
+
price = 1.337,
|
62
|
+
allocation = 0.0,
|
63
|
+
execution_id = '',
|
64
|
+
client_order_id = '', )
|
65
|
+
],
|
66
|
+
expiry_timestamp = 56,
|
67
|
+
leverage = 1.0,
|
68
|
+
margin_mode = 'isolated',
|
69
|
+
timestamp = 56
|
70
|
+
)
|
71
|
+
else:
|
72
|
+
return ActionModel(
|
73
|
+
action_type = 'open_long',
|
74
|
+
market_type = 'spot',
|
75
|
+
strategy_id = '',
|
76
|
+
symbol = '',
|
77
|
+
leverage = 1.0,
|
78
|
+
)
|
79
|
+
"""
|
80
|
+
|
81
|
+
def testActionModel(self):
|
82
|
+
"""Test ActionModel"""
|
83
|
+
# inst_req_only = self.make_instance(include_optional=False)
|
84
|
+
# inst_req_and_optional = self.make_instance(include_optional=True)
|
85
|
+
|
86
|
+
if __name__ == '__main__':
|
87
|
+
unittest.main()
|
@@ -0,0 +1,33 @@
|
|
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
|
+
|
15
|
+
import unittest
|
16
|
+
|
17
|
+
from crypticorn.trade.client.models.api_error_identifier import ApiErrorIdentifier
|
18
|
+
|
19
|
+
class TestApiErrorIdentifier(unittest.TestCase):
|
20
|
+
"""ApiErrorIdentifier unit test stubs"""
|
21
|
+
|
22
|
+
def setUp(self):
|
23
|
+
pass
|
24
|
+
|
25
|
+
def tearDown(self):
|
26
|
+
pass
|
27
|
+
|
28
|
+
def testApiErrorIdentifier(self):
|
29
|
+
"""Test ApiErrorIdentifier"""
|
30
|
+
# inst = ApiErrorIdentifier()
|
31
|
+
|
32
|
+
if __name__ == '__main__':
|
33
|
+
unittest.main()
|
@@ -0,0 +1,61 @@
|
|
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
|
+
|
15
|
+
import unittest
|
16
|
+
|
17
|
+
from crypticorn.trade.client.models.api_key_model import APIKeyModel
|
18
|
+
|
19
|
+
class TestAPIKeyModel(unittest.TestCase):
|
20
|
+
"""APIKeyModel unit test stubs"""
|
21
|
+
|
22
|
+
def setUp(self):
|
23
|
+
pass
|
24
|
+
|
25
|
+
def tearDown(self):
|
26
|
+
pass
|
27
|
+
|
28
|
+
def make_instance(self, include_optional) -> APIKeyModel:
|
29
|
+
"""Test APIKeyModel
|
30
|
+
include_optional is a boolean, when False only required
|
31
|
+
params are included, when True both required and
|
32
|
+
optional params are included """
|
33
|
+
# uncomment below to create an instance of `APIKeyModel`
|
34
|
+
"""
|
35
|
+
model = APIKeyModel()
|
36
|
+
if include_optional:
|
37
|
+
return APIKeyModel(
|
38
|
+
id = '',
|
39
|
+
exchange = '',
|
40
|
+
api_key = '',
|
41
|
+
secret = '',
|
42
|
+
passphrase = '',
|
43
|
+
label = '',
|
44
|
+
enabled = True,
|
45
|
+
created_at = 56,
|
46
|
+
user_id = ''
|
47
|
+
)
|
48
|
+
else:
|
49
|
+
return APIKeyModel(
|
50
|
+
exchange = '',
|
51
|
+
label = '',
|
52
|
+
)
|
53
|
+
"""
|
54
|
+
|
55
|
+
def testAPIKeyModel(self):
|
56
|
+
"""Test APIKeyModel"""
|
57
|
+
# inst_req_only = self.make_instance(include_optional=False)
|
58
|
+
# inst_req_and_optional = self.make_instance(include_optional=True)
|
59
|
+
|
60
|
+
if __name__ == '__main__':
|
61
|
+
unittest.main()
|
@@ -0,0 +1,66 @@
|
|
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
|
+
|
15
|
+
import unittest
|
16
|
+
|
17
|
+
from crypticorn.trade.client.api.api_keys_api import APIKeysApi
|
18
|
+
|
19
|
+
|
20
|
+
class TestAPIKeysApi(unittest.TestCase):
|
21
|
+
"""APIKeysApi unit test stubs"""
|
22
|
+
|
23
|
+
def setUp(self) -> None:
|
24
|
+
self.api = APIKeysApi()
|
25
|
+
|
26
|
+
def tearDown(self) -> None:
|
27
|
+
pass
|
28
|
+
|
29
|
+
def test_create_api_key(self) -> None:
|
30
|
+
"""Test case for create_api_key
|
31
|
+
|
32
|
+
Post Api Key
|
33
|
+
"""
|
34
|
+
pass
|
35
|
+
|
36
|
+
def test_delete_api_key(self) -> None:
|
37
|
+
"""Test case for delete_api_key
|
38
|
+
|
39
|
+
Delete Api Key
|
40
|
+
"""
|
41
|
+
pass
|
42
|
+
|
43
|
+
def test_get_api_key_by_id(self) -> None:
|
44
|
+
"""Test case for get_api_key_by_id
|
45
|
+
|
46
|
+
Get Api Key By Id
|
47
|
+
"""
|
48
|
+
pass
|
49
|
+
|
50
|
+
def test_get_api_keys(self) -> None:
|
51
|
+
"""Test case for get_api_keys
|
52
|
+
|
53
|
+
Get Api Keys
|
54
|
+
"""
|
55
|
+
pass
|
56
|
+
|
57
|
+
def test_update_api_key(self) -> None:
|
58
|
+
"""Test case for update_api_key
|
59
|
+
|
60
|
+
Put Api Key
|
61
|
+
"""
|
62
|
+
pass
|
63
|
+
|
64
|
+
|
65
|
+
if __name__ == '__main__':
|
66
|
+
unittest.main()
|
@@ -0,0 +1,64 @@
|
|
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
|
+
|
15
|
+
import unittest
|
16
|
+
|
17
|
+
from crypticorn.trade.client.models.bot_model import BotModel
|
18
|
+
|
19
|
+
class TestBotModel(unittest.TestCase):
|
20
|
+
"""BotModel unit test stubs"""
|
21
|
+
|
22
|
+
def setUp(self):
|
23
|
+
pass
|
24
|
+
|
25
|
+
def tearDown(self):
|
26
|
+
pass
|
27
|
+
|
28
|
+
def make_instance(self, include_optional) -> BotModel:
|
29
|
+
"""Test BotModel
|
30
|
+
include_optional is a boolean, when False only required
|
31
|
+
params are included, when True both required and
|
32
|
+
optional params are included """
|
33
|
+
# uncomment below to create an instance of `BotModel`
|
34
|
+
"""
|
35
|
+
model = BotModel()
|
36
|
+
if include_optional:
|
37
|
+
return BotModel(
|
38
|
+
id = '',
|
39
|
+
name = '',
|
40
|
+
strategy_id = '',
|
41
|
+
api_key_id = '',
|
42
|
+
initial_allocation = 1.337,
|
43
|
+
current_allocation = 1.337,
|
44
|
+
enabled = True,
|
45
|
+
deleted = True,
|
46
|
+
user_id = ''
|
47
|
+
)
|
48
|
+
else:
|
49
|
+
return BotModel(
|
50
|
+
name = '',
|
51
|
+
strategy_id = '',
|
52
|
+
api_key_id = '',
|
53
|
+
initial_allocation = 1.337,
|
54
|
+
enabled = True,
|
55
|
+
)
|
56
|
+
"""
|
57
|
+
|
58
|
+
def testBotModel(self):
|
59
|
+
"""Test BotModel"""
|
60
|
+
# inst_req_only = self.make_instance(include_optional=False)
|
61
|
+
# inst_req_and_optional = self.make_instance(include_optional=True)
|
62
|
+
|
63
|
+
if __name__ == '__main__':
|
64
|
+
unittest.main()
|
@@ -0,0 +1,59 @@
|
|
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
|
+
|
15
|
+
import unittest
|
16
|
+
|
17
|
+
from crypticorn.trade.client.api.bots_api import BotsApi
|
18
|
+
|
19
|
+
|
20
|
+
class TestBotsApi(unittest.TestCase):
|
21
|
+
"""BotsApi unit test stubs"""
|
22
|
+
|
23
|
+
def setUp(self) -> None:
|
24
|
+
self.api = BotsApi()
|
25
|
+
|
26
|
+
def tearDown(self) -> None:
|
27
|
+
pass
|
28
|
+
|
29
|
+
def test_create_bot(self) -> None:
|
30
|
+
"""Test case for create_bot
|
31
|
+
|
32
|
+
Create Bot
|
33
|
+
"""
|
34
|
+
pass
|
35
|
+
|
36
|
+
def test_delete_bot(self) -> None:
|
37
|
+
"""Test case for delete_bot
|
38
|
+
|
39
|
+
Delete Bot
|
40
|
+
"""
|
41
|
+
pass
|
42
|
+
|
43
|
+
def test_get_bots(self) -> None:
|
44
|
+
"""Test case for get_bots
|
45
|
+
|
46
|
+
Get Bots
|
47
|
+
"""
|
48
|
+
pass
|
49
|
+
|
50
|
+
def test_update_bot(self) -> None:
|
51
|
+
"""Test case for update_bot
|
52
|
+
|
53
|
+
Update Bot
|
54
|
+
"""
|
55
|
+
pass
|
56
|
+
|
57
|
+
|
58
|
+
if __name__ == '__main__':
|
59
|
+
unittest.main()
|