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
@@ -0,0 +1,230 @@
|
|
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 (
|
21
|
+
BaseModel,
|
22
|
+
ConfigDict,
|
23
|
+
Field,
|
24
|
+
StrictBool,
|
25
|
+
StrictFloat,
|
26
|
+
StrictInt,
|
27
|
+
StrictStr,
|
28
|
+
)
|
29
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
30
|
+
from typing_extensions import Annotated
|
31
|
+
from crypticorn.trade.client.models.tpsl import TPSL
|
32
|
+
from crypticorn.trade.client.models.trading_action_type import TradingActionType
|
33
|
+
from typing import Optional, Set
|
34
|
+
from typing_extensions import Self
|
35
|
+
|
36
|
+
|
37
|
+
class SpotTradingAction(BaseModel):
|
38
|
+
"""
|
39
|
+
Model for spot trading actions
|
40
|
+
""" # noqa: E501
|
41
|
+
|
42
|
+
id: Optional[StrictStr] = None
|
43
|
+
execution_id: Optional[StrictStr] = None
|
44
|
+
open_order_execution_id: Optional[StrictStr] = None
|
45
|
+
client_order_id: Optional[StrictStr] = None
|
46
|
+
action_type: TradingActionType = Field(description="The type of action.")
|
47
|
+
market_type: StrictStr = Field(description="Market types")
|
48
|
+
strategy_id: StrictStr = Field(description="UID for the strategy.")
|
49
|
+
symbol: StrictStr = Field(
|
50
|
+
description="Trading symbol or asset pair in format: 'symbol/quote_currency' (see market service for valid symbols)"
|
51
|
+
)
|
52
|
+
is_limit: Optional[StrictBool] = None
|
53
|
+
limit_price: Optional[Union[StrictFloat, StrictInt]] = None
|
54
|
+
allocation: Optional[
|
55
|
+
Union[
|
56
|
+
Annotated[float, Field(le=1.0, strict=True)],
|
57
|
+
Annotated[int, Field(le=1, strict=True)],
|
58
|
+
]
|
59
|
+
] = Field(
|
60
|
+
default=None,
|
61
|
+
description="How much of bot's balance to use for the order (for open actions). How much of the reference open order (open_order_execution_id) to close (for close actions). 0=0%, 1=100%.",
|
62
|
+
)
|
63
|
+
take_profit: Optional[List[TPSL]] = None
|
64
|
+
stop_loss: Optional[List[TPSL]] = None
|
65
|
+
expiry_timestamp: Optional[StrictInt] = None
|
66
|
+
position_id: Optional[StrictStr] = None
|
67
|
+
__properties: ClassVar[List[str]] = [
|
68
|
+
"id",
|
69
|
+
"execution_id",
|
70
|
+
"open_order_execution_id",
|
71
|
+
"client_order_id",
|
72
|
+
"action_type",
|
73
|
+
"market_type",
|
74
|
+
"strategy_id",
|
75
|
+
"symbol",
|
76
|
+
"is_limit",
|
77
|
+
"limit_price",
|
78
|
+
"allocation",
|
79
|
+
"take_profit",
|
80
|
+
"stop_loss",
|
81
|
+
"expiry_timestamp",
|
82
|
+
"position_id",
|
83
|
+
]
|
84
|
+
|
85
|
+
model_config = ConfigDict(
|
86
|
+
populate_by_name=True,
|
87
|
+
validate_assignment=True,
|
88
|
+
protected_namespaces=(),
|
89
|
+
)
|
90
|
+
|
91
|
+
def to_str(self) -> str:
|
92
|
+
"""Returns the string representation of the model using alias"""
|
93
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
94
|
+
|
95
|
+
def to_json(self) -> str:
|
96
|
+
"""Returns the JSON representation of the model using alias"""
|
97
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
98
|
+
return json.dumps(self.to_dict())
|
99
|
+
|
100
|
+
@classmethod
|
101
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
102
|
+
"""Create an instance of SpotTradingAction from a JSON string"""
|
103
|
+
return cls.from_dict(json.loads(json_str))
|
104
|
+
|
105
|
+
def to_dict(self) -> Dict[str, Any]:
|
106
|
+
"""Return the dictionary representation of the model using alias.
|
107
|
+
|
108
|
+
This has the following differences from calling pydantic's
|
109
|
+
`self.model_dump(by_alias=True)`:
|
110
|
+
|
111
|
+
* `None` is only added to the output dict for nullable fields that
|
112
|
+
were set at model initialization. Other fields with value `None`
|
113
|
+
are ignored.
|
114
|
+
"""
|
115
|
+
excluded_fields: Set[str] = set([])
|
116
|
+
|
117
|
+
_dict = self.model_dump(
|
118
|
+
by_alias=True,
|
119
|
+
exclude=excluded_fields,
|
120
|
+
exclude_none=True,
|
121
|
+
)
|
122
|
+
# override the default output from pydantic by calling `to_dict()` of each item in take_profit (list)
|
123
|
+
_items = []
|
124
|
+
if self.take_profit:
|
125
|
+
for _item_take_profit in self.take_profit:
|
126
|
+
if _item_take_profit:
|
127
|
+
_items.append(_item_take_profit.to_dict())
|
128
|
+
_dict["take_profit"] = _items
|
129
|
+
# override the default output from pydantic by calling `to_dict()` of each item in stop_loss (list)
|
130
|
+
_items = []
|
131
|
+
if self.stop_loss:
|
132
|
+
for _item_stop_loss in self.stop_loss:
|
133
|
+
if _item_stop_loss:
|
134
|
+
_items.append(_item_stop_loss.to_dict())
|
135
|
+
_dict["stop_loss"] = _items
|
136
|
+
# set to None if id (nullable) is None
|
137
|
+
# and model_fields_set contains the field
|
138
|
+
if self.id is None and "id" in self.model_fields_set:
|
139
|
+
_dict["id"] = None
|
140
|
+
|
141
|
+
# set to None if execution_id (nullable) is None
|
142
|
+
# and model_fields_set contains the field
|
143
|
+
if self.execution_id is None and "execution_id" in self.model_fields_set:
|
144
|
+
_dict["execution_id"] = None
|
145
|
+
|
146
|
+
# set to None if open_order_execution_id (nullable) is None
|
147
|
+
# and model_fields_set contains the field
|
148
|
+
if (
|
149
|
+
self.open_order_execution_id is None
|
150
|
+
and "open_order_execution_id" in self.model_fields_set
|
151
|
+
):
|
152
|
+
_dict["open_order_execution_id"] = None
|
153
|
+
|
154
|
+
# set to None if client_order_id (nullable) is None
|
155
|
+
# and model_fields_set contains the field
|
156
|
+
if self.client_order_id is None and "client_order_id" in self.model_fields_set:
|
157
|
+
_dict["client_order_id"] = None
|
158
|
+
|
159
|
+
# set to None if is_limit (nullable) is None
|
160
|
+
# and model_fields_set contains the field
|
161
|
+
if self.is_limit is None and "is_limit" in self.model_fields_set:
|
162
|
+
_dict["is_limit"] = None
|
163
|
+
|
164
|
+
# set to None if limit_price (nullable) is None
|
165
|
+
# and model_fields_set contains the field
|
166
|
+
if self.limit_price is None and "limit_price" in self.model_fields_set:
|
167
|
+
_dict["limit_price"] = None
|
168
|
+
|
169
|
+
# set to None if take_profit (nullable) is None
|
170
|
+
# and model_fields_set contains the field
|
171
|
+
if self.take_profit is None and "take_profit" in self.model_fields_set:
|
172
|
+
_dict["take_profit"] = None
|
173
|
+
|
174
|
+
# set to None if stop_loss (nullable) is None
|
175
|
+
# and model_fields_set contains the field
|
176
|
+
if self.stop_loss is None and "stop_loss" in self.model_fields_set:
|
177
|
+
_dict["stop_loss"] = None
|
178
|
+
|
179
|
+
# set to None if expiry_timestamp (nullable) is None
|
180
|
+
# and model_fields_set contains the field
|
181
|
+
if (
|
182
|
+
self.expiry_timestamp is None
|
183
|
+
and "expiry_timestamp" in self.model_fields_set
|
184
|
+
):
|
185
|
+
_dict["expiry_timestamp"] = None
|
186
|
+
|
187
|
+
# set to None if position_id (nullable) is None
|
188
|
+
# and model_fields_set contains the field
|
189
|
+
if self.position_id is None and "position_id" in self.model_fields_set:
|
190
|
+
_dict["position_id"] = None
|
191
|
+
|
192
|
+
return _dict
|
193
|
+
|
194
|
+
@classmethod
|
195
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
196
|
+
"""Create an instance of SpotTradingAction from a dict"""
|
197
|
+
if obj is None:
|
198
|
+
return None
|
199
|
+
|
200
|
+
if not isinstance(obj, dict):
|
201
|
+
return cls.model_validate(obj)
|
202
|
+
|
203
|
+
_obj = cls.model_validate(
|
204
|
+
{
|
205
|
+
"id": obj.get("id"),
|
206
|
+
"execution_id": obj.get("execution_id"),
|
207
|
+
"open_order_execution_id": obj.get("open_order_execution_id"),
|
208
|
+
"client_order_id": obj.get("client_order_id"),
|
209
|
+
"action_type": obj.get("action_type"),
|
210
|
+
"market_type": obj.get("market_type"),
|
211
|
+
"strategy_id": obj.get("strategy_id"),
|
212
|
+
"symbol": obj.get("symbol"),
|
213
|
+
"is_limit": obj.get("is_limit"),
|
214
|
+
"limit_price": obj.get("limit_price"),
|
215
|
+
"allocation": obj.get("allocation"),
|
216
|
+
"take_profit": (
|
217
|
+
[TPSL.from_dict(_item) for _item in obj["take_profit"]]
|
218
|
+
if obj.get("take_profit") is not None
|
219
|
+
else None
|
220
|
+
),
|
221
|
+
"stop_loss": (
|
222
|
+
[TPSL.from_dict(_item) for _item in obj["stop_loss"]]
|
223
|
+
if obj.get("stop_loss") is not None
|
224
|
+
else None
|
225
|
+
),
|
226
|
+
"expiry_timestamp": obj.get("expiry_timestamp"),
|
227
|
+
"position_id": obj.get("position_id"),
|
228
|
+
}
|
229
|
+
)
|
230
|
+
return _obj
|
@@ -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, StrictFloat, StrictInt
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List, Union
|
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
|
|
@@ -29,7 +28,7 @@ class StrategyExchangeInfo(BaseModel):
|
|
29
28
|
StrategyExchangeInfo
|
30
29
|
""" # noqa: E501
|
31
30
|
|
32
|
-
exchange:
|
31
|
+
exchange: StrictStr = Field(description="Supported exchanges for trading")
|
33
32
|
min_amount: Union[StrictFloat, StrictInt] = Field(
|
34
33
|
description="Minimum amount for the strategy on the exchange"
|
35
34
|
)
|
@@ -20,7 +20,6 @@ import json
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
22
22
|
from typing_extensions import Annotated
|
23
|
-
from crypticorn.trade.client.models.market_type import MarketType
|
24
23
|
from crypticorn.trade.client.models.strategy_exchange_info import StrategyExchangeInfo
|
25
24
|
from typing import Optional, Set
|
26
25
|
from typing_extensions import Self
|
@@ -50,7 +49,7 @@ class StrategyModelInput(BaseModel):
|
|
50
49
|
Annotated[float, Field(le=1.0, strict=True)],
|
51
50
|
Annotated[int, Field(le=1, strict=True)],
|
52
51
|
] = Field(description="Performance fee for the strategy")
|
53
|
-
market_type:
|
52
|
+
market_type: StrictStr = Field(description="Market types")
|
54
53
|
__properties: ClassVar[List[str]] = [
|
55
54
|
"created_at",
|
56
55
|
"updated_at",
|
@@ -20,7 +20,6 @@ import json
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
22
22
|
from typing_extensions import Annotated
|
23
|
-
from crypticorn.trade.client.models.market_type import MarketType
|
24
23
|
from crypticorn.trade.client.models.strategy_exchange_info import StrategyExchangeInfo
|
25
24
|
from typing import Optional, Set
|
26
25
|
from typing_extensions import Self
|
@@ -50,7 +49,7 @@ class StrategyModelOutput(BaseModel):
|
|
50
49
|
Annotated[float, Field(le=1.0, strict=True)],
|
51
50
|
Annotated[int, Field(le=1, strict=True)],
|
52
51
|
] = Field(description="Performance fee for the strategy")
|
53
|
-
market_type:
|
52
|
+
market_type: StrictStr = Field(description="Market types")
|
54
53
|
__properties: ClassVar[List[str]] = [
|
55
54
|
"created_at",
|
56
55
|
"updated_at",
|
@@ -39,7 +39,9 @@ class TPSL(BaseModel):
|
|
39
39
|
allocation: Union[
|
40
40
|
Annotated[float, Field(le=1.0, strict=True, ge=0.0)],
|
41
41
|
Annotated[int, Field(le=1, strict=True, ge=0)],
|
42
|
-
] = Field(
|
42
|
+
] = Field(
|
43
|
+
description="Percentage of the open order to sell. All allocations must sum up to 1."
|
44
|
+
)
|
43
45
|
execution_id: Optional[StrictStr] = None
|
44
46
|
client_order_id: Optional[StrictStr] = None
|
45
47
|
__properties: ClassVar[List[str]] = [
|
crypticorn/trade/main.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: crypticorn
|
3
|
-
Version: 2.5.
|
3
|
+
Version: 2.5.2
|
4
4
|
Summary: Maximise Your Crypto Trading Profits with AI Predictions
|
5
5
|
Author-email: Crypticorn <timon@crypticorn.com>
|
6
6
|
Project-URL: Homepage, https://crypticorn.com
|
@@ -36,6 +36,7 @@ Requires-Dist: pytest==8.3.5; extra == "test"
|
|
36
36
|
Requires-Dist: pytest-asyncio==0.26.0; extra == "test"
|
37
37
|
Requires-Dist: pytest-cov==6.1.1; extra == "test"
|
38
38
|
Requires-Dist: python-dotenv==1.0.1; extra == "test"
|
39
|
+
Requires-Dist: PyJWT==2.10.0; extra == "test"
|
39
40
|
Provides-Extra: extra
|
40
41
|
Requires-Dist: pandas<3.0.0,>=2.2.0; extra == "extra"
|
41
42
|
|
@@ -86,7 +87,7 @@ The `common` submodule contains shared classes not bound to a specific API.
|
|
86
87
|
from crypticorn.common import Scope, Exchange
|
87
88
|
```
|
88
89
|
|
89
|
-
## Usage
|
90
|
+
## Basic Usage
|
90
91
|
|
91
92
|
### With Async Context Protocol
|
92
93
|
```python
|
@@ -107,6 +108,7 @@ async def main():
|
|
107
108
|
|
108
109
|
asyncio.run(main())
|
109
110
|
asyncio.run(client.close())
|
111
|
+
|
110
112
|
## Response Types
|
111
113
|
|
112
114
|
There are three different available output formats you can choose from:
|
@@ -155,12 +157,12 @@ The output would look like this:
|
|
155
157
|
|
156
158
|
## Advanced Usage
|
157
159
|
|
158
|
-
You can override some configuration for specific
|
160
|
+
You can override some configuration for specific services. If you just want to use the API as is, you don't need to configure anything.
|
159
161
|
This might be of use if you are testing a specific API locally.
|
160
162
|
|
161
|
-
To override e.g. the host for the Hive client to connect to http://localhost:8000 instead of the default
|
163
|
+
To override e.g. the host for the Hive client to connect to http://localhost:8000 instead of the default proxy, you would do:
|
162
164
|
```python
|
163
165
|
from crypticorn.hive import Configuration as Hiveconfig
|
164
166
|
async with ApiClient(base_url=BaseUrl.DEV) as client:
|
165
|
-
client.configure(config=HiveConfig(host="http://localhost:8000"),
|
167
|
+
client.configure(config=HiveConfig(host="http://localhost:8000"), client=client.hive)
|
166
168
|
```
|