crypticorn 1.0.1__py3-none-any.whl → 1.0.2rc2__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 (132) hide show
  1. crypticorn/__init__.py +3 -3
  2. crypticorn/client.py +722 -0
  3. crypticorn/hive/__init__.py +1 -0
  4. crypticorn/{api.py → hive/main.py} +6 -6
  5. crypticorn/hive/requirements.txt +4 -0
  6. crypticorn/{utils.py → hive/utils.py} +2 -2
  7. crypticorn/klines/__init__.py +2 -0
  8. crypticorn/klines/client/__init__.py +62 -0
  9. crypticorn/klines/client/api/__init__.py +9 -0
  10. crypticorn/klines/client/api/funding_rates_api.py +362 -0
  11. crypticorn/klines/client/api/health_check_api.py +281 -0
  12. crypticorn/klines/client/api/ohlcv_data_api.py +409 -0
  13. crypticorn/klines/client/api/symbols_api.py +308 -0
  14. crypticorn/klines/client/api/udf_api.py +1929 -0
  15. crypticorn/klines/client/api_client.py +797 -0
  16. crypticorn/klines/client/api_response.py +21 -0
  17. crypticorn/klines/client/configuration.py +565 -0
  18. crypticorn/klines/client/exceptions.py +216 -0
  19. crypticorn/klines/client/models/__init__.py +41 -0
  20. crypticorn/klines/client/models/base_response_health_check_response.py +108 -0
  21. crypticorn/klines/client/models/base_response_list_funding_rate_response.py +112 -0
  22. crypticorn/klines/client/models/base_response_list_str.py +104 -0
  23. crypticorn/klines/client/models/base_response_ohlcv_response.py +108 -0
  24. crypticorn/klines/client/models/error_response.py +101 -0
  25. crypticorn/{models/deleted.py → klines/client/models/exchange.py} +15 -11
  26. crypticorn/klines/client/models/funding_rate_response.py +92 -0
  27. crypticorn/klines/client/models/health_check_response.py +89 -0
  28. crypticorn/{models/create_api_key_response.py → klines/client/models/history_error_response.py} +12 -22
  29. crypticorn/klines/client/models/history_no_data_response.py +99 -0
  30. crypticorn/klines/client/models/history_success_response.py +99 -0
  31. crypticorn/klines/client/models/http_validation_error.py +95 -0
  32. crypticorn/klines/client/models/market.py +37 -0
  33. crypticorn/klines/client/models/ohlcv_response.py +98 -0
  34. crypticorn/klines/client/models/resolution.py +40 -0
  35. crypticorn/klines/client/models/response_get_history_udf_history_get.py +149 -0
  36. crypticorn/klines/client/models/search_symbol_response.py +97 -0
  37. crypticorn/klines/client/models/sort_direction.py +37 -0
  38. crypticorn/{models/futures_balance_error.py → klines/client/models/symbol_group_response.py} +12 -14
  39. crypticorn/klines/client/models/symbol_info_response.py +115 -0
  40. crypticorn/{models/id.py → klines/client/models/symbol_type.py} +13 -11
  41. crypticorn/klines/client/models/timeframe.py +40 -0
  42. crypticorn/klines/client/models/udf_config_response.py +121 -0
  43. crypticorn/klines/client/models/validation_error.py +99 -0
  44. crypticorn/{models/get_futures_balance200_response_inner.py → klines/client/models/validation_error_loc_inner.py} +39 -35
  45. crypticorn/klines/client/py.typed +0 -0
  46. crypticorn/klines/client/rest.py +257 -0
  47. crypticorn/klines/main.py +42 -0
  48. crypticorn/klines/requirements.txt +4 -0
  49. crypticorn/klines/test/__init__.py +0 -0
  50. crypticorn/klines/test/test_base_response_health_check_response.py +56 -0
  51. crypticorn/klines/test/test_base_response_list_funding_rate_response.py +59 -0
  52. crypticorn/klines/test/test_base_response_list_str.py +56 -0
  53. crypticorn/klines/test/test_base_response_ohlcv_response.py +72 -0
  54. crypticorn/klines/test/test_error_response.py +57 -0
  55. crypticorn/klines/test/test_exchange.py +56 -0
  56. crypticorn/klines/test/test_funding_rate_response.py +56 -0
  57. crypticorn/klines/test/test_funding_rates_api.py +38 -0
  58. crypticorn/klines/test/test_health_check_api.py +38 -0
  59. crypticorn/klines/test/test_health_check_response.py +52 -0
  60. crypticorn/klines/test/test_history_error_response.py +53 -0
  61. crypticorn/klines/test/test_history_no_data_response.py +69 -0
  62. crypticorn/klines/test/test_history_success_response.py +87 -0
  63. crypticorn/klines/test/test_http_validation_error.py +58 -0
  64. crypticorn/klines/test/test_market.py +33 -0
  65. crypticorn/klines/test/test_ohlcv_data_api.py +38 -0
  66. crypticorn/klines/test/test_ohlcv_response.py +86 -0
  67. crypticorn/klines/test/test_resolution.py +33 -0
  68. crypticorn/klines/test/test_response_get_history_udf_history_get.py +89 -0
  69. crypticorn/klines/test/test_search_symbol_response.py +62 -0
  70. crypticorn/klines/test/test_sort_direction.py +33 -0
  71. crypticorn/klines/test/test_symbol_group_response.py +53 -0
  72. crypticorn/klines/test/test_symbol_info_response.py +84 -0
  73. crypticorn/klines/test/test_symbol_type.py +54 -0
  74. crypticorn/klines/test/test_symbols_api.py +38 -0
  75. crypticorn/klines/test/test_timeframe.py +33 -0
  76. crypticorn/klines/test/test_udf_api.py +80 -0
  77. crypticorn/klines/test/test_udf_config_response.py +95 -0
  78. crypticorn/klines/test/test_validation_error.py +60 -0
  79. crypticorn/klines/test/test_validation_error_loc_inner.py +50 -0
  80. crypticorn/trade/__init__.py +2 -0
  81. crypticorn/trade/client/__init__.py +63 -0
  82. crypticorn/trade/client/api/__init__.py +13 -0
  83. crypticorn/trade/client/api/api_keys_api.py +1468 -0
  84. crypticorn/trade/client/api/bots_api.py +1211 -0
  85. crypticorn/trade/client/api/exchanges_api.py +297 -0
  86. crypticorn/trade/client/api/futures_trading_panel_api.py +1463 -0
  87. crypticorn/trade/client/api/notifications_api.py +1767 -0
  88. crypticorn/trade/client/api/orders_api.py +331 -0
  89. crypticorn/trade/client/api/status_api.py +278 -0
  90. crypticorn/trade/client/api/strategies_api.py +331 -0
  91. crypticorn/trade/client/api/trading_actions_api.py +898 -0
  92. crypticorn/trade/client/api_client.py +797 -0
  93. crypticorn/trade/client/api_response.py +21 -0
  94. crypticorn/trade/client/configuration.py +574 -0
  95. crypticorn/trade/client/exceptions.py +216 -0
  96. crypticorn/trade/client/models/__init__.py +38 -0
  97. crypticorn/{models → trade/client/models}/action_model.py +17 -20
  98. crypticorn/{models → trade/client/models}/api_error_identifier.py +3 -1
  99. crypticorn/{models → trade/client/models}/api_key_model.py +5 -8
  100. crypticorn/{models → trade/client/models}/bot_model.py +15 -11
  101. crypticorn/{models → trade/client/models}/futures_trading_action.py +12 -12
  102. crypticorn/{models → trade/client/models}/http_validation_error.py +1 -1
  103. crypticorn/{models → trade/client/models}/notification_model.py +8 -6
  104. crypticorn/{models → trade/client/models}/order_model.py +12 -15
  105. crypticorn/{models → trade/client/models}/post_futures_action.py +1 -1
  106. crypticorn/{models → trade/client/models}/strategy_exchange_info.py +1 -1
  107. crypticorn/{models → trade/client/models}/strategy_model.py +6 -2
  108. crypticorn/{models → trade/client/models}/validation_error.py +1 -1
  109. crypticorn/trade/client/py.typed +0 -0
  110. crypticorn/trade/client/rest.py +257 -0
  111. crypticorn/trade/main.py +39 -0
  112. crypticorn/trade/requirements.txt +4 -0
  113. crypticorn-1.0.2rc2.dist-info/METADATA +47 -0
  114. crypticorn-1.0.2rc2.dist-info/RECORD +128 -0
  115. {crypticorn-1.0.1.dist-info → crypticorn-1.0.2rc2.dist-info}/WHEEL +1 -1
  116. crypticorn/models/__init__.py +0 -31
  117. crypticorn/models/modified.py +0 -87
  118. crypticorn-1.0.1.dist-info/METADATA +0 -40
  119. crypticorn-1.0.1.dist-info/RECORD +0 -38
  120. /crypticorn/{models → trade/client/models}/exchange.py +0 -0
  121. /crypticorn/{models → trade/client/models}/execution_ids.py +0 -0
  122. /crypticorn/{models → trade/client/models}/futures_balance.py +0 -0
  123. /crypticorn/{models → trade/client/models}/margin_mode.py +0 -0
  124. /crypticorn/{models → trade/client/models}/market_type.py +0 -0
  125. /crypticorn/{models → trade/client/models}/notification_type.py +0 -0
  126. /crypticorn/{models → trade/client/models}/order_status.py +0 -0
  127. /crypticorn/{models → trade/client/models}/tpsl.py +0 -0
  128. /crypticorn/{models → trade/client/models}/trading_action_type.py +0 -0
  129. /crypticorn/{models → trade/client/models}/update_notification.py +0 -0
  130. /crypticorn/{models → trade/client/models}/validation_error_loc_inner.py +0 -0
  131. {crypticorn-1.0.1.dist-info → crypticorn-1.0.2rc2.dist-info}/LICENSE.md +0 -0
  132. {crypticorn-1.0.1.dist-info → crypticorn-1.0.2rc2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,95 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Klines Service API
5
+
6
+ API for retrieving OHLCV data, funding rates, and symbol information from Binance. ## WebSocket Support Connect to `/ws` to receive real-time OHLCV updates. Example subscription message: ```json { \"action\": \"subscribe\", \"market\": \"spot\", \"symbol\": \"BTCUSDT\", \"timeframe\": \"15m\" } ```
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from crypticorn.klines.client.models.validation_error import ValidationError
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class HTTPValidationError(BaseModel):
27
+ """
28
+ HTTPValidationError
29
+ """ # noqa: E501
30
+ detail: Optional[List[ValidationError]] = None
31
+ __properties: ClassVar[List[str]] = ["detail"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of HTTPValidationError from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # override the default output from pydantic by calling `to_dict()` of each item in detail (list)
73
+ _items = []
74
+ if self.detail:
75
+ for _item_detail in self.detail:
76
+ if _item_detail:
77
+ _items.append(_item_detail.to_dict())
78
+ _dict['detail'] = _items
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of HTTPValidationError from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
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
+ })
93
+ return _obj
94
+
95
+
@@ -0,0 +1,37 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Klines Service API
5
+
6
+ API for retrieving OHLCV data, funding rates, and symbol information from Binance. ## WebSocket Support Connect to `/ws` to receive real-time OHLCV updates. Example subscription message: ```json { \"action\": \"subscribe\", \"market\": \"spot\", \"symbol\": \"BTCUSDT\", \"timeframe\": \"15m\" } ```
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import json
17
+ from enum import Enum
18
+ from typing_extensions import Self
19
+
20
+
21
+ class Market(str, Enum):
22
+ """
23
+ Market
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ SPOT = 'spot'
30
+ FUTURES = 'futures'
31
+
32
+ @classmethod
33
+ def from_json(cls, json_str: str) -> Self:
34
+ """Create an instance of Market from a JSON string"""
35
+ return cls(json.loads(json_str))
36
+
37
+
@@ -0,0 +1,98 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Klines Service API
5
+
6
+ API for retrieving OHLCV data, funding rates, and symbol information from Binance. ## WebSocket Support Connect to `/ws` to receive real-time OHLCV updates. Example subscription message: ```json { \"action\": \"subscribe\", \"market\": \"spot\", \"symbol\": \"BTCUSDT\", \"timeframe\": \"15m\" } ```
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt
22
+ from typing import Any, ClassVar, Dict, List, Union
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class OHLCVResponse(BaseModel):
27
+ """
28
+ OHLCVResponse
29
+ """ # noqa: E501
30
+ timestamp: List[datetime]
31
+ open: List[Union[StrictFloat, StrictInt]]
32
+ high: List[Union[StrictFloat, StrictInt]]
33
+ low: List[Union[StrictFloat, StrictInt]]
34
+ close: List[Union[StrictFloat, StrictInt]]
35
+ volume: List[Union[StrictFloat, StrictInt]]
36
+ __properties: ClassVar[List[str]] = ["timestamp", "open", "high", "low", "close", "volume"]
37
+
38
+ model_config = ConfigDict(
39
+ populate_by_name=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
+ """Create an instance of OHLCVResponse from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ ])
71
+
72
+ _dict = self.model_dump(
73
+ by_alias=True,
74
+ exclude=excluded_fields,
75
+ exclude_none=True,
76
+ )
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81
+ """Create an instance of OHLCVResponse from a dict"""
82
+ if obj is None:
83
+ return None
84
+
85
+ if not isinstance(obj, dict):
86
+ return cls.model_validate(obj)
87
+
88
+ _obj = cls.model_validate({
89
+ "timestamp": obj.get("timestamp"),
90
+ "open": obj.get("open"),
91
+ "high": obj.get("high"),
92
+ "low": obj.get("low"),
93
+ "close": obj.get("close"),
94
+ "volume": obj.get("volume")
95
+ })
96
+ return _obj
97
+
98
+
@@ -0,0 +1,40 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Klines Service API
5
+
6
+ API for retrieving OHLCV data, funding rates, and symbol information from Binance. ## WebSocket Support Connect to `/ws` to receive real-time OHLCV updates. Example subscription message: ```json { \"action\": \"subscribe\", \"market\": \"spot\", \"symbol\": \"BTCUSDT\", \"timeframe\": \"15m\" } ```
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import json
17
+ from enum import Enum
18
+ from typing_extensions import Self
19
+
20
+
21
+ class Resolution(str, Enum):
22
+ """
23
+ Resolution
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ ENUM_15 = '15'
30
+ ENUM_30 = '30'
31
+ ENUM_60 = '60'
32
+ ENUM_240 = '240'
33
+ ENUM_1D = '1D'
34
+
35
+ @classmethod
36
+ def from_json(cls, json_str: str) -> Self:
37
+ """Create an instance of Resolution from a JSON string"""
38
+ return cls(json.loads(json_str))
39
+
40
+
@@ -0,0 +1,149 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Klines Service API
5
+
6
+ API for retrieving OHLCV data, funding rates, and symbol information from Binance. ## WebSocket Support Connect to `/ws` to receive real-time OHLCV updates. Example subscription message: ```json { \"action\": \"subscribe\", \"market\": \"spot\", \"symbol\": \"BTCUSDT\", \"timeframe\": \"15m\" } ```
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ from inspect import getfullargspec
17
+ import json
18
+ import pprint
19
+ import re # noqa: F401
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
21
+ from typing import Optional
22
+ from crypticorn.klines.client.models.history_error_response import HistoryErrorResponse
23
+ from crypticorn.klines.client.models.history_no_data_response import HistoryNoDataResponse
24
+ from crypticorn.klines.client.models.history_success_response import HistorySuccessResponse
25
+ from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
26
+ from typing_extensions import Literal, Self
27
+ from pydantic import Field
28
+
29
+ RESPONSEGETHISTORYUDFHISTORYGET_ANY_OF_SCHEMAS = ["HistoryErrorResponse", "HistoryNoDataResponse", "HistorySuccessResponse"]
30
+
31
+ class ResponseGetHistoryUdfHistoryGet(BaseModel):
32
+ """
33
+ ResponseGetHistoryUdfHistoryGet
34
+ """
35
+
36
+ # data type: HistorySuccessResponse
37
+ anyof_schema_1_validator: Optional[HistorySuccessResponse] = None
38
+ # data type: HistoryNoDataResponse
39
+ anyof_schema_2_validator: Optional[HistoryNoDataResponse] = None
40
+ # data type: HistoryErrorResponse
41
+ anyof_schema_3_validator: Optional[HistoryErrorResponse] = None
42
+ if TYPE_CHECKING:
43
+ actual_instance: Optional[Union[HistoryErrorResponse, HistoryNoDataResponse, HistorySuccessResponse]] = None
44
+ else:
45
+ actual_instance: Any = None
46
+ any_of_schemas: Set[str] = { "HistoryErrorResponse", "HistoryNoDataResponse", "HistorySuccessResponse" }
47
+
48
+ model_config = {
49
+ "validate_assignment": True,
50
+ "protected_namespaces": (),
51
+ }
52
+
53
+ def __init__(self, *args, **kwargs) -> None:
54
+ if args:
55
+ if len(args) > 1:
56
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
57
+ if kwargs:
58
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
59
+ super().__init__(actual_instance=args[0])
60
+ else:
61
+ super().__init__(**kwargs)
62
+
63
+ @field_validator('actual_instance')
64
+ def actual_instance_must_validate_anyof(cls, v):
65
+ instance = ResponseGetHistoryUdfHistoryGet.model_construct()
66
+ error_messages = []
67
+ # validate data type: HistorySuccessResponse
68
+ if not isinstance(v, HistorySuccessResponse):
69
+ error_messages.append(f"Error! Input type `{type(v)}` is not `HistorySuccessResponse`")
70
+ else:
71
+ return v
72
+
73
+ # validate data type: HistoryNoDataResponse
74
+ if not isinstance(v, HistoryNoDataResponse):
75
+ error_messages.append(f"Error! Input type `{type(v)}` is not `HistoryNoDataResponse`")
76
+ else:
77
+ return v
78
+
79
+ # validate data type: HistoryErrorResponse
80
+ if not isinstance(v, HistoryErrorResponse):
81
+ error_messages.append(f"Error! Input type `{type(v)}` is not `HistoryErrorResponse`")
82
+ else:
83
+ return v
84
+
85
+ if error_messages:
86
+ # no match
87
+ raise ValueError("No match found when setting the actual_instance in ResponseGetHistoryUdfHistoryGet with anyOf schemas: HistoryErrorResponse, HistoryNoDataResponse, HistorySuccessResponse. Details: " + ", ".join(error_messages))
88
+ else:
89
+ return v
90
+
91
+ @classmethod
92
+ def from_dict(cls, obj: Dict[str, Any]) -> Self:
93
+ return cls.from_json(json.dumps(obj))
94
+
95
+ @classmethod
96
+ def from_json(cls, json_str: str) -> Self:
97
+ """Returns the object represented by the json string"""
98
+ instance = cls.model_construct()
99
+ error_messages = []
100
+ # anyof_schema_1_validator: Optional[HistorySuccessResponse] = None
101
+ try:
102
+ instance.actual_instance = HistorySuccessResponse.from_json(json_str)
103
+ return instance
104
+ except (ValidationError, ValueError) as e:
105
+ error_messages.append(str(e))
106
+ # anyof_schema_2_validator: Optional[HistoryNoDataResponse] = None
107
+ try:
108
+ instance.actual_instance = HistoryNoDataResponse.from_json(json_str)
109
+ return instance
110
+ except (ValidationError, ValueError) as e:
111
+ error_messages.append(str(e))
112
+ # anyof_schema_3_validator: Optional[HistoryErrorResponse] = None
113
+ try:
114
+ instance.actual_instance = HistoryErrorResponse.from_json(json_str)
115
+ return instance
116
+ except (ValidationError, ValueError) as e:
117
+ error_messages.append(str(e))
118
+
119
+ if error_messages:
120
+ # no match
121
+ raise ValueError("No match found when deserializing the JSON string into ResponseGetHistoryUdfHistoryGet with anyOf schemas: HistoryErrorResponse, HistoryNoDataResponse, HistorySuccessResponse. Details: " + ", ".join(error_messages))
122
+ else:
123
+ return instance
124
+
125
+ def to_json(self) -> str:
126
+ """Returns the JSON representation of the actual instance"""
127
+ if self.actual_instance is None:
128
+ return "null"
129
+
130
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
131
+ return self.actual_instance.to_json()
132
+ else:
133
+ return json.dumps(self.actual_instance)
134
+
135
+ def to_dict(self) -> Optional[Union[Dict[str, Any], HistoryErrorResponse, HistoryNoDataResponse, HistorySuccessResponse]]:
136
+ """Returns the dict representation of the actual instance"""
137
+ if self.actual_instance is None:
138
+ return None
139
+
140
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
141
+ return self.actual_instance.to_dict()
142
+ else:
143
+ return self.actual_instance
144
+
145
+ def to_str(self) -> str:
146
+ """Returns the string representation of the actual instance"""
147
+ return pprint.pformat(self.model_dump())
148
+
149
+
@@ -0,0 +1,97 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Klines Service API
5
+
6
+ API for retrieving OHLCV data, funding rates, and symbol information from Binance. ## WebSocket Support Connect to `/ws` to receive real-time OHLCV updates. Example subscription message: ```json { \"action\": \"subscribe\", \"market\": \"spot\", \"symbol\": \"BTCUSDT\", \"timeframe\": \"15m\" } ```
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class SearchSymbolResponse(BaseModel):
26
+ """
27
+ SearchSymbolResponse
28
+ """ # noqa: E501
29
+ symbol: StrictStr
30
+ full_name: StrictStr
31
+ description: StrictStr
32
+ exchange: StrictStr
33
+ ticker: StrictStr
34
+ type: StrictStr
35
+ __properties: ClassVar[List[str]] = ["symbol", "full_name", "description", "exchange", "ticker", "type"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of SearchSymbolResponse from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ return _dict
77
+
78
+ @classmethod
79
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
80
+ """Create an instance of SearchSymbolResponse from a dict"""
81
+ if obj is None:
82
+ return None
83
+
84
+ if not isinstance(obj, dict):
85
+ return cls.model_validate(obj)
86
+
87
+ _obj = cls.model_validate({
88
+ "symbol": obj.get("symbol"),
89
+ "full_name": obj.get("full_name"),
90
+ "description": obj.get("description"),
91
+ "exchange": obj.get("exchange"),
92
+ "ticker": obj.get("ticker"),
93
+ "type": obj.get("type")
94
+ })
95
+ return _obj
96
+
97
+
@@ -0,0 +1,37 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Klines Service API
5
+
6
+ API for retrieving OHLCV data, funding rates, and symbol information from Binance. ## WebSocket Support Connect to `/ws` to receive real-time OHLCV updates. Example subscription message: ```json { \"action\": \"subscribe\", \"market\": \"spot\", \"symbol\": \"BTCUSDT\", \"timeframe\": \"15m\" } ```
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import json
17
+ from enum import Enum
18
+ from typing_extensions import Self
19
+
20
+
21
+ class SortDirection(str, Enum):
22
+ """
23
+ SortDirection
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ ASC = 'asc'
30
+ DESC = 'desc'
31
+
32
+ @classmethod
33
+ def from_json(cls, json_str: str) -> Self:
34
+ """Create an instance of SortDirection from a JSON string"""
35
+ return cls(json.loads(json_str))
36
+
37
+
@@ -1,11 +1,11 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- FastAPI
4
+ Klines Service API
5
5
 
