crypticorn 2.5.1__py3-none-any.whl → 2.5.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- crypticorn/cli/init.py +3 -0
- crypticorn/common/__init__.py +1 -0
- crypticorn/common/enums.py +3 -1
- crypticorn/common/errors.py +42 -21
- crypticorn/common/mixins.py +20 -0
- crypticorn/common/scopes.py +4 -20
- crypticorn/common/status_router.py +44 -0
- crypticorn/common/utils.py +13 -14
- crypticorn/hive/client/__init__.py +1 -5
- crypticorn/hive/client/api/data_api.py +1 -33
- crypticorn/hive/client/api/models_api.py +8 -104
- crypticorn/hive/client/api/status_api.py +481 -9
- crypticorn/hive/client/configuration.py +12 -4
- crypticorn/hive/client/models/__init__.py +1 -5
- crypticorn/hive/client/models/coins.py +0 -1
- crypticorn/hive/client/models/data_version.py +0 -1
- crypticorn/{metrics/client/models/error_response.py → hive/client/models/exception_detail.py} +26 -21
- crypticorn/hive/client/rest.py +4 -1
- crypticorn/klines/client/__init__.py +0 -5
- crypticorn/klines/client/api/change_in_timeframe_api.py +8 -9
- crypticorn/klines/client/api/ohlcv_data_api.py +7 -8
- crypticorn/klines/client/api/status_api.py +481 -6
- crypticorn/klines/client/api/symbols_api.py +7 -8
- crypticorn/klines/client/api/udf_api.py +0 -227
- crypticorn/klines/client/models/__init__.py +0 -5
- crypticorn/klines/client/models/exception_detail.py +3 -6
- crypticorn/klines/client/models/search_symbol.py +4 -3
- crypticorn/klines/client/models/udf_config.py +1 -2
- crypticorn/metrics/client/__init__.py +1 -6
- crypticorn/metrics/client/api/exchanges_api.py +29 -31
- crypticorn/metrics/client/api/indicators_api.py +15 -16
- crypticorn/metrics/client/api/logs_api.py +1 -1
- crypticorn/metrics/client/api/marketcap_api.py +15 -16
- crypticorn/metrics/client/api/markets_api.py +15 -16
- crypticorn/metrics/client/api/status_api.py +477 -2
- crypticorn/metrics/client/api/tokens_api.py +1 -1
- crypticorn/metrics/client/api_client.py +1 -1
- crypticorn/metrics/client/configuration.py +3 -5
- crypticorn/metrics/client/exceptions.py +1 -1
- crypticorn/metrics/client/models/__init__.py +1 -6
- crypticorn/metrics/client/models/exception_detail.py +4 -7
- crypticorn/metrics/client/models/severity.py +1 -1
- crypticorn/metrics/client/models/time_interval.py +1 -1
- crypticorn/metrics/client/models/trading_status.py +1 -1
- crypticorn/metrics/client/rest.py +1 -1
- crypticorn/pay/client/__init__.py +3 -8
- crypticorn/pay/client/api/now_payments_api.py +14 -17
- crypticorn/pay/client/api/payments_api.py +2 -11
- crypticorn/pay/client/api/products_api.py +2 -11
- crypticorn/pay/client/api/status_api.py +483 -8
- crypticorn/pay/client/api_client.py +2 -2
- crypticorn/pay/client/configuration.py +3 -3
- crypticorn/pay/client/exceptions.py +2 -2
- crypticorn/pay/client/models/__init__.py +3 -8
- crypticorn/{metrics/client/models/base_response_dict.py → pay/client/models/exception_detail.py} +28 -20
- crypticorn/pay/client/models/now_create_invoice_req.py +2 -2
- crypticorn/pay/client/models/now_create_invoice_res.py +2 -2
- crypticorn/pay/client/models/payment.py +2 -2
- crypticorn/pay/client/models/payment_status.py +2 -2
- crypticorn/pay/client/models/product_create.py +2 -2
- crypticorn/pay/client/models/product_read.py +2 -2
- crypticorn/pay/client/models/product_sub_read.py +2 -2
- crypticorn/pay/client/models/product_update.py +2 -2
- crypticorn/pay/client/models/scope.py +2 -2
- crypticorn/pay/client/models/services.py +2 -2
- crypticorn/pay/client/rest.py +2 -2
- crypticorn/trade/client/__init__.py +4 -9
- crypticorn/trade/client/api/api_keys_api.py +5 -20
- crypticorn/trade/client/api/bots_api.py +7 -19
- crypticorn/trade/client/api/exchanges_api.py +8 -8
- crypticorn/trade/client/api/futures_trading_panel_api.py +10 -22
- crypticorn/trade/client/api/notifications_api.py +10 -25
- crypticorn/trade/client/api/orders_api.py +2 -5
- crypticorn/trade/client/api/status_api.py +483 -8
- crypticorn/trade/client/api/strategies_api.py +5 -17
- crypticorn/trade/client/api/trading_actions_api.py +18 -26
- crypticorn/trade/client/api_client.py +2 -2
- crypticorn/trade/client/configuration.py +5 -5
- crypticorn/trade/client/exceptions.py +2 -2
- crypticorn/trade/client/models/__init__.py +4 -9
- crypticorn/trade/client/models/action_model.py +3 -4
- crypticorn/trade/client/models/bot_model.py +2 -2
- crypticorn/trade/client/models/bot_status.py +2 -2
- crypticorn/{klines/client/models/error_response.py → trade/client/models/exception_detail.py} +26 -21
- crypticorn/trade/client/models/exchange_key_model.py +4 -13
- crypticorn/trade/client/models/execution_ids.py +2 -2
- crypticorn/trade/client/models/futures_balance.py +2 -2
- crypticorn/trade/client/models/futures_trading_action.py +3 -4
- crypticorn/trade/client/models/margin_mode.py +2 -2
- crypticorn/trade/client/models/notification_model.py +2 -2
- crypticorn/trade/client/models/order_model.py +6 -16
- crypticorn/trade/client/models/order_status.py +2 -2
- crypticorn/trade/client/models/post_futures_action.py +2 -2
- crypticorn/trade/client/models/spot_trading_action.py +3 -4
- crypticorn/trade/client/models/strategy_exchange_info.py +4 -5
- crypticorn/trade/client/models/strategy_model_input.py +3 -4
- crypticorn/trade/client/models/strategy_model_output.py +3 -4
- crypticorn/trade/client/models/tpsl.py +5 -3
- crypticorn/trade/client/models/trading_action_type.py +2 -2
- crypticorn/trade/client/rest.py +2 -2
- {crypticorn-2.5.1.dist-info → crypticorn-2.5.3.dist-info}/METADATA +1 -1
- crypticorn-2.5.3.dist-info/RECORD +223 -0
- crypticorn/hive/client/models/http_validation_error.py +0 -99
- crypticorn/hive/client/models/validation_error.py +0 -105
- crypticorn/hive/client/models/validation_error_loc_inner.py +0 -159
- crypticorn/klines/client/api/health_check_api.py +0 -265
- crypticorn/klines/client/models/api_error_identifier.py +0 -108
- crypticorn/klines/client/models/api_error_level.py +0 -37
- crypticorn/klines/client/models/api_error_type.py +0 -37
- crypticorn/klines/client/models/base_response_health_check_response.py +0 -114
- crypticorn/klines/client/models/base_response_list_change_in_timeframe_response.py +0 -123
- crypticorn/klines/client/models/base_response_list_funding_rate_response.py +0 -118
- crypticorn/klines/client/models/base_response_list_str.py +0 -106
- crypticorn/klines/client/models/base_response_ohlcv_response.py +0 -114
- crypticorn/klines/client/models/change_in_timeframe_response.py +0 -86
- crypticorn/klines/client/models/exchange.py +0 -91
- crypticorn/klines/client/models/funding_rate_response.py +0 -92
- crypticorn/klines/client/models/health_check_response.py +0 -91
- crypticorn/klines/client/models/history_error_response.py +0 -89
- crypticorn/klines/client/models/history_no_data_response.py +0 -99
- crypticorn/klines/client/models/history_success_response.py +0 -99
- crypticorn/klines/client/models/http_validation_error.py +0 -99
- crypticorn/klines/client/models/internal_exchange.py +0 -39
- crypticorn/klines/client/models/market.py +0 -35
- crypticorn/klines/client/models/market_type.py +0 -35
- crypticorn/klines/client/models/ohlcv_response.py +0 -105
- crypticorn/klines/client/models/response_get_history_udf_history_get.py +0 -198
- crypticorn/klines/client/models/response_get_udf_history.py +0 -198
- crypticorn/klines/client/models/search_symbol_response.py +0 -104
- crypticorn/klines/client/models/symbol_group_response.py +0 -83
- crypticorn/klines/client/models/symbol_info_response.py +0 -131
- crypticorn/klines/client/models/udf_config_response.py +0 -160
- crypticorn/klines/client/models/validation_error.py +0 -105
- crypticorn/klines/client/models/validation_error_loc_inner.py +0 -159
- crypticorn/metrics/client/api/health_check_api.py +0 -265
- crypticorn/metrics/client/models/api_error_identifier.py +0 -108
- crypticorn/metrics/client/models/api_error_level.py +0 -37
- crypticorn/metrics/client/models/api_error_type.py +0 -37
- crypticorn/metrics/client/models/base_response_health_check_response.py +0 -114
- crypticorn/metrics/client/models/base_response_list_dict.py +0 -106
- crypticorn/metrics/client/models/base_response_list_exchange_mapping.py +0 -118
- crypticorn/metrics/client/models/base_response_list_str.py +0 -106
- crypticorn/metrics/client/models/exchange_mapping.py +0 -134
- crypticorn/metrics/client/models/health_check_response.py +0 -91
- crypticorn/metrics/client/models/http_validation_error.py +0 -99
- crypticorn/metrics/client/models/internal_exchange.py +0 -39
- crypticorn/metrics/client/models/market.py +0 -35
- crypticorn/metrics/client/models/market_type.py +0 -35
- crypticorn/metrics/client/models/validation_error.py +0 -105
- crypticorn/metrics/client/models/validation_error_loc_inner.py +0 -159
- crypticorn/pay/client/models/api_status_res.py +0 -83
- crypticorn/pay/client/models/body_create_now_invoice.py +0 -98
- crypticorn/pay/client/models/body_create_product.py +0 -98
- crypticorn/pay/client/models/body_get_products.py +0 -87
- crypticorn/pay/client/models/body_handle_now_webhook.py +0 -98
- crypticorn/pay/client/models/body_update_product.py +0 -98
- crypticorn/pay/client/models/combined_payment_history.py +0 -101
- crypticorn/pay/client/models/create_invoice_req.py +0 -188
- crypticorn/pay/client/models/create_invoice_res.py +0 -188
- crypticorn/pay/client/models/currency.py +0 -165
- crypticorn/pay/client/models/estimate_price_req.py +0 -91
- crypticorn/pay/client/models/estimate_price_res.py +0 -102
- crypticorn/pay/client/models/get_currencies_res.py +0 -99
- crypticorn/pay/client/models/get_payment_status_res.py +0 -222
- crypticorn/pay/client/models/get_payments_list_res.py +0 -109
- crypticorn/pay/client/models/http_validation_error.py +0 -99
- crypticorn/pay/client/models/min_amount_req.py +0 -124
- crypticorn/pay/client/models/min_amount_res.py +0 -105
- crypticorn/pay/client/models/now_api_status_res.py +0 -83
- crypticorn/pay/client/models/now_fee_structure.py +0 -104
- crypticorn/pay/client/models/now_payment_model.py +0 -124
- crypticorn/pay/client/models/now_payment_status.py +0 -42
- crypticorn/pay/client/models/now_webhook_payload.py +0 -181
- crypticorn/pay/client/models/partial_product_update_model.py +0 -150
- crypticorn/pay/client/models/product.py +0 -87
- crypticorn/pay/client/models/product_model.py +0 -128
- crypticorn/pay/client/models/product_subs_model.py +0 -108
- crypticorn/pay/client/models/product_update_model.py +0 -150
- crypticorn/pay/client/models/unified_payment_model.py +0 -112
- crypticorn/pay/client/models/validation_error.py +0 -105
- crypticorn/pay/client/models/validation_error_loc_inner.py +0 -159
- crypticorn/trade/client/models/api_key_model.py +0 -156
- crypticorn/trade/client/models/exchange.py +0 -35
- crypticorn/trade/client/models/http_validation_error.py +0 -99
- crypticorn/trade/client/models/market_type.py +0 -35
- crypticorn/trade/client/models/validation_error.py +0 -105
- crypticorn/trade/client/models/validation_error_loc_inner.py +0 -159
- crypticorn-2.5.1.dist-info/RECORD +0 -307
- {crypticorn-2.5.1.dist-info → crypticorn-2.5.3.dist-info}/WHEEL +0 -0
- {crypticorn-2.5.1.dist-info → crypticorn-2.5.3.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.5.1.dist-info → crypticorn-2.5.3.dist-info}/top_level.txt +0 -0
@@ -1,159 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
"""
|
4
|
-
Payment API
|
5
|
-
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
-
|
8
|
-
The version of the OpenAPI document: 0.1.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 (
|
21
|
-
BaseModel,
|
22
|
-
ConfigDict,
|
23
|
-
Field,
|
24
|
-
StrictInt,
|
25
|
-
StrictStr,
|
26
|
-
ValidationError,
|
27
|
-
field_validator,
|
28
|
-
)
|
29
|
-
from typing import Optional
|
30
|
-
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
31
|
-
from typing_extensions import Literal, Self
|
32
|
-
from pydantic import Field
|
33
|
-
|
34
|
-
VALIDATIONERRORLOCINNER_ANY_OF_SCHEMAS = ["int", "str"]
|
35
|
-
|
36
|
-
|
37
|
-
class ValidationErrorLocInner(BaseModel):
|
38
|
-
"""
|
39
|
-
ValidationErrorLocInner
|
40
|
-
"""
|
41
|
-
|
42
|
-
# data type: str
|
43
|
-
anyof_schema_1_validator: Optional[StrictStr] = None
|
44
|
-
# data type: int
|
45
|
-
anyof_schema_2_validator: Optional[StrictInt] = None
|
46
|
-
if TYPE_CHECKING:
|
47
|
-
actual_instance: Optional[Union[int, str]] = None
|
48
|
-
else:
|
49
|
-
actual_instance: Any = None
|
50
|
-
any_of_schemas: Set[str] = {"int", "str"}
|
51
|
-
|
52
|
-
model_config = {
|
53
|
-
"validate_assignment": True,
|
54
|
-
"protected_namespaces": (),
|
55
|
-
}
|
56
|
-
|
57
|
-
def __init__(self, *args, **kwargs) -> None:
|
58
|
-
if args:
|
59
|
-
if len(args) > 1:
|
60
|
-
raise ValueError(
|
61
|
-
"If a position argument is used, only 1 is allowed to set `actual_instance`"
|
62
|
-
)
|
63
|
-
if kwargs:
|
64
|
-
raise ValueError(
|
65
|
-
"If a position argument is used, keyword arguments cannot be used."
|
66
|
-
)
|
67
|
-
super().__init__(actual_instance=args[0])
|
68
|
-
else:
|
69
|
-
super().__init__(**kwargs)
|
70
|
-
|
71
|
-
@field_validator("actual_instance")
|
72
|
-
def actual_instance_must_validate_anyof(cls, v):
|
73
|
-
instance = ValidationErrorLocInner.model_construct()
|
74
|
-
error_messages = []
|
75
|
-
# validate data type: str
|
76
|
-
try:
|
77
|
-
instance.anyof_schema_1_validator = v
|
78
|
-
return v
|
79
|
-
except (ValidationError, ValueError) as e:
|
80
|
-
error_messages.append(str(e))
|
81
|
-
# validate data type: int
|
82
|
-
try:
|
83
|
-
instance.anyof_schema_2_validator = v
|
84
|
-
return v
|
85
|
-
except (ValidationError, ValueError) as e:
|
86
|
-
error_messages.append(str(e))
|
87
|
-
if error_messages:
|
88
|
-
# no match
|
89
|
-
raise ValueError(
|
90
|
-
"No match found when setting the actual_instance in ValidationErrorLocInner with anyOf schemas: int, str. Details: "
|
91
|
-
+ ", ".join(error_messages)
|
92
|
-
)
|
93
|
-
else:
|
94
|
-
return v
|
95
|
-
|
96
|
-
@classmethod
|
97
|
-
def from_dict(cls, obj: Dict[str, Any]) -> Self:
|
98
|
-
return cls.from_json(json.dumps(obj))
|
99
|
-
|
100
|
-
@classmethod
|
101
|
-
def from_json(cls, json_str: str) -> Self:
|
102
|
-
"""Returns the object represented by the json string"""
|
103
|
-
instance = cls.model_construct()
|
104
|
-
error_messages = []
|
105
|
-
# deserialize data into str
|
106
|
-
try:
|
107
|
-
# validation
|
108
|
-
instance.anyof_schema_1_validator = json.loads(json_str)
|
109
|
-
# assign value to actual_instance
|
110
|
-
instance.actual_instance = instance.anyof_schema_1_validator
|
111
|
-
return instance
|
112
|
-
except (ValidationError, ValueError) as e:
|
113
|
-
error_messages.append(str(e))
|
114
|
-
# deserialize data into int
|
115
|
-
try:
|
116
|
-
# validation
|
117
|
-
instance.anyof_schema_2_validator = json.loads(json_str)
|
118
|
-
# assign value to actual_instance
|
119
|
-
instance.actual_instance = instance.anyof_schema_2_validator
|
120
|
-
return instance
|
121
|
-
except (ValidationError, ValueError) as e:
|
122
|
-
error_messages.append(str(e))
|
123
|
-
|
124
|
-
if error_messages:
|
125
|
-
# no match
|
126
|
-
raise ValueError(
|
127
|
-
"No match found when deserializing the JSON string into ValidationErrorLocInner with anyOf schemas: int, str. Details: "
|
128
|
-
+ ", ".join(error_messages)
|
129
|
-
)
|
130
|
-
else:
|
131
|
-
return instance
|
132
|
-
|
133
|
-
def to_json(self) -> str:
|
134
|
-
"""Returns the JSON representation of the actual instance"""
|
135
|
-
if self.actual_instance is None:
|
136
|
-
return "null"
|
137
|
-
|
138
|
-
if hasattr(self.actual_instance, "to_json") and callable(
|
139
|
-
self.actual_instance.to_json
|
140
|
-
):
|
141
|
-
return self.actual_instance.to_json()
|
142
|
-
else:
|
143
|
-
return json.dumps(self.actual_instance)
|
144
|
-
|
145
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], int, str]]:
|
146
|
-
"""Returns the dict representation of the actual instance"""
|
147
|
-
if self.actual_instance is None:
|
148
|
-
return None
|
149
|
-
|
150
|
-
if hasattr(self.actual_instance, "to_dict") and callable(
|
151
|
-
self.actual_instance.to_dict
|
152
|
-
):
|
153
|
-
return self.actual_instance.to_dict()
|
154
|
-
else:
|
155
|
-
return self.actual_instance
|
156
|
-
|
157
|
-
def to_str(self) -> str:
|
158
|
-
"""Returns the string representation of the actual instance"""
|
159
|
-
return pprint.pformat(self.model_dump())
|
@@ -1,156 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
"""
|
4
|
-
Trading API
|
5
|
-
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
-
|
8
|
-
The version of the OpenAPI document: 0.1.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, Field, StrictBool, StrictInt, StrictStr
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from typing import Optional, Set
|
23
|
-
from typing_extensions import Self
|
24
|
-
|
25
|
-
|
26
|
-
class APIKeyModel(BaseModel):
|
27
|
-
"""
|
28
|
-
APIKeyModel
|
29
|
-
""" # noqa: E501
|
30
|
-
|
31
|
-
created_at: Optional[StrictInt] = None
|
32
|
-
updated_at: Optional[StrictInt] = None
|
33
|
-
id: Optional[StrictStr] = None
|
34
|
-
exchange: StrictStr = Field(description="Exchange name")
|
35
|
-
api_key: Optional[StrictStr] = None
|
36
|
-
secret: Optional[StrictStr] = None
|
37
|
-
passphrase: Optional[StrictStr] = None
|
38
|
-
label: StrictStr = Field(description="Label for the API key")
|
39
|
-
enabled: Optional[StrictBool] = None
|
40
|
-
user_id: Optional[StrictStr] = None
|
41
|
-
__properties: ClassVar[List[str]] = [
|
42
|
-
"created_at",
|
43
|
-
"updated_at",
|
44
|
-
"id",
|
45
|
-
"exchange",
|
46
|
-
"api_key",
|
47
|
-
"secret",
|
48
|
-
"passphrase",
|
49
|
-
"label",
|
50
|
-
"enabled",
|
51
|
-
"user_id",
|
52
|
-
]
|
53
|
-
|
54
|
-
model_config = ConfigDict(
|
55
|
-
populate_by_name=True,
|
56
|
-
validate_assignment=True,
|
57
|
-
protected_namespaces=(),
|
58
|
-
)
|
59
|
-
|
60
|
-
def to_str(self) -> str:
|
61
|
-
"""Returns the string representation of the model using alias"""
|
62
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
63
|
-
|
64
|
-
def to_json(self) -> str:
|
65
|
-
"""Returns the JSON representation of the model using alias"""
|
66
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
67
|
-
return json.dumps(self.to_dict())
|
68
|
-
|
69
|
-
@classmethod
|
70
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
71
|
-
"""Create an instance of APIKeyModel from a JSON string"""
|
72
|
-
return cls.from_dict(json.loads(json_str))
|
73
|
-
|
74
|
-
def to_dict(self) -> Dict[str, Any]:
|
75
|
-
"""Return the dictionary representation of the model using alias.
|
76
|
-
|
77
|
-
This has the following differences from calling pydantic's
|
78
|
-
`self.model_dump(by_alias=True)`:
|
79
|
-
|
80
|
-
* `None` is only added to the output dict for nullable fields that
|
81
|
-
were set at model initialization. Other fields with value `None`
|
82
|
-
are ignored.
|
83
|
-
"""
|
84
|
-
excluded_fields: Set[str] = set([])
|
85
|
-
|
86
|
-
_dict = self.model_dump(
|
87
|
-
by_alias=True,
|
88
|
-
exclude=excluded_fields,
|
89
|
-
exclude_none=True,
|
90
|
-
)
|
91
|
-
# set to None if created_at (nullable) is None
|
92
|
-
# and model_fields_set contains the field
|
93
|
-
if self.created_at is None and "created_at" in self.model_fields_set:
|
94
|
-
_dict["created_at"] = None
|
95
|
-
|
96
|
-
# set to None if updated_at (nullable) is None
|
97
|
-
# and model_fields_set contains the field
|
98
|
-
if self.updated_at is None and "updated_at" in self.model_fields_set:
|
99
|
-
_dict["updated_at"] = None
|
100
|
-
|
101
|
-
# set to None if id (nullable) is None
|
102
|
-
# and model_fields_set contains the field
|
103
|
-
if self.id is None and "id" in self.model_fields_set:
|
104
|
-
_dict["id"] = None
|
105
|
-
|
106
|
-
# set to None if api_key (nullable) is None
|
107
|
-
# and model_fields_set contains the field
|
108
|
-
if self.api_key is None and "api_key" in self.model_fields_set:
|
109
|
-
_dict["api_key"] = None
|
110
|
-
|
111
|
-
# set to None if secret (nullable) is None
|
112
|
-
# and model_fields_set contains the field
|
113
|
-
if self.secret is None and "secret" in self.model_fields_set:
|
114
|
-
_dict["secret"] = None
|
115
|
-
|
116
|
-
# set to None if passphrase (nullable) is None
|
117
|
-
# and model_fields_set contains the field
|
118
|
-
if self.passphrase is None and "passphrase" in self.model_fields_set:
|
119
|
-
_dict["passphrase"] = None
|
120
|
-
|
121
|
-
# set to None if enabled (nullable) is None
|
122
|
-
# and model_fields_set contains the field
|
123
|
-
if self.enabled is None and "enabled" in self.model_fields_set:
|
124
|
-
_dict["enabled"] = None
|
125
|
-
|
126
|
-
# set to None if user_id (nullable) is None
|
127
|
-
# and model_fields_set contains the field
|
128
|
-
if self.user_id is None and "user_id" in self.model_fields_set:
|
129
|
-
_dict["user_id"] = None
|
130
|
-
|
131
|
-
return _dict
|
132
|
-
|
133
|
-
@classmethod
|
134
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
135
|
-
"""Create an instance of APIKeyModel from a dict"""
|
136
|
-
if obj is None:
|
137
|
-
return None
|
138
|
-
|
139
|
-
if not isinstance(obj, dict):
|
140
|
-
return cls.model_validate(obj)
|
141
|
-
|
142
|
-
_obj = cls.model_validate(
|
143
|
-
{
|
144
|
-
"created_at": obj.get("created_at"),
|
145
|
-
"updated_at": obj.get("updated_at"),
|
146
|
-
"id": obj.get("id"),
|
147
|
-
"exchange": obj.get("exchange"),
|
148
|
-
"api_key": obj.get("api_key"),
|
149
|
-
"secret": obj.get("secret"),
|
150
|
-
"passphrase": obj.get("passphrase"),
|
151
|
-
"label": obj.get("label"),
|
152
|
-
"enabled": obj.get("enabled"),
|
153
|
-
"user_id": obj.get("user_id"),
|
154
|
-
}
|
155
|
-
)
|
156
|
-
return _obj
|
@@ -1,35 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
"""
|
4
|
-
Trading API
|
5
|
-
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
-
|
8
|
-
The version of the OpenAPI document: 0.1.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 Exchange(str, Enum):
|
22
|
-
"""
|
23
|
-
Supported exchanges for trading
|
24
|
-
"""
|
25
|
-
|
26
|
-
"""
|
27
|
-
allowed enum values
|
28
|
-
"""
|
29
|
-
KUCOIN = "kucoin"
|
30
|
-
BINGX = "bingx"
|
31
|
-
|
32
|
-
@classmethod
|
33
|
-
def from_json(cls, json_str: str) -> Self:
|
34
|
-
"""Create an instance of Exchange from a JSON string"""
|
35
|
-
return cls(json.loads(json_str))
|
@@ -1,99 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
"""
|
4
|
-
Trading API
|
5
|
-
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
-
|
8
|
-
The version of the OpenAPI document: 0.1.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.trade.client.models.validation_error import ValidationError
|
23
|
-
from typing import Optional, Set
|
24
|
-
from typing_extensions import Self
|
25
|
-
|
26
|
-
|
27
|
-
class HTTPValidationError(BaseModel):
|
28
|
-
"""
|
29
|
-
HTTPValidationError
|
30
|
-
""" # noqa: E501
|
31
|
-
|
32
|
-
detail: Optional[List[ValidationError]] = None
|
33
|
-
__properties: ClassVar[List[str]] = ["detail"]
|
34
|
-
|
35
|
-
model_config = ConfigDict(
|
36
|
-
populate_by_name=True,
|
37
|
-
validate_assignment=True,
|
38
|
-
protected_namespaces=(),
|
39
|
-
)
|
40
|
-
|
41
|
-
def to_str(self) -> str:
|
42
|
-
"""Returns the string representation of the model using alias"""
|
43
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
44
|
-
|
45
|
-
def to_json(self) -> str:
|
46
|
-
"""Returns the JSON representation of the model using alias"""
|
47
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
48
|
-
return json.dumps(self.to_dict())
|
49
|
-
|
50
|
-
@classmethod
|
51
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
52
|
-
"""Create an instance of HTTPValidationError from a JSON string"""
|
53
|
-
return cls.from_dict(json.loads(json_str))
|
54
|
-
|
55
|
-
def to_dict(self) -> Dict[str, Any]:
|
56
|
-
"""Return the dictionary representation of the model using alias.
|
57
|
-
|
58
|
-
This has the following differences from calling pydantic's
|
59
|
-
`self.model_dump(by_alias=True)`:
|
60
|
-
|
61
|
-
* `None` is only added to the output dict for nullable fields that
|
62
|
-
were set at model initialization. Other fields with value `None`
|
63
|
-
are ignored.
|
64
|
-
"""
|
65
|
-
excluded_fields: Set[str] = set([])
|
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
|
-
{
|
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
|
-
)
|
99
|
-
return _obj
|
@@ -1,35 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
"""
|
4
|
-
Trading API
|
5
|
-
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
-
|
8
|
-
The version of the OpenAPI document: 0.1.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 MarketType(str, Enum):
|
22
|
-
"""
|
23
|
-
Market types
|
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 MarketType from a JSON string"""
|
35
|
-
return cls(json.loads(json_str))
|
@@ -1,105 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
"""
|
4
|
-
Trading API
|
5
|
-
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
-
|
8
|
-
The version of the OpenAPI document: 0.1.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 crypticorn.trade.client.models.validation_error_loc_inner import (
|
23
|
-
ValidationErrorLocInner,
|
24
|
-
)
|
25
|
-
from typing import Optional, Set
|
26
|
-
from typing_extensions import Self
|
27
|
-
|
28
|
-
|
29
|
-
class ValidationError(BaseModel):
|
30
|
-
"""
|
31
|
-
ValidationError
|
32
|
-
""" # noqa: E501
|
33
|
-
|
34
|
-
loc: List[ValidationErrorLocInner]
|
35
|
-
msg: StrictStr
|
36
|
-
type: StrictStr
|
37
|
-
__properties: ClassVar[List[str]] = ["loc", "msg", "type"]
|
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 ValidationError 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 loc (list)
|
77
|
-
_items = []
|
78
|
-
if self.loc:
|
79
|
-
for _item_loc in self.loc:
|
80
|
-
if _item_loc:
|
81
|
-
_items.append(_item_loc.to_dict())
|
82
|
-
_dict["loc"] = _items
|
83
|
-
return _dict
|
84
|
-
|
85
|
-
@classmethod
|
86
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
87
|
-
"""Create an instance of ValidationError from a dict"""
|
88
|
-
if obj is None:
|
89
|
-
return None
|
90
|
-
|
91
|
-
if not isinstance(obj, dict):
|
92
|
-
return cls.model_validate(obj)
|
93
|
-
|
94
|
-
_obj = cls.model_validate(
|
95
|
-
{
|
96
|
-
"loc": (
|
97
|
-
[ValidationErrorLocInner.from_dict(_item) for _item in obj["loc"]]
|
98
|
-
if obj.get("loc") is not None
|
99
|
-
else None
|
100
|
-
),
|
101
|
-
"msg": obj.get("msg"),
|
102
|
-
"type": obj.get("type"),
|
103
|
-
}
|
104
|
-
)
|
105
|
-
return _obj
|