crypticorn 2.4.7__py3-none-any.whl → 2.5.0rc2__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.
Files changed (74) hide show
  1. crypticorn/cli/init.py +7 -4
  2. crypticorn/common/__init__.py +1 -0
  3. crypticorn/common/auth.py +7 -3
  4. crypticorn/common/exceptions.py +27 -0
  5. crypticorn/common/utils.py +7 -2
  6. crypticorn/klines/client/__init__.py +10 -3
  7. crypticorn/klines/client/api/__init__.py +1 -0
  8. crypticorn/klines/client/api/change_in_timeframe_api.py +331 -0
  9. crypticorn/klines/client/api/funding_rates_api.py +13 -13
  10. crypticorn/klines/client/api/health_check_api.py +8 -8
  11. crypticorn/klines/client/api/ohlcv_data_api.py +38 -26
  12. crypticorn/klines/client/api/symbols_api.py +26 -20
  13. crypticorn/klines/client/api/udf_api.py +229 -229
  14. crypticorn/klines/client/api_client.py +8 -5
  15. crypticorn/klines/client/configuration.py +80 -37
  16. crypticorn/klines/client/models/__init__.py +9 -3
  17. crypticorn/klines/client/models/base_response_list_change_in_timeframe_response.py +123 -0
  18. crypticorn/klines/client/models/change_in_timeframe_response.py +86 -0
  19. crypticorn/klines/client/models/market_type.py +35 -0
  20. crypticorn/klines/client/models/response_get_udf_history.py +198 -0
  21. crypticorn/klines/client/rest.py +111 -159
  22. crypticorn/metrics/main.py +1 -0
  23. crypticorn/pay/client/__init__.py +0 -3
  24. crypticorn/pay/client/api/now_payments_api.py +1 -53
  25. crypticorn/pay/client/models/__init__.py +0 -3
  26. crypticorn/pay/client/models/payment.py +3 -3
  27. crypticorn/pay/client/models/scope.py +6 -1
  28. crypticorn/trade/client/__init__.py +8 -6
  29. crypticorn/trade/client/api/__init__.py +0 -1
  30. crypticorn/trade/client/api/api_keys_api.py +167 -273
  31. crypticorn/trade/client/api/bots_api.py +140 -226
  32. crypticorn/trade/client/api/exchanges_api.py +31 -51
  33. crypticorn/trade/client/api/futures_trading_panel_api.py +169 -272
  34. crypticorn/trade/client/api/notifications_api.py +200 -323
  35. crypticorn/trade/client/api/orders_api.py +40 -60
  36. crypticorn/trade/client/api/status_api.py +31 -49
  37. crypticorn/trade/client/api/strategies_api.py +137 -223
  38. crypticorn/trade/client/api/trading_actions_api.py +106 -170
  39. crypticorn/trade/client/api_client.py +111 -153
  40. crypticorn/trade/client/api_response.py +2 -3
  41. crypticorn/trade/client/configuration.py +128 -115
  42. crypticorn/trade/client/exceptions.py +25 -21
  43. crypticorn/trade/client/models/__init__.py +8 -6
  44. crypticorn/trade/client/models/action_model.py +108 -54
  45. crypticorn/trade/client/models/api_error_identifier.py +76 -72
  46. crypticorn/trade/client/models/api_error_level.py +9 -11
  47. crypticorn/trade/client/models/api_error_type.py +9 -11
  48. crypticorn/trade/client/models/bot_model.py +57 -36
  49. crypticorn/trade/client/models/bot_status.py +9 -11
  50. crypticorn/trade/client/models/exchange.py +7 -9
  51. crypticorn/trade/client/models/exchange_key_model.py +43 -32
  52. crypticorn/trade/client/models/execution_ids.py +18 -18
  53. crypticorn/trade/client/models/futures_balance.py +43 -27
  54. crypticorn/trade/client/models/futures_trading_action.py +102 -50
  55. crypticorn/trade/client/models/http_validation_error.py +19 -15
  56. crypticorn/trade/client/models/margin_mode.py +7 -9
  57. crypticorn/trade/client/models/market_type.py +7 -9
  58. crypticorn/trade/client/models/notification_model.py +52 -32
  59. crypticorn/trade/client/models/order_model.py +112 -72
  60. crypticorn/trade/client/models/order_status.py +10 -12
  61. crypticorn/trade/client/models/post_futures_action.py +20 -16
  62. crypticorn/trade/client/models/strategy_exchange_info.py +15 -16
  63. crypticorn/trade/client/models/strategy_model_input.py +61 -33
  64. crypticorn/trade/client/models/strategy_model_output.py +61 -33
  65. crypticorn/trade/client/models/tpsl.py +39 -25
  66. crypticorn/trade/client/models/trading_action_type.py +9 -11
  67. crypticorn/trade/client/models/validation_error.py +24 -18
  68. crypticorn/trade/client/models/validation_error_loc_inner.py +37 -16
  69. crypticorn/trade/client/rest.py +23 -38
  70. {crypticorn-2.4.7.dist-info → crypticorn-2.5.0rc2.dist-info}/METADATA +1 -1
  71. {crypticorn-2.4.7.dist-info → crypticorn-2.5.0rc2.dist-info}/RECORD +74 -68
  72. {crypticorn-2.4.7.dist-info → crypticorn-2.5.0rc2.dist-info}/WHEEL +1 -1
  73. {crypticorn-2.4.7.dist-info → crypticorn-2.5.0rc2.dist-info}/entry_points.txt +0 -0
  74. {crypticorn-2.4.7.dist-info → crypticorn-2.5.0rc2.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
 
@@ -24,15 +24,19 @@ from crypticorn.trade.client.models.bot_status import BotStatus
24
24
  from typing import Optional, Set
25
25
  from typing_extensions import Self
26
26
 
27
+
27
28
  class BotModel(BaseModel):
28
29
  """
29
30
  BotModel
30
- """ # noqa: E501
31
+ """ # noqa: E501
32
+
31
33
  created_at: Optional[StrictInt] = None
32
34
  updated_at: Optional[StrictInt] = None
33
35
  id: Optional[StrictStr] = None
34
36
  name: StrictStr = Field(description="Name of the bot")
35
- strategy_id: StrictStr = Field(description="UID for the trading strategy used by the bot")
37
+ strategy_id: StrictStr = Field(
38
+ description="UID for the trading strategy used by the bot"
39
+ )
36
40
  api_key_id: StrictStr = Field(description="UID for the API key")
37
41
  allocation: StrictInt = Field(description="Initial allocation for the bot")
38
42
  status: BotStatus = Field(description="Status of the bot")
@@ -40,7 +44,20 @@ class BotModel(BaseModel):
40
44
  user_id: Optional[StrictStr] = None
41
45
  current_allocation: Optional[Union[StrictFloat, StrictInt]] = None
42
46
  current_exposure: Optional[Union[StrictFloat, StrictInt]] = None
43
- __properties: ClassVar[List[str]] = ["created_at", "updated_at", "id", "name", "strategy_id", "api_key_id", "allocation", "status", "status_code", "user_id", "current_allocation", "current_exposure"]
47
+ __properties: ClassVar[List[str]] = [
48
+ "created_at",
49
+ "updated_at",
50
+ "id",
51
+ "name",
52
+ "strategy_id",
53
+ "api_key_id",
54
+ "allocation",
55
+ "status",
56
+ "status_code",
57
+ "user_id",
58
+ "current_allocation",
59
+ "current_exposure",
60
+ ]
44
61
 
45
62
  model_config = ConfigDict(
46
63
  populate_by_name=True,
@@ -48,7 +65,6 @@ class BotModel(BaseModel):
48
65
  protected_namespaces=(),
49
66
  )
50
67
 
51
-
52
68
  def to_str(self) -> str:
53
69
  """Returns the string representation of the model using alias"""
54
70
  return pprint.pformat(self.model_dump(by_alias=True))
@@ -73,8 +89,7 @@ class BotModel(BaseModel):
73
89
  were set at model initialization. Other fields with value `None`
74
90
  are ignored.
75
91
  """
76
- excluded_fields: Set[str] = set([
77
- ])
92
+ excluded_fields: Set[str] = set([])
78
93
 
79
94
  _dict = self.model_dump(
80
95
  by_alias=True,
@@ -84,37 +99,43 @@ class BotModel(BaseModel):
84
99
  # set to None if created_at (nullable) is None
85
100
  # and model_fields_set contains the field
86
101
  if self.created_at is None and "created_at" in self.model_fields_set:
87
- _dict['created_at'] = None
102
+ _dict["created_at"] = None
88
103
 
89
104
  # set to None if updated_at (nullable) is None
90
105
  # and model_fields_set contains the field
91
106
  if self.updated_at is None and "updated_at" in self.model_fields_set:
92
- _dict['updated_at'] = None
107
+ _dict["updated_at"] = None
93
108
 
94
109
  # set to None if id (nullable) is None
95
110
  # and model_fields_set contains the field
96
111
  if self.id is None and "id" in self.model_fields_set:
97
- _dict['id'] = None
112
+ _dict["id"] = None
98
113
 
99
114
  # set to None if status_code (nullable) is None
100
115
  # and model_fields_set contains the field
101
116
  if self.status_code is None and "status_code" in self.model_fields_set:
102
- _dict['status_code'] = None
117
+ _dict["status_code"] = None
103
118
 
104
119
  # set to None if user_id (nullable) is None
105
120
  # and model_fields_set contains the field
106
121
  if self.user_id is None and "user_id" in self.model_fields_set:
107
- _dict['user_id'] = None
122
+ _dict["user_id"] = None
108
123
 
109
124
  # set to None if current_allocation (nullable) is None
110
125
  # and model_fields_set contains the field
111
- if self.current_allocation is None and "current_allocation" in self.model_fields_set:
112
- _dict['current_allocation'] = None
126
+ if (
127
+ self.current_allocation is None
128
+ and "current_allocation" in self.model_fields_set
129
+ ):
130
+ _dict["current_allocation"] = None
113
131
 
114
132
  # set to None if current_exposure (nullable) is None
115
133
  # and model_fields_set contains the field
116
- if self.current_exposure is None and "current_exposure" in self.model_fields_set:
117
- _dict['current_exposure'] = None
134
+ if (
135
+ self.current_exposure is None
136
+ and "current_exposure" in self.model_fields_set
137
+ ):
138
+ _dict["current_exposure"] = None
118
139
 
119
140
  return _dict
120
141
 
@@ -127,20 +148,20 @@ class BotModel(BaseModel):
127
148
  if not isinstance(obj, dict):
128
149
  return cls.model_validate(obj)
129
150
 
130
- _obj = cls.model_validate({
131
- "created_at": obj.get("created_at"),
132
- "updated_at": obj.get("updated_at"),
133
- "id": obj.get("id"),
134
- "name": obj.get("name"),
135
- "strategy_id": obj.get("strategy_id"),
136
- "api_key_id": obj.get("api_key_id"),
137
- "allocation": obj.get("allocation"),
138
- "status": obj.get("status"),
139
- "status_code": obj.get("status_code"),
140
- "user_id": obj.get("user_id"),
141
- "current_allocation": obj.get("current_allocation"),
142
- "current_exposure": obj.get("current_exposure")
143
- })
151
+ _obj = cls.model_validate(
152
+ {
153
+ "created_at": obj.get("created_at"),
154
+ "updated_at": obj.get("updated_at"),
155
+ "id": obj.get("id"),
156
+ "name": obj.get("name"),
157
+ "strategy_id": obj.get("strategy_id"),
158
+ "api_key_id": obj.get("api_key_id"),
159
+ "allocation": obj.get("allocation"),
160
+ "status": obj.get("status"),
161
+ "status_code": obj.get("status_code"),
162
+ "user_id": obj.get("user_id"),
163
+ "current_allocation": obj.get("current_allocation"),
164
+ "current_exposure": obj.get("current_exposure"),
165
+ }
166
+ )
144
167
  return _obj
145
-
146
-
@@ -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,14 +26,12 @@ class BotStatus(str, Enum):
26
26
  """
27
27
  allowed enum values
28
28
  """
29
- RUNNING = 'running'
30
- STOPPING = 'stopping'
31
- STOPPED = 'stopped'
32
- DELETED = 'deleted'
29
+ RUNNING = "running"
30
+ STOPPING = "stopping"
31
+ STOPPED = "stopped"
32
+ DELETED = "deleted"
33
33
 
34
34
  @classmethod
35
35
  def from_json(cls, json_str: str) -> Self:
36
36
  """Create an instance of BotStatus 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
 
@@ -26,12 +26,10 @@ class Exchange(str, Enum):
26
26
  """
27
27
  allowed enum values
28
28
  """
29
- KUCOIN = 'kucoin'
30
- BINGX = 'bingx'
29
+ KUCOIN = "kucoin"
30
+ BINGX = "bingx"
31
31
 
32
32
  @classmethod
33
33
  def from_json(cls, json_str: str) -> Self:
34
34
  """Create an instance of Exchange from a JSON string"""
35
35
  return cls(json.loads(json_str))
36
-
37
-
@@ -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,10 +23,12 @@ from crypticorn.trade.client.models.exchange import Exchange
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
 
26
+
26
27
  class ExchangeKeyModel(BaseModel):
27
28
  """
28
29
  ExchangeKeyModel
29
- """ # noqa: E501
30
+ """ # noqa: E501
31
+
30
32
  created_at: Optional[StrictInt] = None
31
33
  updated_at: Optional[StrictInt] = None
32
34
  id: Optional[StrictStr] = None
@@ -37,7 +39,18 @@ class ExchangeKeyModel(BaseModel):
37
39
  label: StrictStr = Field(description="Label for the API key")
38
40
  enabled: Optional[StrictBool] = None
39
41
  user_id: Optional[StrictStr] = None
40
- __properties: ClassVar[List[str]] = ["created_at", "updated_at", "id", "exchange", "api_key", "secret", "passphrase", "label", "enabled", "user_id"]
42
+ __properties: ClassVar[List[str]] = [
43
+ "created_at",
44
+ "updated_at",
45
+ "id",
46
+ "exchange",
47
+ "api_key",
48
+ "secret",
49
+ "passphrase",
50
+ "label",
51
+ "enabled",
52
+ "user_id",
53
+ ]
41
54
 
42
55
  model_config = ConfigDict(
43
56
  populate_by_name=True,
@@ -45,7 +58,6 @@ class ExchangeKeyModel(BaseModel):
45
58
  protected_namespaces=(),
46
59
  )
47
60
 
48
-
49
61
  def to_str(self) -> str:
50
62
  """Returns the string representation of the model using alias"""
51
63
  return pprint.pformat(self.model_dump(by_alias=True))
@@ -70,8 +82,7 @@ class ExchangeKeyModel(BaseModel):
70
82
  were set at model initialization. Other fields with value `None`
71
83
  are ignored.
72
84
  """
73
- excluded_fields: Set[str] = set([
74
- ])
85
+ excluded_fields: Set[str] = set([])
75
86
 
76
87
  _dict = self.model_dump(
77
88
  by_alias=True,
@@ -81,42 +92,42 @@ class ExchangeKeyModel(BaseModel):
81
92
  # set to None if created_at (nullable) is None
82
93
  # and model_fields_set contains the field
83
94
  if self.created_at is None and "created_at" in self.model_fields_set:
84
- _dict['created_at'] = None
95
+ _dict["created_at"] = None
85
96
 
86
97
  # set to None if updated_at (nullable) is None
87
98
  # and model_fields_set contains the field
88
99
  if self.updated_at is None and "updated_at" in self.model_fields_set:
89
- _dict['updated_at'] = None
100
+ _dict["updated_at"] = None
90
101
 
91
102
  # set to None if id (nullable) is None
92
103
  # and model_fields_set contains the field
93
104
  if self.id is None and "id" in self.model_fields_set:
94
- _dict['id'] = None
105
+ _dict["id"] = None
95
106
 
96
107
  # set to None if api_key (nullable) is None
97
108
  # and model_fields_set contains the field
98
109
  if self.api_key is None and "api_key" in self.model_fields_set:
99
- _dict['api_key'] = None
110
+ _dict["api_key"] = None
100
111
 
101
112
  # set to None if secret (nullable) is None
102
113
  # and model_fields_set contains the field
103
114
  if self.secret is None and "secret" in self.model_fields_set:
104
- _dict['secret'] = None
115
+ _dict["secret"] = None
105
116
 
106
117
  # set to None if passphrase (nullable) is None
107
118
  # and model_fields_set contains the field
108
119
  if self.passphrase is None and "passphrase" in self.model_fields_set:
109
- _dict['passphrase'] = None
120
+ _dict["passphrase"] = None
110
121
 
111
122
  # set to None if enabled (nullable) is None
112
123
  # and model_fields_set contains the field
113
124
  if self.enabled is None and "enabled" in self.model_fields_set:
114
- _dict['enabled'] = None
125
+ _dict["enabled"] = None
115
126
 
116
127
  # set to None if user_id (nullable) is None
117
128
  # and model_fields_set contains the field
118
129
  if self.user_id is None and "user_id" in self.model_fields_set:
119
- _dict['user_id'] = None
130
+ _dict["user_id"] = None
120
131
 
121
132
  return _dict
122
133
 
@@ -129,18 +140,18 @@ class ExchangeKeyModel(BaseModel):
129
140
  if not isinstance(obj, dict):
130
141
  return cls.model_validate(obj)
131
142
 
132
- _obj = cls.model_validate({
133
- "created_at": obj.get("created_at"),
134
- "updated_at": obj.get("updated_at"),
135
- "id": obj.get("id"),
136
- "exchange": obj.get("exchange"),
137
- "api_key": obj.get("api_key"),
138
- "secret": obj.get("secret"),
139
- "passphrase": obj.get("passphrase"),
140
- "label": obj.get("label"),
141
- "enabled": obj.get("enabled"),
142
- "user_id": obj.get("user_id")
143
- })
143
+ _obj = cls.model_validate(
144
+ {
145
+ "created_at": obj.get("created_at"),
146
+ "updated_at": obj.get("updated_at"),
147
+ "id": obj.get("id"),
148
+ "exchange": obj.get("exchange"),
149
+ "api_key": obj.get("api_key"),
150
+ "secret": obj.get("secret"),
151
+ "passphrase": obj.get("passphrase"),
152
+ "label": obj.get("label"),
153
+ "enabled": obj.get("enabled"),
154
+ "user_id": obj.get("user_id"),
155
+ }
156
+ )
144
157
  return _obj
145
-
146
-
@@ -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
 
@@ -22,13 +22,19 @@ from typing import Any, ClassVar, Dict, List
22
22
  from typing import Optional, Set
23
23
  from typing_extensions import Self
24
24
 
25
+
25
26
  class ExecutionIds(BaseModel):
26
27
  """
27
28
  ExecutionIds
28
- """ # noqa: E501
29
+ """ # noqa: E501
30
+
29
31
  main: List[StrictStr] = Field(description="Main execution ID. List with one item.")
30
- sl: List[StrictStr] = Field(description="Stop loss execution IDs. List with multiple items ordered by the next stop loss, e.g. price = 10000 => SLs: ['900', '700', '500'].")
31
- tp: List[StrictStr] = Field(description="Take profit execution IDs. List with multiple items ordered by the next take profit, e.g. price = 10000 => TPs: ['1100', '1300', '1500'].")
32
+ sl: List[StrictStr] = Field(
33
+ description="Stop loss execution IDs. List with multiple items ordered by the next stop loss, e.g. price = 10000 => SLs: ['900', '700', '500']."
34
+ )
35
+ tp: List[StrictStr] = Field(
36
+ description="Take profit execution IDs. List with multiple items ordered by the next take profit, e.g. price = 10000 => TPs: ['1100', '1300', '1500']."
37
+ )
32
38
  __properties: ClassVar[List[str]] = ["main", "sl", "tp"]
33
39
 
34
40
  model_config = ConfigDict(
@@ -37,7 +43,6 @@ class ExecutionIds(BaseModel):
37
43
  protected_namespaces=(),
38
44
  )
39
45
 
40
-
41
46
  def to_str(self) -> str:
42
47
  """Returns the string representation of the model using alias"""
43
48
  return pprint.pformat(self.model_dump(by_alias=True))
@@ -62,8 +67,7 @@ class ExecutionIds(BaseModel):
62
67
  were set at model initialization. Other fields with value `None`
63
68
  are ignored.
64
69
  """
65
- excluded_fields: Set[str] = set([
66
- ])
70
+ excluded_fields: Set[str] = set([])
67
71
 
68
72
  _dict = self.model_dump(
69
73
  by_alias=True,
@@ -81,11 +85,7 @@ class ExecutionIds(BaseModel):
81
85
  if not isinstance(obj, dict):
82
86
  return cls.model_validate(obj)
83
87
 
84
- _obj = cls.model_validate({
85
- "main": obj.get("main"),
86
- "sl": obj.get("sl"),
87
- "tp": obj.get("tp")
88
- })
88
+ _obj = cls.model_validate(
89
+ {"main": obj.get("main"), "sl": obj.get("sl"), "tp": obj.get("tp")}
90
+ )
89
91
  return _obj
90
-
91
-
@@ -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
 
@@ -22,18 +22,36 @@ from typing import Any, ClassVar, Dict, List, Optional, Union
22
22
  from typing import Optional, Set
23
23
  from typing_extensions import Self
24
24
 
25
+
25
26
  class FuturesBalance(BaseModel):
26
27
  """
27
28
  Model for futures balance
28
- """ # noqa: E501
29
+ """ # noqa: E501
30
+
29
31
  api_key_id: StrictStr = Field(description="API key ID", alias="apiKeyId")
30
32
  asset: StrictStr = Field(description="Asset/Currency code")
31
33
  balance: Union[StrictFloat, StrictInt] = Field(description="Total balance/equity")
32
- available: Union[StrictFloat, StrictInt] = Field(description="Available balance for trading/withdrawal")
33
- unrealized_pnl: Union[StrictFloat, StrictInt] = Field(description="Unrealized profit and loss", alias="unrealizedPnl")
34
- used_margin: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="usedMargin")
35
- frozen_amount: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="frozenAmount")
36
- __properties: ClassVar[List[str]] = ["apiKeyId", "asset", "balance", "available", "unrealizedPnl", "usedMargin", "frozenAmount"]
34
+ available: Union[StrictFloat, StrictInt] = Field(
35
+ description="Available balance for trading/withdrawal"
36
+ )
37
+ unrealized_pnl: Union[StrictFloat, StrictInt] = Field(
38
+ description="Unrealized profit and loss", alias="unrealizedPnl"
39
+ )
40
+ used_margin: Optional[Union[StrictFloat, StrictInt]] = Field(
41
+ default=None, alias="usedMargin"
42
+ )
43
+ frozen_amount: Optional[Union[StrictFloat, StrictInt]] = Field(
44
+ default=None, alias="frozenAmount"
45
+ )
46
+ __properties: ClassVar[List[str]] = [
47
+ "apiKeyId",
48
+ "asset",
49
+ "balance",
50
+ "available",
51
+ "unrealizedPnl",
52
+ "usedMargin",
53
+ "frozenAmount",
54
+ ]
37
55
 
