crypticorn 2.5.1__py3-none-any.whl → 2.5.2__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 (128) hide show
  1. crypticorn/common/__init__.py +1 -0
  2. crypticorn/common/enums.py +3 -1
  3. crypticorn/common/errors.py +40 -4
  4. crypticorn/common/mixins.py +1 -0
  5. crypticorn/common/status_router.py +42 -0
  6. crypticorn/common/utils.py +5 -12
  7. crypticorn/klines/client/__init__.py +0 -5
  8. crypticorn/klines/client/api/change_in_timeframe_api.py +8 -9
  9. crypticorn/klines/client/api/ohlcv_data_api.py +7 -8
  10. crypticorn/klines/client/api/symbols_api.py +7 -8
  11. crypticorn/klines/client/models/__init__.py +0 -5
  12. crypticorn/klines/client/models/exception_detail.py +3 -6
  13. crypticorn/klines/client/models/search_symbol.py +4 -3
  14. crypticorn/klines/client/models/udf_config.py +1 -2
  15. crypticorn/metrics/client/__init__.py +1 -6
  16. crypticorn/metrics/client/api/exchanges_api.py +29 -31
  17. crypticorn/metrics/client/api/indicators_api.py +15 -16
  18. crypticorn/metrics/client/api/logs_api.py +1 -1
  19. crypticorn/metrics/client/api/marketcap_api.py +15 -16
  20. crypticorn/metrics/client/api/markets_api.py +15 -16
  21. crypticorn/metrics/client/api/status_api.py +1 -1
  22. crypticorn/metrics/client/api/tokens_api.py +1 -1
  23. crypticorn/metrics/client/api_client.py +1 -1
  24. crypticorn/metrics/client/configuration.py +3 -5
  25. crypticorn/metrics/client/exceptions.py +1 -1
  26. crypticorn/metrics/client/models/__init__.py +1 -6
  27. crypticorn/metrics/client/models/exception_detail.py +4 -7
  28. crypticorn/metrics/client/models/severity.py +1 -1
  29. crypticorn/metrics/client/models/time_interval.py +1 -1
  30. crypticorn/metrics/client/models/trading_status.py +1 -1
  31. crypticorn/metrics/client/rest.py +1 -1
  32. crypticorn/trade/client/__init__.py +1 -2
  33. crypticorn/trade/client/api/exchanges_api.py +6 -6
  34. crypticorn/trade/client/api/trading_actions_api.py +16 -15
  35. crypticorn/trade/client/configuration.py +2 -2
  36. crypticorn/trade/client/models/__init__.py +1 -2
  37. crypticorn/trade/client/models/action_model.py +1 -2
  38. crypticorn/trade/client/models/exchange_key_model.py +2 -11
  39. crypticorn/trade/client/models/futures_trading_action.py +1 -2
  40. crypticorn/trade/client/models/order_model.py +4 -14
  41. crypticorn/trade/client/models/spot_trading_action.py +1 -2
  42. crypticorn/trade/client/models/strategy_exchange_info.py +2 -3
  43. crypticorn/trade/client/models/strategy_model_input.py +1 -2
  44. crypticorn/trade/client/models/strategy_model_output.py +1 -2
  45. crypticorn/trade/client/models/tpsl.py +3 -1
  46. {crypticorn-2.5.1.dist-info → crypticorn-2.5.2.dist-info}/METADATA +1 -1
  47. {crypticorn-2.5.1.dist-info → crypticorn-2.5.2.dist-info}/RECORD +50 -127
  48. crypticorn/klines/client/api/health_check_api.py +0 -265
  49. crypticorn/klines/client/models/api_error_identifier.py +0 -108
  50. crypticorn/klines/client/models/api_error_level.py +0 -37
  51. crypticorn/klines/client/models/api_error_type.py +0 -37
  52. crypticorn/klines/client/models/base_response_health_check_response.py +0 -114
  53. crypticorn/klines/client/models/base_response_list_change_in_timeframe_response.py +0 -123
  54. crypticorn/klines/client/models/base_response_list_funding_rate_response.py +0 -118
  55. crypticorn/klines/client/models/base_response_list_str.py +0 -106
  56. crypticorn/klines/client/models/base_response_ohlcv_response.py +0 -114
  57. crypticorn/klines/client/models/change_in_timeframe_response.py +0 -86
  58. crypticorn/klines/client/models/error_response.py +0 -109
  59. crypticorn/klines/client/models/exchange.py +0 -91
  60. crypticorn/klines/client/models/funding_rate_response.py +0 -92
  61. crypticorn/klines/client/models/health_check_response.py +0 -91
  62. crypticorn/klines/client/models/history_error_response.py +0 -89
  63. crypticorn/klines/client/models/history_no_data_response.py +0 -99
  64. crypticorn/klines/client/models/history_success_response.py +0 -99
  65. crypticorn/klines/client/models/http_validation_error.py +0 -99
  66. crypticorn/klines/client/models/internal_exchange.py +0 -39
  67. crypticorn/klines/client/models/market.py +0 -35
  68. crypticorn/klines/client/models/market_type.py +0 -35
  69. crypticorn/klines/client/models/ohlcv_response.py +0 -105
  70. crypticorn/klines/client/models/response_get_history_udf_history_get.py +0 -198
  71. crypticorn/klines/client/models/response_get_udf_history.py +0 -198
  72. crypticorn/klines/client/models/search_symbol_response.py +0 -104
  73. crypticorn/klines/client/models/symbol_group_response.py +0 -83
  74. crypticorn/klines/client/models/symbol_info_response.py +0 -131
  75. crypticorn/klines/client/models/udf_config_response.py +0 -160
  76. crypticorn/klines/client/models/validation_error.py +0 -105
  77. crypticorn/klines/client/models/validation_error_loc_inner.py +0 -159
  78. crypticorn/metrics/client/api/health_check_api.py +0 -265
  79. crypticorn/metrics/client/models/api_error_identifier.py +0 -108
  80. crypticorn/metrics/client/models/api_error_level.py +0 -37
  81. crypticorn/metrics/client/models/api_error_type.py +0 -37
  82. crypticorn/metrics/client/models/base_response_dict.py +0 -106
  83. crypticorn/metrics/client/models/base_response_health_check_response.py +0 -114
  84. crypticorn/metrics/client/models/base_response_list_dict.py +0 -106
  85. crypticorn/metrics/client/models/base_response_list_exchange_mapping.py +0 -118
  86. crypticorn/metrics/client/models/base_response_list_str.py +0 -106
  87. crypticorn/metrics/client/models/error_response.py +0 -109
  88. crypticorn/metrics/client/models/exchange_mapping.py +0 -134
  89. crypticorn/metrics/client/models/health_check_response.py +0 -91
  90. crypticorn/metrics/client/models/http_validation_error.py +0 -99
  91. crypticorn/metrics/client/models/internal_exchange.py +0 -39
  92. crypticorn/metrics/client/models/market.py +0 -35
  93. crypticorn/metrics/client/models/market_type.py +0 -35
  94. crypticorn/metrics/client/models/validation_error.py +0 -105
  95. crypticorn/metrics/client/models/validation_error_loc_inner.py +0 -159
  96. crypticorn/pay/client/models/api_status_res.py +0 -83
  97. crypticorn/pay/client/models/body_create_now_invoice.py +0 -98
  98. crypticorn/pay/client/models/body_create_product.py +0 -98
  99. crypticorn/pay/client/models/body_get_products.py +0 -87
  100. crypticorn/pay/client/models/body_handle_now_webhook.py +0 -98
  101. crypticorn/pay/client/models/body_update_product.py +0 -98
  102. crypticorn/pay/client/models/combined_payment_history.py +0 -101
  103. crypticorn/pay/client/models/create_invoice_req.py +0 -188
  104. crypticorn/pay/client/models/create_invoice_res.py +0 -188
  105. crypticorn/pay/client/models/currency.py +0 -165
  106. crypticorn/pay/client/models/estimate_price_req.py +0 -91
  107. crypticorn/pay/client/models/estimate_price_res.py +0 -102
  108. crypticorn/pay/client/models/get_currencies_res.py +0 -99
  109. crypticorn/pay/client/models/get_payment_status_res.py +0 -222
  110. crypticorn/pay/client/models/get_payments_list_res.py +0 -109
  111. crypticorn/pay/client/models/min_amount_req.py +0 -124
  112. crypticorn/pay/client/models/min_amount_res.py +0 -105
  113. crypticorn/pay/client/models/now_fee_structure.py +0 -104
  114. crypticorn/pay/client/models/now_payment_model.py +0 -124
  115. crypticorn/pay/client/models/now_payment_status.py +0 -42
  116. crypticorn/pay/client/models/now_webhook_payload.py +0 -181
  117. crypticorn/pay/client/models/partial_product_update_model.py +0 -150
  118. crypticorn/pay/client/models/product.py +0 -87
  119. crypticorn/pay/client/models/product_model.py +0 -128
  120. crypticorn/pay/client/models/product_subs_model.py +0 -108
  121. crypticorn/pay/client/models/product_update_model.py +0 -150
  122. crypticorn/pay/client/models/unified_payment_model.py +0 -112
  123. crypticorn/trade/client/models/api_key_model.py +0 -156
  124. crypticorn/trade/client/models/exchange.py +0 -35
  125. crypticorn/trade/client/models/market_type.py +0 -35
  126. {crypticorn-2.5.1.dist-info → crypticorn-2.5.2.dist-info}/WHEEL +0 -0
  127. {crypticorn-2.5.1.dist-info → crypticorn-2.5.2.dist-info}/entry_points.txt +0 -0
  128. {crypticorn-2.5.1.dist-info → crypticorn-2.5.2.dist-info}/top_level.txt +0 -0