6
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ API for retrieving OHLCV data, funding rates, and symbol information from Binance. ## WebSocket Support Connect to `/ws` to receive real-time OHLCV updates. Example subscription message: ```json { \"action\": \"subscribe\", \"market\": \"spot\", \"symbol\": \"BTCUSDT\", \"timeframe\": \"15m\" } ```
7
7
 
8
- The version of the OpenAPI document: 0.1.0
8
+ The version of the OpenAPI document: 1.0.0
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -17,18 +17,17 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
- from typing import Any, ClassVar, Dict, List
20
+ from pydantic import BaseModel, ConfigDict, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
22
  from typing import Optional, Set
23
23
  from typing_extensions import Self
24
24
 
25
- class FuturesBalanceError(BaseModel):
25
+ class SymbolGroupResponse(BaseModel):
26
26
  """
27
- Model for futures balance error response
27
+ SymbolGroupResponse
28
28
  """ # noqa: E501
29
- api_key_id: StrictStr = Field(description="API key ID", alias="apiKeyId")
30
- error: StrictStr = Field(description="Error message")
31
- __properties: ClassVar[List[str]] = ["apiKeyId", "error"]
29
+ symbol: Optional[List[StrictStr]] = None
30
+ __properties: ClassVar[List[str]] = ["symbol"]
32
31
 
