crypticorn 2.5.0rc5__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.
- crypticorn/auth/main.py +2 -0
- crypticorn/client.py +60 -69
- crypticorn/common/__init__.py +3 -1
- crypticorn/common/auth.py +38 -20
- crypticorn/common/enums.py +4 -31
- crypticorn/common/errors.py +72 -17
- crypticorn/common/exceptions.py +29 -15
- crypticorn/common/mixins.py +37 -0
- crypticorn/common/status_router.py +42 -0
- crypticorn/common/urls.py +2 -1
- crypticorn/common/utils.py +9 -14
- crypticorn/hive/main.py +2 -0
- crypticorn/klines/client/__init__.py +10 -43
- crypticorn/klines/client/api/__init__.py +1 -1
- crypticorn/klines/client/api/change_in_timeframe_api.py +16 -31
- crypticorn/klines/client/api/funding_rates_api.py +8 -22
- crypticorn/klines/client/api/ohlcv_data_api.py +17 -38
- crypticorn/klines/client/api/{health_check_api.py → status_api.py} +18 -23
- crypticorn/klines/client/api/symbols_api.py +18 -34
- crypticorn/klines/client/api/udf_api.py +48 -59
- crypticorn/klines/client/api_client.py +1 -1
- crypticorn/klines/client/configuration.py +1 -1
- crypticorn/klines/client/exceptions.py +1 -1
- crypticorn/klines/client/models/__init__.py +9 -42
- crypticorn/klines/client/models/{change_in_timeframe_response.py → change_in_timeframe.py} +5 -5
- crypticorn/klines/client/models/{error_response.py → exception_detail.py} +25 -20
- crypticorn/klines/client/models/{funding_rate_response.py → funding_rate.py} +5 -5
- crypticorn/klines/client/models/{ohlcv_response.py → ohlcv_history.py} +14 -14
- crypticorn/klines/client/models/resolution.py +1 -1
- crypticorn/klines/client/models/{exchange.py → search_symbol.py} +17 -13
- crypticorn/klines/client/models/sort_direction.py +1 -1
- crypticorn/klines/client/models/{symbol_group_response.py → symbol_group.py} +5 -5
- crypticorn/klines/client/models/{symbol_info_response.py → symbol_info.py} +5 -5
- crypticorn/klines/client/models/symbol_type.py +1 -1
- crypticorn/klines/client/models/timeframe.py +1 -1
- crypticorn/klines/client/models/{udf_config_response.py → udf_config.py} +7 -19
- crypticorn/klines/client/rest.py +1 -1
- crypticorn/klines/main.py +40 -23
- crypticorn/metrics/client/__init__.py +3 -22
- crypticorn/metrics/client/api/__init__.py +1 -1
- crypticorn/metrics/client/api/exchanges_api.py +53 -97
- crypticorn/metrics/client/api/indicators_api.py +26 -52
- crypticorn/metrics/client/api/logs_api.py +8 -23
- crypticorn/metrics/client/api/marketcap_api.py +36 -88
- crypticorn/metrics/client/api/markets_api.py +26 -55
- crypticorn/metrics/client/api/{health_check_api.py → status_api.py} +18 -23
- crypticorn/metrics/client/api/tokens_api.py +7 -21
- crypticorn/metrics/client/api_client.py +1 -1
- crypticorn/metrics/client/configuration.py +1 -1
- crypticorn/metrics/client/exceptions.py +1 -1
- crypticorn/metrics/client/models/__init__.py +2 -21
- crypticorn/metrics/client/models/{error_response.py → exception_detail.py} +25 -20
- 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/metrics/main.py +51 -43
- crypticorn/pay/main.py +2 -0
- crypticorn/trade/client/__init__.py +1 -5
- crypticorn/trade/client/api/exchanges_api.py +6 -6
- crypticorn/trade/client/api/trading_actions_api.py +16 -15
- crypticorn/trade/client/models/__init__.py +1 -5
- crypticorn/trade/client/models/action_model.py +1 -2
- crypticorn/trade/client/models/bot_model.py +3 -7
- crypticorn/trade/client/models/exchange_key_model.py +2 -11
- crypticorn/trade/client/models/execution_ids.py +1 -1
- crypticorn/trade/client/models/futures_trading_action.py +1 -2
- crypticorn/trade/client/models/notification_model.py +3 -12
- crypticorn/trade/client/models/order_model.py +7 -21
- crypticorn/trade/client/models/spot_trading_action.py +230 -0
- crypticorn/trade/client/models/strategy_exchange_info.py +2 -3
- crypticorn/trade/client/models/strategy_model_input.py +1 -2
- crypticorn/trade/client/models/strategy_model_output.py +1 -2
- crypticorn/trade/client/models/tpsl.py +3 -1
- crypticorn/trade/main.py +2 -0
- {crypticorn-2.5.0rc5.dist-info → crypticorn-2.5.2.dist-info}/METADATA +7 -5
- {crypticorn-2.5.0rc5.dist-info → crypticorn-2.5.2.dist-info}/RECORD +81 -141
- {crypticorn-2.5.0rc5.dist-info → crypticorn-2.5.2.dist-info}/WHEEL +1 -1
- crypticorn/common/sorter.py +0 -40
- 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/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/market.py +0 -35
- crypticorn/klines/client/models/market_type.py +0 -35
- 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/validation_error.py +0 -105
- crypticorn/klines/client/models/validation_error_loc_inner.py +0 -159
- crypticorn/metrics/client/models/base_response_dict.py +0 -106
- 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/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/min_amount_req.py +0 -124
- crypticorn/pay/client/models/min_amount_res.py +0 -105
- 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/trade/client/models/api_error_identifier.py +0 -104
- crypticorn/trade/client/models/api_error_level.py +0 -37
- crypticorn/trade/client/models/api_error_type.py +0 -37
- crypticorn/trade/client/models/api_key_model.py +0 -156
- crypticorn/trade/client/models/exchange.py +0 -35
- crypticorn/trade/client/models/market_type.py +0 -35
- /crypticorn/common/{pydantic.py → decorators.py} +0 -0
- {crypticorn-2.5.0rc5.dist-info → crypticorn-2.5.2.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.5.0rc5.dist-info → crypticorn-2.5.2.dist-info}/top_level.txt +0 -0
@@ -3,7 +3,7 @@
|
|
3
3
|
"""
|
4
4
|
Marketcap Service API
|
5
5
|
|
6
|
-
|
6
|
+
API for retrieving historical marketcap data, available exchanges, and indicators.
|
7
7
|
|
8
8
|
The version of the OpenAPI document: 1.0.0
|
9
9
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
crypticorn/metrics/main.py
CHANGED
@@ -3,18 +3,14 @@ from crypticorn.metrics import (
|
|
3
3
|
ApiClient,
|
4
4
|
Configuration,
|
5
5
|
ExchangesApi,
|
6
|
-
|
6
|
+
StatusApi,
|
7
7
|
IndicatorsApi,
|
8
8
|
LogsApi,
|
9
9
|
MarketcapApi,
|
10
10
|
MarketsApi,
|
11
11
|
TokensApi,
|
12
|
-
MarketType,
|
13
12
|
)
|
14
13
|
from crypticorn.common import optional_import
|
15
|
-
from pydantic import StrictStr, StrictInt, Field
|
16
|
-
from typing_extensions import Annotated
|
17
|
-
from typing import Optional
|
18
14
|
|
19
15
|
|
20
16
|
class MetricsClient:
|
@@ -22,6 +18,8 @@ class MetricsClient:
|
|
22
18
|
A client for interacting with the Crypticorn Metrics API.
|
23
19
|
"""
|
24
20
|
|
21
|
+
config_class = Configuration
|
22
|
+
|
25
23
|
def __init__(
|
26
24
|
self,
|
27
25
|
config: Configuration,
|
@@ -29,7 +27,7 @@ class MetricsClient:
|
|
29
27
|
self.config = config
|
30
28
|
self.base_client = ApiClient(configuration=self.config)
|
31
29
|
# Instantiate all the endpoint clients
|
32
|
-
self.status =
|
30
|
+
self.status = StatusApi(self.base_client)
|
33
31
|
self.indicators = IndicatorsApi(self.base_client)
|
34
32
|
self.logs = LogsApi(self.base_client)
|
35
33
|
self.marketcap = MarketcapApiWrapper(self.base_client)
|
@@ -43,42 +41,18 @@ class MarketcapApiWrapper(MarketcapApi):
|
|
43
41
|
A wrapper for the MarketcapApi class.
|
44
42
|
"""
|
45
43
|
|
46
|
-
async def get_marketcap_symbols_fmt(
|
47
|
-
self,
|
48
|
-
start_timestamp: Annotated[
|
49
|
-
Optional[StrictInt], Field(description="Start timestamp")
|
50
|
-
] = None,
|
51
|
-
end_timestamp: Annotated[
|
52
|
-
Optional[StrictInt], Field(description="End timestamp")
|
53
|
-
] = None,
|
54
|
-
interval: Annotated[
|
55
|
-
Optional[StrictStr],
|
56
|
-
Field(description="Interval for which to fetch symbols and marketcap data"),
|
57
|
-
] = None,
|
58
|
-
market: Annotated[
|
59
|
-
Optional[MarketType],
|
60
|
-
Field(description="Market for which to fetch symbols and marketcap data"),
|
61
|
-
] = None,
|
62
|
-
exchange: Annotated[
|
63
|
-
Optional[StrictStr],
|
64
|
-
Field(description="Exchange for which to fetch symbols and marketcap data"),
|
65
|
-
] = None,
|
66
|
-
) -> pd.DataFrame:
|
44
|
+
async def get_marketcap_symbols_fmt(self, *args, **kwargs) -> pd.DataFrame: # type: ignore
|
67
45
|
"""
|
68
46
|
Get the marketcap symbols in a pandas dataframe
|
69
47
|
"""
|
70
48
|
pd = optional_import("pandas", "extra")
|
71
|
-
response = await self.
|
72
|
-
|
73
|
-
end_timestamp=end_timestamp,
|
74
|
-
interval=interval,
|
75
|
-
market=market,
|
76
|
-
exchange=exchange,
|
49
|
+
response = await self.get_marketcap_symbols_without_preload_content(
|
50
|
+
*args, **kwargs
|
77
51
|
)
|
52
|
+
response.raise_for_status()
|
78
53
|
json_response = await response.json()
|
79
54
|
df = pd.DataFrame(json_response["data"])
|
80
55
|
df.rename(columns={df.columns[0]: "timestamp"}, inplace=True)
|
81
|
-
df["timestamp"] = pd.to_datetime(df["timestamp"]).astype("int64") // 10**9
|
82
56
|
return df
|
83
57
|
|
84
58
|
|
@@ -87,19 +61,53 @@ class TokensApiWrapper(TokensApi):
|
|
87
61
|
A wrapper for the TokensApi class.
|
88
62
|
"""
|
89
63
|
|
90
|
-
async def
|
91
|
-
self,
|
92
|
-
token_type: Annotated[
|
93
|
-
StrictStr,
|
94
|
-
Field(description="Type of tokens to fetch"),
|
95
|
-
],
|
96
|
-
) -> pd.DataFrame:
|
64
|
+
async def get_stable_and_wrapped_tokens_fmt(self, *args, **kwargs) -> pd.DataFrame: # type: ignore
|
97
65
|
"""
|
98
66
|
Get the tokens in a pandas dataframe
|
99
67
|
"""
|
100
68
|
pd = optional_import("pandas", "extra")
|
101
69
|
response = await self.get_stable_and_wrapped_tokens_without_preload_content(
|
102
|
-
|
70
|
+
*args, **kwargs
|
71
|
+
)
|
72
|
+
response.raise_for_status()
|
73
|
+
json_data = await response.json()
|
74
|
+
return pd.DataFrame(json_data)
|
75
|
+
|
76
|
+
|
77
|
+
class ExchangesApiWrapper(ExchangesApi):
|
78
|
+
"""
|
79
|
+
A wrapper for the ExchangesApi class.
|
80
|
+
"""
|
81
|
+
|
82
|
+
async def get_exchanges_fmt(self, *args, **kwargs) -> pd.DataFrame: # type: ignore
|
83
|
+
"""
|
84
|
+
Get the exchanges in a pandas dataframe
|
85
|
+
"""
|
86
|
+
pd = optional_import("pandas", "extra")
|
87
|
+
response = await self.get_available_exchanges_without_preload_content(
|
88
|
+
*args, **kwargs
|
103
89
|
)
|
90
|
+
response.raise_for_status()
|
104
91
|
json_data = await response.json()
|
105
|
-
|
92
|
+
processed_results = []
|
93
|
+
for row in json_data:
|
94
|
+
data = {"timestamp": row["timestamp"]}
|
95
|
+
data.update(row["exchanges"])
|
96
|
+
processed_results.append(data)
|
97
|
+
|
98
|
+
# Create DataFrame and sort columns
|
99
|
+
df = pd.DataFrame(processed_results)
|
100
|
+
cols = ["timestamp"] + sorted([col for col in df.columns if col != "timestamp"])
|
101
|
+
df = df[cols]
|
102
|
+
|
103
|
+
# Convert timestamp to unix timestamp
|
104
|
+
df["timestamp"] = pd.to_datetime(df["timestamp"]).astype("int64") // 10**9
|
105
|
+
|
106
|
+
# Convert exchange availability to boolean integers (0/1)
|
107
|
+
df = df.astype(
|
108
|
+
{
|
109
|
+
"timestamp": "int64",
|
110
|
+
**{col: "int8" for col in df.columns if col != "timestamp"},
|
111
|
+
}
|
112
|
+
)
|
113
|
+
return df
|
crypticorn/pay/main.py
CHANGED
@@ -40,23 +40,19 @@ from crypticorn.trade.client.exceptions import ApiException
|
|
40
40
|
|
41
41
|
# import models into sdk package
|
42
42
|
from crypticorn.trade.client.models.action_model import ActionModel
|
43
|
-
from crypticorn.trade.client.models.api_error_identifier import ApiErrorIdentifier
|
44
|
-
from crypticorn.trade.client.models.api_error_level import ApiErrorLevel
|
45
|
-
from crypticorn.trade.client.models.api_error_type import ApiErrorType
|
46
43
|
from crypticorn.trade.client.models.bot_model import BotModel
|
47
44
|
from crypticorn.trade.client.models.bot_status import BotStatus
|
48
|
-
from crypticorn.trade.client.models.exchange import Exchange
|
49
45
|
from crypticorn.trade.client.models.exchange_key_model import ExchangeKeyModel
|
50
46
|
from crypticorn.trade.client.models.execution_ids import ExecutionIds
|
51
47
|
from crypticorn.trade.client.models.futures_balance import FuturesBalance
|
52
48
|
from crypticorn.trade.client.models.futures_trading_action import FuturesTradingAction
|
53
49
|
from crypticorn.trade.client.models.http_validation_error import HTTPValidationError
|
54
50
|
from crypticorn.trade.client.models.margin_mode import MarginMode
|
55
|
-
from crypticorn.trade.client.models.market_type import MarketType
|
56
51
|
from crypticorn.trade.client.models.notification_model import NotificationModel
|
57
52
|
from crypticorn.trade.client.models.order_model import OrderModel
|
58
53
|
from crypticorn.trade.client.models.order_status import OrderStatus
|
59
54
|
from crypticorn.trade.client.models.post_futures_action import PostFuturesAction
|
55
|
+
from crypticorn.trade.client.models.spot_trading_action import SpotTradingAction
|
60
56
|
from crypticorn.trade.client.models.strategy_exchange_info import StrategyExchangeInfo
|
61
57
|
from crypticorn.trade.client.models.strategy_model_input import StrategyModelInput
|
62
58
|
from crypticorn.trade.client.models.strategy_model_output import StrategyModelOutput
|
@@ -16,8 +16,8 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
16
16
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
17
17
|
from typing_extensions import Annotated
|
18
18
|
|
19
|
+
from pydantic import StrictStr
|
19
20
|
from typing import List
|
20
|
-
from crypticorn.trade.client.models.exchange import Exchange
|
21
21
|
|
22
22
|
from crypticorn.trade.client.api_client import ApiClient, RequestSerialized
|
23
23
|
from crypticorn.trade.client.api_response import ApiResponse
|
@@ -50,7 +50,7 @@ class ExchangesApi:
|
|
50
50
|
_content_type: Optional[StrictStr] = None,
|
51
51
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
52
52
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
53
|
-
) -> List[
|
53
|
+
) -> List[str]:
|
54
54
|
"""Get Exchanges
|
55
55
|
|
56
56
|
|
@@ -84,7 +84,7 @@ class ExchangesApi:
|
|
84
84
|
)
|
85
85
|
|
86
86
|
_response_types_map: Dict[str, Optional[str]] = {
|
87
|
-
"200": "List[
|
87
|
+
"200": "List[str]",
|
88
88
|
}
|
89
89
|
response_data = await self.api_client.call_api(
|
90
90
|
*_param, _request_timeout=_request_timeout
|
@@ -109,7 +109,7 @@ class ExchangesApi:
|
|
109
109
|
_content_type: Optional[StrictStr] = None,
|
110
110
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
111
111
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
112
|
-
) -> ApiResponse[List[
|
112
|
+
) -> ApiResponse[List[str]]:
|
113
113
|
"""Get Exchanges
|
114
114
|
|
115
115
|
|
@@ -143,7 +143,7 @@ class ExchangesApi:
|
|
143
143
|
)
|
144
144
|
|
145
145
|
_response_types_map: Dict[str, Optional[str]] = {
|
146
|
-
"200": "List[
|
146
|
+
"200": "List[str]",
|
147
147
|
}
|
148
148
|
response_data = await self.api_client.call_api(
|
149
149
|
*_param, _request_timeout=_request_timeout
|
@@ -202,7 +202,7 @@ class ExchangesApi:
|
|
202
202
|
)
|
203
203
|
|
204
204
|
_response_types_map: Dict[str, Optional[str]] = {
|
205
|
-
"200": "List[
|
205
|
+
"200": "List[str]",
|
206
206
|
}
|
207
207
|
response_data = await self.api_client.call_api(
|
208
208
|
*_param, _request_timeout=_request_timeout
|
@@ -21,6 +21,7 @@ from typing import Any, List, Optional
|
|
21
21
|
from crypticorn.trade.client.models.action_model import ActionModel
|
22
22
|
from crypticorn.trade.client.models.futures_trading_action import FuturesTradingAction
|
23
23
|
from crypticorn.trade.client.models.post_futures_action import PostFuturesAction
|
24
|
+
from crypticorn.trade.client.models.spot_trading_action import SpotTradingAction
|
24
25
|
|
25
26
|
from crypticorn.trade.client.api_client import ApiClient, RequestSerialized
|
26
27
|
from crypticorn.trade.client.api_response import ApiResponse
|
@@ -558,7 +559,7 @@ class TradingActionsApi:
|
|
558
559
|
@validate_call
|
559
560
|
async def post_spot_action(
|
560
561
|
self,
|
561
|
-
|
562
|
+
spot_trading_action: SpotTradingAction,
|
562
563
|
_request_timeout: Union[
|
563
564
|
None,
|
564
565
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -574,8 +575,8 @@ class TradingActionsApi:
|
|
574
575
|
"""Post Spot Action
|
575
576
|
|
576
577
|
|
577
|
-
:param
|
578
|
-
:type
|
578
|
+
:param spot_trading_action: (required)
|
579
|
+
:type spot_trading_action: SpotTradingAction
|
579
580
|
:param _request_timeout: timeout setting for this request. If one
|
580
581
|
number provided, it will be total request
|
581
582
|
timeout. It can also be a pair (tuple) of
|
@@ -599,7 +600,7 @@ class TradingActionsApi:
|
|
599
600
|
""" # noqa: E501
|
600
601
|
|
601
602
|
_param = self._post_spot_action_serialize(
|
602
|
-
|
603
|
+
spot_trading_action=spot_trading_action,
|
603
604
|
_request_auth=_request_auth,
|
604
605
|
_content_type=_content_type,
|
605
606
|
_headers=_headers,
|
@@ -622,7 +623,7 @@ class TradingActionsApi:
|
|
622
623
|
@validate_call
|
623
624
|
async def post_spot_action_with_http_info(
|
624
625
|
self,
|
625
|
-
|
626
|
+
spot_trading_action: SpotTradingAction,
|
626
627
|
_request_timeout: Union[
|
627
628
|
None,
|
628
629
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -638,8 +639,8 @@ class TradingActionsApi:
|
|
638
639
|
"""Post Spot Action
|
639
640
|
|
640
641
|
|
641
|
-
:param
|
642
|
-
:type
|
642
|
+
:param spot_trading_action: (required)
|
643
|
+
:type spot_trading_action: SpotTradingAction
|
643
644
|
:param _request_timeout: timeout setting for this request. If one
|
644
645
|
number provided, it will be total request
|
645
646
|
timeout. It can also be a pair (tuple) of
|
@@ -663,7 +664,7 @@ class TradingActionsApi:
|
|
663
664
|
""" # noqa: E501
|
664
665
|
|
665
666
|
_param = self._post_spot_action_serialize(
|
666
|
-
|
667
|
+
spot_trading_action=spot_trading_action,
|
667
668
|
_request_auth=_request_auth,
|
668
669
|
_content_type=_content_type,
|
669
670
|
_headers=_headers,
|
@@ -686,7 +687,7 @@ class TradingActionsApi:
|
|
686
687
|
@validate_call
|
687
688
|
async def post_spot_action_without_preload_content(
|
688
689
|
self,
|
689
|
-
|
690
|
+
spot_trading_action: SpotTradingAction,
|
690
691
|
_request_timeout: Union[
|
691
692
|
None,
|
692
693
|
Annotated[StrictFloat, Field(gt=0)],
|
@@ -702,8 +703,8 @@ class TradingActionsApi:
|
|
702
703
|
"""Post Spot Action
|
703
704
|
|
704
705
|
|
705
|
-
:param
|
706
|
-
:type
|
706
|
+
:param spot_trading_action: (required)
|
707
|
+
:type spot_trading_action: SpotTradingAction
|
707
708
|
:param _request_timeout: timeout setting for this request. If one
|
708
709
|
number provided, it will be total request
|
709
710
|
timeout. It can also be a pair (tuple) of
|
@@ -727,7 +728,7 @@ class TradingActionsApi:
|
|
727
728
|
""" # noqa: E501
|
728
729
|
|
729
730
|
_param = self._post_spot_action_serialize(
|
730
|
-
|
731
|
+
spot_trading_action=spot_trading_action,
|
731
732
|
_request_auth=_request_auth,
|
732
733
|
_content_type=_content_type,
|
733
734
|
_headers=_headers,
|
@@ -745,7 +746,7 @@ class TradingActionsApi:
|
|
745
746
|
|
746
747
|
def _post_spot_action_serialize(
|
747
748
|
self,
|
748
|
-
|
749
|
+
spot_trading_action,
|
749
750
|
_request_auth,
|
750
751
|
_content_type,
|
751
752
|
_headers,
|
@@ -770,8 +771,8 @@ class TradingActionsApi:
|
|
770
771
|
# process the header parameters
|
771
772
|
# process the form parameters
|
772
773
|
# process the body parameter
|
773
|
-
if
|
774
|
-
_body_params =
|
774
|
+
if spot_trading_action is not None:
|
775
|
+
_body_params = spot_trading_action
|
775
776
|
|
776
777
|
# set the HTTP header `Accept`
|
777
778
|
if "Accept" not in _header_params:
|
@@ -15,23 +15,19 @@ Do not edit the class manually.
|
|
15
15
|
|
16
16
|
# import models into model package
|
17
17
|
from crypticorn.trade.client.models.action_model import ActionModel
|
18
|
-
from crypticorn.trade.client.models.api_error_identifier import ApiErrorIdentifier
|
19
|
-
from crypticorn.trade.client.models.api_error_level import ApiErrorLevel
|
20
|
-
from crypticorn.trade.client.models.api_error_type import ApiErrorType
|
21
18
|
from crypticorn.trade.client.models.bot_model import BotModel
|
22
19
|
from crypticorn.trade.client.models.bot_status import BotStatus
|
23
|
-
from crypticorn.trade.client.models.exchange import Exchange
|
24
20
|
from crypticorn.trade.client.models.exchange_key_model import ExchangeKeyModel
|
25
21
|
from crypticorn.trade.client.models.execution_ids import ExecutionIds
|
26
22
|
from crypticorn.trade.client.models.futures_balance import FuturesBalance
|
27
23
|
from crypticorn.trade.client.models.futures_trading_action import FuturesTradingAction
|
28
24
|
from crypticorn.trade.client.models.http_validation_error import HTTPValidationError
|
29
25
|
from crypticorn.trade.client.models.margin_mode import MarginMode
|
30
|
-
from crypticorn.trade.client.models.market_type import MarketType
|
31
26
|
from crypticorn.trade.client.models.notification_model import NotificationModel
|
32
27
|
from crypticorn.trade.client.models.order_model import OrderModel
|
33
28
|
from crypticorn.trade.client.models.order_status import OrderStatus
|
34
29
|
from crypticorn.trade.client.models.post_futures_action import PostFuturesAction
|
30
|
+
from crypticorn.trade.client.models.spot_trading_action import SpotTradingAction
|
35
31
|
from crypticorn.trade.client.models.strategy_exchange_info import StrategyExchangeInfo
|
36
32
|
from crypticorn.trade.client.models.strategy_model_input import StrategyModelInput
|
37
33
|
from crypticorn.trade.client.models.strategy_model_output import StrategyModelOutput
|
@@ -29,7 +29,6 @@ from pydantic import (
|
|
29
29
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
30
30
|
from typing_extensions import Annotated
|
31
31
|
from crypticorn.trade.client.models.margin_mode import MarginMode
|
32
|
-
from crypticorn.trade.client.models.market_type import MarketType
|
33
32
|
from crypticorn.trade.client.models.tpsl import TPSL
|
34
33
|
from crypticorn.trade.client.models.trading_action_type import TradingActionType
|
35
34
|
from typing import Optional, Set
|
@@ -48,7 +47,7 @@ class ActionModel(BaseModel):
|
|
48
47
|
open_order_execution_id: Optional[StrictStr] = None
|
49
48
|
client_order_id: Optional[StrictStr] = None
|
50
49
|
action_type: TradingActionType = Field(description="The type of action.")
|
51
|
-
market_type:
|
50
|
+
market_type: StrictStr = Field(description="Market types")
|
52
51
|
strategy_id: StrictStr = Field(description="UID for the strategy.")
|
53
52
|
symbol: StrictStr = Field(
|
54
53
|
description="Trading symbol or asset pair in format: 'symbol/quote_currency' (see market service for valid symbols)"
|
@@ -19,7 +19,6 @@ import json
|
|
19
19
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
22
|
-
from crypticorn.trade.client.models.api_error_identifier import ApiErrorIdentifier
|
23
22
|
from crypticorn.trade.client.models.bot_status import BotStatus
|
24
23
|
from typing import Optional, Set
|
25
24
|
from typing_extensions import Self
|
@@ -40,7 +39,9 @@ class BotModel(BaseModel):
|
|
40
39
|
api_key_id: StrictStr = Field(description="UID for the API key")
|
41
40
|
allocation: StrictInt = Field(description="Initial allocation for the bot")
|
42
41
|
status: BotStatus = Field(description="Status of the bot")
|
43
|
-
status_code: Optional[
|
42
|
+
status_code: Optional[StrictStr] = Field(
|
43
|
+
default=None, description="API error identifiers"
|
44
|
+
)
|
44
45
|
user_id: Optional[StrictStr] = None
|
45
46
|
current_allocation: Optional[Union[StrictFloat, StrictInt]] = None
|
46
47
|
current_exposure: Optional[Union[StrictFloat, StrictInt]] = None
|
@@ -111,11 +112,6 @@ class BotModel(BaseModel):
|
|
111
112
|
if self.id is None and "id" in self.model_fields_set:
|
112
113
|
_dict["id"] = None
|
113
114
|
|
114
|
-
# set to None if status_code (nullable) is None
|
115
|
-
# and model_fields_set contains the field
|
116
|
-
if self.status_code is None and "status_code" in self.model_fields_set:
|
117
|
-
_dict["status_code"] = None
|
118
|
-
|
119
115
|
# set to None if user_id (nullable) is None
|
120
116
|
# and model_fields_set contains the field
|
121
117
|
if self.user_id is None and "user_id" in self.model_fields_set:
|
@@ -17,9 +17,8 @@ import pprint
|
|
17
17
|
import re # noqa: F401
|
18
18
|
import json
|
19
19
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field,
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from crypticorn.trade.client.models.exchange import Exchange
|
23
22
|
from typing import Optional, Set
|
24
23
|
from typing_extensions import Self
|
25
24
|
|
@@ -32,12 +31,11 @@ class ExchangeKeyModel(BaseModel):
|
|
32
31
|
created_at: Optional[StrictInt] = None
|
33
32
|
updated_at: Optional[StrictInt] = None
|
34
33
|
id: Optional[StrictStr] = None
|
35
|
-
exchange:
|
34
|
+
exchange: StrictStr = Field(description="Supported exchanges for trading")
|
36
35
|
api_key: Optional[StrictStr] = None
|
37
36
|
secret: Optional[StrictStr] = None
|
38
37
|
passphrase: Optional[StrictStr] = None
|
39
38
|
label: StrictStr = Field(description="Label for the API key")
|
40
|
-
enabled: Optional[StrictBool] = None
|
41
39
|
user_id: Optional[StrictStr] = None
|
42
40
|
__properties: ClassVar[List[str]] = [
|
43
41
|
"created_at",
|
@@ -48,7 +46,6 @@ class ExchangeKeyModel(BaseModel):
|
|
48
46
|
"secret",
|
49
47
|
"passphrase",
|
50
48
|
"label",
|
51
|
-
"enabled",
|
52
49
|
"user_id",
|
53
50
|
]
|
54
51
|
|
@@ -119,11 +116,6 @@ class ExchangeKeyModel(BaseModel):
|
|
119
116
|
if self.passphrase is None and "passphrase" in self.model_fields_set:
|
120
117
|
_dict["passphrase"] = None
|
121
118
|
|
122
|
-
# set to None if enabled (nullable) is None
|
123
|
-
# and model_fields_set contains the field
|
124
|
-
if self.enabled is None and "enabled" in self.model_fields_set:
|
125
|
-
_dict["enabled"] = None
|
126
|
-
|
127
119
|
# set to None if user_id (nullable) is None
|
128
120
|
# and model_fields_set contains the field
|
129
121
|
if self.user_id is None and "user_id" in self.model_fields_set:
|
@@ -150,7 +142,6 @@ class ExchangeKeyModel(BaseModel):
|
|
150
142
|
"secret": obj.get("secret"),
|
151
143
|
"passphrase": obj.get("passphrase"),
|
152
144
|
"label": obj.get("label"),
|
153
|
-
"enabled": obj.get("enabled"),
|
154
145
|
"user_id": obj.get("user_id"),
|
155
146
|
}
|
156
147
|
)
|
@@ -28,7 +28,7 @@ class ExecutionIds(BaseModel):
|
|
28
28
|
ExecutionIds
|
29
29
|
""" # noqa: E501
|
30
30
|
|
31
|
-
main:
|
31
|
+
main: StrictStr = Field(description="Main execution ID.")
|
32
32
|
sl: List[StrictStr] = Field(
|
33
33
|
description="Stop loss execution IDs. List with multiple items ordered by the next stop loss, e.g. price = 10000 => SLs: ['900', '700', '500']."
|
34
34
|
)
|
@@ -29,7 +29,6 @@ from pydantic import (
|
|
29
29
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
30
30
|
from typing_extensions import Annotated
|
31
31
|
from crypticorn.trade.client.models.margin_mode import MarginMode
|
32
|
-
from crypticorn.trade.client.models.market_type import MarketType
|
33
32
|
from crypticorn.trade.client.models.tpsl import TPSL
|
34
33
|
from crypticorn.trade.client.models.trading_action_type import TradingActionType
|
35
34
|
from typing import Optional, Set
|
@@ -46,7 +45,7 @@ class FuturesTradingAction(BaseModel):
|
|
46
45
|
open_order_execution_id: Optional[StrictStr] = None
|
47
46
|
client_order_id: Optional[StrictStr] = None
|
48
47
|
action_type: TradingActionType = Field(description="The type of action.")
|
49
|
-
market_type:
|
48
|
+
market_type: StrictStr = Field(description="Market types")
|
50
49
|
strategy_id: StrictStr = Field(description="UID for the strategy.")
|
51
50
|
symbol: StrictStr = Field(
|
52
51
|
description="Trading symbol or asset pair in format: 'symbol/quote_currency' (see market service for valid symbols)"
|
@@ -19,9 +19,6 @@ import json
|
|
19
19
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
-
from crypticorn.trade.client.models.api_error_identifier import ApiErrorIdentifier
|
23
|
-
from crypticorn.trade.client.models.api_error_level import ApiErrorLevel
|
24
|
-
from crypticorn.trade.client.models.api_error_type import ApiErrorType
|
25
22
|
from typing import Optional, Set
|
26
23
|
from typing_extensions import Self
|
27
24
|
|
@@ -34,15 +31,9 @@ class NotificationModel(BaseModel):
|
|
34
31
|
created_at: Optional[StrictInt] = None
|
35
32
|
updated_at: Optional[StrictInt] = None
|
36
33
|
id: Optional[StrictStr] = None
|
37
|
-
identifier:
|
38
|
-
|
39
|
-
)
|
40
|
-
level: ApiErrorLevel = Field(
|
41
|
-
description="Level of the notification. Of type ApiErrorLevel"
|
42
|
-
)
|
43
|
-
type: ApiErrorType = Field(
|
44
|
-
description="Type of the notification. Of type ApiErrorType"
|
45
|
-
)
|
34
|
+
identifier: StrictStr = Field(description="API error identifiers")
|
35
|
+
level: StrictStr = Field(description="API error levels")
|
36
|
+
type: StrictStr = Field(description="Type of API error")
|
46
37
|
user_id: Optional[StrictStr] = None
|
47
38
|
viewed: Optional[StrictBool] = Field(
|
48
39
|
default=False, description="Whether the notification has been marked as seen"
|
@@ -19,10 +19,7 @@ import json
|
|
19
19
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
22
|
-
from crypticorn.trade.client.models.api_error_identifier import ApiErrorIdentifier
|
23
|
-
from crypticorn.trade.client.models.exchange import Exchange
|
24
22
|
from crypticorn.trade.client.models.margin_mode import MarginMode
|
25
|
-
from crypticorn.trade.client.models.market_type import MarketType
|
26
23
|
from crypticorn.trade.client.models.order_status import OrderStatus
|
27
24
|
from crypticorn.trade.client.models.trading_action_type import TradingActionType
|
28
25
|
from typing import Optional, Set
|
@@ -45,14 +42,18 @@ class OrderModel(BaseModel):
|
|
45
42
|
user_id: Optional[StrictStr] = None
|
46
43
|
bot_id: Optional[StrictStr] = None
|
47
44
|
client_order_id: Optional[StrictStr] = None
|
48
|
-
exchange: Optional[
|
45
|
+
exchange: Optional[StrictStr] = Field(
|
46
|
+
default=None, description="Supported exchanges for trading"
|
47
|
+
)
|
49
48
|
symbol: Optional[StrictStr] = None
|
50
49
|
common_symbol: Optional[StrictStr] = None
|
51
50
|
price: Optional[Union[StrictFloat, StrictInt]] = None
|
52
51
|
action_type: Optional[TradingActionType] = None
|
53
|
-
market_type: Optional[
|
52
|
+
market_type: Optional[StrictStr] = Field(default=None, description="Market types")
|
54
53
|
margin_mode: Optional[MarginMode] = None
|
55
|
-
status_code: Optional[
|
54
|
+
status_code: Optional[StrictStr] = Field(
|
55
|
+
default=None, description="API error identifiers"
|
56
|
+
)
|
56
57
|
status: Optional[OrderStatus] = None
|
57
58
|
filled_perc: Optional[Union[StrictFloat, StrictInt]] = None
|
58
59
|
filled_qty: Optional[Union[StrictFloat, StrictInt]] = None
|
@@ -194,11 +195,6 @@ class OrderModel(BaseModel):
|
|
194
195
|
if self.client_order_id is None and "client_order_id" in self.model_fields_set:
|
195
196
|
_dict["client_order_id"] = None
|
196
197
|
|
197
|
-
# set to None if exchange (nullable) is None
|
198
|
-
# and model_fields_set contains the field
|
199
|
-
if self.exchange is None and "exchange" in self.model_fields_set:
|
200
|
-
_dict["exchange"] = None
|
201
|
-
|
202
198
|
# set to None if symbol (nullable) is None
|
203
199
|
# and model_fields_set contains the field
|
204
200
|
if self.symbol is None and "symbol" in self.model_fields_set:
|
@@ -219,21 +215,11 @@ class OrderModel(BaseModel):
|
|
219
215
|
if self.action_type is None and "action_type" in self.model_fields_set:
|
220
216
|
_dict["action_type"] = None
|
221
217
|
|
222
|
-
# set to None if market_type (nullable) is None
|
223
|
-
# and model_fields_set contains the field
|
224
|
-
if self.market_type is None and "market_type" in self.model_fields_set:
|
225
|
-
_dict["market_type"] = None
|
226
|
-
|
227
218
|
# set to None if margin_mode (nullable) is None
|
228
219
|
# and model_fields_set contains the field
|
229
220
|
if self.margin_mode is None and "margin_mode" in self.model_fields_set:
|
230
221
|
_dict["margin_mode"] = None
|
231
222
|
|
232
|
-
# set to None if status_code (nullable) is None
|
233
|
-
# and model_fields_set contains the field
|
234
|
-
if self.status_code is None and "status_code" in self.model_fields_set:
|
235
|
-
_dict["status_code"] = None
|
236
|
-
|
237
223
|
# set to None if status (nullable) is None
|
238
224
|
# and model_fields_set contains the field
|
239
225
|
if self.status is None and "status" in self.model_fields_set:
|