38
56
  model_config = ConfigDict(
39
57
  populate_by_name=True,
@@ -41,7 +59,6 @@ class FuturesBalance(BaseModel):
41
59
  protected_namespaces=(),
42
60
  )
43
61
 
44
-
45
62
  def to_str(self) -> str:
46
63
  """Returns the string representation of the model using alias"""
47
64
  return pprint.pformat(self.model_dump(by_alias=True))
@@ -66,8 +83,7 @@ class FuturesBalance(BaseModel):
66
83
  were set at model initialization. Other fields with value `None`
67
84
  are ignored.
68
85
  """
69
- excluded_fields: Set[str] = set([
70
- ])
86
+ excluded_fields: Set[str] = set([])
71
87
 
72
88
  _dict = self.model_dump(
73
89
  by_alias=True,
@@ -77,12 +93,12 @@ class FuturesBalance(BaseModel):
77
93
  # set to None if used_margin (nullable) is None
78
94
  # and model_fields_set contains the field
79
95
  if self.used_margin is None and "used_margin" in self.model_fields_set:
80
- _dict['usedMargin'] = None
96
+ _dict["usedMargin"] = None
81
97
 
82
98
  # set to None if frozen_amount (nullable) is None
83
99
  # and model_fields_set contains the field
84
100
  if self.frozen_amount is None and "frozen_amount" in self.model_fields_set:
85
- _dict['frozenAmount'] = None
101
+ _dict["frozenAmount"] = None
86
102
 
87
103
  return _dict
88
104
 
@@ -95,15 +111,15 @@ class FuturesBalance(BaseModel):
95
111
  if not isinstance(obj, dict):
96
112
  return cls.model_validate(obj)
97
113
 
98
- _obj = cls.model_validate({
99
- "apiKeyId": obj.get("apiKeyId"),
100
- "asset": obj.get("asset"),
101
- "balance": obj.get("balance"),
102
- "available": obj.get("available"),
103
- "unrealizedPnl": obj.get("unrealizedPnl"),
104
- "usedMargin": obj.get("usedMargin"),
105
- "frozenAmount": obj.get("frozenAmount")
106
- })
114
+ _obj = cls.model_validate(
115
+ {
116
+ "apiKeyId": obj.get("apiKeyId"),
117
+ "asset": obj.get("asset"),
118
+ "balance": obj.get("balance"),
119
+ "available": obj.get("available"),
120
+ "unrealizedPnl": obj.get("unrealizedPnl"),
121
+ "usedMargin": obj.get("usedMargin"),
122
+ "frozenAmount": obj.get("frozenAmount"),
123
+ }
124
+ )
107
125
  return _obj
108
-
109
-