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
@@ -1,7 +1,7 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Trading API
|
5
5
|
|
6
6
|
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
7
|
|
@@ -23,10 +23,12 @@ from crypticorn.trade.client.models.execution_ids import ExecutionIds
|
|
23
23
|
from typing import Optional, Set
|
24
24
|
from typing_extensions import Self
|
25
25
|
|
26
|
+
|
26
27
|
class PostFuturesAction(BaseModel):
|
27
28
|
"""
|
28
29
|
PostFuturesAction
|
29
|
-
"""
|
30
|
+
""" # noqa: E501
|
31
|
+
|
30
32
|
id: StrictStr = Field(description="Action ID.")
|
31
33
|
execution_ids: ExecutionIds = Field(description="Execution IDs for the action.")
|
32
34
|
__properties: ClassVar[List[str]] = ["id", "execution_ids"]
|
@@ -37,7 +39,6 @@ class PostFuturesAction(BaseModel):
|
|
37
39
|
protected_namespaces=(),
|
38
40
|
)
|
39
41
|
|
40
|
-
|
41
42
|
def to_str(self) -> str:
|
42
43
|
"""Returns the string representation of the model using alias"""
|
43
44
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -62,8 +63,7 @@ class PostFuturesAction(BaseModel):
|
|
62
63
|
were set at model initialization. Other fields with value `None`
|
63
64
|
are ignored.
|
64
65
|
"""
|
65
|
-
excluded_fields: Set[str] = set([
|
66
|
-
])
|
66
|
+
excluded_fields: Set[str] = set([])
|
67
67
|
|
68
68
|
_dict = self.model_dump(
|
69
69
|
by_alias=True,
|
@@ -72,7 +72,7 @@ class PostFuturesAction(BaseModel):
|
|
72
72
|
)
|
73
73
|
# override the default output from pydantic by calling `to_dict()` of execution_ids
|
74
74
|
if self.execution_ids:
|
75
|
-
_dict[
|
75
|
+
_dict["execution_ids"] = self.execution_ids.to_dict()
|
76
76
|
return _dict
|
77
77
|
|
78
78
|
@classmethod
|
@@ -84,10 +84,14 @@ class PostFuturesAction(BaseModel):
|
|
84
84
|
if not isinstance(obj, dict):
|
85
85
|
return cls.model_validate(obj)
|
86
86
|
|
87
|
-
_obj = cls.model_validate(
|
88
|
-
|
89
|
-
|
90
|
-
|
87
|
+
_obj = cls.model_validate(
|
88
|
+
{
|
89
|
+
"id": obj.get("id"),
|
90
|
+
"execution_ids": (
|
91
|
+
ExecutionIds.from_dict(obj["execution_ids"])
|
92
|
+
if obj.get("execution_ids") is not None
|
93
|
+
else None
|
94
|
+
),
|
95
|
+
}
|
96
|
+
)
|
91
97
|
return _obj
|
92
|
-
|
93
|
-
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Trading API
|
5
5
|
|
6
6
|
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
7
|
|
@@ -23,12 +23,16 @@ from crypticorn.trade.client.models.exchange import Exchange
|
|
23
23
|
from typing import Optional, Set
|
24
24
|
from typing_extensions import Self
|
25
25
|
|
26
|
+
|
26
27
|
class StrategyExchangeInfo(BaseModel):
|
27
28
|
"""
|
28
29
|
StrategyExchangeInfo
|
29
|
-
"""
|
30
|
+
""" # noqa: E501
|
31
|
+
|
30
32
|
exchange: Exchange = Field(description="Exchange name. Of type Exchange")
|
31
|
-
min_amount: Union[StrictFloat, StrictInt] = Field(
|
33
|
+
min_amount: Union[StrictFloat, StrictInt] = Field(
|
34
|
+
description="Minimum amount for the strategy on the exchange"
|
35
|
+
)
|
32
36
|
__properties: ClassVar[List[str]] = ["exchange", "min_amount"]
|
33
37
|
|
34
38
|
model_config = ConfigDict(
|
@@ -37,7 +41,6 @@ class StrategyExchangeInfo(BaseModel):
|
|
37
41
|
protected_namespaces=(),
|
38
42
|
)
|
39
43
|
|
40
|
-
|
41
44
|
def to_str(self) -> str:
|
42
45
|
"""Returns the string representation of the model using alias"""
|
43
46
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -62,8 +65,7 @@ class StrategyExchangeInfo(BaseModel):
|
|
62
65
|
were set at model initialization. Other fields with value `None`
|
63
66
|
are ignored.
|
64
67
|
"""
|
65
|
-
excluded_fields: Set[str] = set([
|
66
|
-
])
|
68
|
+
excluded_fields: Set[str] = set([])
|
67
69
|
|
68
70
|
_dict = self.model_dump(
|
69
71
|
by_alias=True,
|
@@ -81,10 +83,7 @@ class StrategyExchangeInfo(BaseModel):
|
|
81
83
|
if not isinstance(obj, dict):
|
82
84
|
return cls.model_validate(obj)
|
83
85
|
|
84
|
-
_obj = cls.model_validate(
|
85
|
-
"exchange": obj.get("exchange"),
|
86
|
-
|
87
|
-
})
|
86
|
+
_obj = cls.model_validate(
|
87
|
+
{"exchange": obj.get("exchange"), "min_amount": obj.get("min_amount")}
|
88
|
+
)
|
88
89
|
return _obj
|
89
|
-
|
90
|
-
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Trading API
|
5
5
|
|
6
6
|
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
7
|
|
@@ -20,25 +20,48 @@ import json
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
22
22
|
from typing_extensions import Annotated
|
23
|
+
from crypticorn.trade.client.models.market_type import MarketType
|
23
24
|
from crypticorn.trade.client.models.strategy_exchange_info import StrategyExchangeInfo
|
24
25
|
from typing import Optional, Set
|
25
26
|
from typing_extensions import Self
|
26
27
|
|
28
|
+
|
27
29
|
class StrategyModel(BaseModel):
|
28
30
|
"""
|
29
31
|
StrategyModel
|
30
|
-
"""
|
31
|
-
|
32
|
-
|
32
|
+
""" # noqa: E501
|
33
|
+
|
34
|
+
created_at: Optional[StrictInt] = None
|
35
|
+
updated_at: Optional[StrictInt] = None
|
33
36
|
id: Optional[StrictStr] = None
|
34
|
-
identifier: StrictStr = Field(
|
37
|
+
identifier: StrictStr = Field(
|
38
|
+
description="Unique human readable identifier for the strategy e.g. 'daily_trend_momentum'"
|
39
|
+
)
|
35
40
|
name: StrictStr = Field(description="Name of the strategy")
|
36
41
|
description: StrictStr = Field(description="Description of the strategy")
|
37
|
-
exchanges: List[StrategyExchangeInfo] = Field(
|
42
|
+
exchanges: List[StrategyExchangeInfo] = Field(
|
43
|
+
description="Exchanges supported by the strategy."
|
44
|
+
)
|
38
45
|
enabled: StrictBool = Field(description="Whether the strategy is enabled")
|
39
46
|
leverage: StrictInt = Field(description="Leverage for the strategy")
|
40
|
-
performance_fee: Union[
|
41
|
-
|
47
|
+
performance_fee: Union[
|
48
|
+
Annotated[float, Field(le=1.0, strict=True)],
|
49
|
+
Annotated[int, Field(le=1, strict=True)],
|
50
|
+
] = Field(description="Performance fee for the strategy")
|
51
|
+
market_type: MarketType = Field(description="Market of operation of the strategy")
|
52
|
+
__properties: ClassVar[List[str]] = [
|
53
|
+
"created_at",
|
54
|
+
"updated_at",
|
55
|
+
"id",
|
56
|
+
"identifier",
|
57
|
+
"name",
|
58
|
+
"description",
|
59
|
+
"exchanges",
|
60
|
+
"enabled",
|
61
|
+
"leverage",
|
62
|
+
"performance_fee",
|
63
|
+
"market_type",
|
64
|
+
]
|
42
65
|
|
43
66
|
model_config = ConfigDict(
|
44
67
|
populate_by_name=True,
|
@@ -46,7 +69,6 @@ class StrategyModel(BaseModel):
|
|
46
69
|
protected_namespaces=(),
|
47
70
|
)
|
48
71
|
|
49
|
-
|
50
72
|
def to_str(self) -> str:
|
51
73
|
"""Returns the string representation of the model using alias"""
|
52
74
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -71,8 +93,7 @@ class StrategyModel(BaseModel):
|
|
71
93
|
were set at model initialization. Other fields with value `None`
|
72
94
|
are ignored.
|
73
95
|
"""
|
74
|
-
excluded_fields: Set[str] = set([
|
75
|
-
])
|
96
|
+
excluded_fields: Set[str] = set([])
|
76
97
|
|
77
98
|
_dict = self.model_dump(
|
78
99
|
by_alias=True,
|
@@ -85,11 +106,21 @@ class StrategyModel(BaseModel):
|
|
85
106
|
for _item_exchanges in self.exchanges:
|
86
107
|
if _item_exchanges:
|
87
108
|
_items.append(_item_exchanges.to_dict())
|
88
|
-
_dict[
|
109
|
+
_dict["exchanges"] = _items
|
110
|
+
# set to None if created_at (nullable) is None
|
111
|
+
# and model_fields_set contains the field
|
112
|
+
if self.created_at is None and "created_at" in self.model_fields_set:
|
113
|
+
_dict["created_at"] = None
|
114
|
+
|
115
|
+
# set to None if updated_at (nullable) is None
|
116
|
+
# and model_fields_set contains the field
|
117
|
+
if self.updated_at is None and "updated_at" in self.model_fields_set:
|
118
|
+
_dict["updated_at"] = None
|
119
|
+
|
89
120
|
# set to None if id (nullable) is None
|
90
121
|
# and model_fields_set contains the field
|
91
122
|
if self.id is None and "id" in self.model_fields_set:
|
92
|
-
_dict[
|
123
|
+
_dict["id"] = None
|
93
124
|
|
94
125
|
return _dict
|
95
126
|
|
@@ -102,18 +133,26 @@ class StrategyModel(BaseModel):
|
|
102
133
|
if not isinstance(obj, dict):
|
103
134
|
return cls.model_validate(obj)
|
104
135
|
|
105
|
-
_obj = cls.model_validate(
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
136
|
+
_obj = cls.model_validate(
|
137
|
+
{
|
138
|
+
"created_at": obj.get("created_at"),
|
139
|
+
"updated_at": obj.get("updated_at"),
|
140
|
+
"id": obj.get("id"),
|
141
|
+
"identifier": obj.get("identifier"),
|
142
|
+
"name": obj.get("name"),
|
143
|
+
"description": obj.get("description"),
|
144
|
+
"exchanges": (
|
145
|
+
[
|
146
|
+
StrategyExchangeInfo.from_dict(_item)
|
147
|
+
for _item in obj["exchanges"]
|
148
|
+
]
|
149
|
+
if obj.get("exchanges") is not None
|
150
|
+
else None
|
151
|
+
),
|
152
|
+
"enabled": obj.get("enabled"),
|
153
|
+
"leverage": obj.get("leverage"),
|
154
|
+
"performance_fee": obj.get("performance_fee"),
|
155
|
+
"market_type": obj.get("market_type"),
|
156
|
+
}
|
157
|
+
)
|
117
158
|
return _obj
|
118
|
-
|
119
|
-
|
@@ -0,0 +1,160 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Trading 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
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
22
|
+
from typing_extensions import Annotated
|
23
|
+
from crypticorn.trade.client.models.market_type import MarketType
|
24
|
+
from crypticorn.trade.client.models.strategy_exchange_info import StrategyExchangeInfo
|
25
|
+
from typing import Optional, Set
|
26
|
+
from typing_extensions import Self
|
27
|
+
|
28
|
+
|
29
|
+
class StrategyModelInput(BaseModel):
|
30
|
+
"""
|
31
|
+
StrategyModelInput
|
32
|
+
""" # noqa: E501
|
33
|
+
|
34
|
+
created_at: Optional[StrictInt] = None
|
35
|
+
updated_at: Optional[StrictInt] = None
|
36
|
+
id: Optional[StrictStr] = None
|
37
|
+
identifier: StrictStr = Field(
|
38
|
+
description="Unique human readable identifier for the strategy e.g. 'daily_trend_momentum'"
|
39
|
+
)
|
40
|
+
name: StrictStr = Field(description="Name of the strategy")
|
41
|
+
description: StrictStr = Field(description="Description of the strategy")
|
42
|
+
exchanges: List[StrategyExchangeInfo] = Field(
|
43
|
+
description="Exchanges supported by the strategy."
|
44
|
+
)
|
45
|
+
enabled: StrictBool = Field(
|
46
|
+
description="Whether the strategy is enabled. If false, no bots will be created or updated for this strategy, open trades will be rejected. Existing bots will be marked as stopping."
|
47
|
+
)
|
48
|
+
leverage: StrictInt = Field(description="Leverage for the strategy")
|
49
|
+
performance_fee: Union[
|
50
|
+
Annotated[float, Field(le=1.0, strict=True)],
|
51
|
+
Annotated[int, Field(le=1, strict=True)],
|
52
|
+
] = Field(description="Performance fee for the strategy")
|
53
|
+
market_type: MarketType = Field(description="Market of operation of the strategy")
|
54
|
+
__properties: ClassVar[List[str]] = [
|
55
|
+
"created_at",
|
56
|
+
"updated_at",
|
57
|
+
"id",
|
58
|
+
"identifier",
|
59
|
+
"name",
|
60
|
+
"description",
|
61
|
+
"exchanges",
|
62
|
+
"enabled",
|
63
|
+
"leverage",
|
64
|
+
"performance_fee",
|
65
|
+
"market_type",
|
66
|
+
]
|
67
|
+
|
68
|
+
model_config = ConfigDict(
|
69
|
+
populate_by_name=True,
|
70
|
+
validate_assignment=True,
|
71
|
+
protected_namespaces=(),
|
72
|
+
)
|
73
|
+
|
74
|
+
def to_str(self) -> str:
|
75
|
+
"""Returns the string representation of the model using alias"""
|
76
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
77
|
+
|
78
|
+
def to_json(self) -> str:
|
79
|
+
"""Returns the JSON representation of the model using alias"""
|
80
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
81
|
+
return json.dumps(self.to_dict())
|
82
|
+
|
83
|
+
@classmethod
|
84
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
85
|
+
"""Create an instance of StrategyModelInput from a JSON string"""
|
86
|
+
return cls.from_dict(json.loads(json_str))
|
87
|
+
|
88
|
+
def to_dict(self) -> Dict[str, Any]:
|
89
|
+
"""Return the dictionary representation of the model using alias.
|
90
|
+
|
91
|
+
This has the following differences from calling pydantic's
|
92
|
+
`self.model_dump(by_alias=True)`:
|
93
|
+
|
94
|
+
* `None` is only added to the output dict for nullable fields that
|
95
|
+
were set at model initialization. Other fields with value `None`
|
96
|
+
are ignored.
|
97
|
+
"""
|
98
|
+
excluded_fields: Set[str] = set([])
|
99
|
+
|
100
|
+
_dict = self.model_dump(
|
101
|
+
by_alias=True,
|
102
|
+
exclude=excluded_fields,
|
103
|
+
exclude_none=True,
|
104
|
+
)
|
105
|
+
# override the default output from pydantic by calling `to_dict()` of each item in exchanges (list)
|
106
|
+
_items = []
|
107
|
+
if self.exchanges:
|
108
|
+
for _item_exchanges in self.exchanges:
|
109
|
+
if _item_exchanges:
|
110
|
+
_items.append(_item_exchanges.to_dict())
|
111
|
+
_dict["exchanges"] = _items
|
112
|
+
# set to None if created_at (nullable) is None
|
113
|
+
# and model_fields_set contains the field
|
114
|
+
if self.created_at is None and "created_at" in self.model_fields_set:
|
115
|
+
_dict["created_at"] = None
|
116
|
+
|
117
|
+
# set to None if updated_at (nullable) is None
|
118
|
+
# and model_fields_set contains the field
|
119
|
+
if self.updated_at is None and "updated_at" in self.model_fields_set:
|
120
|
+
_dict["updated_at"] = None
|
121
|
+
|
122
|
+
# set to None if id (nullable) is None
|
123
|
+
# and model_fields_set contains the field
|
124
|
+
if self.id is None and "id" in self.model_fields_set:
|
125
|
+
_dict["id"] = None
|
126
|
+
|
127
|
+
return _dict
|
128
|
+
|
129
|
+
@classmethod
|
130
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
131
|
+
"""Create an instance of StrategyModelInput from a dict"""
|
132
|
+
if obj is None:
|
133
|
+
return None
|
134
|
+
|
135
|
+
if not isinstance(obj, dict):
|
136
|
+
return cls.model_validate(obj)
|
137
|
+
|
138
|
+
_obj = cls.model_validate(
|
139
|
+
{
|
140
|
+
"created_at": obj.get("created_at"),
|
141
|
+
"updated_at": obj.get("updated_at"),
|
142
|
+
"id": obj.get("id"),
|
143
|
+
"identifier": obj.get("identifier"),
|
144
|
+
"name": obj.get("name"),
|
145
|
+
"description": obj.get("description"),
|
146
|
+
"exchanges": (
|
147
|
+
[
|
148
|
+
StrategyExchangeInfo.from_dict(_item)
|
149
|
+
for _item in obj["exchanges"]
|
150
|
+
]
|
151
|
+
if obj.get("exchanges") is not None
|
152
|
+
else None
|
153
|
+
),
|
154
|
+
"enabled": obj.get("enabled"),
|
155
|
+
"leverage": obj.get("leverage"),
|
156
|
+
"performance_fee": obj.get("performance_fee"),
|
157
|
+
"market_type": obj.get("market_type"),
|
158
|
+
}
|
159
|
+
)
|
160
|
+
return _obj
|
@@ -0,0 +1,160 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Trading 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
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
22
|
+
from typing_extensions import Annotated
|
23
|
+
from crypticorn.trade.client.models.market_type import MarketType
|
24
|
+
from crypticorn.trade.client.models.strategy_exchange_info import StrategyExchangeInfo
|
25
|
+
from typing import Optional, Set
|
26
|
+
from typing_extensions import Self
|
27
|
+
|
28
|
+
|
29
|
+
class StrategyModelOutput(BaseModel):
|
30
|
+
"""
|
31
|
+
StrategyModelOutput
|
32
|
+
""" # noqa: E501
|
33
|
+
|
34
|
+
created_at: Optional[StrictInt] = None
|
35
|
+
updated_at: Optional[StrictInt] = None
|
36
|
+
id: Optional[StrictStr] = None
|
37
|
+
identifier: StrictStr = Field(
|
38
|
+
description="Unique human readable identifier for the strategy e.g. 'daily_trend_momentum'"
|
39
|
+
)
|
40
|
+
name: StrictStr = Field(description="Name of the strategy")
|
41
|
+
description: StrictStr = Field(description="Description of the strategy")
|
42
|
+
exchanges: List[StrategyExchangeInfo] = Field(
|
43
|
+
description="Exchanges supported by the strategy."
|
44
|
+
)
|
45
|
+
enabled: StrictBool = Field(
|
46
|
+
description="Whether the strategy is enabled. If false, no bots will be created or updated for this strategy, open trades will be rejected. Existing bots will be marked as stopping."
|
47
|
+
)
|
48
|
+
leverage: StrictInt = Field(description="Leverage for the strategy")
|
49
|
+
performance_fee: Union[
|
50
|
+
Annotated[float, Field(le=1.0, strict=True)],
|
51
|
+
Annotated[int, Field(le=1, strict=True)],
|
52
|
+
] = Field(description="Performance fee for the strategy")
|
53
|
+
market_type: MarketType = Field(description="Market of operation of the strategy")
|
54
|
+
__properties: ClassVar[List[str]] = [
|
55
|
+
"created_at",
|
56
|
+
"updated_at",
|
57
|
+
"id",
|
58
|
+
"identifier",
|
59
|
+
"name",
|
60
|
+
"description",
|
61
|
+
"exchanges",
|
62
|
+
"enabled",
|
63
|
+
"leverage",
|
64
|
+
"performance_fee",
|
65
|
+
"market_type",
|
66
|
+
]
|
67
|
+
|
68
|
+
model_config = ConfigDict(
|
69
|
+
populate_by_name=True,
|
70
|
+
validate_assignment=True,
|
71
|
+
protected_namespaces=(),
|
72
|
+
)
|
73
|
+
|
74
|
+
def to_str(self) -> str:
|
75
|
+
"""Returns the string representation of the model using alias"""
|
76
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
77
|
+
|
78
|
+
def to_json(self) -> str:
|
79
|
+
"""Returns the JSON representation of the model using alias"""
|
80
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
81
|
+
return json.dumps(self.to_dict())
|
82
|
+
|
83
|
+
@classmethod
|
84
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
85
|
+
"""Create an instance of StrategyModelOutput from a JSON string"""
|
86
|
+
return cls.from_dict(json.loads(json_str))
|
87
|
+
|
88
|
+
def to_dict(self) -> Dict[str, Any]:
|
89
|
+
"""Return the dictionary representation of the model using alias.
|
90
|
+
|
91
|
+
This has the following differences from calling pydantic's
|
92
|
+
`self.model_dump(by_alias=True)`:
|
93
|
+
|
94
|
+
* `None` is only added to the output dict for nullable fields that
|
95
|
+
were set at model initialization. Other fields with value `None`
|
96
|
+
are ignored.
|
97
|
+
"""
|
98
|
+
excluded_fields: Set[str] = set([])
|
99
|
+
|
100
|
+
_dict = self.model_dump(
|
101
|
+
by_alias=True,
|
102
|
+
exclude=excluded_fields,
|
103
|
+
exclude_none=True,
|
104
|
+
)
|
105
|
+
# override the default output from pydantic by calling `to_dict()` of each item in exchanges (list)
|
106
|
+
_items = []
|
107
|
+
if self.exchanges:
|
108
|
+
for _item_exchanges in self.exchanges:
|
109
|
+
if _item_exchanges:
|
110
|
+
_items.append(_item_exchanges.to_dict())
|
111
|
+
_dict["exchanges"] = _items
|
112
|
+
# set to None if created_at (nullable) is None
|
113
|
+
# and model_fields_set contains the field
|
114
|
+
if self.created_at is None and "created_at" in self.model_fields_set:
|
115
|
+
_dict["created_at"] = None
|
116
|
+
|
117
|
+
# set to None if updated_at (nullable) is None
|
118
|
+
# and model_fields_set contains the field
|
119
|
+
if self.updated_at is None and "updated_at" in self.model_fields_set:
|
120
|
+
_dict["updated_at"] = None
|
121
|
+
|
122
|
+
# set to None if id (nullable) is None
|
123
|
+
# and model_fields_set contains the field
|
124
|
+
if self.id is None and "id" in self.model_fields_set:
|
125
|
+
_dict["id"] = None
|
126
|
+
|
127
|
+
return _dict
|
128
|
+
|
129
|
+
@classmethod
|
130
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
131
|
+
"""Create an instance of StrategyModelOutput from a dict"""
|
132
|
+
if obj is None:
|
133
|
+
return None
|
134
|
+
|
135
|
+
if not isinstance(obj, dict):
|
136
|
+
return cls.model_validate(obj)
|
137
|
+
|
138
|
+
_obj = cls.model_validate(
|
139
|
+
{
|
140
|
+
"created_at": obj.get("created_at"),
|
141
|
+
"updated_at": obj.get("updated_at"),
|
142
|
+
"id": obj.get("id"),
|
143
|
+
"identifier": obj.get("identifier"),
|
144
|
+
"name": obj.get("name"),
|
145
|
+
"description": obj.get("description"),
|
146
|
+
"exchanges": (
|
147
|
+
[
|
148
|
+
StrategyExchangeInfo.from_dict(_item)
|
149
|
+
for _item in obj["exchanges"]
|
150
|
+
]
|
151
|
+
if obj.get("exchanges") is not None
|
152
|
+
else None
|
153
|
+
),
|
154
|
+
"enabled": obj.get("enabled"),
|
155
|
+
"leverage": obj.get("leverage"),
|
156
|
+
"performance_fee": obj.get("performance_fee"),
|
157
|
+
"market_type": obj.get("market_type"),
|
158
|
+
}
|
159
|
+
)
|
160
|
+
return _obj
|