crypticorn 1.0.2rc3__py3-none-any.whl → 2.0.0__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/auth/__init__.py +2 -0
- crypticorn/auth/client/__init__.py +112 -0
- crypticorn/auth/client/api/__init__.py +8 -0
- crypticorn/auth/client/api/admin_api.py +522 -0
- crypticorn/auth/client/api/auth_api.py +2089 -0
- crypticorn/auth/client/api/service_api.py +309 -0
- crypticorn/auth/client/api/user_api.py +2540 -0
- crypticorn/auth/client/api/wallet_api.py +1698 -0
- crypticorn/auth/client/api_client.py +758 -0
- crypticorn/auth/client/api_response.py +20 -0
- crypticorn/auth/client/configuration.py +584 -0
- crypticorn/auth/client/exceptions.py +220 -0
- crypticorn/auth/client/models/__init__.py +91 -0
- crypticorn/auth/client/models/add_wallet200_response.py +86 -0
- crypticorn/auth/client/models/add_wallet_request.py +107 -0
- crypticorn/auth/client/models/authorize_user200_response.py +107 -0
- crypticorn/auth/client/models/authorize_user200_response_auth.py +101 -0
- crypticorn/auth/client/models/authorize_user_request.py +96 -0
- crypticorn/auth/client/models/create_user_request.py +114 -0
- crypticorn/auth/client/models/list_wallets200_response.py +137 -0
- crypticorn/auth/client/models/list_wallets200_response_balances_inner.py +115 -0
- crypticorn/auth/client/models/list_wallets200_response_balances_inner_sale_round.py +115 -0
- crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet.py +168 -0
- crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet_vesting_wallets_inner.py +191 -0
- crypticorn/auth/client/models/list_wallets200_response_data_inner.py +102 -0
- crypticorn/auth/client/models/list_wallets200_response_user_value.py +118 -0
- crypticorn/auth/client/models/logout_default_response.py +108 -0
- crypticorn/auth/client/models/logout_default_response_issues_inner.py +83 -0
- crypticorn/auth/client/models/refresh_token_info200_response.py +97 -0
- crypticorn/auth/client/models/refresh_token_info200_response_user_session.py +105 -0
- crypticorn/auth/client/models/resend_verification_email_request.py +84 -0
- crypticorn/auth/client/models/revoke_user_tokens_request.py +83 -0
- crypticorn/auth/client/models/rotate_tokens200_response.py +110 -0
- crypticorn/auth/client/models/token_info200_response.py +97 -0
- crypticorn/auth/client/models/unlink_wallet_request.py +83 -0
- crypticorn/auth/client/models/update_user_request.py +93 -0
- crypticorn/auth/client/models/user_reset_password_request.py +87 -0
- crypticorn/auth/client/models/user_set_password_request.py +89 -0
- crypticorn/auth/client/models/verify200_response.py +110 -0
- crypticorn/auth/client/models/verify_email200_response.py +107 -0
- crypticorn/auth/client/models/verify_email200_response_auth.py +101 -0
- crypticorn/auth/client/models/verify_email200_response_auth_auth.py +110 -0
- crypticorn/auth/client/models/verify_email_request.py +83 -0
- crypticorn/auth/client/models/verify_wallet_request.py +91 -0
- crypticorn/auth/client/models/wallet_verified200_response.py +83 -0
- crypticorn/auth/client/models/whoami200_response.py +104 -0
- crypticorn/auth/client/rest.py +195 -0
- crypticorn/auth/main.py +45 -0
- crypticorn/client.py +46 -8
- crypticorn/common/__init__.py +5 -0
- crypticorn/common/auth.py +43 -0
- crypticorn/common/auth_client.py +163 -0
- crypticorn/common/errors.py +432 -0
- crypticorn/common/scopes.py +29 -0
- crypticorn/common/urls.py +25 -0
- crypticorn/hive/__init__.py +2 -1
- crypticorn/hive/client/__init__.py +57 -0
- crypticorn/hive/client/api/__init__.py +6 -0
- crypticorn/hive/client/api/data_api.py +594 -0
- crypticorn/hive/client/api/models_api.py +1680 -0
- crypticorn/hive/client/api/status_api.py +263 -0
- crypticorn/hive/client/api_client.py +758 -0
- crypticorn/hive/client/api_response.py +20 -0
- crypticorn/hive/client/configuration.py +612 -0
- crypticorn/hive/client/exceptions.py +220 -0
- crypticorn/hive/client/models/__init__.py +38 -0
- crypticorn/hive/client/models/coins.py +44 -0
- crypticorn/hive/client/models/data_download_response.py +113 -0
- crypticorn/hive/client/models/data_info.py +115 -0
- crypticorn/hive/client/models/data_value_value_value_inner.py +154 -0
- crypticorn/hive/client/models/data_version.py +35 -0
- crypticorn/hive/client/models/download_links.py +91 -0
- crypticorn/hive/client/models/evaluation.py +86 -0
- crypticorn/hive/client/models/evaluation_response.py +85 -0
- crypticorn/hive/client/models/feature_size.py +36 -0
- crypticorn/hive/client/models/http_validation_error.py +99 -0
- crypticorn/hive/client/models/model.py +133 -0
- crypticorn/hive/client/models/model_create.py +93 -0
- crypticorn/hive/client/models/model_status.py +35 -0
- crypticorn/hive/client/models/model_update.py +83 -0
- crypticorn/hive/client/models/target.py +36 -0
- crypticorn/hive/client/models/target_type.py +35 -0
- crypticorn/hive/client/models/validation_error.py +105 -0
- crypticorn/hive/client/models/validation_error_loc_inner.py +159 -0
- crypticorn/hive/client/py.typed +0 -0
- crypticorn/hive/client/rest.py +195 -0
- crypticorn/hive/main.py +27 -100
- crypticorn/klines/client/__init__.py +21 -7
- crypticorn/klines/client/api/__init__.py +0 -1
- crypticorn/klines/client/api/funding_rates_api.py +90 -79
- crypticorn/klines/client/api/health_check_api.py +29 -45
- crypticorn/klines/client/api/ohlcv_data_api.py +104 -87
- crypticorn/klines/client/api/symbols_api.py +36 -54
- crypticorn/klines/client/api/udf_api.py +228 -352
- crypticorn/klines/client/api_client.py +106 -148
- crypticorn/klines/client/api_response.py +2 -3
- crypticorn/klines/client/configuration.py +64 -50
- crypticorn/klines/client/exceptions.py +20 -16
- crypticorn/klines/client/models/__init__.py +21 -7
- crypticorn/klines/client/models/base_response_health_check_response.py +21 -15
- crypticorn/klines/client/models/base_response_list_funding_rate_response.py +21 -15
- crypticorn/klines/client/models/base_response_list_str.py +16 -14
- crypticorn/klines/client/models/base_response_ohlcv_response.py +21 -15
- crypticorn/klines/client/models/error_response.py +23 -15
- crypticorn/klines/client/models/exchange.py +11 -11
- crypticorn/klines/client/models/funding_rate_response.py +11 -11
- crypticorn/klines/client/models/health_check_response.py +14 -12
- crypticorn/klines/client/models/history_error_response.py +11 -11
- crypticorn/klines/client/models/history_no_data_response.py +16 -16
- crypticorn/klines/client/models/history_success_response.py +16 -16
- crypticorn/klines/client/models/http_validation_error.py +14 -10
- crypticorn/klines/client/models/market.py +2 -4
- crypticorn/klines/client/models/ohlcv_response.py +22 -15
- crypticorn/klines/client/models/resolution.py +5 -7
- crypticorn/klines/client/models/response_get_history_udf_history_get.py +71 -22
- crypticorn/klines/client/models/search_symbol_response.py +22 -15
- crypticorn/klines/client/models/sort_direction.py +2 -4
- crypticorn/klines/client/models/symbol_group_response.py +5 -9
- crypticorn/klines/client/models/symbol_info_response.py +40 -24
- crypticorn/klines/client/models/symbol_type.py +5 -10
- crypticorn/klines/client/models/timeframe.py +5 -7
- crypticorn/klines/client/models/udf_config_response.py +60 -21
- crypticorn/klines/client/models/validation_error.py +19 -13
- crypticorn/klines/client/models/validation_error_loc_inner.py +32 -11
- crypticorn/klines/client/rest.py +30 -41
- crypticorn/klines/main.py +52 -15
- crypticorn/pay/__init__.py +2 -0
- crypticorn/pay/client/__init__.py +52 -0
- crypticorn/pay/client/api/__init__.py +7 -0
- crypticorn/pay/client/api/now_payments_api.py +813 -0
- crypticorn/pay/client/api/payments_api.py +799 -0
- crypticorn/pay/client/api/products_api.py +891 -0
- crypticorn/pay/client/api/status_api.py +260 -0
- crypticorn/pay/client/api_client.py +758 -0
- crypticorn/pay/client/api_response.py +20 -0
- crypticorn/pay/client/configuration.py +612 -0
- crypticorn/pay/client/exceptions.py +220 -0
- crypticorn/pay/client/models/__init__.py +32 -0
- crypticorn/pay/client/models/api_status_res.py +83 -0
- crypticorn/pay/client/models/combined_payment_history.py +101 -0
- crypticorn/pay/client/models/create_invoice_req.py +188 -0
- crypticorn/pay/client/models/create_invoice_res.py +188 -0
- crypticorn/pay/client/models/currency.py +165 -0
- crypticorn/pay/client/models/estimate_price_req.py +91 -0
- crypticorn/pay/client/models/estimate_price_res.py +102 -0
- crypticorn/pay/client/models/get_currencies_res.py +99 -0
- crypticorn/pay/client/models/get_payment_status_res.py +222 -0
- crypticorn/pay/client/models/get_payments_list_res.py +109 -0
- crypticorn/pay/client/models/http_validation_error.py +99 -0
- crypticorn/pay/client/models/min_amount_req.py +124 -0
- crypticorn/pay/client/models/min_amount_res.py +105 -0
- crypticorn/pay/client/models/now_api_status_res.py +83 -0
- crypticorn/pay/client/models/now_create_invoice_req.py +188 -0
- crypticorn/pay/client/models/now_create_invoice_res.py +188 -0
- crypticorn/pay/client/models/now_fee_structure.py +104 -0
- crypticorn/pay/client/models/now_payment_model.py +124 -0
- crypticorn/pay/client/models/now_payment_status.py +42 -0
- crypticorn/pay/client/models/now_webhook_payload.py +181 -0
- crypticorn/pay/client/models/payment.py +231 -0
- crypticorn/pay/client/models/payment_status.py +40 -0
- crypticorn/pay/client/models/product.py +87 -0
- crypticorn/pay/client/models/product_model.py +119 -0
- crypticorn/pay/client/models/product_subs_model.py +108 -0
- crypticorn/pay/client/models/services.py +34 -0
- crypticorn/pay/client/models/unified_payment_model.py +112 -0
- crypticorn/pay/client/models/validation_error.py +105 -0
- crypticorn/pay/client/models/validation_error_loc_inner.py +159 -0
- crypticorn/pay/client/py.typed +0 -0
- crypticorn/pay/client/rest.py +195 -0
- crypticorn/pay/main.py +35 -0
- crypticorn/trade/client/__init__.py +9 -4
- crypticorn/trade/client/api/__init__.py +0 -1
- crypticorn/trade/client/api/api_keys_api.py +203 -304
- crypticorn/trade/client/api/bots_api.py +177 -250
- crypticorn/trade/client/api/exchanges_api.py +38 -57
- crypticorn/trade/client/api/futures_trading_panel_api.py +223 -321
- crypticorn/trade/client/api/notifications_api.py +247 -364
- crypticorn/trade/client/api/orders_api.py +44 -63
- crypticorn/trade/client/api/status_api.py +35 -53
- crypticorn/trade/client/api/strategies_api.py +852 -64
- crypticorn/trade/client/api/trading_actions_api.py +126 -203
- crypticorn/trade/client/api_client.py +115 -154
- crypticorn/trade/client/api_response.py +2 -3
- crypticorn/trade/client/configuration.py +128 -90
- crypticorn/trade/client/exceptions.py +21 -17
- crypticorn/trade/client/models/__init__.py +9 -4
- crypticorn/trade/client/models/action_model.py +114 -50
- crypticorn/trade/client/models/api_error_identifier.py +60 -51
- crypticorn/trade/client/models/api_error_level.py +37 -0
- crypticorn/trade/client/models/api_error_type.py +37 -0
- crypticorn/trade/client/models/api_key_model.py +49 -28
- crypticorn/trade/client/models/bot_model.py +76 -31
- crypticorn/trade/client/models/bot_status.py +37 -0
- crypticorn/trade/client/models/exchange.py +3 -5
- crypticorn/trade/client/models/execution_ids.py +14 -14
- crypticorn/trade/client/models/futures_balance.py +39 -23
- crypticorn/trade/client/models/futures_trading_action.py +98 -46
- crypticorn/trade/client/models/http_validation_error.py +15 -11
- crypticorn/trade/client/models/margin_mode.py +3 -5
- crypticorn/trade/client/models/market_type.py +3 -5
- crypticorn/trade/client/models/notification_model.py +60 -27
- crypticorn/trade/client/models/notification_type.py +4 -6
- crypticorn/trade/client/models/order_model.py +125 -65
- crypticorn/trade/client/models/order_status.py +6 -8
- crypticorn/trade/client/models/post_futures_action.py +16 -12
- crypticorn/trade/client/models/strategy_exchange_info.py +11 -12
- crypticorn/trade/client/models/strategy_model.py +66 -27
- crypticorn/trade/client/models/strategy_model_input.py +160 -0
- crypticorn/trade/client/models/strategy_model_output.py +160 -0
- crypticorn/trade/client/models/tpsl.py +35 -21
- crypticorn/trade/client/models/trading_action_type.py +5 -7
- crypticorn/trade/client/models/update_notification.py +17 -13
- crypticorn/trade/client/models/validation_error.py +20 -14
- crypticorn/trade/client/models/validation_error_loc_inner.py +33 -12
- crypticorn/trade/client/rest.py +108 -170
- crypticorn/trade/main.py +26 -19
- crypticorn-2.0.0.dist-info/METADATA +74 -0
- crypticorn-2.0.0.dist-info/RECORD +226 -0
- {crypticorn-1.0.2rc3.dist-info → crypticorn-2.0.0.dist-info}/WHEEL +1 -1
- crypticorn/hive/requirements.txt +0 -4
- crypticorn/hive/utils.py +0 -109
- crypticorn/klines/requirements.txt +0 -4
- crypticorn/klines/test/test_base_response_health_check_response.py +0 -56
- crypticorn/klines/test/test_base_response_list_funding_rate_response.py +0 -59
- crypticorn/klines/test/test_base_response_list_str.py +0 -56
- crypticorn/klines/test/test_base_response_ohlcv_response.py +0 -72
- crypticorn/klines/test/test_error_response.py +0 -57
- crypticorn/klines/test/test_exchange.py +0 -56
- crypticorn/klines/test/test_funding_rate_response.py +0 -56
- crypticorn/klines/test/test_funding_rates_api.py +0 -38
- crypticorn/klines/test/test_health_check_api.py +0 -38
- crypticorn/klines/test/test_health_check_response.py +0 -52
- crypticorn/klines/test/test_history_error_response.py +0 -53
- crypticorn/klines/test/test_history_no_data_response.py +0 -69
- crypticorn/klines/test/test_history_success_response.py +0 -87
- crypticorn/klines/test/test_http_validation_error.py +0 -58
- crypticorn/klines/test/test_market.py +0 -33
- crypticorn/klines/test/test_ohlcv_data_api.py +0 -38
- crypticorn/klines/test/test_ohlcv_response.py +0 -86
- crypticorn/klines/test/test_resolution.py +0 -33
- crypticorn/klines/test/test_response_get_history_udf_history_get.py +0 -89
- crypticorn/klines/test/test_search_symbol_response.py +0 -62
- crypticorn/klines/test/test_sort_direction.py +0 -33
- crypticorn/klines/test/test_symbol_group_response.py +0 -53
- crypticorn/klines/test/test_symbol_info_response.py +0 -84
- crypticorn/klines/test/test_symbol_type.py +0 -54
- crypticorn/klines/test/test_symbols_api.py +0 -38
- crypticorn/klines/test/test_timeframe.py +0 -33
- crypticorn/klines/test/test_udf_api.py +0 -80
- crypticorn/klines/test/test_udf_config_response.py +0 -95
- crypticorn/klines/test/test_validation_error.py +0 -60
- crypticorn/klines/test/test_validation_error_loc_inner.py +0 -50
- crypticorn/trade/requirements.txt +0 -4
- crypticorn-1.0.2rc3.dist-info/LICENSE.md +0 -19
- crypticorn-1.0.2rc3.dist-info/METADATA +0 -47
- crypticorn-1.0.2rc3.dist-info/RECORD +0 -128
- /crypticorn/{klines/test/__init__.py → auth/client/py.typed} +0 -0
- {crypticorn-1.0.2rc3.dist-info → crypticorn-2.0.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,195 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Payment API
|
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
|
+
from typing import Optional, Union
|
20
|
+
|
21
|
+
import aiohttp
|
22
|
+
import aiohttp_retry
|
23
|
+
|
24
|
+
from crypticorn.pay.client.exceptions import ApiException, ApiValueError
|
25
|
+
|
26
|
+
RESTResponseType = aiohttp.ClientResponse
|
27
|
+
|
28
|
+
ALLOW_RETRY_METHODS = frozenset({"DELETE", "GET", "HEAD", "OPTIONS", "PUT", "TRACE"})
|
29
|
+
|
30
|
+
|
31
|
+
class RESTResponse(io.IOBase):
|
32
|
+
|
33
|
+
def __init__(self, resp) -> None:
|
34
|
+
self.response = resp
|
35
|
+
self.status = resp.status
|
36
|
+
self.reason = resp.reason
|
37
|
+
self.data = None
|
38
|
+
|
39
|
+
async def read(self):
|
40
|
+
if self.data is None:
|
41
|
+
self.data = await self.response.read()
|
42
|
+
return self.data
|
43
|
+
|
44
|
+
def getheaders(self):
|
45
|
+
"""Returns a CIMultiDictProxy of the response headers."""
|
46
|
+
return self.response.headers
|
47
|
+
|
48
|
+
def getheader(self, name, default=None):
|
49
|
+
"""Returns a given response header."""
|
50
|
+
return self.response.headers.get(name, default)
|
51
|
+
|
52
|
+
|
53
|
+
class RESTClientObject:
|
54
|
+
|
55
|
+
def __init__(self, configuration) -> None:
|
56
|
+
|
57
|
+
# maxsize is number of requests to host that are allowed in parallel
|
58
|
+
self.maxsize = configuration.connection_pool_maxsize
|
59
|
+
|
60
|
+
self.ssl_context = ssl.create_default_context(cafile=configuration.ssl_ca_cert)
|
61
|
+
if configuration.cert_file:
|
62
|
+
self.ssl_context.load_cert_chain(
|
63
|
+
configuration.cert_file, keyfile=configuration.key_file
|
64
|
+
)
|
65
|
+
|
66
|
+
if not configuration.verify_ssl:
|
67
|
+
self.ssl_context.check_hostname = False
|
68
|
+
self.ssl_context.verify_mode = ssl.CERT_NONE
|
69
|
+
|
70
|
+
self.proxy = configuration.proxy
|
71
|
+
self.proxy_headers = configuration.proxy_headers
|
72
|
+
|
73
|
+
self.retries = configuration.retries
|
74
|
+
|
75
|
+
self.pool_manager: Optional[aiohttp.ClientSession] = None
|
76
|
+
self.retry_client: Optional[aiohttp_retry.RetryClient] = None
|
77
|
+
|
78
|
+
async def close(self) -> None:
|
79
|
+
if self.pool_manager:
|
80
|
+
await self.pool_manager.close()
|
81
|
+
if self.retry_client is not None:
|
82
|
+
await self.retry_client.close()
|
83
|
+
|
84
|
+
async def request(
|
85
|
+
self,
|
86
|
+
method,
|
87
|
+
url,
|
88
|
+
headers=None,
|
89
|
+
body=None,
|
90
|
+
post_params=None,
|
91
|
+
_request_timeout=None,
|
92
|
+
):
|
93
|
+
"""Execute request
|
94
|
+
|
95
|
+
:param method: http request method
|
96
|
+
:param url: http request url
|
97
|
+
:param headers: http request headers
|
98
|
+
:param body: request json body, for `application/json`
|
99
|
+
:param post_params: request post parameters,
|
100
|
+
`application/x-www-form-urlencoded`
|
101
|
+
and `multipart/form-data`
|
102
|
+
:param _request_timeout: timeout setting for this request. If one
|
103
|
+
number provided, it will be total request
|
104
|
+
timeout. It can also be a pair (tuple) of
|
105
|
+
(connection, read) timeouts.
|
106
|
+
"""
|
107
|
+
method = method.upper()
|
108
|
+
assert method in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"]
|
109
|
+
|
110
|
+
if post_params and body:
|
111
|
+
raise ApiValueError(
|
112
|
+
"body parameter cannot be used with post_params parameter."
|
113
|
+
)
|
114
|
+
|
115
|
+
post_params = post_params or {}
|
116
|
+
headers = headers or {}
|
117
|
+
# url already contains the URL query string
|
118
|
+
timeout = _request_timeout or 5 * 60
|
119
|
+
|
120
|
+
if "Content-Type" not in headers:
|
121
|
+
headers["Content-Type"] = "application/json"
|
122
|
+
|
123
|
+
args = {"method": method, "url": url, "timeout": timeout, "headers": headers}
|
124
|
+
|
125
|
+
if self.proxy:
|
126
|
+
args["proxy"] = self.proxy
|
127
|
+
if self.proxy_headers:
|
128
|
+
args["proxy_headers"] = self.proxy_headers
|
129
|
+
|
130
|
+
# For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
|
131
|
+
if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]:
|
132
|
+
if re.search("json", headers["Content-Type"], re.IGNORECASE):
|
133
|
+
if body is not None:
|
134
|
+
body = json.dumps(body)
|
135
|
+
args["data"] = body
|
136
|
+
elif headers["Content-Type"] == "application/x-www-form-urlencoded":
|
137
|
+
args["data"] = aiohttp.FormData(post_params)
|
138
|
+
elif headers["Content-Type"] == "multipart/form-data":
|
139
|
+
# must del headers['Content-Type'], or the correct
|
140
|
+
# Content-Type which generated by aiohttp
|
141
|
+
del headers["Content-Type"]
|
142
|
+
data = aiohttp.FormData()
|
143
|
+
for param in post_params:
|
144
|
+
k, v = param
|
145
|
+
if isinstance(v, tuple) and len(v) == 3:
|
146
|
+
data.add_field(k, value=v[1], filename=v[0], content_type=v[2])
|
147
|
+
else:
|
148
|
+
# Ensures that dict objects are serialized
|
149
|
+
if isinstance(v, dict):
|
150
|
+
v = json.dumps(v)
|
151
|
+
elif isinstance(v, int):
|
152
|
+
v = str(v)
|
153
|
+
data.add_field(k, v)
|
154
|
+
args["data"] = data
|
155
|
+
|
156
|
+
# Pass a `bytes` or `str` parameter directly in the body to support
|
157
|
+
# other content types than Json when `body` argument is provided
|
158
|
+
# in serialized form
|
159
|
+
elif isinstance(body, str) or isinstance(body, bytes):
|
160
|
+
args["data"] = body
|
161
|
+
else:
|
162
|
+
# Cannot generate the request from given parameters
|
163
|
+
msg = """Cannot prepare a request message for provided
|
164
|
+
arguments. Please check that your arguments match
|
165
|
+
declared content type."""
|
166
|
+
raise ApiException(status=0, reason=msg)
|
167
|
+
|
168
|
+
pool_manager: Union[aiohttp.ClientSession, aiohttp_retry.RetryClient]
|
169
|
+
|
170
|
+
# https pool manager
|
171
|
+
if self.pool_manager is None:
|
172
|
+
self.pool_manager = aiohttp.ClientSession(
|
173
|
+
connector=aiohttp.TCPConnector(
|
174
|
+
limit=self.maxsize, ssl=self.ssl_context
|
175
|
+
),
|
176
|
+
trust_env=True,
|
177
|
+
)
|
178
|
+
pool_manager = self.pool_manager
|
179
|
+
|
180
|
+
if self.retries is not None and method in ALLOW_RETRY_METHODS:
|
181
|
+
if self.retry_client is None:
|
182
|
+
self.retry_client = aiohttp_retry.RetryClient(
|
183
|
+
client_session=self.pool_manager,
|
184
|
+
retry_options=aiohttp_retry.ExponentialRetry(
|
185
|
+
attempts=self.retries,
|
186
|
+
factor=2.0,
|
187
|
+
start_timeout=0.1,
|
188
|
+
max_timeout=120.0,
|
189
|
+
),
|
190
|
+
)
|
191
|
+
pool_manager = self.retry_client
|
192
|
+
|
193
|
+
r = await pool_manager.request(**args)
|
194
|
+
|
195
|
+
return RESTResponse(r)
|
crypticorn/pay/main.py
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
from crypticorn.pay import (
|
2
|
+
ApiClient,
|
3
|
+
Configuration,
|
4
|
+
NOWPaymentsApi,
|
5
|
+
StatusApi,
|
6
|
+
PaymentsApi,
|
7
|
+
ProductsApi,
|
8
|
+
)
|
9
|
+
from crypticorn.common import BaseURL, ApiVersion, Service, apikey_header as aph
|
10
|
+
|
11
|
+
|
12
|
+
class PayClient:
|
13
|
+
"""
|
14
|
+
A client for interacting with the Crypticorn Pay API.
|
15
|
+
"""
|
16
|
+
|
17
|
+
def __init__(
|
18
|
+
self,
|
19
|
+
base_url: BaseURL,
|
20
|
+
api_version: ApiVersion,
|
21
|
+
api_key: str = None,
|
22
|
+
jwt: str = None,
|
23
|
+
):
|
24
|
+
self.host = f"{base_url.value}/{api_version.value}/{Service.PAY.value}"
|
25
|
+
self.config = Configuration(
|
26
|
+
host=self.host,
|
27
|
+
access_token=jwt,
|
28
|
+
api_key={aph.scheme_name: api_key} if api_key else None,
|
29
|
+
api_key_prefix=({aph.scheme_name: aph.model.name} if api_key else None),
|
30
|
+
)
|
31
|
+
self.base_client = ApiClient(configuration=self.config)
|
32
|
+
self.now = NOWPaymentsApi(self.base_client)
|
33
|
+
self.status = StatusApi(self.base_client)
|
34
|
+
self.payments = PaymentsApi(self.base_client)
|
35
|
+
self.products = ProductsApi(self.base_client)
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# flake8: noqa
|
4
4
|
|
5
5
|
"""
|
6
|
-
|
6
|
+
Trading API
|
7
7
|
|
8
8
|
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
9
9
|
|
@@ -42,7 +42,10 @@ from crypticorn.trade.client.exceptions import ApiException
|
|
42
42
|
from crypticorn.trade.client.models.api_key_model import APIKeyModel
|
43
43
|
from crypticorn.trade.client.models.action_model import ActionModel
|
44
44
|
from crypticorn.trade.client.models.api_error_identifier import ApiErrorIdentifier
|
45
|
+
from crypticorn.trade.client.models.api_error_level import ApiErrorLevel
|
46
|
+
from crypticorn.trade.client.models.api_error_type import ApiErrorType
|
45
47
|
from crypticorn.trade.client.models.bot_model import BotModel
|
48
|
+
from crypticorn.trade.client.models.bot_status import BotStatus
|
46
49
|
from crypticorn.trade.client.models.exchange import Exchange
|
47
50
|
from crypticorn.trade.client.models.execution_ids import ExecutionIds
|
48
51
|
from crypticorn.trade.client.models.futures_balance import FuturesBalance
|
@@ -51,13 +54,15 @@ from crypticorn.trade.client.models.http_validation_error import HTTPValidationE
|
|
51
54
|
from crypticorn.trade.client.models.margin_mode import MarginMode
|
52
55
|
from crypticorn.trade.client.models.market_type import MarketType
|
53
56
|
from crypticorn.trade.client.models.notification_model import NotificationModel
|
54
|
-
from crypticorn.trade.client.models.notification_type import NotificationType
|
55
57
|
from crypticorn.trade.client.models.order_model import OrderModel
|
56
58
|
from crypticorn.trade.client.models.order_status import OrderStatus
|
57
59
|
from crypticorn.trade.client.models.post_futures_action import PostFuturesAction
|
58
60
|
from crypticorn.trade.client.models.strategy_exchange_info import StrategyExchangeInfo
|
59
|
-
from crypticorn.trade.client.models.
|
61
|
+
from crypticorn.trade.client.models.strategy_model_input import StrategyModelInput
|
62
|
+
from crypticorn.trade.client.models.strategy_model_output import StrategyModelOutput
|
60
63
|
from crypticorn.trade.client.models.tpsl import TPSL
|
61
64
|
from crypticorn.trade.client.models.trading_action_type import TradingActionType
|
62
65
|
from crypticorn.trade.client.models.validation_error import ValidationError
|
63
|
-
from crypticorn.trade.client.models.validation_error_loc_inner import
|
66
|
+
from crypticorn.trade.client.models.validation_error_loc_inner import (
|
67
|
+
ValidationErrorLocInner,
|
68
|
+
)
|
@@ -10,4 +10,3 @@ from crypticorn.trade.client.api.orders_api import OrdersApi
|
|
10
10
|
from crypticorn.trade.client.api.status_api import StatusApi
|
11
11
|
from crypticorn.trade.client.api.strategies_api import StrategiesApi
|
12
12
|
from crypticorn.trade.client.api.trading_actions_api import TradingActionsApi
|
13
|
-
|