crypticorn 2.4.7__py3-none-any.whl → 2.5.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/cli/init.py +7 -4
- crypticorn/common/__init__.py +1 -0
- crypticorn/common/auth.py +7 -3
- crypticorn/common/errors.py +21 -0
- crypticorn/common/exceptions.py +83 -0
- crypticorn/common/utils.py +11 -4
- crypticorn/klines/client/__init__.py +10 -3
- crypticorn/klines/client/api/__init__.py +1 -0
- crypticorn/klines/client/api/change_in_timeframe_api.py +331 -0
- crypticorn/klines/client/api/funding_rates_api.py +13 -13
- crypticorn/klines/client/api/health_check_api.py +8 -8
- crypticorn/klines/client/api/ohlcv_data_api.py +38 -26
- crypticorn/klines/client/api/symbols_api.py +26 -20
- crypticorn/klines/client/api/udf_api.py +229 -229
- crypticorn/klines/client/api_client.py +8 -5
- crypticorn/klines/client/configuration.py +80 -37
- crypticorn/klines/client/models/__init__.py +9 -3
- crypticorn/klines/client/models/base_response_list_change_in_timeframe_response.py +123 -0
- crypticorn/klines/client/models/change_in_timeframe_response.py +86 -0
- crypticorn/klines/client/models/market_type.py +35 -0
- crypticorn/klines/client/models/response_get_udf_history.py +198 -0
- crypticorn/klines/client/rest.py +111 -159
- crypticorn/klines/main.py +32 -22
- crypticorn/metrics/main.py +39 -40
- crypticorn/pay/client/__init__.py +0 -3
- crypticorn/pay/client/api/now_payments_api.py +1 -53
- crypticorn/pay/client/models/__init__.py +0 -3
- crypticorn/pay/client/models/payment.py +3 -3
- crypticorn/pay/client/models/scope.py +6 -1
- crypticorn/trade/client/__init__.py +8 -6
- crypticorn/trade/client/api/__init__.py +0 -1
- crypticorn/trade/client/api/api_keys_api.py +167 -273
- crypticorn/trade/client/api/bots_api.py +140 -226
- crypticorn/trade/client/api/exchanges_api.py +31 -51
- crypticorn/trade/client/api/futures_trading_panel_api.py +169 -272
- crypticorn/trade/client/api/notifications_api.py +200 -323
- crypticorn/trade/client/api/orders_api.py +40 -60
- crypticorn/trade/client/api/status_api.py +31 -49
- crypticorn/trade/client/api/strategies_api.py +137 -223
- crypticorn/trade/client/api/trading_actions_api.py +106 -170
- crypticorn/trade/client/api_client.py +111 -153
- crypticorn/trade/client/api_response.py +2 -3
- crypticorn/trade/client/configuration.py +128 -115
- crypticorn/trade/client/exceptions.py +25 -21
- crypticorn/trade/client/models/__init__.py +8 -6
- crypticorn/trade/client/models/action_model.py +108 -54
- crypticorn/trade/client/models/api_error_identifier.py +76 -72
- crypticorn/trade/client/models/api_error_level.py +9 -11
- crypticorn/trade/client/models/api_error_type.py +9 -11
- crypticorn/trade/client/models/bot_model.py +57 -36
- crypticorn/trade/client/models/bot_status.py +9 -11
- crypticorn/trade/client/models/exchange.py +7 -9
- crypticorn/trade/client/models/exchange_key_model.py +43 -32
- crypticorn/trade/client/models/execution_ids.py +18 -18
- crypticorn/trade/client/models/futures_balance.py +43 -27
- crypticorn/trade/client/models/futures_trading_action.py +102 -50
- crypticorn/trade/client/models/http_validation_error.py +19 -15
- crypticorn/trade/client/models/margin_mode.py +7 -9
- crypticorn/trade/client/models/market_type.py +7 -9
- crypticorn/trade/client/models/notification_model.py +52 -32
- crypticorn/trade/client/models/order_model.py +112 -72
- crypticorn/trade/client/models/order_status.py +10 -12
- crypticorn/trade/client/models/post_futures_action.py +20 -16
- crypticorn/trade/client/models/strategy_exchange_info.py +15 -16
- crypticorn/trade/client/models/strategy_model_input.py +61 -33
- crypticorn/trade/client/models/strategy_model_output.py +61 -33
- crypticorn/trade/client/models/tpsl.py +39 -25
- crypticorn/trade/client/models/trading_action_type.py +9 -11
- crypticorn/trade/client/models/validation_error.py +24 -18
- crypticorn/trade/client/models/validation_error_loc_inner.py +37 -16
- crypticorn/trade/client/rest.py +23 -38
- {crypticorn-2.4.7.dist-info → crypticorn-2.5.0.dist-info}/METADATA +1 -1
- {crypticorn-2.4.7.dist-info → crypticorn-2.5.0.dist-info}/RECORD +76 -70
- {crypticorn-2.4.7.dist-info → crypticorn-2.5.0.dist-info}/WHEEL +1 -1
- {crypticorn-2.4.7.dist-info → crypticorn-2.5.0.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.4.7.dist-info → crypticorn-2.5.0.dist-info}/top_level.txt +0 -0
@@ -1,14 +1,14 @@
|
|
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
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -25,22 +25,45 @@ from crypticorn.trade.client.models.strategy_exchange_info import StrategyExchan
|
|
25
25
|
from typing import Optional, Set
|
26
26
|
from typing_extensions import Self
|
27
27
|
|
28
|
+
|
28
29
|
class StrategyModelInput(BaseModel):
|
29
30
|
"""
|
30
31
|
StrategyModelInput
|
31
|
-
"""
|
32
|
+
""" # noqa: E501
|
33
|
+
|
32
34
|
created_at: Optional[StrictInt] = None
|
33
35
|
updated_at: Optional[StrictInt] = None
|
34
36
|
id: Optional[StrictStr] = None
|
35
|
-
identifier: StrictStr = Field(
|
37
|
+
identifier: StrictStr = Field(
|
38
|
+
description="Unique human readable identifier for the strategy e.g. 'daily_trend_momentum'"
|
39
|
+
)
|
36
40
|
name: StrictStr = Field(description="Name of the strategy")
|
37
41
|
description: StrictStr = Field(description="Description of the strategy")
|
38
|
-
exchanges: List[StrategyExchangeInfo] = Field(
|
39
|
-
|
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
|
+
)
|
40
48
|
leverage: StrictInt = Field(description="Leverage for the strategy")
|
41
|
-
performance_fee: Union[
|
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")
|
42
53
|
market_type: MarketType = Field(description="Market of operation of the strategy")
|
43
|
-
__properties: ClassVar[List[str]] = [
|
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
|
+
]
|
44
67
|
|
45
68
|
model_config = ConfigDict(
|
46
69
|
populate_by_name=True,
|
@@ -48,7 +71,6 @@ class StrategyModelInput(BaseModel):
|
|
48
71
|
protected_namespaces=(),
|
49
72
|
)
|
50
73
|
|
51
|
-
|
52
74
|
def to_str(self) -> str:
|
53
75
|
"""Returns the string representation of the model using alias"""
|
54
76
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -73,8 +95,7 @@ class StrategyModelInput(BaseModel):
|
|
73
95
|
were set at model initialization. Other fields with value `None`
|
74
96
|
are ignored.
|
75
97
|
"""
|
76
|
-
excluded_fields: Set[str] = set([
|
77
|
-
])
|
98
|
+
excluded_fields: Set[str] = set([])
|
78
99
|
|
79
100
|
_dict = self.model_dump(
|
80
101
|
by_alias=True,
|
@@ -87,21 +108,21 @@ class StrategyModelInput(BaseModel):
|
|
87
108
|
for _item_exchanges in self.exchanges:
|
88
109
|
if _item_exchanges:
|
89
110
|
_items.append(_item_exchanges.to_dict())
|
90
|
-
_dict[
|
111
|
+
_dict["exchanges"] = _items
|
91
112
|
# set to None if created_at (nullable) is None
|
92
113
|
# and model_fields_set contains the field
|
93
114
|
if self.created_at is None and "created_at" in self.model_fields_set:
|
94
|
-
_dict[
|
115
|
+
_dict["created_at"] = None
|
95
116
|
|
96
117
|
# set to None if updated_at (nullable) is None
|
97
118
|
# and model_fields_set contains the field
|
98
119
|
if self.updated_at is None and "updated_at" in self.model_fields_set:
|
99
|
-
_dict[
|
120
|
+
_dict["updated_at"] = None
|
100
121
|
|
101
122
|
# set to None if id (nullable) is None
|
102
123
|
# and model_fields_set contains the field
|
103
124
|
if self.id is None and "id" in self.model_fields_set:
|
104
|
-
_dict[
|
125
|
+
_dict["id"] = None
|
105
126
|
|
106
127
|
return _dict
|
107
128
|
|
@@ -114,19 +135,26 @@ class StrategyModelInput(BaseModel):
|
|
114
135
|
if not isinstance(obj, dict):
|
115
136
|
return cls.model_validate(obj)
|
116
137
|
|
117
|
-
_obj = cls.model_validate(
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
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
|
+
)
|
130
160
|
return _obj
|
131
|
-
|
132
|
-
|
@@ -1,14 +1,14 @@
|
|
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
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -25,22 +25,45 @@ from crypticorn.trade.client.models.strategy_exchange_info import StrategyExchan
|
|
25
25
|
from typing import Optional, Set
|
26
26
|
from typing_extensions import Self
|
27
27
|
|
28
|
+
|
28
29
|
class StrategyModelOutput(BaseModel):
|
29
30
|
"""
|
30
31
|
StrategyModelOutput
|
31
|
-
"""
|
32
|
+
""" # noqa: E501
|
33
|
+
|
32
34
|
created_at: Optional[StrictInt] = None
|
33
35
|
updated_at: Optional[StrictInt] = None
|
34
36
|
id: Optional[StrictStr] = None
|
35
|
-
identifier: StrictStr = Field(
|
37
|
+
identifier: StrictStr = Field(
|
38
|
+
description="Unique human readable identifier for the strategy e.g. 'daily_trend_momentum'"
|
39
|
+
)
|
36
40
|
name: StrictStr = Field(description="Name of the strategy")
|
37
41
|
description: StrictStr = Field(description="Description of the strategy")
|
38
|
-
exchanges: List[StrategyExchangeInfo] = Field(
|
39
|
-
|
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
|
+
)
|
40
48
|
leverage: StrictInt = Field(description="Leverage for the strategy")
|
41
|
-
performance_fee: Union[
|
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")
|
42
53
|
market_type: MarketType = Field(description="Market of operation of the strategy")
|
43
|
-
__properties: ClassVar[List[str]] = [
|
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
|
+
]
|
44
67
|
|
45
68
|
model_config = ConfigDict(
|
46
69
|
populate_by_name=True,
|
@@ -48,7 +71,6 @@ class StrategyModelOutput(BaseModel):
|
|
48
71
|
protected_namespaces=(),
|
49
72
|
)
|
50
73
|
|
51
|
-
|
52
74
|
def to_str(self) -> str:
|
53
75
|
"""Returns the string representation of the model using alias"""
|
54
76
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -73,8 +95,7 @@ class StrategyModelOutput(BaseModel):
|
|
73
95
|
were set at model initialization. Other fields with value `None`
|
74
96
|
are ignored.
|
75
97
|
"""
|
76
|
-
excluded_fields: Set[str] = set([
|
77
|
-
])
|
98
|
+
excluded_fields: Set[str] = set([])
|
78
99
|
|
79
100
|
_dict = self.model_dump(
|
80
101
|
by_alias=True,
|
@@ -87,21 +108,21 @@ class StrategyModelOutput(BaseModel):
|
|
87
108
|
for _item_exchanges in self.exchanges:
|
88
109
|
if _item_exchanges:
|
89
110
|
_items.append(_item_exchanges.to_dict())
|
90
|
-
_dict[
|
111
|
+
_dict["exchanges"] = _items
|
91
112
|
# set to None if created_at (nullable) is None
|
92
113
|
# and model_fields_set contains the field
|
93
114
|
if self.created_at is None and "created_at" in self.model_fields_set:
|
94
|
-
_dict[
|
115
|
+
_dict["created_at"] = None
|
95
116
|
|
96
117
|
# set to None if updated_at (nullable) is None
|
97
118
|
# and model_fields_set contains the field
|
98
119
|
if self.updated_at is None and "updated_at" in self.model_fields_set:
|
99
|
-
_dict[
|
120
|
+
_dict["updated_at"] = None
|
100
121
|
|
101
122
|
# set to None if id (nullable) is None
|
102
123
|
# and model_fields_set contains the field
|
103
124
|
if self.id is None and "id" in self.model_fields_set:
|
104
|
-
_dict[
|
125
|
+
_dict["id"] = None
|
105
126
|
|
106
127
|
return _dict
|
107
128
|
|
@@ -114,19 +135,26 @@ class StrategyModelOutput(BaseModel):
|
|
114
135
|
if not isinstance(obj, dict):
|
115
136
|
return cls.model_validate(obj)
|
116
137
|
|
117
|
-
_obj = cls.model_validate(
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
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
|
+
)
|
130
160
|
return _obj
|
131
|
-
|
132
|
-
|
@@ -1,14 +1,14 @@
|
|
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
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -23,16 +23,32 @@ from typing_extensions import Annotated
|
|
23
23
|
from typing import Optional, Set
|
24
24
|
from typing_extensions import Self
|
25
25
|
|
26
|
+
|
26
27
|
class TPSL(BaseModel):
|
27
28
|
"""
|
28
29
|
Model for take profit and stop loss targets
|
29
|
-
"""
|
30
|
-
|
30
|
+
""" # noqa: E501
|
31
|
+
|
32
|
+
price_delta: Optional[
|
33
|
+
Union[
|
34
|
+
Annotated[float, Field(strict=True, ge=0.0)],
|
35
|
+
Annotated[int, Field(strict=True, ge=0)],
|
36
|
+
]
|
37
|
+
] = None
|
31
38
|
price: Optional[Union[StrictFloat, StrictInt]] = None
|
32
|
-
allocation: Union[
|
39
|
+
allocation: Union[
|
40
|
+
Annotated[float, Field(le=1.0, strict=True, ge=0.0)],
|
41
|
+
Annotated[int, Field(le=1, strict=True, ge=0)],
|
42
|
+
] = Field(description="Percentage of the order to sell")
|
33
43
|
execution_id: Optional[StrictStr] = None
|
34
44
|
client_order_id: Optional[StrictStr] = None
|
35
|
-
__properties: ClassVar[List[str]] = [
|
45
|
+
__properties: ClassVar[List[str]] = [
|
46
|
+
"price_delta",
|
47
|
+
"price",
|
48
|
+
"allocation",
|
49
|
+
"execution_id",
|
50
|
+
"client_order_id",
|
51
|
+
]
|
36
52
|
|
37
53
|
model_config = ConfigDict(
|
38
54
|
populate_by_name=True,
|
@@ -40,7 +56,6 @@ class TPSL(BaseModel):
|
|
40
56
|
protected_namespaces=(),
|
41
57
|
)
|
42
58
|
|
43
|
-
|
44
59
|
def to_str(self) -> str:
|
45
60
|
"""Returns the string representation of the model using alias"""
|
46
61
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -65,8 +80,7 @@ class TPSL(BaseModel):
|
|
65
80
|
were set at model initialization. Other fields with value `None`
|
66
81
|
are ignored.
|
67
82
|
"""
|
68
|
-
excluded_fields: Set[str] = set([
|
69
|
-
])
|
83
|
+
excluded_fields: Set[str] = set([])
|
70
84
|
|
71
85
|
_dict = self.model_dump(
|
72
86
|
by_alias=True,
|
@@ -76,22 +90,22 @@ class TPSL(BaseModel):
|
|
76
90
|
# set to None if price_delta (nullable) is None
|
77
91
|
# and model_fields_set contains the field
|
78
92
|
if self.price_delta is None and "price_delta" in self.model_fields_set:
|
79
|
-
_dict[
|
93
|
+
_dict["price_delta"] = None
|
80
94
|
|
81
95
|
# set to None if price (nullable) is None
|
82
96
|
# and model_fields_set contains the field
|
83
97
|
if self.price is None and "price" in self.model_fields_set:
|
84
|
-
_dict[
|
98
|
+
_dict["price"] = None
|
85
99
|
|
86
100
|
# set to None if execution_id (nullable) is None
|
87
101
|
# and model_fields_set contains the field
|
88
102
|
if self.execution_id is None and "execution_id" in self.model_fields_set:
|
89
|
-
_dict[
|
103
|
+
_dict["execution_id"] = None
|
90
104
|
|
91
105
|
# set to None if client_order_id (nullable) is None
|
92
106
|
# and model_fields_set contains the field
|
93
107
|
if self.client_order_id is None and "client_order_id" in self.model_fields_set:
|
94
|
-
_dict[
|
108
|
+
_dict["client_order_id"] = None
|
95
109
|
|
96
110
|
return _dict
|
97
111
|
|
@@ -104,13 +118,13 @@ class TPSL(BaseModel):
|
|
104
118
|
if not isinstance(obj, dict):
|
105
119
|
return cls.model_validate(obj)
|
106
120
|
|
107
|
-
_obj = cls.model_validate(
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
121
|
+
_obj = cls.model_validate(
|
122
|
+
{
|
123
|
+
"price_delta": obj.get("price_delta"),
|
124
|
+
"price": obj.get("price"),
|
125
|
+
"allocation": obj.get("allocation"),
|
126
|
+
"execution_id": obj.get("execution_id"),
|
127
|
+
"client_order_id": obj.get("client_order_id"),
|
128
|
+
}
|
129
|
+
)
|
114
130
|
return _obj
|
115
|
-
|
116
|
-
|
@@ -1,14 +1,14 @@
|
|
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
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -26,14 +26,12 @@ class TradingActionType(str, Enum):
|
|
26
26
|
"""
|
27
27
|
allowed enum values
|
28
28
|
"""
|
29
|
-
OPEN_LONG =
|
30
|
-
OPEN_SHORT =
|
31
|
-
CLOSE_LONG =
|
32
|
-
CLOSE_SHORT =
|
29
|
+
OPEN_LONG = "open_long"
|
30
|
+
OPEN_SHORT = "open_short"
|
31
|
+
CLOSE_LONG = "close_long"
|
32
|
+
CLOSE_SHORT = "close_short"
|
33
33
|
|
34
34
|
@classmethod
|
35
35
|
def from_json(cls, json_str: str) -> Self:
|
36
36
|
"""Create an instance of TradingActionType from a JSON string"""
|
37
37
|
return cls(json.loads(json_str))
|
38
|
-
|
39
|
-
|
@@ -1,14 +1,14 @@
|
|
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
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -19,14 +19,18 @@ import json
|
|
19
19
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
22
|
-
from crypticorn.trade.client.models.validation_error_loc_inner import
|
22
|
+
from crypticorn.trade.client.models.validation_error_loc_inner import (
|
23
|
+
ValidationErrorLocInner,
|
24
|
+
)
|
23
25
|
from typing import Optional, Set
|
24
26
|
from typing_extensions import Self
|
25
27
|
|
28
|
+
|
26
29
|
class ValidationError(BaseModel):
|
27
30
|
"""
|
28
31
|
ValidationError
|
29
|
-
"""
|
32
|
+
""" # noqa: E501
|
33
|
+
|
30
34
|
loc: List[ValidationErrorLocInner]
|
31
35
|
msg: StrictStr
|
32
36
|
type: StrictStr
|
@@ -38,7 +42,6 @@ class ValidationError(BaseModel):
|
|
38
42
|
protected_namespaces=(),
|
39
43
|
)
|
40
44
|
|
41
|
-
|
42
45
|
def to_str(self) -> str:
|
43
46
|
"""Returns the string representation of the model using alias"""
|
44
47
|
return pprint.pformat(self.model_dump(by_alias=True))
|
@@ -63,8 +66,7 @@ class ValidationError(BaseModel):
|
|
63
66
|
were set at model initialization. Other fields with value `None`
|
64
67
|
are ignored.
|
65
68
|
"""
|
66
|
-
excluded_fields: Set[str] = set([
|
67
|
-
])
|
69
|
+
excluded_fields: Set[str] = set([])
|
68
70
|
|
69
71
|
_dict = self.model_dump(
|
70
72
|
by_alias=True,
|
@@ -77,7 +79,7 @@ class ValidationError(BaseModel):
|
|
77
79
|
for _item_loc in self.loc:
|
78
80
|
if _item_loc:
|
79
81
|
_items.append(_item_loc.to_dict())
|
80
|
-
_dict[
|
82
|
+
_dict["loc"] = _items
|
81
83
|
return _dict
|
82
84
|
|
83
85
|
@classmethod
|
@@ -89,11 +91,15 @@ class ValidationError(BaseModel):
|
|
89
91
|
if not isinstance(obj, dict):
|
90
92
|
return cls.model_validate(obj)
|
91
93
|
|
92
|
-
_obj = cls.model_validate(
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
94
|
+
_obj = cls.model_validate(
|
95
|
+
{
|
96
|
+
"loc": (
|
97
|
+
[ValidationErrorLocInner.from_dict(_item) for _item in obj["loc"]]
|
98
|
+
if obj.get("loc") is not None
|
99
|
+
else None
|
100
|
+
),
|
101
|
+
"msg": obj.get("msg"),
|
102
|
+
"type": obj.get("type"),
|
103
|
+
}
|
104
|
+
)
|
97
105
|
return _obj
|
98
|
-
|
99
|
-
|