@@ -1,108 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Klines Service API
5
-
6
- API for retrieving OHLCV data, funding rates, and symbol information from Binance.
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 ApiErrorIdentifier(str, Enum):
22
- """
23
- API error identifiers
24
- """
25
-
26
- """
27
- allowed enum values
28
- """
29
- ALLOCATION_BELOW_CURRENT_EXPOSURE = "allocation_below_current_exposure"
30
- ALLOCATION_BELOW_MIN_AMOUNT = "allocation_below_min_amount"
31
- ALPHANUMERIC_CHARACTERS_ONLY = "alphanumeric_characters_only"
32
- BLACK_SWAN = "black_swan"
33
- BOT_ALREADY_DELETED = "bot_already_deleted"
34
- BOT_DISABLED = "bot_disabled"
35
- BOT_STOPPING_COMPLETED = "bot_stopping_completed"
36
- CLIENT_ORDER_ID_ALREADY_EXISTS = "client_order_id_already_exists"
37
- INVALID_CONTENT_TYPE = "invalid_content_type"
38
- DELETE_BOT_ERROR = "delete_bot_error"
39
- EXCHANGE_INVALID_SIGNATURE = "exchange_invalid_signature"
40
- EXCHANGE_INVALID_TIMESTAMP = "exchange_invalid_timestamp"
41
- EXCHANGE_IP_ADDRESS_IS_NOT_AUTHORIZED = "exchange_ip_address_is_not_authorized"
42
- EXCHANGE_KEY_ALREADY_EXISTS = "exchange_key_already_exists"
43
- EXCHANGE_KEY_IN_USE = "exchange_key_in_use"
44
- EXCHANGE_SYSTEM_UNDER_MAINTENANCE = "exchange_system_under_maintenance"
45
- EXCHANGE_RATE_LIMIT_EXCEEDED = "exchange_rate_limit_exceeded"
46
- INSUFFICIENT_PERMISSIONS_SPOT_AND_FUTURES_REQUIRED = (
47
- "insufficient_permissions_spot_and_futures_required"
48
- )
49
- EXCHANGE_SERVICE_TEMPORARILY_UNAVAILABLE = (
50
- "exchange_service_temporarily_unavailable"
51
- )
52
- EXCHANGE_SYSTEM_IS_BUSY = "exchange_system_is_busy"
53
- EXCHANGE_SYSTEM_CONFIGURATION_ERROR = "exchange_system_configuration_error"
54
- EXCHANGE_INTERNAL_SYSTEM_ERROR = "exchange_internal_system_error"
55
- EXCHANGE_USER_ACCOUNT_IS_FROZEN = "exchange_user_account_is_frozen"
56
- FORBIDDEN = "forbidden"
57
- HEDGE_MODE_NOT_ACTIVE = "hedge_mode_not_active"
58
- HTTP_REQUEST_ERROR = "http_request_error"
59
- INSUFFICIENT_BALANCE = "insufficient_balance"
60
- INSUFFICIENT_MARGIN = "insufficient_margin"
61
- INSUFFICIENT_SCOPES = "insufficient_scopes"
62
- INVALID_API_KEY = "invalid_api_key"
63
- INVALID_BEARER = "invalid_bearer"
64
- INVALID_DATA = "invalid_data"
65
- INVALID_DATA_RESPONSE = "invalid_data_response"
66
- INVALID_EXCHANGE_KEY = "invalid_exchange_key"
67
- INVALID_MARGIN_MODE = "invalid_margin_mode"
68
- INVALID_PARAMETER_PROVIDED = "invalid_parameter_provided"
69
- JWT_EXPIRED = "jwt_expired"
70
- LEVERAGE_LIMIT_EXCEEDED = "leverage_limit_exceeded"
71
- ORDER_VIOLATES_LIQUIDATION_PRICE_CONSTRAINTS = (
72
- "order_violates_liquidation_price_constraints"
73
- )
74
- NO_CREDENTIALS = "no_credentials"
75
- NOW_API_DOWN = "now_api_down"
76
- OBJECT_NOT_FOUND = "object_not_found"
77
- OBJECT_ALREADY_EXISTS = "object_already_exists"
78
- ORDER_IS_ALREADY_FILLED = "order_is_already_filled"
79
- ORDER_IS_BEING_PROCESSED = "order_is_being_processed"
80
- ORDER_QUANTITY_LIMIT_EXCEEDED = "order_quantity_limit_exceeded"
81
- ORDER_DOES_NOT_EXIST = "order_does_not_exist"
82
- ORDER_PRICE_IS_INVALID = "order_price_is_invalid"
83
- ORDER_SIZE_TOO_LARGE = "order_size_too_large"
84
- ORDER_SIZE_TOO_SMALL = "order_size_too_small"
85
- POSITION_LIMIT_EXCEEDED = "position_limit_exceeded"
86
- POSITION_DOES_NOT_EXIST = "position_does_not_exist"
87
- POSITION_OPENING_TEMPORARILY_SUSPENDED = "position_opening_temporarily_suspended"
88
- POST_ONLY_ORDER_WOULD_IMMEDIATELY_MATCH = "post_only_order_would_immediately_match"
89
- REQUEST_SCOPE_LIMIT_EXCEEDED = "request_scope_limit_exceeded"
90
- RISK_LIMIT_EXCEEDED = "risk_limit_exceeded"
91
- RPC_TIMEOUT = "rpc_timeout"
92
- SYSTEM_SETTLEMENT_IN_PROCESS = "system_settlement_in_process"
93
- STRATEGY_DISABLED = "strategy_disabled"
94
- STRATEGY_LEVERAGE_MISMATCH = "strategy_leverage_mismatch"
95
- STRATEGY_NOT_SUPPORTING_EXCHANGE = "strategy_not_supporting_exchange"
96
- SUCCESS = "success"
97
- SYMBOL_DOES_NOT_EXIST = "symbol_does_not_exist"
98
- TRADING_ACTION_EXPIRED = "trading_action_expired"
99
- TRADING_ACTION_SKIPPED = "trading_action_skipped"
100
- TRADING_HAS_BEEN_LOCKED = "trading_has_been_locked"
101
- TRADING_IS_SUSPENDED = "trading_is_suspended"
102
- UNKNOWN_ERROR_OCCURRED = "unknown_error_occurred"
103
- REQUESTED_RESOURCE_NOT_FOUND = "requested_resource_not_found"
104
-
105
- @classmethod
106
- def from_json(cls, json_str: str) -> Self:
107
- """Create an instance of ApiErrorIdentifier from a JSON string"""
108
- return cls(json.loads(json_str))
@@ -1,37 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Klines Service API
5
-
6
- API for retrieving OHLCV data, funding rates, and symbol information from Binance.
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 ApiErrorLevel(str, Enum):
22
- """
23
- API error levels
24
- """
25
-
26
- """
27
- allowed enum values
28
- """
29
- ERROR = "error"
30
- INFO = "info"
31
- SUCCESS = "success"
32
- WARNING = "warning"
33
-
34
- @classmethod
35
- def from_json(cls, json_str: str) -> Self:
36
- """Create an instance of ApiErrorLevel from a JSON string"""
37
- return cls(json.loads(json_str))
@@ -1,37 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Klines Service API
5
-
6
- API for retrieving OHLCV data, funding rates, and symbol information from Binance.
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 ApiErrorType(str, Enum):
22
- """
23
- Type of API error
24
- """
25
-
26
- """
27
- allowed enum values
28
- """
29
- USER_ERROR = "user error"
30
- EXCHANGE_ERROR = "exchange error"
31
- SERVER_ERROR = "server error"
32
- NO_ERROR = "no error"
33
-
34
- @classmethod
35
- def from_json(cls, json_str: str) -> Self:
36
- """Create an instance of ApiErrorType from a JSON string"""
37
- return cls(json.loads(json_str))
@@ -1,114 +0,0 @@
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, StrictBool, StrictStr
22
- from typing import Any, ClassVar, Dict, List, Optional
23
- from crypticorn.klines.client.models.health_check_response import HealthCheckResponse
24
- from typing import Optional, Set
25
- from typing_extensions import Self
26
-
27
-
28
- class BaseResponseHealthCheckResponse(BaseModel):
29
- """
30
- BaseResponseHealthCheckResponse
31
- """ # noqa: E501
32
-
33
- success: Optional[StrictBool] = True
34
- message: Optional[StrictStr] = None
35
- data: Optional[HealthCheckResponse] = None
36
- timestamp: Optional[datetime] = None
37
- __properties: ClassVar[List[str]] = ["success", "message", "data", "timestamp"]
38
-
39
- model_config = ConfigDict(
40
- populate_by_name=True,
41
- validate_assignment=True,
42
- protected_namespaces=(),
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 BaseResponseHealthCheckResponse 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
- _dict = self.model_dump(
72
- by_alias=True,
73
- exclude=excluded_fields,
74
- exclude_none=True,
75
- )
76
- # override the default output from pydantic by calling `to_dict()` of data
77
- if self.data:
78
- _dict["data"] = self.data.to_dict()
79
- # set to None if message (nullable) is None
80
- # and model_fields_set contains the field
81
- if self.message is None and "message" in self.model_fields_set:
82
- _dict["message"] = None
83
-
84
- # set to None if data (nullable) is None
85
- # and model_fields_set contains the field
86
- if self.data is None and "data" in self.model_fields_set:
87
- _dict["data"] = None
88
-
89
- return _dict
90
-
91
- @classmethod
92
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93
- """Create an instance of BaseResponseHealthCheckResponse from a dict"""
94
- if obj is None:
95
- return None
96
-
97
- if not isinstance(obj, dict):
98
- return cls.model_validate(obj)
99
-
100
- _obj = cls.model_validate(
101
- {
102
- "success": (
103
- obj.get("success") if obj.get("success") is not None else True
104
- ),
105
- "message": obj.get("message"),
106
- "data": (
107
- HealthCheckResponse.from_dict(obj["data"])
108
- if obj.get("data") is not None
109
- else None
110
- ),
111
- "timestamp": obj.get("timestamp"),
112
- }
113
- )
114
- return _obj
@@ -1,123 +0,0 @@
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, StrictBool, StrictStr
22
- from typing import Any, ClassVar, Dict, List, Optional
23
- from crypticorn.klines.client.models.change_in_timeframe_response import (
24
- ChangeInTimeframeResponse,
25
- )
26
- from typing import Optional, Set
27
- from typing_extensions import Self
28
-
29
-
30
- class BaseResponseListChangeInTimeframeResponse(BaseModel):
31
- """
32
- BaseResponseListChangeInTimeframeResponse
33
- """ # noqa: E501
34
-
35
- success: Optional[StrictBool] = True
36
- message: Optional[StrictStr] = None
37
- data: Optional[List[ChangeInTimeframeResponse]] = None
38
- timestamp: Optional[datetime] = None
39
- __properties: ClassVar[List[str]] = ["success", "message", "data", "timestamp"]
40
-
41
- model_config = ConfigDict(
42
- populate_by_name=True,
43
- validate_assignment=True,
44
- protected_namespaces=(),
45
- )
46
-
47
- def to_str(self) -> str:
48
- """Returns the string representation of the model using alias"""
49
- return pprint.pformat(self.model_dump(by_alias=True))
50
-
51
- def to_json(self) -> str:
52
- """Returns the JSON representation of the model using alias"""
53
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
54
- return json.dumps(self.to_dict())
55
-
56
- @classmethod
57
- def from_json(cls, json_str: str) -> Optional[Self]:
58
- """Create an instance of BaseResponseListChangeInTimeframeResponse from a JSON string"""
59
- return cls.from_dict(json.loads(json_str))
60
-
61
- def to_dict(self) -> Dict[str, Any]:
62
- """Return the dictionary representation of the model using alias.
63
-
64
- This has the following differences from calling pydantic's
65
- `self.model_dump(by_alias=True)`:
66
-
67
- * `None` is only added to the output dict for nullable fields that
68
- were set at model initialization. Other fields with value `None`
69
- are ignored.
70
- """
71
- excluded_fields: Set[str] = set([])
72
-
73
- _dict = self.model_dump(
74
- by_alias=True,
75
- exclude=excluded_fields,
76
- exclude_none=True,
77
- )
78
- # override the default output from pydantic by calling `to_dict()` of each item in data (list)
79
- _items = []
80
- if self.data:
81
- for _item_data in self.data:
82
- if _item_data:
83
- _items.append(_item_data.to_dict())
84
- _dict["data"] = _items
85
- # set to None if message (nullable) is None
86
- # and model_fields_set contains the field
87
- if self.message is None and "message" in self.model_fields_set:
88
- _dict["message"] = None
89
-
90
- # set to None if data (nullable) is None
91
- # and model_fields_set contains the field
92
- if self.data is None and "data" in self.model_fields_set:
93
- _dict["data"] = None
94
-
95
- return _dict
96
-
97
- @classmethod
98
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
99
- """Create an instance of BaseResponseListChangeInTimeframeResponse from a dict"""
100
- if obj is None:
101
- return None
102
-
103
- if not isinstance(obj, dict):
104
- return cls.model_validate(obj)
105
-
106
- _obj = cls.model_validate(
107
- {
108
- "success": (
109
- obj.get("success") if obj.get("success") is not None else True
110
- ),
111
- "message": obj.get("message"),
112
- "data": (
113
- [
114
- ChangeInTimeframeResponse.from_dict(_item)
115
- for _item in obj["data"]
116
- ]
117
- if obj.get("data") is not None
118
- else None
119
- ),
120
- "timestamp": obj.get("timestamp"),
121
- }
122
- )
123
- return _obj
@@ -1,118 +0,0 @@
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, StrictBool, StrictStr
22
- from typing import Any, ClassVar, Dict, List, Optional
23
- from crypticorn.klines.client.models.funding_rate_response import FundingRateResponse
24
- from typing import Optional, Set
25
- from typing_extensions import Self
26
-
27
-
28
- class BaseResponseListFundingRateResponse(BaseModel):
29
- """
30
- BaseResponseListFundingRateResponse
31
- """ # noqa: E501
32
-
33
- success: Optional[StrictBool] = True
34
- message: Optional[StrictStr] = None
35
- data: Optional[List[FundingRateResponse]] = None
36
- timestamp: Optional[datetime] = None
37
- __properties: ClassVar[List[str]] = ["success", "message", "data", "timestamp"]
38
-
39
- model_config = ConfigDict(
40
- populate_by_name=True,
41
- validate_assignment=True,
42
- protected_namespaces=(),
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 BaseResponseListFundingRateResponse 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
- _dict = self.model_dump(
72
- by_alias=True,
73
- exclude=excluded_fields,
74
- exclude_none=True,
75
- )
76
- # override the default output from pydantic by calling `to_dict()` of each item in data (list)
77
- _items = []
78
- if self.data:
79
- for _item_data in self.data:
80
- if _item_data:
81
- _items.append(_item_data.to_dict())
82
- _dict["data"] = _items
83
- # set to None if message (nullable) is None
84
- # and model_fields_set contains the field
85
- if self.message is None and "message" in self.model_fields_set:
86
- _dict["message"] = None
87
-
88
- # set to None if data (nullable) is None
89
- # and model_fields_set contains the field
90
- if self.data is None and "data" in self.model_fields_set:
91
- _dict["data"] = None
92
-
93
- return _dict
94
-
95
- @classmethod
96
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
97
- """Create an instance of BaseResponseListFundingRateResponse from a dict"""
98
- if obj is None:
99
- return None
100
-
101
- if not isinstance(obj, dict):
102
- return cls.model_validate(obj)
103
-
104
- _obj = cls.model_validate(
105
- {
106
- "success": (
107
- obj.get("success") if obj.get("success") is not None else True
108
- ),
109
- "message": obj.get("message"),
110
- "data": (
111
- [FundingRateResponse.from_dict(_item) for _item in obj["data"]]
112
- if obj.get("data") is not None
113
- else None
114
- ),
115
- "timestamp": obj.get("timestamp"),
116
- }
117
- )
118
- return _obj
@@ -1,106 +0,0 @@
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, StrictBool, StrictStr
22
- from typing import Any, ClassVar, Dict, List, Optional
23
- from typing import Optional, Set
24
- from typing_extensions import Self
25
-
26
-
27
- class BaseResponseListStr(BaseModel):
28
- """
29
- BaseResponseListStr
30
- """ # noqa: E501
31
-
32
- success: Optional[StrictBool] = True
33
- message: Optional[StrictStr] = None
34
- data: Optional[List[StrictStr]] = None
35
- timestamp: Optional[datetime] = None
36
- __properties: ClassVar[List[str]] = ["success", "message", "data", "timestamp"]
37
-
38
- model_config = ConfigDict(
39
- populate_by_name=True,
40
- validate_assignment=True,
41
- protected_namespaces=(),
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 BaseResponseListStr 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
- _dict = self.model_dump(
71
- by_alias=True,
72
- exclude=excluded_fields,
73
- exclude_none=True,
74
- )
75
- # set to None if message (nullable) is None
76
- # and model_fields_set contains the field
77
- if self.message is None and "message" in self.model_fields_set:
78
- _dict["message"] = None
79
-
80
- # set to None if data (nullable) is None
81
- # and model_fields_set contains the field
82
- if self.data is None and "data" in self.model_fields_set:
83
- _dict["data"] = None
84
-
85
- return _dict
86
-
87
- @classmethod
88
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
- """Create an instance of BaseResponseListStr from a dict"""
90
- if obj is None:
91
- return None
92
-
93
- if not isinstance(obj, dict):
94
- return cls.model_validate(obj)
95
-
96
- _obj = cls.model_validate(
97
- {
98
- "success": (
99
- obj.get("success") if obj.get("success") is not None else True
100
- ),
101
- "message": obj.get("message"),
102
- "data": obj.get("data"),
103
- "timestamp": obj.get("timestamp"),
104
- }
105
- )
106
- return _obj