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