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
|
|
@@ -17,7 +17,15 @@ import pprint
|
|
17
17
|
import re # noqa: F401
|
18
18
|
import json
|
19
19
|
|
20
|
-
from pydantic import
|
20
|
+
from pydantic import (
|
21
|
+
BaseModel,
|
22
|
+
ConfigDict,
|
23
|
+
Field,
|
24
|
+
StrictBool,
|
25
|
+
StrictFloat,
|
26
|
+
StrictInt,
|
27
|
+
StrictStr,
|
28
|
+
)
|
21
29
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
22
30
|
from typing_extensions import Annotated
|
23
31
|
from crypticorn.trade.client.models.margin_mode import MarginMode
|
@@ -27,12 +35,14 @@ from crypticorn.trade.client.models.trading_action_type import TradingActionType
|
|
27
35
|
from typing import Optional, Set
|
28
36
|
from typing_extensions import Self
|
29
37
|
|
38
|
+
|
30
39
|
class ActionModel(BaseModel):
|
31
40
|
"""
|
32
41
|
ActionModel
|
33
|
-
"""
|
34
|
-
|
35
|
-
|
42
|
+
""" # noqa: E501
|
43
|
+
|
44
|
+
created_at: Optional[StrictInt] = None
|
45
|
+
updated_at: Optional[StrictInt] = None
|
36
46
|
id: Optional[StrictStr] = None
|
37
47
|
execution_id: Optional[StrictStr] = None
|
38
48
|
open_order_execution_id: Optional[StrictStr] = None
|
@@ -40,17 +50,47 @@ class ActionModel(BaseModel):
|
|
40
50
|
action_type: TradingActionType = Field(description="The type of action.")
|
41
51
|
market_type: MarketType = Field(description="The type of market the action is for.")
|
42
52
|
strategy_id: StrictStr = Field(description="UID for the strategy.")
|
43
|
-
symbol: StrictStr = Field(
|
53
|
+
symbol: StrictStr = Field(
|
54
|
+
description="Trading symbol or asset pair in format: 'symbol/quote_currency' (see market service for valid symbols)"
|
55
|
+
)
|
44
56
|
is_limit: Optional[StrictBool] = None
|
45
57
|
limit_price: Optional[Union[StrictFloat, StrictInt]] = None
|
46
|
-
allocation: Optional[
|
58
|
+
allocation: Optional[
|
59
|
+
Union[
|
60
|
+
Annotated[float, Field(le=1.0, strict=True)],
|
61
|
+
Annotated[int, Field(le=1, strict=True)],
|
62
|
+
]
|
63
|
+
] = Field(
|
64
|
+
default=None,
|
65
|
+
description="How much of bot's balance to use for the order (for open actions). How much of the reference open order (open_order_execution_id) to close (for close actions). 0=0%, 1=100%.",
|
66
|
+
)
|
47
67
|
take_profit: Optional[List[TPSL]] = None
|
48
68
|
stop_loss: Optional[List[TPSL]] = None
|
49
69
|
expiry_timestamp: Optional[StrictInt] = None
|
50
70
|
position_id: Optional[StrictStr] = None
|
51
71
|
leverage: Optional[Annotated[int, Field(strict=True, ge=1)]]
|
52
72
|
margin_mode: Optional[MarginMode] = None
|
53
|
-
__properties: ClassVar[List[str]] = [
|
73
|
+
__properties: ClassVar[List[str]] = [
|
74
|
+
"created_at",
|
75
|
+
"updated_at",
|
76
|
+
"id",
|
77
|
+
"execution_id",
|
78
|
+
"open_order_execution_id",
|
79
|
+
"client_order_id",
|
80
|
+
"action_type",
|
81
|
+
"market_type",
|
82
|
+
"strategy_id",
|
83
|
+
"symbol",
|
84
|
+
"is_limit",
|
85
|
+
"limit_price",
|
86
|
+
"allocation",
|
87
|
+
"take_profit",
|
88
|
+
"stop_loss",
|
89
|
+
"expiry_timestamp",
|
90
|
+
"position_id",
|
91
|
+
"leverage",
|
92
|
+
"margin_mode",
|
93
|
+
]
|
54
94
|
|
55
95
|
model_config = ConfigDict(
|
56
96
|
populate_by_name=True,
|
@@ -58,7 +98,6 @@ class ActionModel(BaseModel):
|
|
58
98
|
protected_namespaces=(),
|
59
99
|
)
|
60
100
|
|
61
|
-
|
62
101
|
def to_str(self) -> str:
|
63
102
|
"""Returns the string representation of the model using alias"""
|
64
103
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -83,8 +122,7 @@ class ActionModel(BaseModel):
|
|
83
122
|
were set at model initialization. Other fields with value `None`
|
84
123
|
are ignored.
|
85
124
|
"""
|
86
|
-
excluded_fields: Set[str] = set([
|
87
|
-
])
|
125
|
+
excluded_fields: Set[str] = set([])
|
88
126
|
|
89
127
|
_dict = self.model_dump(
|
90
128
|
by_alias=True,
|
@@ -97,73 +135,89 @@ class ActionModel(BaseModel):
|
|
97
135
|
for _item_take_profit in self.take_profit:
|
98
136
|
if _item_take_profit:
|
99
137
|
_items.append(_item_take_profit.to_dict())
|
100
|
-
_dict[
|
138
|
+
_dict["take_profit"] = _items
|
101
139
|
# override the default output from pydantic by calling `to_dict()` of each item in stop_loss (list)
|
102
140
|
_items = []
|
103
141
|
if self.stop_loss:
|
104
142
|
for _item_stop_loss in self.stop_loss:
|
105
143
|
if _item_stop_loss:
|
106
144
|
_items.append(_item_stop_loss.to_dict())
|
107
|
-
_dict[
|
145
|
+
_dict["stop_loss"] = _items
|
146
|
+
# set to None if created_at (nullable) is None
|
147
|
+
# and model_fields_set contains the field
|
148
|
+
if self.created_at is None and "created_at" in self.model_fields_set:
|
149
|
+
_dict["created_at"] = None
|
150
|
+
|
151
|
+
# set to None if updated_at (nullable) is None
|
152
|
+
# and model_fields_set contains the field
|
153
|
+
if self.updated_at is None and "updated_at" in self.model_fields_set:
|
154
|
+
_dict["updated_at"] = None
|
155
|
+
|
108
156
|
# set to None if id (nullable) is None
|
109
157
|
# and model_fields_set contains the field
|
110
158
|
if self.id is None and "id" in self.model_fields_set:
|
111
|
-
_dict[
|
159
|
+
_dict["id"] = None
|
112
160
|
|
113
161
|
# set to None if execution_id (nullable) is None
|
114
162
|
# and model_fields_set contains the field
|
115
163
|
if self.execution_id is None and "execution_id" in self.model_fields_set:
|
116
|
-
_dict[
|
164
|
+
_dict["execution_id"] = None
|
117
165
|
|
118
166
|
# set to None if open_order_execution_id (nullable) is None
|
119
167
|
# and model_fields_set contains the field
|
120
|
-
if
|
121
|
-
|
168
|
+
if (
|
169
|
+
self.open_order_execution_id is None
|
170
|
+
and "open_order_execution_id" in self.model_fields_set
|
171
|
+
):
|
172
|
+
_dict["open_order_execution_id"] = None
|
122
173
|
|
123
174
|
# set to None if client_order_id (nullable) is None
|
124
175
|
# and model_fields_set contains the field
|
125
176
|
if self.client_order_id is None and "client_order_id" in self.model_fields_set:
|
126
|
-
_dict[
|
177
|
+
_dict["client_order_id"] = None
|
127
178
|
|
128
179
|
# set to None if is_limit (nullable) is None
|
129
180
|
# and model_fields_set contains the field
|
130
181
|
if self.is_limit is None and "is_limit" in self.model_fields_set:
|
131
|
-
_dict[
|
182
|
+
_dict["is_limit"] = None
|
132
183
|
|
133
184
|
# set to None if limit_price (nullable) is None
|
134
185
|
# and model_fields_set contains the field
|
135
186
|
if self.limit_price is None and "limit_price" in self.model_fields_set:
|
136
|
-
_dict[
|
187
|
+
_dict["limit_price"] = None
|
137
188
|
|
138
189
|
# set to None if take_profit (nullable) is None
|
139
190
|
# and model_fields_set contains the field
|
140
191
|
if self.take_profit is None and "take_profit" in self.model_fields_set:
|
141
|
-
_dict[
|
192
|
+
_dict["take_profit"] = None
|
142
193
|
|
143
194
|
# set to None if stop_loss (nullable) is None
|
144
195
|
# and model_fields_set contains the field
|
145
196
|
if self.stop_loss is None and "stop_loss" in self.model_fields_set:
|
146
|
-
_dict[
|
197
|
+
_dict["stop_loss"] = None
|
147
198
|
|
148
199
|
# set to None if expiry_timestamp (nullable) is None
|
149
200
|
# and model_fields_set contains the field
|
150
|
-
if
|
151
|
-
|
201
|
+
if (
|
202
|
+
self.expiry_timestamp is None
|
203
|
+
and "expiry_timestamp" in self.model_fields_set
|
204
|
+
):
|
205
|
+
_dict["expiry_timestamp"] = None
|
152
206
|
|
153
207
|
# set to None if position_id (nullable) is None
|
154
208
|
# and model_fields_set contains the field
|
155
209
|
if self.position_id is None and "position_id" in self.model_fields_set:
|
156
|
-
_dict[
|
210
|
+
_dict["position_id"] = None
|
157
211
|
|
158
212
|
# set to None if leverage (nullable) is None
|
159
213
|
# and model_fields_set contains the field
|
160
214
|
if self.leverage is None and "leverage" in self.model_fields_set:
|
161
|
-
_dict[
|
215
|
+
_dict["leverage"] = None
|
162
216
|
|
163
217
|
# set to None if margin_mode (nullable) is None
|
164
218
|
# and model_fields_set contains the field
|
165
219
|
if self.margin_mode is None and "margin_mode" in self.model_fields_set:
|
166
|
-
_dict[
|
220
|
+
_dict["margin_mode"] = None
|
167
221
|
|
168
222
|
return _dict
|
169
223
|
|
@@ -176,27 +230,37 @@ class ActionModel(BaseModel):
|
|
176
230
|
if not isinstance(obj, dict):
|
177
231
|
return cls.model_validate(obj)
|
178
232
|
|
179
|
-
_obj = cls.model_validate(
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
233
|
+
_obj = cls.model_validate(
|
234
|
+
{
|
235
|
+
"created_at": obj.get("created_at"),
|
236
|
+
"updated_at": obj.get("updated_at"),
|
237
|
+
"id": obj.get("id"),
|
238
|
+
"execution_id": obj.get("execution_id"),
|
239
|
+
"open_order_execution_id": obj.get("open_order_execution_id"),
|
240
|
+
"client_order_id": obj.get("client_order_id"),
|
241
|
+
"action_type": obj.get("action_type"),
|
242
|
+
"market_type": obj.get("market_type"),
|
243
|
+
"strategy_id": obj.get("strategy_id"),
|
244
|
+
"symbol": obj.get("symbol"),
|
245
|
+
"is_limit": obj.get("is_limit"),
|
246
|
+
"limit_price": obj.get("limit_price"),
|
247
|
+
"allocation": obj.get("allocation"),
|
248
|
+
"take_profit": (
|
249
|
+
[TPSL.from_dict(_item) for _item in obj["take_profit"]]
|
250
|
+
if obj.get("take_profit") is not None
|
251
|
+
else None
|
252
|
+
),
|
253
|
+
"stop_loss": (
|
254
|
+
[TPSL.from_dict(_item) for _item in obj["stop_loss"]]
|
255
|
+
if obj.get("stop_loss") is not None
|
256
|
+
else None
|
257
|
+
),
|
258
|
+
"expiry_timestamp": obj.get("expiry_timestamp"),
|
259
|
+
"position_id": obj.get("position_id"),
|
260
|
+
"leverage": (
|
261
|
+
obj.get("leverage") if obj.get("leverage") is not None else 1
|
262
|
+
),
|
263
|
+
"margin_mode": obj.get("margin_mode"),
|
264
|
+
}
|
265
|
+
)
|
200
266
|
return _obj
|
201
|
-
|
202
|
-
|
@@ -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,58 +26,67 @@ class ApiErrorIdentifier(str, Enum):
|
|
26
26
|
"""
|
27
27
|
allowed enum values
|
28
28
|
"""
|
29
|
-
SUCCESS =
|
30
|
-
INVALID_API_KEY =
|
31
|
-
INVALID_SIGNATURE =
|
32
|
-
INVALID_TIMESTAMP =
|
33
|
-
IP_ADDRESS_IS_NOT_AUTHORIZED =
|
34
|
-
INSUFFICIENT_PERMISSIONS_SPOT_AND_FUTURES_REQUIRED =
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
29
|
+
SUCCESS = "success"
|
30
|
+
INVALID_API_KEY = "invalid_api_key"
|
31
|
+
INVALID_SIGNATURE = "invalid_signature"
|
32
|
+
INVALID_TIMESTAMP = "invalid_timestamp"
|
33
|
+
IP_ADDRESS_IS_NOT_AUTHORIZED = "ip_address_is_not_authorized"
|
34
|
+
INSUFFICIENT_PERMISSIONS_SPOT_AND_FUTURES_REQUIRED = (
|
35
|
+
"insufficient_permissions_spot_and_futures_required"
|
36
|
+
)
|
37
|
+
USER_ACCOUNT_IS_FROZEN = "user_account_is_frozen"
|
38
|
+
RATE_LIMIT_EXCEEDED = "rate_limit_exceeded"
|
39
|
+
INVALID_PARAMETER_PROVIDED = "invalid_parameter_provided"
|
40
|
+
REQUEST_SCOPE_LIMIT_EXCEEDED = "request_scope_limit_exceeded"
|
41
|
+
INVALID_CONTENT_TYPE = "invalid_content_type"
|
42
|
+
REQUESTED_RESOURCE_NOT_FOUND = "requested_resource_not_found"
|
43
|
+
ORDER_DOES_NOT_EXIST = "order_does_not_exist"
|
44
|
+
ORDER_IS_ALREADY_FILLED = "order_is_already_filled"
|
45
|
+
ORDER_IS_BEING_PROCESSED = "order_is_being_processed"
|
46
|
+
ORDER_QUANTITY_LIMIT_EXCEEDED = "order_quantity_limit_exceeded"
|
47
|
+
ORDER_PRICE_IS_INVALID = "order_price_is_invalid"
|
48
|
+
POST_ONLY_ORDER_WOULD_IMMEDIATELY_MATCH = "post_only_order_would_immediately_match"
|
49
|
+
SYMBOL_DOES_NOT_EXIST = "symbol_does_not_exist"
|
50
|
+
CLIENT_ORDER_ID_ALREADY_EXISTS = "client_order_id_already_exists"
|
51
|
+
POSITION_DOES_NOT_EXIST = "position_does_not_exist"
|
52
|
+
POSITION_LIMIT_EXCEEDED = "position_limit_exceeded"
|
53
|
+
POSITION_OPENING_TEMPORARILY_SUSPENDED = "position_opening_temporarily_suspended"
|
54
|
+
INSUFFICIENT_BALANCE = "insufficient_balance"
|
55
|
+
INSUFFICIENT_MARGIN = "insufficient_margin"
|
56
|
+
LEVERAGE_LIMIT_EXCEEDED = "leverage_limit_exceeded"
|
57
|
+
RISK_LIMIT_EXCEEDED = "risk_limit_exceeded"
|
58
|
+
ORDER_VIOLATES_LIQUIDATION_PRICE_CONSTRAINTS = (
|
59
|
+
"order_violates_liquidation_price_constraints"
|
60
|
+
)
|
61
|
+
INVALID_MARGIN_MODE = "invalid_margin_mode"
|
62
|
+
INTERNAL_SYSTEM_ERROR = "internal_system_error"
|
63
|
+
SYSTEM_CONFIGURATION_ERROR = "system_configuration_error"
|
64
|
+
SERVICE_TEMPORARILY_UNAVAILABLE = "service_temporarily_unavailable"
|
65
|
+
SYSTEM_IS_BUSY_PLEASE_TRY_AGAIN_LATER = "system_is_busy_please_try_again_later"
|
66
|
+
SYSTEM_UNDER_MAINTENANCE = "system_under_maintenance"
|
67
|
+
RPC_TIMEOUT = "rpc_timeout"
|
68
|
+
SYSTEM_SETTLEMENT_IN_PROCESS = "system_settlement_in_process"
|
69
|
+
TRADING_IS_SUSPENDED = "trading_is_suspended"
|
70
|
+
TRADING_HAS_BEEN_LOCKED = "trading_has_been_locked"
|
71
|
+
UNKNOWN_ERROR_OCCURRED = "unknown_error_occurred"
|
72
|
+
HTTP_REQUEST_ERROR = "http_request_error"
|
73
|
+
BLACK_SWAN = "black_swan"
|
74
|
+
TRADING_ACTION_EXPIRED = "trading_action_expired"
|
75
|
+
TRADING_ACTION_SKIPPED = "trading_action_skipped"
|
76
|
+
BOT_DISABLED = "bot_disabled"
|
77
|
+
ORDER_SIZE_TOO_SMALL = "order_size_too_small"
|
78
|
+
ORDER_SIZE_TOO_LARGE = "order_size_too_large"
|
79
|
+
HEDGE_MODE_NOT_ACTIVE = "hedge_mode_not_active"
|
80
|
+
API_KEY_ALREADY_EXISTS = "api_key_already_exists"
|
81
|
+
DELETE_BOT_ERROR = "delete_bot_error"
|
82
|
+
JWT_EXPIRED = "jwt_expired"
|
83
|
+
BOT_STOPPING_COMPLETED = "bot_stopping_completed"
|
84
|
+
OBJECT_NOT_FOUND = "object_not_found"
|
85
|
+
STRATEGY_DISABLED = "strategy_disabled"
|
86
|
+
API_KEY_IN_USE_BY_BOTS = "api_key_in_use_by_bots"
|
87
|
+
BOT_ALREADY_DELETED = "bot_already_deleted"
|
77
88
|
|
78
89
|
@classmethod
|
79
90
|
def from_json(cls, json_str: str) -> Self:
|
80
91
|
"""Create an instance of ApiErrorIdentifier from a JSON string"""
|
81
92
|
return cls(json.loads(json_str))
|
82
|
-
|
83
|
-
|
@@ -0,0 +1,37 @@
|
|
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 json
|
17
|
+
from enum import Enum
|
18
|
+
from typing_extensions import Self
|
19
|
+
|
20
|
+
|
21
|
+
class ApiErrorLevel(str, Enum):
|
22
|
+
"""
|
23
|
+
ApiErrorLevel
|
24
|
+
"""
|
25
|
+
|
26
|
+
"""
|
27
|
+
allowed enum values
|
28
|
+
"""
|
29
|
+
ERROR = "error"
|
30
|
+
SUCCESS = "success"
|
31
|
+
INFO = "info"
|
32
|
+
WARNING = "warning"
|
33
|
+
|
34
|
+
@classmethod
|
35
|
+
def from_json(cls, json_str: str) -> Self:
|
36
|
+
"""Create an instance of ApiErrorLevel from a JSON string"""
|
37
|
+
return cls(json.loads(json_str))
|
@@ -0,0 +1,37 @@
|
|
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 json
|
17
|
+
from enum import Enum
|
18
|
+
from typing_extensions import Self
|
19
|
+
|
20
|
+
|
21
|
+
class ApiErrorType(str, Enum):
|
22
|
+
"""
|
23
|
+
Type of API error
|
24
|
+
"""
|
25
|
+
|
26
|
+
"""
|
27
|
+
allowed enum values
|
28
|
+
"""
|
29
|
+
USER_ERROR = "user error"
|
30
|
+
EXCHANGE_ERROR = "exchange error"
|
31
|
+
SERVER_ERROR = "server error"
|
32
|
+
NO_ERROR = "no error"
|
33
|
+
|
34
|
+
@classmethod
|
35
|
+
def from_json(cls, json_str: str) -> Self:
|
36
|
+
"""Create an instance of ApiErrorType from a JSON string"""
|
37
|
+
return cls(json.loads(json_str))
|
@@ -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
|
|
@@ -22,12 +22,14 @@ 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 APIKeyModel(BaseModel):
|
26
27
|
"""
|
27
28
|
APIKeyModel
|
28
|
-
"""
|
29
|
-
|
30
|
-
|
29
|
+
""" # noqa: E501
|
30
|
+
|
31
|
+
created_at: Optional[StrictInt] = None
|
32
|
+
updated_at: Optional[StrictInt] = None
|
31
33
|
id: Optional[StrictStr] = None
|
32
34
|
exchange: StrictStr = Field(description="Exchange name")
|
33
35
|
api_key: Optional[StrictStr] = None
|
@@ -36,7 +38,18 @@ class APIKeyModel(BaseModel):
|
|
36
38
|
label: StrictStr = Field(description="Label for the API key")
|
37
39
|
enabled: Optional[StrictBool] = None
|
38
40
|
user_id: Optional[StrictStr] = None
|
39
|
-
__properties: ClassVar[List[str]] = [
|
41
|
+
__properties: ClassVar[List[str]] = [
|
42
|
+
"created_at",
|
43
|
+
"updated_at",
|
44
|
+
"id",
|
45
|
+
"exchange",
|
46
|
+
"api_key",
|
47
|
+
"secret",
|
48
|
+
"passphrase",
|
49
|
+
"label",
|
50
|
+
"enabled",
|
51
|
+
"user_id",
|
52
|
+
]
|
40
53
|
|
41
54
|
model_config = ConfigDict(
|
42
55
|
populate_by_name=True,
|
@@ -44,7 +57,6 @@ class APIKeyModel(BaseModel):
|
|
44
57
|
protected_namespaces=(),
|
45
58
|
)
|
46
59
|
|
47
|
-
|
48
60
|
def to_str(self) -> str:
|
49
61
|
"""Returns the string representation of the model using alias"""
|
50
62
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -69,43 +81,52 @@ class APIKeyModel(BaseModel):
|
|
69
81
|
were set at model initialization. Other fields with value `None`
|
70
82
|
are ignored.
|
71
83
|
"""
|
72
|
-
excluded_fields: Set[str] = set([
|
73
|
-
])
|
84
|
+
excluded_fields: Set[str] = set([])
|
74
85
|
|
75
86
|
_dict = self.model_dump(
|
76
87
|
by_alias=True,
|
77
88
|
exclude=excluded_fields,
|
78
89
|
exclude_none=True,
|
79
90
|
)
|
91
|
+
# set to None if created_at (nullable) is None
|
92
|
+
# and model_fields_set contains the field
|
93
|
+
if self.created_at is None and "created_at" in self.model_fields_set:
|
94
|
+
_dict["created_at"] = None
|
95
|
+
|
96
|
+
# set to None if updated_at (nullable) is None
|
97
|
+
# and model_fields_set contains the field
|
98
|
+
if self.updated_at is None and "updated_at" in self.model_fields_set:
|
99
|
+
_dict["updated_at"] = None
|
100
|
+
|
80
101
|
# set to None if id (nullable) is None
|
81
102
|
# and model_fields_set contains the field
|
82
103
|
if self.id is None and "id" in self.model_fields_set:
|
83
|
-
_dict[
|
104
|
+
_dict["id"] = None
|
84
105
|
|
85
106
|
# set to None if api_key (nullable) is None
|
86
107
|
# and model_fields_set contains the field
|
87
108
|
if self.api_key is None and "api_key" in self.model_fields_set:
|
88
|
-
_dict[
|
109
|
+
_dict["api_key"] = None
|
89
110
|
|
90
111
|
# set to None if secret (nullable) is None
|
91
112
|
# and model_fields_set contains the field
|
92
113
|
if self.secret is None and "secret" in self.model_fields_set:
|
93
|
-
_dict[
|
114
|
+
_dict["secret"] = None
|
94
115
|
|
95
116
|
# set to None if passphrase (nullable) is None
|
96
117
|
# and model_fields_set contains the field
|
97
118
|
if self.passphrase is None and "passphrase" in self.model_fields_set:
|
98
|
-
_dict[
|
119
|
+
_dict["passphrase"] = None
|
99
120
|
|
100
121
|
# set to None if enabled (nullable) is None
|
101
122
|
# and model_fields_set contains the field
|
102
123
|
if self.enabled is None and "enabled" in self.model_fields_set:
|
103
|
-
_dict[
|
124
|
+
_dict["enabled"] = None
|
104
125
|
|
105
126
|
# set to None if user_id (nullable) is None
|
106
127
|
# and model_fields_set contains the field
|
107
128
|
if self.user_id is None and "user_id" in self.model_fields_set:
|
108
|
-
_dict[
|
129
|
+
_dict["user_id"] = None
|
109
130
|
|
110
131
|
return _dict
|
111
132
|
|
@@ -118,18 +139,18 @@ class APIKeyModel(BaseModel):
|
|
118
139
|
if not isinstance(obj, dict):
|
119
140
|
return cls.model_validate(obj)
|
120
141
|
|
121
|
-
_obj = cls.model_validate(
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
142
|
+
_obj = cls.model_validate(
|
143
|
+
{
|
144
|
+
"created_at": obj.get("created_at"),
|
145
|
+
"updated_at": obj.get("updated_at"),
|
146
|
+
"id": obj.get("id"),
|
147
|
+
"exchange": obj.get("exchange"),
|
148
|
+
"api_key": obj.get("api_key"),
|
149
|
+
"secret": obj.get("secret"),
|
150
|
+
"passphrase": obj.get("passphrase"),
|
151
|
+
"label": obj.get("label"),
|
152
|
+
"enabled": obj.get("enabled"),
|
153
|
+
"user_id": obj.get("user_id"),
|
154
|
+
}
|
155
|
+
)
|
133
156
|
return _obj
|
134
|
-
|
135
|
-
|