33
32
  model_config = ConfigDict(
34
33
  populate_by_name=True,
@@ -48,7 +47,7 @@ class FuturesBalanceError(BaseModel):
48
47
 
49
48
  @classmethod
50
49
  def from_json(cls, json_str: str) -> Optional[Self]:
51
- """Create an instance of FuturesBalanceError from a JSON string"""
50
+ """Create an instance of SymbolGroupResponse from a JSON string"""
52
51
  return cls.from_dict(json.loads(json_str))
53
52
 
54
53
  def to_dict(self) -> Dict[str, Any]:
@@ -73,7 +72,7 @@ class FuturesBalanceError(BaseModel):
73
72
 
74
73
  @classmethod
75
74
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
- """Create an instance of FuturesBalanceError from a dict"""
75
+ """Create an instance of SymbolGroupResponse from a dict"""
77
76
  if obj is None:
78
77
  return None
79
78
 
@@ -81,8 +80,7 @@ class FuturesBalanceError(BaseModel):
81
80
  return cls.model_validate(obj)
82
81
 
83
82
  _obj = cls.model_validate({
84
- "apiKeyId": obj.get("apiKeyId"),
85
- "error": obj.get("error")
83
+ "symbol": obj.get("symbol")
86
84
  })
87
85
  return _obj
88
86