crypticorn 1.0.2rc4__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-1.0.2rc4.dist-info → crypticorn-2.0.0.dist-info}/METADATA +39 -5
- crypticorn-2.0.0.dist-info/RECORD +226 -0
- {crypticorn-1.0.2rc4.dist-info → crypticorn-2.0.0.dist-info}/WHEEL +1 -1
- crypticorn/hive/utils.py +0 -109
- 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-1.0.2rc4.dist-info/LICENSE.md +0 -19
- crypticorn-1.0.2rc4.dist-info/RECORD +0 -125
- /crypticorn/{klines/test/__init__.py → auth/client/py.typed} +0 -0
- {crypticorn-1.0.2rc4.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.validation_error import ValidationError
|
|
23
23
|
from typing import Optional, Set
|
24
24
|
from typing_extensions import Self
|
25
25
|
|
26
|
+
|
26
27
|
class HTTPValidationError(BaseModel):
|
27
28
|
"""
|
28
29
|
HTTPValidationError
|
29
|
-
"""
|
30
|
+
""" # noqa: E501
|
31
|
+
|
30
32
|
detail: Optional[List[ValidationError]] = None
|
31
33
|
__properties: ClassVar[List[str]] = ["detail"]
|
32
34
|
|
@@ -36,7 +38,6 @@ class HTTPValidationError(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 HTTPValidationError(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,
|
@@ -75,7 +75,7 @@ class HTTPValidationError(BaseModel):
|
|
75
75
|
for _item_detail in self.detail:
|
76
76
|
if _item_detail:
|
77
77
|
_items.append(_item_detail.to_dict())
|
78
|
-
_dict[
|
78
|
+
_dict["detail"] = _items
|
79
79
|
return _dict
|
80
80
|
|
81
81
|
@classmethod
|
@@ -87,9 +87,13 @@ class HTTPValidationError(BaseModel):
|
|
87
87
|
if not isinstance(obj, dict):
|
88
88
|
return cls.model_validate(obj)
|
89
89
|
|
90
|
-
_obj = cls.model_validate(
|
91
|
-
|
92
|
-
|
90
|
+
_obj = cls.model_validate(
|
91
|
+
{
|
92
|
+
"detail": (
|
93
|
+
[ValidationError.from_dict(_item) for _item in obj["detail"]]
|
94
|
+
if obj.get("detail") is not None
|
95
|
+
else None
|
96
|
+
)
|
97
|
+
}
|
98
|
+
)
|
93
99
|
return _obj
|
94
|
-
|
95
|
-
|
@@ -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
|
|
@@ -26,12 +26,10 @@ class MarginMode(str, Enum):
|
|
26
26
|
"""
|
27
27
|
allowed enum values
|
28
28
|
"""
|
29
|
-
ISOLATED =
|
30
|
-
CROSS =
|
29
|
+
ISOLATED = "isolated"
|
30
|
+
CROSS = "cross"
|
31
31
|
|
32
32
|
@classmethod
|
33
33
|
def from_json(cls, json_str: str) -> Self:
|
34
34
|
"""Create an instance of MarginMode from a JSON string"""
|
35
35
|
return cls(json.loads(json_str))
|
36
|
-
|
37
|
-
|
@@ -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
|
|
@@ -26,12 +26,10 @@ class MarketType(str, Enum):
|
|
26
26
|
"""
|
27
27
|
allowed enum values
|
28
28
|
"""
|
29
|
-
SPOT =
|
30
|
-
FUTURES =
|
29
|
+
SPOT = "spot"
|
30
|
+
FUTURES = "futures"
|
31
31
|
|
32
32
|
@classmethod
|
33
33
|
def from_json(cls, json_str: str) -> Self:
|
34
34
|
"""Create an instance of MarketType from a JSON string"""
|
35
35
|
return cls(json.loads(json_str))
|
36
|
-
|
37
|
-
|
@@ -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,23 +20,47 @@ import json
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
22
22
|
from crypticorn.trade.client.models.api_error_identifier import ApiErrorIdentifier
|
23
|
-
from crypticorn.trade.client.models.
|
23
|
+
from crypticorn.trade.client.models.api_error_level import ApiErrorLevel
|
24
|
+
from crypticorn.trade.client.models.api_error_type import ApiErrorType
|
24
25
|
from typing import Optional, Set
|
25
26
|
from typing_extensions import Self
|
26
27
|
|
28
|
+
|
27
29
|
class NotificationModel(BaseModel):
|
28
30
|
"""
|
29
31
|
NotificationModel
|
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: ApiErrorIdentifier = Field(
|
37
|
+
identifier: ApiErrorIdentifier = Field(
|
38
|
+
description="Identifier string. Must match the mapping key in the frontend."
|
39
|
+
)
|
40
|
+
level: ApiErrorLevel = Field(
|
41
|
+
description="Level of the notification. Of type ApiErrorLevel"
|
42
|
+
)
|
43
|
+
type: ApiErrorType = Field(
|
44
|
+
description="Type of the notification. Of type ApiErrorType"
|
45
|
+
)
|
35
46
|
user_id: Optional[StrictStr] = None
|
36
|
-
viewed: Optional[StrictBool] = Field(
|
37
|
-
|
38
|
-
|
39
|
-
|
47
|
+
viewed: Optional[StrictBool] = Field(
|
48
|
+
default=False, description="Whether the notification has been marked as seen"
|
49
|
+
)
|
50
|
+
sent: Optional[StrictBool] = Field(
|
51
|
+
default=False, description="Whether the notification has been sent as an email"
|
52
|
+
)
|
53
|
+
__properties: ClassVar[List[str]] = [
|
54
|
+
"created_at",
|
55
|
+
"updated_at",
|
56
|
+
"id",
|
57
|
+
"identifier",
|
58
|
+
"level",
|
59
|
+
"type",
|
60
|
+
"user_id",
|
61
|
+
"viewed",
|
62
|
+
"sent",
|
63
|
+
]
|
40
64
|
|
41
65
|
model_config = ConfigDict(
|
42
66
|
populate_by_name=True,
|
@@ -44,7 +68,6 @@ class NotificationModel(BaseModel):
|
|
44
68
|
protected_namespaces=(),
|
45
69
|
)
|
46
70
|
|
47
|
-
|
48
71
|
def to_str(self) -> str:
|
49
72
|
"""Returns the string representation of the model using alias"""
|
50
73
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -69,23 +92,32 @@ class NotificationModel(BaseModel):
|
|
69
92
|
were set at model initialization. Other fields with value `None`
|
70
93
|
are ignored.
|
71
94
|
"""
|
72
|
-
excluded_fields: Set[str] = set([
|
73
|
-
])
|
95
|
+
excluded_fields: Set[str] = set([])
|
74
96
|
|
75
97
|
_dict = self.model_dump(
|
76
98
|
by_alias=True,
|
77
99
|
exclude=excluded_fields,
|
78
100
|
exclude_none=True,
|
79
101
|
)
|
102
|
+
# set to None if created_at (nullable) is None
|
103
|
+
# and model_fields_set contains the field
|
104
|
+
if self.created_at is None and "created_at" in self.model_fields_set:
|
105
|
+
_dict["created_at"] = None
|
106
|
+
|
107
|
+
# set to None if updated_at (nullable) is None
|
108
|
+
# and model_fields_set contains the field
|
109
|
+
if self.updated_at is None and "updated_at" in self.model_fields_set:
|
110
|
+
_dict["updated_at"] = None
|
111
|
+
|
80
112
|
# set to None if id (nullable) is None
|
81
113
|
# and model_fields_set contains the field
|
82
114
|
if self.id is None and "id" in self.model_fields_set:
|
83
|
-
_dict[
|
115
|
+
_dict["id"] = None
|
84
116
|
|
85
117
|
# set to None if user_id (nullable) is None
|
86
118
|
# and model_fields_set contains the field
|
87
119
|
if self.user_id is None and "user_id" in self.model_fields_set:
|
88
|
-
_dict[
|
120
|
+
_dict["user_id"] = None
|
89
121
|
|
90
122
|
return _dict
|
91
123
|
|
@@ -98,16 +130,17 @@ class NotificationModel(BaseModel):
|
|
98
130
|
if not isinstance(obj, dict):
|
99
131
|
return cls.model_validate(obj)
|
100
132
|
|
101
|
-
_obj = cls.model_validate(
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
133
|
+
_obj = cls.model_validate(
|
134
|
+
{
|
135
|
+
"created_at": obj.get("created_at"),
|
136
|
+
"updated_at": obj.get("updated_at"),
|
137
|
+
"id": obj.get("id"),
|
138
|
+
"identifier": obj.get("identifier"),
|
139
|
+
"level": obj.get("level"),
|
140
|
+
"type": obj.get("type"),
|
141
|
+
"user_id": obj.get("user_id"),
|
142
|
+
"viewed": obj.get("viewed") if obj.get("viewed") is not None else False,
|
143
|
+
"sent": obj.get("sent") if obj.get("sent") is not None else False,
|
144
|
+
}
|
145
|
+
)
|
111
146
|
return _obj
|
112
|
-
|
113
|
-
|
@@ -26,14 +26,12 @@ class NotificationType(str, Enum):
|
|
26
26
|
"""
|
27
27
|
allowed enum values
|
28
28
|
"""
|
29
|
-
ERROR =
|
30
|
-
SUCCESS =
|
31
|
-
INFO =
|
32
|
-
WARNING =
|
29
|
+
ERROR = "error"
|
30
|
+
SUCCESS = "success"
|
31
|
+
INFO = "info"
|
32
|
+
WARNING = "warning"
|
33
33
|
|
34
34
|
@classmethod
|
35
35
|
def from_json(cls, json_str: str) -> Self:
|
36
36
|
"""Create an instance of NotificationType from a JSON string"""
|
37
37
|
return cls(json.loads(json_str))
|
38
|
-
|
39
|
-
|
@@ -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
|
|
@@ -28,12 +28,14 @@ from crypticorn.trade.client.models.trading_action_type import TradingActionType
|
|
28
28
|
from typing import Optional, Set
|
29
29
|
from typing_extensions import Self
|
30
30
|
|
31
|
+
|
31
32
|
class OrderModel(BaseModel):
|
32
33
|
"""
|
33
34
|
Response model for orders. All optional as the model is built step by step.
|
34
|
-
"""
|
35
|
-
|
36
|
-
|
35
|
+
""" # noqa: E501
|
36
|
+
|
37
|
+
created_at: Optional[StrictInt] = None
|
38
|
+
updated_at: Optional[StrictInt] = None
|
37
39
|
id: Optional[StrictStr] = None
|
38
40
|
trading_action_id: Optional[StrictStr] = None
|
39
41
|
execution_id: Optional[StrictStr] = None
|
@@ -56,9 +58,40 @@ class OrderModel(BaseModel):
|
|
56
58
|
filled_qty: Optional[Union[StrictFloat, StrictInt]] = None
|
57
59
|
fee: Optional[Union[StrictFloat, StrictInt]] = None
|
58
60
|
leverage: Optional[Union[StrictFloat, StrictInt]] = None
|
59
|
-
order_details: Optional[
|
61
|
+
order_details: Optional[Any] = Field(
|
62
|
+
default=None, description="Exchange specific details of the order"
|
63
|
+
)
|
60
64
|
pnl: Optional[Union[StrictFloat, StrictInt]] = None
|
61
|
-
|
65
|
+
order_time: Optional[StrictInt] = None
|
66
|
+
__properties: ClassVar[List[str]] = [
|
67
|
+
"created_at",
|
68
|
+
"updated_at",
|
69
|
+
"id",
|
70
|
+
"trading_action_id",
|
71
|
+
"execution_id",
|
72
|
+
"exchange_order_id",
|
73
|
+
"position_id",
|
74
|
+
"api_key_id",
|
75
|
+
"user_id",
|
76
|
+
"bot_id",
|
77
|
+
"client_order_id",
|
78
|
+
"exchange",
|
79
|
+
"symbol",
|
80
|
+
"common_symbol",
|
81
|
+
"price",
|
82
|
+
"action_type",
|
83
|
+
"market_type",
|
84
|
+
"margin_mode",
|
85
|
+
"status_code",
|
86
|
+
"status",
|
87
|
+
"filled_perc",
|
88
|
+
"filled_qty",
|
89
|
+
"fee",
|
90
|
+
"leverage",
|
91
|
+
"order_details",
|
92
|
+
"pnl",
|
93
|
+
"order_time",
|
94
|
+
]
|
62
95
|
|
63
96
|
model_config = ConfigDict(
|
64
97
|
populate_by_name=True,
|
@@ -66,7 +99,6 @@ class OrderModel(BaseModel):
|
|
66
99
|
protected_namespaces=(),
|
67
100
|
)
|
68
101
|
|
69
|
-
|
70
102
|
def to_str(self) -> str:
|
71
103
|
"""Returns the string representation of the model using alias"""
|
72
104
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -91,133 +123,156 @@ class OrderModel(BaseModel):
|
|
91
123
|
were set at model initialization. Other fields with value `None`
|
92
124
|
are ignored.
|
93
125
|
"""
|
94
|
-
excluded_fields: Set[str] = set([
|
95
|
-
])
|
126
|
+
excluded_fields: Set[str] = set([])
|
96
127
|
|
97
128
|
_dict = self.model_dump(
|
98
129
|
by_alias=True,
|
99
130
|
exclude=excluded_fields,
|
100
131
|
exclude_none=True,
|
101
132
|
)
|
133
|
+
# override the default output from pydantic by calling `to_dict()` of order_details
|
134
|
+
if self.order_details:
|
135
|
+
_dict["order_details"] = self.order_details.to_dict()
|
136
|
+
# set to None if created_at (nullable) is None
|
137
|
+
# and model_fields_set contains the field
|
138
|
+
if self.created_at is None and "created_at" in self.model_fields_set:
|
139
|
+
_dict["created_at"] = None
|
140
|
+
|
141
|
+
# set to None if updated_at (nullable) is None
|
142
|
+
# and model_fields_set contains the field
|
143
|
+
if self.updated_at is None and "updated_at" in self.model_fields_set:
|
144
|
+
_dict["updated_at"] = None
|
145
|
+
|
102
146
|
# set to None if id (nullable) is None
|
103
147
|
# and model_fields_set contains the field
|
104
148
|
if self.id is None and "id" in self.model_fields_set:
|
105
|
-
_dict[
|
149
|
+
_dict["id"] = None
|
106
150
|
|
107
151
|
# set to None if trading_action_id (nullable) is None
|
108
152
|
# and model_fields_set contains the field
|
109
|
-
if
|
110
|
-
|
153
|
+
if (
|
154
|
+
self.trading_action_id is None
|
155
|
+
and "trading_action_id" in self.model_fields_set
|
156
|
+
):
|
157
|
+
_dict["trading_action_id"] = None
|
111
158
|
|
112
159
|
# set to None if execution_id (nullable) is None
|
113
160
|
# and model_fields_set contains the field
|
114
161
|
if self.execution_id is None and "execution_id" in self.model_fields_set:
|
115
|
-
_dict[
|
162
|
+
_dict["execution_id"] = None
|
116
163
|
|
117
164
|
# set to None if exchange_order_id (nullable) is None
|
118
165
|
# and model_fields_set contains the field
|
119
|
-
if
|
120
|
-
|
166
|
+
if (
|
167
|
+
self.exchange_order_id is None
|
168
|
+
and "exchange_order_id" in self.model_fields_set
|
169
|
+
):
|
170
|
+
_dict["exchange_order_id"] = None
|
121
171
|
|
122
172
|
# set to None if position_id (nullable) is None
|
123
173
|
# and model_fields_set contains the field
|
124
174
|
if self.position_id is None and "position_id" in self.model_fields_set:
|
125
|
-
_dict[
|
175
|
+
_dict["position_id"] = None
|
126
176
|
|
127
177
|
# set to None if api_key_id (nullable) is None
|
128
178
|
# and model_fields_set contains the field
|
129
179
|
if self.api_key_id is None and "api_key_id" in self.model_fields_set:
|
130
|
-
_dict[
|
180
|
+
_dict["api_key_id"] = None
|
131
181
|
|
132
182
|
# set to None if user_id (nullable) is None
|
133
183
|
# and model_fields_set contains the field
|
134
184
|
if self.user_id is None and "user_id" in self.model_fields_set:
|
135
|
-
_dict[
|
185
|
+
_dict["user_id"] = None
|
136
186
|
|
137
187
|
# set to None if bot_id (nullable) is None
|
138
188
|
# and model_fields_set contains the field
|
139
189
|
if self.bot_id is None and "bot_id" in self.model_fields_set:
|
140
|
-
_dict[
|
190
|
+
_dict["bot_id"] = None
|
141
191
|
|
142
192
|
# set to None if client_order_id (nullable) is None
|
143
193
|
# and model_fields_set contains the field
|
144
194
|
if self.client_order_id is None and "client_order_id" in self.model_fields_set:
|
145
|
-
_dict[
|
195
|
+
_dict["client_order_id"] = None
|
146
196
|
|
147
197
|
# set to None if exchange (nullable) is None
|
148
198
|
# and model_fields_set contains the field
|
149
199
|
if self.exchange is None and "exchange" in self.model_fields_set:
|
150
|
-
_dict[
|
200
|
+
_dict["exchange"] = None
|
151
201
|
|
152
202
|
# set to None if symbol (nullable) is None
|
153
203
|
# and model_fields_set contains the field
|
154
204
|
if self.symbol is None and "symbol" in self.model_fields_set:
|
155
|
-
_dict[
|
205
|
+
_dict["symbol"] = None
|
156
206
|
|
157
207
|
# set to None if common_symbol (nullable) is None
|
158
208
|
# and model_fields_set contains the field
|
159
209
|
if self.common_symbol is None and "common_symbol" in self.model_fields_set:
|
160
|
-
_dict[
|
210
|
+
_dict["common_symbol"] = None
|
161
211
|
|
162
212
|
# set to None if price (nullable) is None
|
163
213
|
# and model_fields_set contains the field
|
164
214
|
if self.price is None and "price" in self.model_fields_set:
|
165
|
-
_dict[
|
215
|
+
_dict["price"] = None
|
166
216
|
|
167
217
|
# set to None if action_type (nullable) is None
|
168
218
|
# and model_fields_set contains the field
|
169
219
|
if self.action_type is None and "action_type" in self.model_fields_set:
|
170
|
-
_dict[
|
220
|
+
_dict["action_type"] = None
|
171
221
|
|
172
222
|
# set to None if market_type (nullable) is None
|
173
223
|
# and model_fields_set contains the field
|
174
224
|
if self.market_type is None and "market_type" in self.model_fields_set:
|
175
|
-
_dict[
|
225
|
+
_dict["market_type"] = None
|
176
226
|
|
177
227
|
# set to None if margin_mode (nullable) is None
|
178
228
|
# and model_fields_set contains the field
|
179
229
|
if self.margin_mode is None and "margin_mode" in self.model_fields_set:
|
180
|
-
_dict[
|
230
|
+
_dict["margin_mode"] = None
|
181
231
|
|
182
232
|
# set to None if status_code (nullable) is None
|
183
233
|
# and model_fields_set contains the field
|
184
234
|
if self.status_code is None and "status_code" in self.model_fields_set:
|
185
|
-
_dict[
|
235
|
+
_dict["status_code"] = None
|
186
236
|
|
187
237
|
# set to None if status (nullable) is None
|
188
238
|
# and model_fields_set contains the field
|
189
239
|
if self.status is None and "status" in self.model_fields_set:
|
190
|
-
_dict[
|
240
|
+
_dict["status"] = None
|
191
241
|
|
192
242
|
# set to None if filled_perc (nullable) is None
|
193
243
|
# and model_fields_set contains the field
|
194
244
|
if self.filled_perc is None and "filled_perc" in self.model_fields_set:
|
195
|
-
_dict[
|
245
|
+
_dict["filled_perc"] = None
|
196
246
|
|
197
247
|
# set to None if filled_qty (nullable) is None
|
198
248
|
# and model_fields_set contains the field
|
199
249
|
if self.filled_qty is None and "filled_qty" in self.model_fields_set:
|
200
|
-
_dict[
|
250
|
+
_dict["filled_qty"] = None
|
201
251
|
|
202
252
|
# set to None if fee (nullable) is None
|
203
253
|
# and model_fields_set contains the field
|
204
254
|
if self.fee is None and "fee" in self.model_fields_set:
|
205
|
-
_dict[
|
255
|
+
_dict["fee"] = None
|
206
256
|
|
207
257
|
# set to None if leverage (nullable) is None
|
208
258
|
# and model_fields_set contains the field
|
209
259
|
if self.leverage is None and "leverage" in self.model_fields_set:
|
210
|
-
_dict[
|
260
|
+
_dict["leverage"] = None
|
211
261
|
|
212
262
|
# set to None if order_details (nullable) is None
|
213
263
|
# and model_fields_set contains the field
|
214
264
|
if self.order_details is None and "order_details" in self.model_fields_set:
|
215
|
-
_dict[
|
265
|
+
_dict["order_details"] = None
|
216
266
|
|
217
267
|
# set to None if pnl (nullable) is None
|
218
268
|
# and model_fields_set contains the field
|
219
269
|
if self.pnl is None and "pnl" in self.model_fields_set:
|
220
|
-
_dict[
|
270
|
+
_dict["pnl"] = None
|
271
|
+
|
272
|
+
# set to None if order_time (nullable) is None
|
273
|
+
# and model_fields_set contains the field
|
274
|
+
if self.order_time is None and "order_time" in self.model_fields_set:
|
275
|
+
_dict["order_time"] = None
|
221
276
|
|
222
277
|
return _dict
|
223
278
|
|
@@ -230,34 +285,39 @@ class OrderModel(BaseModel):
|
|
230
285
|
if not isinstance(obj, dict):
|
231
286
|
return cls.model_validate(obj)
|
232
287
|
|
233
|
-
_obj = cls.model_validate(
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
288
|
+
_obj = cls.model_validate(
|
289
|
+
{
|
290
|
+
"created_at": obj.get("created_at"),
|
291
|
+
"updated_at": obj.get("updated_at"),
|
292
|
+
"id": obj.get("id"),
|
293
|
+
"trading_action_id": obj.get("trading_action_id"),
|
294
|
+
"execution_id": obj.get("execution_id"),
|
295
|
+
"exchange_order_id": obj.get("exchange_order_id"),
|
296
|
+
"position_id": obj.get("position_id"),
|
297
|
+
"api_key_id": obj.get("api_key_id"),
|
298
|
+
"user_id": obj.get("user_id"),
|
299
|
+
"bot_id": obj.get("bot_id"),
|
300
|
+
"client_order_id": obj.get("client_order_id"),
|
301
|
+
"exchange": obj.get("exchange"),
|
302
|
+
"symbol": obj.get("symbol"),
|
303
|
+
"common_symbol": obj.get("common_symbol"),
|
304
|
+
"price": obj.get("price"),
|
305
|
+
"action_type": obj.get("action_type"),
|
306
|
+
"market_type": obj.get("market_type"),
|
307
|
+
"margin_mode": obj.get("margin_mode"),
|
308
|
+
"status_code": obj.get("status_code"),
|
309
|
+
"status": obj.get("status"),
|
310
|
+
"filled_perc": obj.get("filled_perc"),
|
311
|
+
"filled_qty": obj.get("filled_qty"),
|
312
|
+
"fee": obj.get("fee"),
|
313
|
+
"leverage": obj.get("leverage"),
|
314
|
+
"order_details": (
|
315
|
+
AnyOf.from_dict(obj["order_details"])
|
316
|
+
if obj.get("order_details") is not None
|
317
|
+
else None
|
318
|
+
),
|
319
|
+
"pnl": obj.get("pnl"),
|
320
|
+
"order_time": obj.get("order_time"),
|
321
|
+
}
|
322
|
+
)
|
261
323
|
return _obj
|
262
|
-
|
263
|
-
|
@@ -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
|
|
@@ -26,15 +26,13 @@ class OrderStatus(str, Enum):
|
|
26
26
|
"""
|
27
27
|
allowed enum values
|
28
28
|
"""
|
29
|
-
NEW =
|
30
|
-
FILLED =
|
31
|
-
PARTIALLY_FILLED =
|
32
|
-
CANCELLED =
|
33
|
-
FAILED =
|
29
|
+
NEW = "new"
|
30
|
+
FILLED = "filled"
|
31
|
+
PARTIALLY_FILLED = "partially_filled"
|
32
|
+
CANCELLED = "cancelled"
|
33
|
+
FAILED = "failed"
|
34
34
|
|
35
35
|
@classmethod
|
36
36
|
def from_json(cls, json_str: str) -> Self:
|
37
37
|
"""Create an instance of OrderStatus from a JSON string"""
|
38
38
|
return cls(json.loads(json_str))
|
39
|
-
|
40
|
-
|