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
@@ -17,16 +17,32 @@ from inspect import getfullargspec
|
|
17
17
|
import json
|
18
18
|
import pprint
|
19
19
|
import re # noqa: F401
|
20
|
-
from pydantic import
|
20
|
+
from pydantic import (
|
21
|
+
BaseModel,
|
22
|
+
ConfigDict,
|
23
|
+
Field,
|
24
|
+
StrictStr,
|
25
|
+
ValidationError,
|
26
|
+
field_validator,
|
27
|
+
)
|
21
28
|
from typing import Optional
|
22
29
|
from crypticorn.klines.client.models.history_error_response import HistoryErrorResponse
|
23
|
-
from crypticorn.klines.client.models.history_no_data_response import
|
24
|
-
|
30
|
+
from crypticorn.klines.client.models.history_no_data_response import (
|
31
|
+
HistoryNoDataResponse,
|
32
|
+
)
|
33
|
+
from crypticorn.klines.client.models.history_success_response import (
|
34
|
+
HistorySuccessResponse,
|
35
|
+
)
|
25
36
|
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
26
37
|
from typing_extensions import Literal, Self
|
27
38
|
from pydantic import Field
|
28
39
|
|
29
|
-
RESPONSEGETHISTORYUDFHISTORYGET_ANY_OF_SCHEMAS = [
|
40
|
+
RESPONSEGETHISTORYUDFHISTORYGET_ANY_OF_SCHEMAS = [
|
41
|
+
"HistoryErrorResponse",
|
42
|
+
"HistoryNoDataResponse",
|
43
|
+
"HistorySuccessResponse",
|
44
|
+
]
|
45
|
+
|
30
46
|
|
31
47
|
class ResponseGetHistoryUdfHistoryGet(BaseModel):
|
32
48
|
"""
|
@@ -40,10 +56,16 @@ class ResponseGetHistoryUdfHistoryGet(BaseModel):
|
|
40
56
|
# data type: HistoryErrorResponse
|
41
57
|
anyof_schema_3_validator: Optional[HistoryErrorResponse] = None
|
42
58
|
if TYPE_CHECKING:
|
43
|
-
actual_instance: Optional[
|
59
|
+
actual_instance: Optional[
|
60
|
+
Union[HistoryErrorResponse, HistoryNoDataResponse, HistorySuccessResponse]
|
61
|
+
] = None
|
44
62
|
else:
|
45
63
|
actual_instance: Any = None
|
46
|
-
any_of_schemas: Set[str] = {
|
64
|
+
any_of_schemas: Set[str] = {
|
65
|
+
"HistoryErrorResponse",
|
66
|
+
"HistoryNoDataResponse",
|
67
|
+
"HistorySuccessResponse",
|
68
|
+
}
|
47
69
|
|
48
70
|
model_config = {
|
49
71
|
"validate_assignment": True,
|
@@ -53,38 +75,51 @@ class ResponseGetHistoryUdfHistoryGet(BaseModel):
|
|
53
75
|
def __init__(self, *args, **kwargs) -> None:
|
54
76
|
if args:
|
55
77
|
if len(args) > 1:
|
56
|
-
raise ValueError(
|
78
|
+
raise ValueError(
|
79
|
+
"If a position argument is used, only 1 is allowed to set `actual_instance`"
|
80
|
+
)
|
57
81
|
if kwargs:
|
58
|
-
raise ValueError(
|
82
|
+
raise ValueError(
|
83
|
+
"If a position argument is used, keyword arguments cannot be used."
|
84
|
+
)
|
59
85
|
super().__init__(actual_instance=args[0])
|
60
86
|
else:
|
61
87
|
super().__init__(**kwargs)
|
62
88
|
|
63
|
-
@field_validator(
|
89
|
+
@field_validator("actual_instance")
|
64
90
|
def actual_instance_must_validate_anyof(cls, v):
|
65
91
|
instance = ResponseGetHistoryUdfHistoryGet.model_construct()
|
66
92
|
error_messages = []
|
67
93
|
# validate data type: HistorySuccessResponse
|
68
94
|
if not isinstance(v, HistorySuccessResponse):
|
69
|
-
error_messages.append(
|
95
|
+
error_messages.append(
|
96
|
+
f"Error! Input type `{type(v)}` is not `HistorySuccessResponse`"
|
97
|
+
)
|
70
98
|
else:
|
71
99
|
return v
|
72
100
|
|
73
101
|
# validate data type: HistoryNoDataResponse
|
74
102
|
if not isinstance(v, HistoryNoDataResponse):
|
75
|
-
error_messages.append(
|
103
|
+
error_messages.append(
|
104
|
+
f"Error! Input type `{type(v)}` is not `HistoryNoDataResponse`"
|
105
|
+
)
|
76
106
|
else:
|
77
107
|
return v
|
78
108
|
|
79
109
|
# validate data type: HistoryErrorResponse
|
80
110
|
if not isinstance(v, HistoryErrorResponse):
|
81
|
-
error_messages.append(
|
111
|
+
error_messages.append(
|
112
|
+
f"Error! Input type `{type(v)}` is not `HistoryErrorResponse`"
|
113
|
+
)
|
82
114
|
else:
|
83
115
|
return v
|
84
116
|
|
85
117
|
if error_messages:
|
86
118
|
# no match
|
87
|
-
raise ValueError(
|
119
|
+
raise ValueError(
|
120
|
+
"No match found when setting the actual_instance in ResponseGetHistoryUdfHistoryGet with anyOf schemas: HistoryErrorResponse, HistoryNoDataResponse, HistorySuccessResponse. Details: "
|
121
|
+
+ ", ".join(error_messages)
|
122
|
+
)
|
88
123
|
else:
|
89
124
|
return v
|
90
125
|
|
@@ -102,23 +137,26 @@ class ResponseGetHistoryUdfHistoryGet(BaseModel):
|
|
102
137
|
instance.actual_instance = HistorySuccessResponse.from_json(json_str)
|
103
138
|
return instance
|
104
139
|
except (ValidationError, ValueError) as e:
|
105
|
-
|
140
|
+
error_messages.append(str(e))
|
106
141
|
# anyof_schema_2_validator: Optional[HistoryNoDataResponse] = None
|
107
142
|
try:
|
108
143
|
instance.actual_instance = HistoryNoDataResponse.from_json(json_str)
|
109
144
|
return instance
|
110
145
|
except (ValidationError, ValueError) as e:
|
111
|
-
|
146
|
+
error_messages.append(str(e))
|
112
147
|
# anyof_schema_3_validator: Optional[HistoryErrorResponse] = None
|
113
148
|
try:
|
114
149
|
instance.actual_instance = HistoryErrorResponse.from_json(json_str)
|
115
150
|
return instance
|
116
151
|
except (ValidationError, ValueError) as e:
|
117
|
-
|
152
|
+
error_messages.append(str(e))
|
118
153
|
|
119
154
|
if error_messages:
|
120
155
|
# no match
|
121
|
-
raise ValueError(
|
156
|
+
raise ValueError(
|
157
|
+
"No match found when deserializing the JSON string into ResponseGetHistoryUdfHistoryGet with anyOf schemas: HistoryErrorResponse, HistoryNoDataResponse, HistorySuccessResponse. Details: "
|
158
|
+
+ ", ".join(error_messages)
|
159
|
+
)
|
122
160
|
else:
|
123
161
|
return instance
|
124
162
|
|
@@ -127,17 +165,30 @@ class ResponseGetHistoryUdfHistoryGet(BaseModel):
|
|
127
165
|
if self.actual_instance is None:
|
128
166
|
return "null"
|
129
167
|
|
130
|
-
if hasattr(self.actual_instance, "to_json") and callable(
|
168
|
+
if hasattr(self.actual_instance, "to_json") and callable(
|
169
|
+
self.actual_instance.to_json
|
170
|
+
):
|
131
171
|
return self.actual_instance.to_json()
|
132
172
|
else:
|
133
173
|
return json.dumps(self.actual_instance)
|
134
174
|
|
135
|
-
def to_dict(
|
175
|
+
def to_dict(
|
176
|
+
self,
|
177
|
+
) -> Optional[
|
178
|
+
Union[
|
179
|
+
Dict[str, Any],
|
180
|
+
HistoryErrorResponse,
|
181
|
+
HistoryNoDataResponse,
|
182
|
+
HistorySuccessResponse,
|
183
|
+
]
|
184
|
+
]:
|
136
185
|
"""Returns the dict representation of the actual instance"""
|
137
186
|
if self.actual_instance is None:
|
138
187
|
return None
|
139
188
|
|
140
|
-
if hasattr(self.actual_instance, "to_dict") and callable(
|
189
|
+
if hasattr(self.actual_instance, "to_dict") and callable(
|
190
|
+
self.actual_instance.to_dict
|
191
|
+
):
|
141
192
|
return self.actual_instance.to_dict()
|
142
193
|
else:
|
143
194
|
return self.actual_instance
|
@@ -145,5 +196,3 @@ class ResponseGetHistoryUdfHistoryGet(BaseModel):
|
|
145
196
|
def to_str(self) -> str:
|
146
197
|
"""Returns the string representation of the actual instance"""
|
147
198
|
return pprint.pformat(self.model_dump())
|
148
|
-
|
149
|
-
|
@@ -22,17 +22,26 @@ from typing import Any, ClassVar, Dict, List
|
|
22
22
|
from typing import Optional, Set
|
23
23
|
from typing_extensions import Self
|
24
24
|
|
25
|
+
|
25
26
|
class SearchSymbolResponse(BaseModel):
|
26
27
|
"""
|
27
28
|
SearchSymbolResponse
|
28
|
-
"""
|
29
|
+
""" # noqa: E501
|
30
|
+
|
29
31
|
symbol: StrictStr
|
30
32
|
full_name: StrictStr
|
31
33
|
description: StrictStr
|
32
34
|
exchange: StrictStr
|
33
35
|
ticker: StrictStr
|
34
36
|
type: StrictStr
|
35
|
-
__properties: ClassVar[List[str]] = [
|
37
|
+
__properties: ClassVar[List[str]] = [
|
38
|
+
"symbol",
|
39
|
+
"full_name",
|
40
|
+
"description",
|
41
|
+
"exchange",
|
42
|
+
"ticker",
|
43
|
+
"type",
|
44
|
+
]
|
36
45
|
|
37
46
|
model_config = ConfigDict(
|
38
47
|
populate_by_name=True,
|
@@ -40,7 +49,6 @@ class SearchSymbolResponse(BaseModel):
|
|
40
49
|
protected_namespaces=(),
|
41
50
|
)
|
42
51
|
|
43
|
-
|
44
52
|
def to_str(self) -> str:
|
45
53
|
"""Returns the string representation of the model using alias"""
|
46
54
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -65,8 +73,7 @@ class SearchSymbolResponse(BaseModel):
|
|
65
73
|
were set at model initialization. Other fields with value `None`
|
66
74
|
are ignored.
|
67
75
|
"""
|
68
|
-
excluded_fields: Set[str] = set([
|
69
|
-
])
|
76
|
+
excluded_fields: Set[str] = set([])
|
70
77
|
|
71
78
|
_dict = self.model_dump(
|
72
79
|
by_alias=True,
|
@@ -84,14 +91,14 @@ class SearchSymbolResponse(BaseModel):
|
|
84
91
|
if not isinstance(obj, dict):
|
85
92
|
return cls.model_validate(obj)
|
86
93
|
|
87
|
-
_obj = cls.model_validate(
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
94
|
+
_obj = cls.model_validate(
|
95
|
+
{
|
96
|
+
"symbol": obj.get("symbol"),
|
97
|
+
"full_name": obj.get("full_name"),
|
98
|
+
"description": obj.get("description"),
|
99
|
+
"exchange": obj.get("exchange"),
|
100
|
+
"ticker": obj.get("ticker"),
|
101
|
+
"type": obj.get("type"),
|
102
|
+
}
|
103
|
+
)
|
95
104
|
return _obj
|
96
|
-
|
97
|
-
|
@@ -26,12 +26,10 @@ class SortDirection(str, Enum):
|
|
26
26
|
"""
|
27
27
|
allowed enum values
|
28
28
|
"""
|
29
|
-
ASC =
|
30
|
-
DESC =
|
29
|
+
ASC = "asc"
|
30
|
+
DESC = "desc"
|
31
31
|
|
32
32
|
@classmethod
|
33
33
|
def from_json(cls, json_str: str) -> Self:
|
34
34
|
"""Create an instance of SortDirection from a JSON string"""
|
35
35
|
return cls(json.loads(json_str))
|
36
|
-
|
37
|
-
|
@@ -22,10 +22,12 @@ from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from typing import Optional, Set
|
23
23
|
from typing_extensions import Self
|
24
24
|
|
25
|
+
|
25
26
|
class SymbolGroupResponse(BaseModel):
|
26
27
|
"""
|
27
28
|
SymbolGroupResponse
|
28
|
-
"""
|
29
|
+
""" # noqa: E501
|
30
|
+
|
29
31
|
symbol: Optional[List[StrictStr]] = None
|
30
32
|
__properties: ClassVar[List[str]] = ["symbol"]
|
31
33
|
|
@@ -35,7 +37,6 @@ class SymbolGroupResponse(BaseModel):
|
|
35
37
|
protected_namespaces=(),
|
36
38
|
)
|
37
39
|
|
38
|
-
|
39
40
|
def to_str(self) -> str:
|
40
41
|
"""Returns the string representation of the model using alias"""
|
41
42
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -60,8 +61,7 @@ class SymbolGroupResponse(BaseModel):
|
|
60
61
|
were set at model initialization. Other fields with value `None`
|
61
62
|
are ignored.
|
62
63
|
"""
|
63
|
-
excluded_fields: Set[str] = set([
|
64
|
-
])
|
64
|
+
excluded_fields: Set[str] = set([])
|
65
65
|
|
66
66
|
_dict = self.model_dump(
|
67
67
|
by_alias=True,
|
@@ -79,9 +79,5 @@ class SymbolGroupResponse(BaseModel):
|
|
79
79
|
if not isinstance(obj, dict):
|
80
80
|
return cls.model_validate(obj)
|
81
81
|
|
82
|
-
_obj = cls.model_validate({
|
83
|
-
"symbol": obj.get("symbol")
|
84
|
-
})
|
82
|
+
_obj = cls.model_validate({"symbol": obj.get("symbol")})
|
85
83
|
return _obj
|
86
|
-
|
87
|
-
|
@@ -22,10 +22,12 @@ from typing import Any, ClassVar, Dict, List
|
|
22
22
|
from typing import Optional, Set
|
23
23
|
from typing_extensions import Self
|
24
24
|
|
25
|
+
|
25
26
|
class SymbolInfoResponse(BaseModel):
|
26
27
|
"""
|
27
28
|
SymbolInfoResponse
|
28
|
-
"""
|
29
|
+
""" # noqa: E501
|
30
|
+
|
29
31
|
name: StrictStr
|
30
32
|
exchange_traded: StrictStr = Field(alias="exchange-traded")
|
31
33
|
exchange_listed: StrictStr = Field(alias="exchange-listed")
|
@@ -41,7 +43,23 @@ class SymbolInfoResponse(BaseModel):
|
|
41
43
|
supported_resolutions: List[StrictStr]
|
42
44
|
pricescale: StrictInt
|
43
45
|
ticker: StrictStr
|
44
|
-
__properties: ClassVar[List[str]] = [
|
46
|
+
__properties: ClassVar[List[str]] = [
|
47
|
+
"name",
|
48
|
+
"exchange-traded",
|
49
|
+
"exchange-listed",
|
50
|
+
"timezone",
|
51
|
+
"minmov",
|
52
|
+
"minmov2",
|
53
|
+
"pointvalue",
|
54
|
+
"session",
|
55
|
+
"has_intraday",
|
56
|
+
"has_no_volume",
|
57
|
+
"description",
|
58
|
+
"type",
|
59
|
+
"supported_resolutions",
|
60
|
+
"pricescale",
|
61
|
+
"ticker",
|
62
|
+
]
|
45
63
|
|
46
64
|
model_config = ConfigDict(
|
47
65
|
populate_by_name=True,
|
@@ -49,7 +67,6 @@ class SymbolInfoResponse(BaseModel):
|
|
49
67
|
protected_namespaces=(),
|
50
68
|
)
|
51
69
|
|
52
|
-
|
53
70
|
def to_str(self) -> str:
|
54
71
|
"""Returns the string representation of the model using alias"""
|
55
72
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -74,8 +91,7 @@ class SymbolInfoResponse(BaseModel):
|
|
74
91
|
were set at model initialization. Other fields with value `None`
|
75
92
|
are ignored.
|
76
93
|
"""
|
77
|
-
excluded_fields: Set[str] = set([
|
78
|
-
])
|
94
|
+
excluded_fields: Set[str] = set([])
|
79
95
|
|
80
96
|
_dict = self.model_dump(
|
81
97
|
by_alias=True,
|
@@ -93,23 +109,23 @@ class SymbolInfoResponse(BaseModel):
|
|
93
109
|
if not isinstance(obj, dict):
|
94
110
|
return cls.model_validate(obj)
|
95
111
|
|
96
|
-
_obj = cls.model_validate(
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
112
|
+
_obj = cls.model_validate(
|
113
|
+
{
|
114
|
+
"name": obj.get("name"),
|
115
|
+
"exchange-traded": obj.get("exchange-traded"),
|
116
|
+
"exchange-listed": obj.get("exchange-listed"),
|
117
|
+
"timezone": obj.get("timezone"),
|
118
|
+
"minmov": obj.get("minmov"),
|
119
|
+
"minmov2": obj.get("minmov2"),
|
120
|
+
"pointvalue": obj.get("pointvalue"),
|
121
|
+
"session": obj.get("session"),
|
122
|
+
"has_intraday": obj.get("has_intraday"),
|
123
|
+
"has_no_volume": obj.get("has_no_volume"),
|
124
|
+
"description": obj.get("description"),
|
125
|
+
"type": obj.get("type"),
|
126
|
+
"supported_resolutions": obj.get("supported_resolutions"),
|
127
|
+
"pricescale": obj.get("pricescale"),
|
128
|
+
"ticker": obj.get("ticker"),
|
129
|
+
}
|
130
|
+
)
|
113
131
|
return _obj
|
114
|
-
|
115
|
-
|
@@ -22,10 +22,12 @@ from typing import Any, ClassVar, Dict, List
|
|
22
22
|
from typing import Optional, Set
|
23
23
|
from typing_extensions import Self
|
24
24
|
|
25
|
+
|
25
26
|
class SymbolType(BaseModel):
|
26
27
|
"""
|
27
28
|
SymbolType
|
28
|
-
"""
|
29
|
+
""" # noqa: E501
|
30
|
+
|
29
31
|
name: StrictStr
|
30
32
|
value: StrictStr
|
31
33
|
__properties: ClassVar[List[str]] = ["name", "value"]
|
@@ -36,7 +38,6 @@ class SymbolType(BaseModel):
|
|
36
38
|
protected_namespaces=(),
|
37
39
|
)
|
38
40
|
|
39
|
-
|
40
41
|
def to_str(self) -> str:
|
41
42
|
"""Returns the string representation of the model using alias"""
|
42
43
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -61,8 +62,7 @@ class SymbolType(BaseModel):
|
|
61
62
|
were set at model initialization. Other fields with value `None`
|
62
63
|
are ignored.
|
63
64
|
"""
|
64
|
-
excluded_fields: Set[str] = set([
|
65
|
-
])
|
65
|
+
excluded_fields: Set[str] = set([])
|
66
66
|
|
67
67
|
_dict = self.model_dump(
|
68
68
|
by_alias=True,
|
@@ -80,10 +80,5 @@ class SymbolType(BaseModel):
|
|
80
80
|
if not isinstance(obj, dict):
|
81
81
|
return cls.model_validate(obj)
|
82
82
|
|
83
|
-
_obj = cls.model_validate({
|
84
|
-
"name": obj.get("name"),
|
85
|
-
"value": obj.get("value")
|
86
|
-
})
|
83
|
+
_obj = cls.model_validate({"name": obj.get("name"), "value": obj.get("value")})
|
87
84
|
return _obj
|
88
|
-
|
89
|
-
|
@@ -26,15 +26,13 @@ class Timeframe(str, Enum):
|
|
26
26
|
"""
|
27
27
|
allowed enum values
|
28
28
|
"""
|
29
|
-
ENUM_15M =
|
30
|
-
ENUM_30M =
|
31
|
-
ENUM_1H =
|
32
|
-
ENUM_4H =
|
33
|
-
ENUM_1D =
|
29
|
+
ENUM_15M = "15m"
|
30
|
+
ENUM_30M = "30m"
|
31
|
+
ENUM_1H = "1h"
|
32
|
+
ENUM_4H = "4h"
|
33
|
+
ENUM_1D = "1d"
|
34
34
|
|
35
35
|
@classmethod
|
36
36
|
def from_json(cls, json_str: str) -> Self:
|
37
37
|
"""Create an instance of Timeframe from a JSON string"""
|
38
38
|
return cls(json.loads(json_str))
|
39
|
-
|
40
|
-
|
@@ -24,10 +24,12 @@ from crypticorn.klines.client.models.symbol_type import SymbolType
|
|
24
24
|
from typing import Optional, Set
|
25
25
|
from typing_extensions import Self
|
26
26
|
|
27
|
+
|
27
28
|
class UDFConfigResponse(BaseModel):
|
28
29
|
"""
|
29
30
|
UDFConfigResponse
|
30
|
-
"""
|
31
|
+
""" # noqa: E501
|
32
|
+
|
31
33
|
supported_resolutions: List[StrictStr]
|
32
34
|
supports_group_request: Optional[StrictBool] = False
|
33
35
|
supports_marks: Optional[StrictBool] = False
|
@@ -38,7 +40,18 @@ class UDFConfigResponse(BaseModel):
|
|
38
40
|
symbols_types: List[SymbolType]
|
39
41
|
currency_codes: List[StrictStr]
|
40
42
|
supported_markets: List[StrictStr]
|
41
|
-
__properties: ClassVar[List[str]] = [
|
43
|
+
__properties: ClassVar[List[str]] = [
|
44
|
+
"supported_resolutions",
|
45
|
+
"supports_group_request",
|
46
|
+
"supports_marks",
|
47
|
+
"supports_search",
|
48
|
+
"supports_timescale_marks",
|
49
|
+
"supports_time",
|
50
|
+
"exchanges",
|
51
|
+
"symbols_types",
|
52
|
+
"currency_codes",
|
53
|
+
"supported_markets",
|
54
|
+
]
|
42
55
|
|
43
56
|
model_config = ConfigDict(
|
44
57
|
populate_by_name=True,
|
@@ -46,7 +59,6 @@ class UDFConfigResponse(BaseModel):
|
|
46
59
|
protected_namespaces=(),
|
47
60
|
)
|
48
61
|
|
49
|
-
|
50
62
|
def to_str(self) -> str:
|
51
63
|
"""Returns the string representation of the model using alias"""
|
52
64
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -71,8 +83,7 @@ class UDFConfigResponse(BaseModel):
|
|
71
83
|
were set at model initialization. Other fields with value `None`
|
72
84
|
are ignored.
|
73
85
|
"""
|
74
|
-
excluded_fields: Set[str] = set([
|
75
|
-
])
|
86
|
+
excluded_fields: Set[str] = set([])
|
76
87
|
|
77
88
|
_dict = self.model_dump(
|
78
89
|
by_alias=True,
|
@@ -85,14 +96,14 @@ class UDFConfigResponse(BaseModel):
|
|
85
96
|
for _item_exchanges in self.exchanges:
|
86
97
|
if _item_exchanges:
|
87
98
|
_items.append(_item_exchanges.to_dict())
|
88
|
-
_dict[
|
99
|
+
_dict["exchanges"] = _items
|
89
100
|
# override the default output from pydantic by calling `to_dict()` of each item in symbols_types (list)
|
90
101
|
_items = []
|
91
102
|
if self.symbols_types:
|
92
103
|
for _item_symbols_types in self.symbols_types:
|
93
104
|
if _item_symbols_types:
|
94
105
|
_items.append(_item_symbols_types.to_dict())
|
95
|
-
_dict[
|
106
|
+
_dict["symbols_types"] = _items
|
96
107
|
return _dict
|
97
108
|
|
98
109
|
@classmethod
|
@@ -104,18 +115,46 @@ class UDFConfigResponse(BaseModel):
|
|
104
115
|
if not isinstance(obj, dict):
|
105
116
|
return cls.model_validate(obj)
|
106
117
|
|
107
|
-
_obj = cls.model_validate(
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
118
|
+
_obj = cls.model_validate(
|
119
|
+
{
|
120
|
+
"supported_resolutions": obj.get("supported_resolutions"),
|
121
|
+
"supports_group_request": (
|
122
|
+
obj.get("supports_group_request")
|
123
|
+
if obj.get("supports_group_request") is not None
|
124
|
+
else False
|
125
|
+
),
|
126
|
+
"supports_marks": (
|
127
|
+
obj.get("supports_marks")
|
128
|
+
if obj.get("supports_marks") is not None
|
129
|
+
else False
|
130
|
+
),
|
131
|
+
"supports_search": (
|
132
|
+
obj.get("supports_search")
|
133
|
+
if obj.get("supports_search") is not None
|
134
|
+
else True
|
135
|
+
),
|
136
|
+
"supports_timescale_marks": (
|
137
|
+
obj.get("supports_timescale_marks")
|
138
|
+
if obj.get("supports_timescale_marks") is not None
|
139
|
+
else False
|
140
|
+
),
|
141
|
+
"supports_time": (
|
142
|
+
obj.get("supports_time")
|
143
|
+
if obj.get("supports_time") is not None
|
144
|
+
else True
|
145
|
+
),
|
146
|
+
"exchanges": (
|
147
|
+
[Exchange.from_dict(_item) for _item in obj["exchanges"]]
|
148
|
+
if obj.get("exchanges") is not None
|
149
|
+
else None
|
150
|
+
),
|
151
|
+
"symbols_types": (
|
152
|
+
[SymbolType.from_dict(_item) for _item in obj["symbols_types"]]
|
153
|
+
if obj.get("symbols_types") is not None
|
154
|
+
else None
|
155
|
+
),
|
156
|
+
"currency_codes": obj.get("currency_codes"),
|
157
|
+
"supported_markets": obj.get("supported_markets"),
|
158
|
+
}
|
159
|
+
)
|
119
160
|
return _obj
|
120
|
-
|
121
|
-
|