crypticorn 1.0.2rc4__py3-none-any.whl → 2.0.1__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 (256) hide show
  1. crypticorn/__init__.py +3 -3
  2. crypticorn/auth/__init__.py +2 -0
  3. crypticorn/auth/client/__init__.py +112 -0
  4. crypticorn/auth/client/api/__init__.py +8 -0
  5. crypticorn/auth/client/api/admin_api.py +522 -0
  6. crypticorn/auth/client/api/auth_api.py +2089 -0
  7. crypticorn/auth/client/api/service_api.py +309 -0
  8. crypticorn/auth/client/api/user_api.py +2540 -0
  9. crypticorn/auth/client/api/wallet_api.py +1698 -0
  10. crypticorn/auth/client/api_client.py +758 -0
  11. crypticorn/auth/client/api_response.py +20 -0
  12. crypticorn/auth/client/configuration.py +584 -0
  13. crypticorn/auth/client/exceptions.py +220 -0
  14. crypticorn/auth/client/models/__init__.py +91 -0
  15. crypticorn/auth/client/models/add_wallet200_response.py +86 -0
  16. crypticorn/auth/client/models/add_wallet_request.py +107 -0
  17. crypticorn/auth/client/models/authorize_user200_response.py +107 -0
  18. crypticorn/auth/client/models/authorize_user200_response_auth.py +101 -0
  19. crypticorn/auth/client/models/authorize_user_request.py +96 -0
  20. crypticorn/auth/client/models/create_user_request.py +114 -0
  21. crypticorn/auth/client/models/list_wallets200_response.py +137 -0
  22. crypticorn/auth/client/models/list_wallets200_response_balances_inner.py +115 -0
  23. crypticorn/auth/client/models/list_wallets200_response_balances_inner_sale_round.py +115 -0
  24. crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet.py +168 -0
  25. crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet_vesting_wallets_inner.py +191 -0
  26. crypticorn/auth/client/models/list_wallets200_response_data_inner.py +102 -0
  27. crypticorn/auth/client/models/list_wallets200_response_user_value.py +118 -0
  28. crypticorn/auth/client/models/logout_default_response.py +108 -0
  29. crypticorn/auth/client/models/logout_default_response_issues_inner.py +83 -0
  30. crypticorn/auth/client/models/refresh_token_info200_response.py +97 -0
  31. crypticorn/auth/client/models/refresh_token_info200_response_user_session.py +105 -0
  32. crypticorn/auth/client/models/resend_verification_email_request.py +84 -0
  33. crypticorn/auth/client/models/revoke_user_tokens_request.py +83 -0
  34. crypticorn/auth/client/models/rotate_tokens200_response.py +110 -0
  35. crypticorn/auth/client/models/token_info200_response.py +97 -0
  36. crypticorn/auth/client/models/unlink_wallet_request.py +83 -0
  37. crypticorn/auth/client/models/update_user_request.py +93 -0
  38. crypticorn/auth/client/models/user_reset_password_request.py +87 -0
  39. crypticorn/auth/client/models/user_set_password_request.py +89 -0
  40. crypticorn/auth/client/models/verify200_response.py +110 -0
  41. crypticorn/auth/client/models/verify_email200_response.py +107 -0
  42. crypticorn/auth/client/models/verify_email200_response_auth.py +101 -0
  43. crypticorn/auth/client/models/verify_email200_response_auth_auth.py +110 -0
  44. crypticorn/auth/client/models/verify_email_request.py +83 -0
  45. crypticorn/auth/client/models/verify_wallet_request.py +91 -0
  46. crypticorn/auth/client/models/wallet_verified200_response.py +83 -0
  47. crypticorn/auth/client/models/whoami200_response.py +104 -0
  48. crypticorn/auth/client/rest.py +195 -0
  49. crypticorn/auth/main.py +45 -0
  50. crypticorn/client.py +46 -8
  51. crypticorn/common/__init__.py +5 -0
  52. crypticorn/common/auth.py +43 -0
  53. crypticorn/common/auth_client.py +183 -0
  54. crypticorn/common/errors.py +432 -0
  55. crypticorn/common/scopes.py +36 -0
  56. crypticorn/common/urls.py +25 -0
  57. crypticorn/hive/__init__.py +2 -1
  58. crypticorn/hive/client/__init__.py +57 -0
  59. crypticorn/hive/client/api/__init__.py +6 -0
  60. crypticorn/hive/client/api/data_api.py +594 -0
  61. crypticorn/hive/client/api/models_api.py +1680 -0
  62. crypticorn/hive/client/api/status_api.py +263 -0
  63. crypticorn/hive/client/api_client.py +758 -0
  64. crypticorn/hive/client/api_response.py +20 -0
  65. crypticorn/hive/client/configuration.py +612 -0
  66. crypticorn/hive/client/exceptions.py +220 -0
  67. crypticorn/hive/client/models/__init__.py +38 -0
  68. crypticorn/hive/client/models/coins.py +44 -0
  69. crypticorn/hive/client/models/data_download_response.py +113 -0
  70. crypticorn/hive/client/models/data_info.py +115 -0
  71. crypticorn/hive/client/models/data_value_value_value_inner.py +154 -0
  72. crypticorn/hive/client/models/data_version.py +35 -0
  73. crypticorn/hive/client/models/download_links.py +91 -0
  74. crypticorn/hive/client/models/evaluation.py +86 -0
  75. crypticorn/hive/client/models/evaluation_response.py +85 -0
  76. crypticorn/hive/client/models/feature_size.py +36 -0
  77. crypticorn/hive/client/models/http_validation_error.py +99 -0
  78. crypticorn/hive/client/models/model.py +133 -0
  79. crypticorn/hive/client/models/model_create.py +93 -0
  80. crypticorn/hive/client/models/model_status.py +35 -0
  81. crypticorn/hive/client/models/model_update.py +83 -0
  82. crypticorn/hive/client/models/target.py +36 -0
  83. crypticorn/hive/client/models/target_type.py +35 -0
  84. crypticorn/hive/client/models/validation_error.py +105 -0
  85. crypticorn/hive/client/models/validation_error_loc_inner.py +159 -0
  86. crypticorn/hive/client/py.typed +0 -0
  87. crypticorn/hive/client/rest.py +195 -0
  88. crypticorn/hive/main.py +27 -100
  89. crypticorn/klines/client/__init__.py +21 -7
  90. crypticorn/klines/client/api/__init__.py +0 -1
  91. crypticorn/klines/client/api/funding_rates_api.py +90 -79
  92. crypticorn/klines/client/api/health_check_api.py +29 -45
  93. crypticorn/klines/client/api/ohlcv_data_api.py +104 -87
  94. crypticorn/klines/client/api/symbols_api.py +36 -54
  95. crypticorn/klines/client/api/udf_api.py +228 -352
  96. crypticorn/klines/client/api_client.py +106 -148
  97. crypticorn/klines/client/api_response.py +2 -3
  98. crypticorn/klines/client/configuration.py +64 -50
  99. crypticorn/klines/client/exceptions.py +20 -16
  100. crypticorn/klines/client/models/__init__.py +21 -7
  101. crypticorn/klines/client/models/base_response_health_check_response.py +21 -15
  102. crypticorn/klines/client/models/base_response_list_funding_rate_response.py +21 -15
  103. crypticorn/klines/client/models/base_response_list_str.py +16 -14
  104. crypticorn/klines/client/models/base_response_ohlcv_response.py +21 -15
  105. crypticorn/klines/client/models/error_response.py +23 -15
  106. crypticorn/klines/client/models/exchange.py +11 -11
  107. crypticorn/klines/client/models/funding_rate_response.py +11 -11
  108. crypticorn/klines/client/models/health_check_response.py +14 -12
  109. crypticorn/klines/client/models/history_error_response.py +11 -11
  110. crypticorn/klines/client/models/history_no_data_response.py +16 -16
  111. crypticorn/klines/client/models/history_success_response.py +16 -16
  112. crypticorn/klines/client/models/http_validation_error.py +14 -10
  113. crypticorn/klines/client/models/market.py +2 -4
  114. crypticorn/klines/client/models/ohlcv_response.py +22 -15
  115. crypticorn/klines/client/models/resolution.py +5 -7
  116. crypticorn/klines/client/models/response_get_history_udf_history_get.py +71 -22
  117. crypticorn/klines/client/models/search_symbol_response.py +22 -15
  118. crypticorn/klines/client/models/sort_direction.py +2 -4
  119. crypticorn/klines/client/models/symbol_group_response.py +5 -9
  120. crypticorn/klines/client/models/symbol_info_response.py +40 -24
  121. crypticorn/klines/client/models/symbol_type.py +5 -10
  122. crypticorn/klines/client/models/timeframe.py +5 -7
  123. crypticorn/klines/client/models/udf_config_response.py +60 -21
  124. crypticorn/klines/client/models/validation_error.py +19 -13
  125. crypticorn/klines/client/models/validation_error_loc_inner.py +32 -11
  126. crypticorn/klines/client/rest.py +30 -41
  127. crypticorn/klines/main.py +52 -15
  128. crypticorn/pay/__init__.py +2 -0
  129. crypticorn/pay/client/__init__.py +52 -0
  130. crypticorn/pay/client/api/__init__.py +7 -0
  131. crypticorn/pay/client/api/now_payments_api.py +813 -0
  132. crypticorn/pay/client/api/payments_api.py +799 -0
  133. crypticorn/pay/client/api/products_api.py +891 -0
  134. crypticorn/pay/client/api/status_api.py +260 -0
  135. crypticorn/pay/client/api_client.py +758 -0
  136. crypticorn/pay/client/api_response.py +20 -0
  137. crypticorn/pay/client/configuration.py +612 -0
  138. crypticorn/pay/client/exceptions.py +220 -0
  139. crypticorn/pay/client/models/__init__.py +32 -0
  140. crypticorn/pay/client/models/api_status_res.py +83 -0
  141. crypticorn/pay/client/models/combined_payment_history.py +101 -0
  142. crypticorn/pay/client/models/create_invoice_req.py +188 -0
  143. crypticorn/pay/client/models/create_invoice_res.py +188 -0
  144. crypticorn/pay/client/models/currency.py +165 -0
  145. crypticorn/pay/client/models/estimate_price_req.py +91 -0
  146. crypticorn/pay/client/models/estimate_price_res.py +102 -0
  147. crypticorn/pay/client/models/get_currencies_res.py +99 -0
  148. crypticorn/pay/client/models/get_payment_status_res.py +222 -0
  149. crypticorn/pay/client/models/get_payments_list_res.py +109 -0
  150. crypticorn/pay/client/models/http_validation_error.py +99 -0
  151. crypticorn/pay/client/models/min_amount_req.py +124 -0
  152. crypticorn/pay/client/models/min_amount_res.py +105 -0
  153. crypticorn/pay/client/models/now_api_status_res.py +83 -0
  154. crypticorn/pay/client/models/now_create_invoice_req.py +188 -0
  155. crypticorn/pay/client/models/now_create_invoice_res.py +188 -0
  156. crypticorn/pay/client/models/now_fee_structure.py +104 -0
  157. crypticorn/pay/client/models/now_payment_model.py +124 -0
  158. crypticorn/pay/client/models/now_payment_status.py +42 -0
  159. crypticorn/pay/client/models/now_webhook_payload.py +181 -0
  160. crypticorn/pay/client/models/payment.py +231 -0
  161. crypticorn/pay/client/models/payment_status.py +40 -0
  162. crypticorn/pay/client/models/product.py +87 -0
  163. crypticorn/pay/client/models/product_model.py +119 -0
  164. crypticorn/pay/client/models/product_subs_model.py +108 -0
  165. crypticorn/pay/client/models/services.py +34 -0
  166. crypticorn/pay/client/models/unified_payment_model.py +112 -0
  167. crypticorn/pay/client/models/validation_error.py +105 -0
  168. crypticorn/pay/client/models/validation_error_loc_inner.py +159 -0
  169. crypticorn/pay/client/py.typed +0 -0
  170. crypticorn/pay/client/rest.py +195 -0
  171. crypticorn/pay/main.py +35 -0
  172. crypticorn/trade/client/__init__.py +9 -4
  173. crypticorn/trade/client/api/__init__.py +0 -1
  174. crypticorn/trade/client/api/api_keys_api.py +203 -304
  175. crypticorn/trade/client/api/bots_api.py +177 -250
  176. crypticorn/trade/client/api/exchanges_api.py +38 -57
  177. crypticorn/trade/client/api/futures_trading_panel_api.py +223 -321
  178. crypticorn/trade/client/api/notifications_api.py +247 -364
  179. crypticorn/trade/client/api/orders_api.py +44 -63
  180. crypticorn/trade/client/api/status_api.py +35 -53
  181. crypticorn/trade/client/api/strategies_api.py +852 -64
  182. crypticorn/trade/client/api/trading_actions_api.py +126 -203
  183. crypticorn/trade/client/api_client.py +115 -154
  184. crypticorn/trade/client/api_response.py +2 -3
  185. crypticorn/trade/client/configuration.py +128 -90
  186. crypticorn/trade/client/exceptions.py +21 -17
  187. crypticorn/trade/client/models/__init__.py +9 -4
  188. crypticorn/trade/client/models/action_model.py +114 -50
  189. crypticorn/trade/client/models/api_error_identifier.py +60 -51
  190. crypticorn/trade/client/models/api_error_level.py +37 -0
  191. crypticorn/trade/client/models/api_error_type.py +37 -0
  192. crypticorn/trade/client/models/api_key_model.py +49 -28
  193. crypticorn/trade/client/models/bot_model.py +76 -31
  194. crypticorn/trade/client/models/bot_status.py +37 -0
  195. crypticorn/trade/client/models/exchange.py +3 -5
  196. crypticorn/trade/client/models/execution_ids.py +14 -14
  197. crypticorn/trade/client/models/futures_balance.py +39 -23
  198. crypticorn/trade/client/models/futures_trading_action.py +98 -46
  199. crypticorn/trade/client/models/http_validation_error.py +15 -11
  200. crypticorn/trade/client/models/margin_mode.py +3 -5
  201. crypticorn/trade/client/models/market_type.py +3 -5
  202. crypticorn/trade/client/models/notification_model.py +60 -27
  203. crypticorn/trade/client/models/notification_type.py +4 -6
  204. crypticorn/trade/client/models/order_model.py +125 -65
  205. crypticorn/trade/client/models/order_status.py +6 -8
  206. crypticorn/trade/client/models/post_futures_action.py +16 -12
  207. crypticorn/trade/client/models/strategy_exchange_info.py +11 -12
  208. crypticorn/trade/client/models/strategy_model.py +66 -27
  209. crypticorn/trade/client/models/strategy_model_input.py +160 -0
  210. crypticorn/trade/client/models/strategy_model_output.py +160 -0
  211. crypticorn/trade/client/models/tpsl.py +35 -21
  212. crypticorn/trade/client/models/trading_action_type.py +5 -7
  213. crypticorn/trade/client/models/update_notification.py +17 -13
  214. crypticorn/trade/client/models/validation_error.py +20 -14
  215. crypticorn/trade/client/models/validation_error_loc_inner.py +33 -12
  216. crypticorn/trade/client/rest.py +108 -170
  217. crypticorn/trade/main.py +26 -19
  218. crypticorn-2.0.1.dist-info/METADATA +92 -0
  219. crypticorn-2.0.1.dist-info/RECORD +226 -0
  220. {crypticorn-1.0.2rc4.dist-info → crypticorn-2.0.1.dist-info}/WHEEL +1 -1
  221. crypticorn/hive/utils.py +0 -109
  222. crypticorn/klines/test/test_base_response_health_check_response.py +0 -56
  223. crypticorn/klines/test/test_base_response_list_funding_rate_response.py +0 -59
  224. crypticorn/klines/test/test_base_response_list_str.py +0 -56
  225. crypticorn/klines/test/test_base_response_ohlcv_response.py +0 -72
  226. crypticorn/klines/test/test_error_response.py +0 -57
  227. crypticorn/klines/test/test_exchange.py +0 -56
  228. crypticorn/klines/test/test_funding_rate_response.py +0 -56
  229. crypticorn/klines/test/test_funding_rates_api.py +0 -38
  230. crypticorn/klines/test/test_health_check_api.py +0 -38
  231. crypticorn/klines/test/test_health_check_response.py +0 -52
  232. crypticorn/klines/test/test_history_error_response.py +0 -53
  233. crypticorn/klines/test/test_history_no_data_response.py +0 -69
  234. crypticorn/klines/test/test_history_success_response.py +0 -87
  235. crypticorn/klines/test/test_http_validation_error.py +0 -58
  236. crypticorn/klines/test/test_market.py +0 -33
  237. crypticorn/klines/test/test_ohlcv_data_api.py +0 -38
  238. crypticorn/klines/test/test_ohlcv_response.py +0 -86
  239. crypticorn/klines/test/test_resolution.py +0 -33
  240. crypticorn/klines/test/test_response_get_history_udf_history_get.py +0 -89
  241. crypticorn/klines/test/test_search_symbol_response.py +0 -62
  242. crypticorn/klines/test/test_sort_direction.py +0 -33
  243. crypticorn/klines/test/test_symbol_group_response.py +0 -53
  244. crypticorn/klines/test/test_symbol_info_response.py +0 -84
  245. crypticorn/klines/test/test_symbol_type.py +0 -54
  246. crypticorn/klines/test/test_symbols_api.py +0 -38
  247. crypticorn/klines/test/test_timeframe.py +0 -33
  248. crypticorn/klines/test/test_udf_api.py +0 -80
  249. crypticorn/klines/test/test_udf_config_response.py +0 -95
  250. crypticorn/klines/test/test_validation_error.py +0 -60
  251. crypticorn/klines/test/test_validation_error_loc_inner.py +0 -50
  252. crypticorn-1.0.2rc4.dist-info/LICENSE.md +0 -19
  253. crypticorn-1.0.2rc4.dist-info/METADATA +0 -40
  254. crypticorn-1.0.2rc4.dist-info/RECORD +0 -125
  255. /crypticorn/{klines/test/__init__.py → auth/client/py.typed} +0 -0
  256. {crypticorn-1.0.2rc4.dist-info → crypticorn-2.0.1.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- FastAPI
4
+ Trading API
5
5
 
6
6
  No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
 
@@ -23,10 +23,12 @@ from crypticorn.trade.client.models.validation_error import ValidationError
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
 
26
+
26
27
  class HTTPValidationError(BaseModel):
27
28
  """
28
29
  HTTPValidationError
29
- """ # noqa: E501
30
+ """ # noqa: E501
31
+
30
32
  detail: Optional[List[ValidationError]] = None
31
33
  __properties: ClassVar[List[str]] = ["detail"]
32
34
 
@@ -36,7 +38,6 @@ class HTTPValidationError(BaseModel):
36
38
  protected_namespaces=(),
37
39
  )
38
40
 
39
-
40
41
  def to_str(self) -> str:
41
42
  """Returns the string representation of the model using alias"""
42
43
  return pprint.pformat(self.model_dump(by_alias=True))
@@ -61,8 +62,7 @@ class HTTPValidationError(BaseModel):
61
62
  were set at model initialization. Other fields with value `None`
62
63
  are ignored.
63
64
  """
64
- excluded_fields: Set[str] = set([
65
- ])
65
+ excluded_fields: Set[str] = set([])
66
66
 
67
67
  _dict = self.model_dump(
68
68
  by_alias=True,
@@ -75,7 +75,7 @@ class HTTPValidationError(BaseModel):
75
75
  for _item_detail in self.detail:
76
76
  if _item_detail:
77
77
  _items.append(_item_detail.to_dict())
78
- _dict['detail'] = _items
78
+ _dict["detail"] = _items
79
79
  return _dict
80
80
 
81
81
  @classmethod
@@ -87,9 +87,13 @@ class HTTPValidationError(BaseModel):
87
87
  if not isinstance(obj, dict):
88
88
  return cls.model_validate(obj)
89
89
 
90
- _obj = cls.model_validate({
91
- "detail": [ValidationError.from_dict(_item) for _item in obj["detail"]] if obj.get("detail") is not None else None
92
- })
90
+ _obj = cls.model_validate(
91
+ {
92
+ "detail": (
93
+ [ValidationError.from_dict(_item) for _item in obj["detail"]]
94
+ if obj.get("detail") is not None
95
+ else None
96
+ )
97
+ }
98
+ )
93
99
  return _obj
94
-
95
-
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- FastAPI
4
+ Trading API
5
5
 
6
6
  No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
 
@@ -26,12 +26,10 @@ class MarginMode(str, Enum):
26
26
  """
27
27
  allowed enum values
28
28
  """
29
- ISOLATED = 'isolated'
30
- CROSS = 'cross'
29
+ ISOLATED = "isolated"
30
+ CROSS = "cross"
31
31
 
32
32
  @classmethod
33
33
  def from_json(cls, json_str: str) -> Self:
34
34
  """Create an instance of MarginMode from a JSON string"""
35
35
  return cls(json.loads(json_str))
36
-
37
-
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- FastAPI
4
+ Trading API
5
5
 
6
6
  No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
 
@@ -26,12 +26,10 @@ class MarketType(str, Enum):
26
26
  """
27
27
  allowed enum values
28
28
  """
29
- SPOT = 'spot'
30
- FUTURES = 'futures'
29
+ SPOT = "spot"
30
+ FUTURES = "futures"
31
31
 
32
32
  @classmethod
33
33
  def from_json(cls, json_str: str) -> Self:
34
34
  """Create an instance of MarketType from a JSON string"""
35
35
  return cls(json.loads(json_str))
36
-
37
-
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- FastAPI
4
+ Trading API
5
5
 
6
6
  No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
 
@@ -20,23 +20,47 @@ import json
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
22
  from crypticorn.trade.client.models.api_error_identifier import ApiErrorIdentifier
23
- from crypticorn.trade.client.models.notification_type import NotificationType
23
+ from crypticorn.trade.client.models.api_error_level import ApiErrorLevel
24
+ from crypticorn.trade.client.models.api_error_type import ApiErrorType
24
25
  from typing import Optional, Set
25
26
  from typing_extensions import Self
26
27
 
28
+
27
29
  class NotificationModel(BaseModel):
28
30
  """
29
31
  NotificationModel
30
- """ # noqa: E501
31
- created_at: Optional[StrictInt] = Field(default=1742386800, description="Timestamp of creation")
32
- updated_at: Optional[StrictInt] = Field(default=1742386800, description="Timestamp of last update")
32
+ """ # noqa: E501
33
+
34
+ created_at: Optional[StrictInt] = None
35
+ updated_at: Optional[StrictInt] = None
33
36
  id: Optional[StrictStr] = None
34
- identifier: ApiErrorIdentifier = Field(description="Identifier string. Must match the mapping key in the frontend.")
37
+ identifier: ApiErrorIdentifier = Field(
38
+ description="Identifier string. Must match the mapping key in the frontend."
39
+ )
40
+ level: ApiErrorLevel = Field(
41
+ description="Level of the notification. Of type ApiErrorLevel"
42
+ )
43
+ type: ApiErrorType = Field(
44
+ description="Type of the notification. Of type ApiErrorType"
45
+ )
35
46
  user_id: Optional[StrictStr] = None
36
- viewed: Optional[StrictBool] = Field(default=False, description="Whether the notification has been marked as seen")
37
- sent: Optional[StrictBool] = Field(default=False, description="Whether the notification has been sent as an email")
38
- type: NotificationType = Field(description="The type of the notification.")
39
- __properties: ClassVar[List[str]] = ["created_at", "updated_at", "id", "identifier", "user_id", "viewed", "sent", "type"]
47
+ viewed: Optional[StrictBool] = Field(
48
+ default=False, description="Whether the notification has been marked as seen"
49
+ )
50
+ sent: Optional[StrictBool] = Field(
51
+ default=False, description="Whether the notification has been sent as an email"
52
+ )
53
+ __properties: ClassVar[List[str]] = [
54
+ "created_at",
55
+ "updated_at",
56
+ "id",
57
+ "identifier",
58
+ "level",
59
+ "type",
60
+ "user_id",
61
+ "viewed",
62
+ "sent",
63
+ ]
40
64
 
41
65
  model_config = ConfigDict(
42
66
  populate_by_name=True,
@@ -44,7 +68,6 @@ class NotificationModel(BaseModel):
44
68
  protected_namespaces=(),
45
69
  )
46
70
 
47
-
48
71
  def to_str(self) -> str:
49
72
  """Returns the string representation of the model using alias"""
50
73
  return pprint.pformat(self.model_dump(by_alias=True))
@@ -69,23 +92,32 @@ class NotificationModel(BaseModel):
69
92
  were set at model initialization. Other fields with value `None`
70
93
  are ignored.
71
94
  """
72
- excluded_fields: Set[str] = set([
73
- ])
95
+ excluded_fields: Set[str] = set([])
74
96
 
75
97
  _dict = self.model_dump(
76
98
  by_alias=True,
77
99
  exclude=excluded_fields,
78
100
  exclude_none=True,
79
101
  )
102
+ # set to None if created_at (nullable) is None
103
+ # and model_fields_set contains the field
104
+ if self.created_at is None and "created_at" in self.model_fields_set:
105
+ _dict["created_at"] = None
106
+
107
+ # set to None if updated_at (nullable) is None
108
+ # and model_fields_set contains the field
109
+ if self.updated_at is None and "updated_at" in self.model_fields_set:
110
+ _dict["updated_at"] = None
111
+
80
112
  # set to None if id (nullable) is None
81
113
  # and model_fields_set contains the field
82
114
  if self.id is None and "id" in self.model_fields_set:
83
- _dict['id'] = None
115
+ _dict["id"] = None
84
116
 
85
117
  # set to None if user_id (nullable) is None
86
118
  # and model_fields_set contains the field
87
119
  if self.user_id is None and "user_id" in self.model_fields_set:
88
- _dict['user_id'] = None
120
+ _dict["user_id"] = None
89
121
 
90
122
  return _dict
91
123
 
@@ -98,16 +130,17 @@ class NotificationModel(BaseModel):
98
130
  if not isinstance(obj, dict):
99
131
  return cls.model_validate(obj)
100
132
 
101
- _obj = cls.model_validate({
102
- "created_at": obj.get("created_at") if obj.get("created_at") is not None else 1742386800,
103
- "updated_at": obj.get("updated_at") if obj.get("updated_at") is not None else 1742386800,
104
- "id": obj.get("id"),
105
- "identifier": obj.get("identifier"),
106
- "user_id": obj.get("user_id"),
107
- "viewed": obj.get("viewed") if obj.get("viewed") is not None else False,
108
- "sent": obj.get("sent") if obj.get("sent") is not None else False,
109
- "type": obj.get("type")
110
- })
133
+ _obj = cls.model_validate(
134
+ {
135
+ "created_at": obj.get("created_at"),
136
+ "updated_at": obj.get("updated_at"),
137
+ "id": obj.get("id"),
138
+ "identifier": obj.get("identifier"),
139
+ "level": obj.get("level"),
140
+ "type": obj.get("type"),
141
+ "user_id": obj.get("user_id"),
142
+ "viewed": obj.get("viewed") if obj.get("viewed") is not None else False,
143
+ "sent": obj.get("sent") if obj.get("sent") is not None else False,
144
+ }
145
+ )
111
146
  return _obj
112
-
113
-
@@ -26,14 +26,12 @@ class NotificationType(str, Enum):
26
26
  """
27
27
  allowed enum values
28
28
  """
29
- ERROR = 'error'
30
- SUCCESS = 'success'
31
- INFO = 'info'
32
- WARNING = 'warning'
29
+ ERROR = "error"
30
+ SUCCESS = "success"
31
+ INFO = "info"
32
+ WARNING = "warning"
33
33
 
34
34
  @classmethod
35
35
  def from_json(cls, json_str: str) -> Self:
36
36
  """Create an instance of NotificationType from a JSON string"""
37
37
  return cls(json.loads(json_str))
38
-
39
-
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- FastAPI
4
+ Trading API
5
5
 
6
6
  No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
 
@@ -28,12 +28,14 @@ from crypticorn.trade.client.models.trading_action_type import TradingActionType
28
28
  from typing import Optional, Set
29
29
  from typing_extensions import Self
30
30
 
31
+
31
32
  class OrderModel(BaseModel):
32
33
  """
33
34
  Response model for orders. All optional as the model is built step by step.
34
- """ # noqa: E501
35
- created_at: Optional[StrictInt] = Field(default=1742386800, description="Timestamp of creation")
36
- updated_at: Optional[StrictInt] = Field(default=1742386800, description="Timestamp of last update")
35
+ """ # noqa: E501
36
+
37
+ created_at: Optional[StrictInt] = None
38
+ updated_at: Optional[StrictInt] = None
37
39
  id: Optional[StrictStr] = None
38
40
  trading_action_id: Optional[StrictStr] = None
39
41
  execution_id: Optional[StrictStr] = None
@@ -56,9 +58,40 @@ class OrderModel(BaseModel):
56
58
  filled_qty: Optional[Union[StrictFloat, StrictInt]] = None
57
59
  fee: Optional[Union[StrictFloat, StrictInt]] = None
58
60
  leverage: Optional[Union[StrictFloat, StrictInt]] = None
59
- order_details: Optional[Dict[str, Any]] = None
61
+ order_details: Optional[Any] = Field(
62
+ default=None, description="Exchange specific details of the order"
63
+ )
60
64
  pnl: Optional[Union[StrictFloat, StrictInt]] = None
61
- __properties: ClassVar[List[str]] = ["created_at", "updated_at", "id", "trading_action_id", "execution_id", "exchange_order_id", "position_id", "api_key_id", "user_id", "bot_id", "client_order_id", "exchange", "symbol", "common_symbol", "price", "action_type", "market_type", "margin_mode", "status_code", "status", "filled_perc", "filled_qty", "fee", "leverage", "order_details", "pnl"]
65
+ order_time: Optional[StrictInt] = None
66
+ __properties: ClassVar[List[str]] = [
67
+ "created_at",
68
+ "updated_at",
69
+ "id",
70
+ "trading_action_id",
71
+ "execution_id",
72
+ "exchange_order_id",
73
+ "position_id",
74
+ "api_key_id",
75
+ "user_id",
76
+ "bot_id",
77
+ "client_order_id",
78
+ "exchange",
79
+ "symbol",
80
+ "common_symbol",
81
+ "price",
82
+ "action_type",
83
+ "market_type",
84
+ "margin_mode",
85
+ "status_code",
86
+ "status",
87
+ "filled_perc",
88
+ "filled_qty",
89
+ "fee",
90
+ "leverage",
91
+ "order_details",
92
+ "pnl",
93
+ "order_time",
94
+ ]
62
95
 
63
96
  model_config = ConfigDict(
64
97
  populate_by_name=True,
@@ -66,7 +99,6 @@ class OrderModel(BaseModel):
66
99
  protected_namespaces=(),
67
100
  )
68
101
 
69
-
70
102
  def to_str(self) -> str:
71
103
  """Returns the string representation of the model using alias"""
72
104
  return pprint.pformat(self.model_dump(by_alias=True))
@@ -91,133 +123,156 @@ class OrderModel(BaseModel):
91
123
  were set at model initialization. Other fields with value `None`
92
124
  are ignored.
93
125
  """
94
- excluded_fields: Set[str] = set([
95
- ])
126
+ excluded_fields: Set[str] = set([])
96
127
 
97
128
  _dict = self.model_dump(
98
129
  by_alias=True,
99
130
  exclude=excluded_fields,
100
131
  exclude_none=True,
101
132
  )
133
+ # override the default output from pydantic by calling `to_dict()` of order_details
134
+ if self.order_details:
135
+ _dict["order_details"] = self.order_details.to_dict()
136
+ # set to None if created_at (nullable) is None
137
+ # and model_fields_set contains the field
138
+ if self.created_at is None and "created_at" in self.model_fields_set:
139
+ _dict["created_at"] = None
140
+
141
+ # set to None if updated_at (nullable) is None
142
+ # and model_fields_set contains the field
143
+ if self.updated_at is None and "updated_at" in self.model_fields_set:
144
+ _dict["updated_at"] = None
145
+
102
146
  # set to None if id (nullable) is None
103
147
  # and model_fields_set contains the field
104
148
  if self.id is None and "id" in self.model_fields_set:
105
- _dict['id'] = None
149
+ _dict["id"] = None
106
150
 
107
151
  # set to None if trading_action_id (nullable) is None
108
152
  # and model_fields_set contains the field
109
- if self.trading_action_id is None and "trading_action_id" in self.model_fields_set:
110
- _dict['trading_action_id'] = None
153
+ if (
154
+ self.trading_action_id is None
155
+ and "trading_action_id" in self.model_fields_set
156
+ ):
157
+ _dict["trading_action_id"] = None
111
158
 
112
159
  # set to None if execution_id (nullable) is None
113
160
  # and model_fields_set contains the field
114
161
  if self.execution_id is None and "execution_id" in self.model_fields_set:
115
- _dict['execution_id'] = None
162
+ _dict["execution_id"] = None
116
163
 
117
164
  # set to None if exchange_order_id (nullable) is None
118
165
  # and model_fields_set contains the field
119
- if self.exchange_order_id is None and "exchange_order_id" in self.model_fields_set:
120
- _dict['exchange_order_id'] = None
166
+ if (
167
+ self.exchange_order_id is None
168
+ and "exchange_order_id" in self.model_fields_set
169
+ ):
170
+ _dict["exchange_order_id"] = None
121
171
 
122
172
  # set to None if position_id (nullable) is None
123
173
  # and model_fields_set contains the field
124
174
  if self.position_id is None and "position_id" in self.model_fields_set:
125
- _dict['position_id'] = None
175
+ _dict["position_id"] = None
126
176
 
127
177
  # set to None if api_key_id (nullable) is None
128
178
  # and model_fields_set contains the field
129
179
  if self.api_key_id is None and "api_key_id" in self.model_fields_set:
130
- _dict['api_key_id'] = None
180
+ _dict["api_key_id"] = None
131
181
 
132
182
  # set to None if user_id (nullable) is None
133
183
  # and model_fields_set contains the field
134
184
  if self.user_id is None and "user_id" in self.model_fields_set:
135
- _dict['user_id'] = None
185
+ _dict["user_id"] = None
136
186
 
137
187
  # set to None if bot_id (nullable) is None
138
188
  # and model_fields_set contains the field
139
189
  if self.bot_id is None and "bot_id" in self.model_fields_set:
140
- _dict['bot_id'] = None
190
+ _dict["bot_id"] = None
141
191
 
142
192
  # set to None if client_order_id (nullable) is None
143
193
  # and model_fields_set contains the field
144
194
  if self.client_order_id is None and "client_order_id" in self.model_fields_set:
145
- _dict['client_order_id'] = None
195
+ _dict["client_order_id"] = None
146
196
 
147
197
  # set to None if exchange (nullable) is None
148
198
  # and model_fields_set contains the field
149
199
  if self.exchange is None and "exchange" in self.model_fields_set:
150
- _dict['exchange'] = None
200
+ _dict["exchange"] = None
151
201
 
152
202
  # set to None if symbol (nullable) is None
153
203
  # and model_fields_set contains the field
154
204
  if self.symbol is None and "symbol" in self.model_fields_set:
155
- _dict['symbol'] = None
205
+ _dict["symbol"] = None
156
206
 
157
207
  # set to None if common_symbol (nullable) is None
158
208
  # and model_fields_set contains the field
159
209
  if self.common_symbol is None and "common_symbol" in self.model_fields_set:
160
- _dict['common_symbol'] = None
210
+ _dict["common_symbol"] = None
161
211
 
162
212
  # set to None if price (nullable) is None
163
213
  # and model_fields_set contains the field
164
214
  if self.price is None and "price" in self.model_fields_set:
165
- _dict['price'] = None
215
+ _dict["price"] = None
166
216
 
167
217
  # set to None if action_type (nullable) is None
168
218
  # and model_fields_set contains the field
169
219
  if self.action_type is None and "action_type" in self.model_fields_set:
170
- _dict['action_type'] = None
220
+ _dict["action_type"] = None
171
221
 
172
222
  # set to None if market_type (nullable) is None
173
223
  # and model_fields_set contains the field
174
224
  if self.market_type is None and "market_type" in self.model_fields_set:
175
- _dict['market_type'] = None
225
+ _dict["market_type"] = None
176
226
 
177
227
  # set to None if margin_mode (nullable) is None
178
228
  # and model_fields_set contains the field
179
229
  if self.margin_mode is None and "margin_mode" in self.model_fields_set:
180
- _dict['margin_mode'] = None
230
+ _dict["margin_mode"] = None
181
231
 
182
232
  # set to None if status_code (nullable) is None
183
233
  # and model_fields_set contains the field
184
234
  if self.status_code is None and "status_code" in self.model_fields_set:
185
- _dict['status_code'] = None
235
+ _dict["status_code"] = None
186
236
 
187
237
  # set to None if status (nullable) is None
188
238
  # and model_fields_set contains the field
189
239
  if self.status is None and "status" in self.model_fields_set:
190
- _dict['status'] = None
240
+ _dict["status"] = None
191
241
 
192
242
  # set to None if filled_perc (nullable) is None
193
243
  # and model_fields_set contains the field
194
244
  if self.filled_perc is None and "filled_perc" in self.model_fields_set:
195
- _dict['filled_perc'] = None
245
+ _dict["filled_perc"] = None
196
246
 
197
247
  # set to None if filled_qty (nullable) is None
198
248
  # and model_fields_set contains the field
199
249
  if self.filled_qty is None and "filled_qty" in self.model_fields_set:
200
- _dict['filled_qty'] = None
250
+ _dict["filled_qty"] = None
201
251
 
202
252
  # set to None if fee (nullable) is None
203
253
  # and model_fields_set contains the field
204
254
  if self.fee is None and "fee" in self.model_fields_set:
205
- _dict['fee'] = None
255
+ _dict["fee"] = None
206
256
 
207
257
  # set to None if leverage (nullable) is None
208
258
  # and model_fields_set contains the field
209
259
  if self.leverage is None and "leverage" in self.model_fields_set:
210
- _dict['leverage'] = None
260
+ _dict["leverage"] = None
211
261
 
212
262
  # set to None if order_details (nullable) is None
213
263
  # and model_fields_set contains the field
214
264
  if self.order_details is None and "order_details" in self.model_fields_set:
215
- _dict['order_details'] = None
265
+ _dict["order_details"] = None
216
266
 
217
267
  # set to None if pnl (nullable) is None
218
268
  # and model_fields_set contains the field
219
269
  if self.pnl is None and "pnl" in self.model_fields_set:
220
- _dict['pnl'] = None
270
+ _dict["pnl"] = None
271
+
272
+ # set to None if order_time (nullable) is None
273
+ # and model_fields_set contains the field
274
+ if self.order_time is None and "order_time" in self.model_fields_set:
275
+ _dict["order_time"] = None
221
276
 
222
277
  return _dict
223
278
 
@@ -230,34 +285,39 @@ class OrderModel(BaseModel):
230
285
  if not isinstance(obj, dict):
231
286
  return cls.model_validate(obj)
232
287
 
233
- _obj = cls.model_validate({
234
- "created_at": obj.get("created_at") if obj.get("created_at") is not None else 1742386800,
235
- "updated_at": obj.get("updated_at") if obj.get("updated_at") is not None else 1742386800,
236
- "id": obj.get("id"),
237
- "trading_action_id": obj.get("trading_action_id"),
238
- "execution_id": obj.get("execution_id"),
239
- "exchange_order_id": obj.get("exchange_order_id"),
240
- "position_id": obj.get("position_id"),
241
- "api_key_id": obj.get("api_key_id"),
242
- "user_id": obj.get("user_id"),
243
- "bot_id": obj.get("bot_id"),
244
- "client_order_id": obj.get("client_order_id"),
245
- "exchange": obj.get("exchange"),
246
- "symbol": obj.get("symbol"),
247
- "common_symbol": obj.get("common_symbol"),
248
- "price": obj.get("price"),
249
- "action_type": obj.get("action_type"),
250
- "market_type": obj.get("market_type"),
251
- "margin_mode": obj.get("margin_mode"),
252
- "status_code": obj.get("status_code"),
253
- "status": obj.get("status"),
254
- "filled_perc": obj.get("filled_perc"),
255
- "filled_qty": obj.get("filled_qty"),
256
- "fee": obj.get("fee"),
257
- "leverage": obj.get("leverage"),
258
- "order_details": obj.get("order_details"),
259
- "pnl": obj.get("pnl")
260
- })
288
+ _obj = cls.model_validate(
289
+ {
290
+ "created_at": obj.get("created_at"),
291
+ "updated_at": obj.get("updated_at"),
292
+ "id": obj.get("id"),
293
+ "trading_action_id": obj.get("trading_action_id"),
294
+ "execution_id": obj.get("execution_id"),
295
+ "exchange_order_id": obj.get("exchange_order_id"),
296
+ "position_id": obj.get("position_id"),
297
+ "api_key_id": obj.get("api_key_id"),
298
+ "user_id": obj.get("user_id"),
299
+ "bot_id": obj.get("bot_id"),
300
+ "client_order_id": obj.get("client_order_id"),
301
+ "exchange": obj.get("exchange"),
302
+ "symbol": obj.get("symbol"),
303
+ "common_symbol": obj.get("common_symbol"),
304
+ "price": obj.get("price"),
305
+ "action_type": obj.get("action_type"),
306
+ "market_type": obj.get("market_type"),
307
+ "margin_mode": obj.get("margin_mode"),
308
+ "status_code": obj.get("status_code"),
309
+ "status": obj.get("status"),
310
+ "filled_perc": obj.get("filled_perc"),
311
+ "filled_qty": obj.get("filled_qty"),
312
+ "fee": obj.get("fee"),
313
+ "leverage": obj.get("leverage"),
314
+ "order_details": (
315
+ AnyOf.from_dict(obj["order_details"])
316
+ if obj.get("order_details") is not None
317
+ else None
318
+ ),
319
+ "pnl": obj.get("pnl"),
320
+ "order_time": obj.get("order_time"),
321
+ }
322
+ )
261
323
  return _obj
262
-
263
-
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- FastAPI
4
+ Trading API
5
5
 
6
6
  No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
 
@@ -26,15 +26,13 @@ class OrderStatus(str, Enum):
26
26
  """
27
27
  allowed enum values
28
28
  """
29
- NEW = 'new'
30
- FILLED = 'filled'
31
- PARTIALLY_FILLED = 'partially_filled'
32
- CANCELLED = 'cancelled'
33
- FAILED = 'failed'
29
+ NEW = "new"
30
+ FILLED = "filled"
31
+ PARTIALLY_FILLED = "partially_filled"
32
+ CANCELLED = "cancelled"
33
+ FAILED = "failed"
34
34
 
35
35
  @classmethod
36
36
  def from_json(cls, json_str: str) -> Self:
37
37
  """Create an instance of OrderStatus from a JSON string"""
38
38
  return cls(json.loads(json_str))
39
-
40
-