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
crypticorn/hive/main.py
CHANGED
@@ -1,107 +1,34 @@
|
|
1
|
-
from
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
from crypticorn.hive import (
|
2
|
+
ApiClient,
|
3
|
+
Configuration,
|
4
|
+
ModelsApi,
|
5
|
+
DataApi,
|
6
|
+
StatusApi,
|
7
|
+
)
|
8
|
+
from crypticorn.common import BaseURL, ApiVersion, Service, apikey_header as aph
|
6
9
|
|
7
10
|
|
8
11
|
class HiveClient:
|
9
12
|
"""
|
10
|
-
A client for interacting with the Crypticorn Hive API
|
11
|
-
download data, and retrieve information about available coins, targets, and features.
|
13
|
+
A client for interacting with the Crypticorn Hive API.
|
12
14
|
"""
|
13
15
|
|
14
|
-
def __init__(
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
self.
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
:param coin_id: The id of the coin to be used for the model.
|
28
|
-
:param target: The target variable for the model.
|
29
|
-
"""
|
30
|
-
endpoint = "/model/creation"
|
31
|
-
response = requests.post(
|
32
|
-
url=self._base_url + endpoint,
|
33
|
-
params={"coin_id": coin_id, "target": target},
|
34
|
-
headers=self._headers
|
16
|
+
def __init__(
|
17
|
+
self,
|
18
|
+
base_url: BaseURL,
|
19
|
+
api_version: ApiVersion,
|
20
|
+
api_key: str = None,
|
21
|
+
jwt: str = None,
|
22
|
+
):
|
23
|
+
self.host = f"{base_url.value}/{api_version.value}/{Service.HIVE.value}"
|
24
|
+
self.config = Configuration(
|
25
|
+
host=self.host,
|
26
|
+
access_token=jwt,
|
27
|
+
api_key={aph.scheme_name: api_key} if api_key else None,
|
28
|
+
api_key_prefix=({aph.scheme_name: aph.model.name} if api_key else None),
|
35
29
|
)
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
:param model_id: The id of the model to evaluate.
|
43
|
-
:param data: The data to use for evaluation, which can be a pandas DataFrame or a file path with
|
44
|
-
extensions `.feather` or `.parquet`.
|
45
|
-
:param version: (optional) Specifies the data version for evaluation. Defaults to the latest version.
|
46
|
-
If a different version than the latest is specified, the evaluation will not be stored
|
47
|
-
or counted on the leaderboard. This is useful for testing your model with different versions.
|
48
|
-
Ensure to specify a `version` if your model was trained on older data versions; otherwise,
|
49
|
-
it will be evaluated against the latest data, potentially affecting the results.
|
50
|
-
"""
|
51
|
-
if isinstance(data, pd.DataFrame):
|
52
|
-
json_data = data.to_json(orient='records')
|
53
|
-
elif isinstance(data, str):
|
54
|
-
if data.endswith('.feather'):
|
55
|
-
json_data = pd.read_feather(data).to_json(orient="records")
|
56
|
-
elif data.endswith('.parquet'):
|
57
|
-
json_data = pd.read_parquet(data).to_json(orient="records")
|
58
|
-
else:
|
59
|
-
raise ValueError("Unsupported file format. Use .feather, .parquet, or pd.Dataframe.")
|
60
|
-
else:
|
61
|
-
raise ValueError("Unsupported data format. Pass a pd.DataFrame or a valid file path.")
|
62
|
-
|
63
|
-
endpoint = "/model/evaluation"
|
64
|
-
response = requests.post(
|
65
|
-
url=self._base_url + endpoint,
|
66
|
-
params={"model_id": model_id, "version": version},
|
67
|
-
json=json_data,
|
68
|
-
headers=self._headers
|
69
|
-
)
|
70
|
-
return response.json()
|
71
|
-
|
72
|
-
def download_data(self, model_id: int, version: float = None,
|
73
|
-
feature_size: str = None) -> int:
|
74
|
-
"""
|
75
|
-
Downloads training data for models.
|
76
|
-
Either pass a model_id or coin_id. For more details about available data, use `data_info()`.
|
77
|
-
|
78
|
-
:param model_id: id of the model to download data for.
|
79
|
-
:param version: (optional) Data version to download. Defaults to the latest version if not specified.
|
80
|
-
:param feature_size: (optional) Size of the feature set to download. Default is "large".
|
81
|
-
"""
|
82
|
-
endpoint = "/data"
|
83
|
-
response = requests.get(
|
84
|
-
url=self._base_url + endpoint,
|
85
|
-
params={"feature_size": feature_size, "version": version, "model_id": model_id},
|
86
|
-
headers=self._headers
|
87
|
-
)
|
88
|
-
if response.status_code != 200:
|
89
|
-
return response.json()
|
90
|
-
data = response.json()
|
91
|
-
base_path = f"v{data['version']}/coin_{data['coin']}/"
|
92
|
-
os.makedirs(base_path, exist_ok=True)
|
93
|
-
download_file(url=data["y_train"], dest_path=f"{base_path}y_train_{data['target']}.feather")
|
94
|
-
download_file(url=data["X_test"], dest_path=f"{base_path}X_test_{data['feature_size']}.feather")
|
95
|
-
download_file(url=data["X_train"], dest_path=f"{base_path}X_train_{data['feature_size']}.feather")
|
96
|
-
return 200
|
97
|
-
|
98
|
-
def data_info(self) -> DataInfo:
|
99
|
-
"""
|
100
|
-
Returns information about the training data.
|
101
|
-
Useful in combination with `download_data()` and `create_model()`.
|
102
|
-
"""
|
103
|
-
endpoint = "/data/info"
|
104
|
-
response = requests.get(
|
105
|
-
url=self._base_url + endpoint,
|
106
|
-
headers=self._headers)
|
107
|
-
return response.json()
|
30
|
+
self.base_client = ApiClient(configuration=self.config)
|
31
|
+
# Instantiate all the endpoint clients
|
32
|
+
self.models = ModelsApi(self.base_client)
|
33
|
+
self.data = DataApi(self.base_client)
|
34
|
+
self.status = StatusApi(self.base_client)
|
@@ -35,22 +35,34 @@ from crypticorn.klines.client.exceptions import ApiAttributeError
|
|
35
35
|
from crypticorn.klines.client.exceptions import ApiException
|
36
36
|
|
37
37
|
# import models into sdk package
|
38
|
-
from crypticorn.klines.client.models.base_response_health_check_response import
|
39
|
-
|
38
|
+
from crypticorn.klines.client.models.base_response_health_check_response import (
|
39
|
+
BaseResponseHealthCheckResponse,
|
40
|
+
)
|
41
|
+
from crypticorn.klines.client.models.base_response_list_funding_rate_response import (
|
42
|
+
BaseResponseListFundingRateResponse,
|
43
|
+
)
|
40
44
|
from crypticorn.klines.client.models.base_response_list_str import BaseResponseListStr
|
41
|
-
from crypticorn.klines.client.models.base_response_ohlcv_response import
|
45
|
+
from crypticorn.klines.client.models.base_response_ohlcv_response import (
|
46
|
+
BaseResponseOHLCVResponse,
|
47
|
+
)
|
42
48
|
from crypticorn.klines.client.models.error_response import ErrorResponse
|
43
49
|
from crypticorn.klines.client.models.exchange import Exchange
|
44
50
|
from crypticorn.klines.client.models.funding_rate_response import FundingRateResponse
|
45
51
|
from crypticorn.klines.client.models.http_validation_error import HTTPValidationError
|
46
52
|
from crypticorn.klines.client.models.health_check_response import HealthCheckResponse
|
47
53
|
from crypticorn.klines.client.models.history_error_response import HistoryErrorResponse
|
48
|
-
from crypticorn.klines.client.models.history_no_data_response import
|
49
|
-
|
54
|
+
from crypticorn.klines.client.models.history_no_data_response import (
|
55
|
+
HistoryNoDataResponse,
|
56
|
+
)
|
57
|
+
from crypticorn.klines.client.models.history_success_response import (
|
58
|
+
HistorySuccessResponse,
|
59
|
+
)
|
50
60
|
from crypticorn.klines.client.models.market import Market
|
51
61
|
from crypticorn.klines.client.models.ohlcv_response import OHLCVResponse
|
52
62
|
from crypticorn.klines.client.models.resolution import Resolution
|
53
|
-
from crypticorn.klines.client.models.response_get_history_udf_history_get import
|
63
|
+
from crypticorn.klines.client.models.response_get_history_udf_history_get import (
|
64
|
+
ResponseGetHistoryUdfHistoryGet,
|
65
|
+
)
|
54
66
|
from crypticorn.klines.client.models.search_symbol_response import SearchSymbolResponse
|
55
67
|
from crypticorn.klines.client.models.sort_direction import SortDirection
|
56
68
|
from crypticorn.klines.client.models.symbol_group_response import SymbolGroupResponse
|
@@ -59,4 +71,6 @@ from crypticorn.klines.client.models.symbol_type import SymbolType
|
|
59
71
|
from crypticorn.klines.client.models.timeframe import Timeframe
|
60
72
|
from crypticorn.klines.client.models.udf_config_response import UDFConfigResponse
|
61
73
|
from crypticorn.klines.client.models.validation_error import ValidationError
|
62
|
-
from crypticorn.klines.client.models.validation_error_loc_inner import
|
74
|
+
from crypticorn.klines.client.models.validation_error_loc_inner import (
|
75
|
+
ValidationErrorLocInner,
|
76
|
+
)
|
@@ -19,7 +19,9 @@ from typing_extensions import Annotated
|
|
19
19
|
from pydantic import Field, StrictInt, StrictStr
|
20
20
|
from typing import Optional
|
21
21
|
from typing_extensions import Annotated
|
22
|
-
from crypticorn.klines.client.models.base_response_list_funding_rate_response import
|
22
|
+
from crypticorn.klines.client.models.base_response_list_funding_rate_response import (
|
23
|
+
BaseResponseListFundingRateResponse,
|
24
|
+
)
|
23
25
|
|
24
26
|
from crypticorn.klines.client.api_client import ApiClient, RequestSerialized
|
25
27
|
from crypticorn.klines.client.api_response import ApiResponse
|
@@ -38,21 +40,28 @@ class FundingRatesApi:
|
|
38
40
|
api_client = ApiClient.get_default()
|
39
41
|
self.api_client = api_client
|
40
42
|
|
41
|
-
|
42
43
|
@validate_call
|
43
44
|
def funding_rate_funding_rates_symbol_get(
|
44
45
|
self,
|
45
|
-
symbol: Annotated[
|
46
|
-
|
47
|
-
|
48
|
-
|
46
|
+
symbol: Annotated[
|
47
|
+
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
48
|
+
],
|
49
|
+
start: Annotated[
|
50
|
+
Optional[StrictInt], Field(description="Start timestamp in milliseconds")
|
51
|
+
] = None,
|
52
|
+
end: Annotated[
|
53
|
+
Optional[StrictInt], Field(description="End timestamp in milliseconds")
|
54
|
+
] = None,
|
55
|
+
limit: Annotated[
|
56
|
+
Optional[Annotated[int, Field(strict=True, ge=1)]],
|
57
|
+
Field(description="Number of funding rates to return"),
|
58
|
+
] = None,
|
49
59
|
_request_timeout: Union[
|
50
60
|
None,
|
51
61
|
Annotated[StrictFloat, Field(gt=0)],
|
52
62
|
Tuple[
|
53
|
-
Annotated[StrictFloat, Field(gt=0)],
|
54
|
-
|
55
|
-
]
|
63
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
64
|
+
],
|
56
65
|
] = None,
|
57
66
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
58
67
|
_content_type: Optional[StrictStr] = None,
|
@@ -91,7 +100,7 @@ class FundingRatesApi:
|
|
91
100
|
in the spec for a single request.
|
92
101
|
:type _host_index: int, optional
|
93
102
|
:return: Returns the result object.
|
94
|
-
"""
|
103
|
+
""" # noqa: E501
|
95
104
|
|
96
105
|
_param = self._funding_rate_funding_rates_symbol_get_serialize(
|
97
106
|
symbol=symbol,
|
@@ -101,19 +110,18 @@ class FundingRatesApi:
|
|
101
110
|
_request_auth=_request_auth,
|
102
111
|
_content_type=_content_type,
|
103
112
|
_headers=_headers,
|
104
|
-
_host_index=_host_index
|
113
|
+
_host_index=_host_index,
|
105
114
|
)
|
106
115
|
|
107
116
|
_response_types_map: Dict[str, Optional[str]] = {
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
117
|
+
"200": "BaseResponseListFundingRateResponse",
|
118
|
+
"400": "ErrorResponse",
|
119
|
+
"404": "ErrorResponse",
|
120
|
+
"500": "ErrorResponse",
|
121
|
+
"422": "HTTPValidationError",
|
113
122
|
}
|
114
123
|
response_data = self.api_client.call_api(
|
115
|
-
*_param,
|
116
|
-
_request_timeout=_request_timeout
|
124
|
+
*_param, _request_timeout=_request_timeout
|
117
125
|
)
|
118
126
|
response_data.read()
|
119
127
|
return self.api_client.response_deserialize(
|
@@ -121,21 +129,28 @@ class FundingRatesApi:
|
|
121
129
|
response_types_map=_response_types_map,
|
122
130
|
).data
|
123
131
|
|
124
|
-
|
125
132
|
@validate_call
|
126
133
|
def funding_rate_funding_rates_symbol_get_with_http_info(
|
127
134
|
self,
|
128
|
-
symbol: Annotated[
|
129
|
-
|
130
|
-
|
131
|
-
|
135
|
+
symbol: Annotated[
|
136
|
+
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
137
|
+
],
|
138
|
+
start: Annotated[
|
139
|
+
Optional[StrictInt], Field(description="Start timestamp in milliseconds")
|
140
|
+
] = None,
|
141
|
+
end: Annotated[
|
142
|
+
Optional[StrictInt], Field(description="End timestamp in milliseconds")
|
143
|
+
] = None,
|
144
|
+
limit: Annotated[
|
145
|
+
Optional[Annotated[int, Field(strict=True, ge=1)]],
|
146
|
+
Field(description="Number of funding rates to return"),
|
147
|
+
] = None,
|
132
148
|
_request_timeout: Union[
|
133
149
|
None,
|
134
150
|
Annotated[StrictFloat, Field(gt=0)],
|
135
151
|
Tuple[
|
136
|
-
Annotated[StrictFloat, Field(gt=0)],
|
137
|
-
|
138
|
-
]
|
152
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
153
|
+
],
|
139
154
|
] = None,
|
140
155
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
141
156
|
_content_type: Optional[StrictStr] = None,
|
@@ -174,7 +189,7 @@ class FundingRatesApi:
|
|
174
189
|
in the spec for a single request.
|
175
190
|
:type _host_index: int, optional
|
176
191
|
:return: Returns the result object.
|
177
|
-
"""
|
192
|
+
""" # noqa: E501
|
178
193
|
|
179
194
|
_param = self._funding_rate_funding_rates_symbol_get_serialize(
|
180
195
|
symbol=symbol,
|
@@ -184,19 +199,18 @@ class FundingRatesApi:
|
|
184
199
|
_request_auth=_request_auth,
|
185
200
|
_content_type=_content_type,
|
186
201
|
_headers=_headers,
|
187
|
-
_host_index=_host_index
|
202
|
+
_host_index=_host_index,
|
188
203
|
)
|
189
204
|
|
190
205
|
_response_types_map: Dict[str, Optional[str]] = {
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
206
|
+
"200": "BaseResponseListFundingRateResponse",
|
207
|
+
"400": "ErrorResponse",
|
208
|
+
"404": "ErrorResponse",
|
209
|
+
"500": "ErrorResponse",
|
210
|
+
"422": "HTTPValidationError",
|
196
211
|
}
|
197
212
|
response_data = self.api_client.call_api(
|
198
|
-
*_param,
|
199
|
-
_request_timeout=_request_timeout
|
213
|
+
*_param, _request_timeout=_request_timeout
|
200
214
|
)
|
201
215
|
response_data.read()
|
202
216
|
return self.api_client.response_deserialize(
|
@@ -204,21 +218,28 @@ class FundingRatesApi:
|
|
204
218
|
response_types_map=_response_types_map,
|
205
219
|
)
|
206
220
|
|
207
|
-
|
208
221
|
@validate_call
|
209
222
|
def funding_rate_funding_rates_symbol_get_without_preload_content(
|
210
223
|
self,
|
211
|
-
symbol: Annotated[
|
212
|
-
|
213
|
-
|
214
|
-
|
224
|
+
symbol: Annotated[
|
225
|
+
StrictStr, Field(description="Trading pair symbol (e.g., BTCUSDT)")
|
226
|
+
],
|
227
|
+
start: Annotated[
|
228
|
+
Optional[StrictInt], Field(description="Start timestamp in milliseconds")
|
229
|
+
] = None,
|
230
|
+
end: Annotated[
|
231
|
+
Optional[StrictInt], Field(description="End timestamp in milliseconds")
|
232
|
+
] = None,
|
233
|
+
limit: Annotated[
|
234
|
+
Optional[Annotated[int, Field(strict=True, ge=1)]],
|
235
|
+
Field(description="Number of funding rates to return"),
|
236
|
+
] = None,
|
215
237
|
_request_timeout: Union[
|
216
238
|
None,
|
217
239
|
Annotated[StrictFloat, Field(gt=0)],
|
218
240
|
Tuple[
|
219
|
-
Annotated[StrictFloat, Field(gt=0)],
|
220
|
-
|
221
|
-
]
|
241
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
242
|
+
],
|
222
243
|
] = None,
|
223
244
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
224
245
|
_content_type: Optional[StrictStr] = None,
|
@@ -257,7 +278,7 @@ class FundingRatesApi:
|
|
257
278
|
in the spec for a single request.
|
258
279
|
:type _host_index: int, optional
|
259
280
|
:return: Returns the result object.
|
260
|
-
"""
|
281
|
+
""" # noqa: E501
|
261
282
|
|
262
283
|
_param = self._funding_rate_funding_rates_symbol_get_serialize(
|
263
284
|
symbol=symbol,
|
@@ -267,23 +288,21 @@ class FundingRatesApi:
|
|
267
288
|
_request_auth=_request_auth,
|
268
289
|
_content_type=_content_type,
|
269
290
|
_headers=_headers,
|
270
|
-
_host_index=_host_index
|
291
|
+
_host_index=_host_index,
|
271
292
|
)
|
272
293
|
|
273
294
|
_response_types_map: Dict[str, Optional[str]] = {
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
295
|
+
"200": "BaseResponseListFundingRateResponse",
|
296
|
+
"400": "ErrorResponse",
|
297
|
+
"404": "ErrorResponse",
|
298
|
+
"500": "ErrorResponse",
|
299
|
+
"422": "HTTPValidationError",
|
279
300
|
}
|
280
301
|
response_data = self.api_client.call_api(
|
281
|
-
*_param,
|
282
|
-
_request_timeout=_request_timeout
|
302
|
+
*_param, _request_timeout=_request_timeout
|
283
303
|
)
|
284
304
|
return response_data.response
|
285
305
|
|
286
|
-
|
287
306
|
def _funding_rate_funding_rates_symbol_get_serialize(
|
288
307
|
self,
|
289
308
|
symbol,
|
@@ -298,8 +317,7 @@ class FundingRatesApi:
|
|
298
317
|
|
299
318
|
_host = None
|
300
319
|
|
301
|
-
_collection_formats: Dict[str, str] = {
|
302
|
-
}
|
320
|
+
_collection_formats: Dict[str, str] = {}
|
303
321
|
|
304
322
|
_path_params: Dict[str, str] = {}
|
305
323
|
_query_params: List[Tuple[str, str]] = []
|
@@ -312,41 +330,36 @@ class FundingRatesApi:
|
|
312
330
|
|
313
331
|
# process the path parameters
|
314
332
|
if symbol is not None:
|
315
|
-
_path_params[
|
333
|
+
_path_params["symbol"] = symbol
|
316
334
|
# process the query parameters
|
317
335
|
if start is not None:
|
318
|
-
|
319
|
-
_query_params.append((
|
320
|
-
|
336
|
+
|
337
|
+
_query_params.append(("start", start))
|
338
|
+
|
321
339
|
if end is not None:
|
322
|
-
|
323
|
-
_query_params.append((
|
324
|
-
|
340
|
+
|
341
|
+
_query_params.append(("end", end))
|
342
|
+
|
325
343
|
if limit is not None:
|
326
|
-
|
327
|
-
_query_params.append((
|
328
|
-
|
344
|
+
|
345
|
+
_query_params.append(("limit", limit))
|
346
|
+
|
329
347
|
# process the header parameters
|
330
348
|
# process the form parameters
|
331
349
|
# process the body parameter
|
332
350
|
|
333
|
-
|
334
351
|
# set the HTTP header `Accept`
|
335
|
-
if
|
336
|
-
_header_params[
|
337
|
-
[
|
338
|
-
'application/json'
|
339
|
-
]
|
352
|
+
if "Accept" not in _header_params:
|
353
|
+
_header_params["Accept"] = self.api_client.select_header_accept(
|
354
|
+
["application/json"]
|
340
355
|
)
|
341
356
|
|
342
|
-
|
343
357
|
# authentication setting
|
344
|
-
_auth_settings: List[str] = [
|
345
|
-
]
|
358
|
+
_auth_settings: List[str] = []
|
346
359
|
|
347
360
|
return self.api_client.param_serialize(
|
348
|
-
method=
|
349
|
-
resource_path=
|
361
|
+
method="GET",
|
362
|
+
resource_path="/funding_rates/{symbol}",
|
350
363
|
path_params=_path_params,
|
351
364
|
query_params=_query_params,
|
352
365
|
header_params=_header_params,
|
@@ -356,7 +369,5 @@ class FundingRatesApi:
|
|
356
369
|
auth_settings=_auth_settings,
|
357
370
|
collection_formats=_collection_formats,
|
358
371
|
_host=_host,
|
359
|
-
_request_auth=_request_auth
|
372
|
+
_request_auth=_request_auth,
|
360
373
|
)
|
361
|
-
|
362
|
-
|