crypticorn 2.1.3__py3-none-any.whl → 2.1.5__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/common/errors.py +215 -252
- crypticorn/common/sorter.py +38 -0
- crypticorn/pay/client/__init__.py +1 -0
- crypticorn/pay/client/api/now_payments_api.py +3 -16
- crypticorn/pay/client/api/payments_api.py +0 -42
- crypticorn/pay/client/api/products_api.py +3 -42
- crypticorn/pay/client/configuration.py +2 -1
- crypticorn/pay/client/models/__init__.py +1 -0
- crypticorn/pay/client/models/body_create_now_invoice.py +98 -0
- crypticorn/{trade/client/models/update_notification.py → pay/client/models/body_create_product.py} +20 -17
- crypticorn/pay/client/models/body_get_products.py +87 -0
- crypticorn/pay/client/models/body_handle_now_webhook.py +98 -0
- crypticorn/pay/client/models/body_update_product.py +98 -0
- crypticorn/pay/client/models/product_model.py +9 -0
- crypticorn/pay/client/models/scope.py +56 -0
- crypticorn/trade/client/api/api_keys_api.py +5 -70
- crypticorn/trade/client/api/bots_api.py +4 -56
- crypticorn/trade/client/api/exchanges_api.py +2 -19
- crypticorn/trade/client/api/futures_trading_panel_api.py +21 -89
- crypticorn/trade/client/api/notifications_api.py +6 -87
- crypticorn/trade/client/api/orders_api.py +2 -15
- crypticorn/trade/client/api/strategies_api.py +4 -56
- crypticorn/trade/client/api/trading_actions_api.py +1 -14
- crypticorn/trade/client/configuration.py +2 -1
- crypticorn/trade/client/models/api_error_identifier.py +49 -43
- crypticorn/trade/client/models/api_error_level.py +2 -2
- {crypticorn-2.1.3.dist-info → crypticorn-2.1.5.dist-info}/METADATA +3 -3
- {crypticorn-2.1.3.dist-info → crypticorn-2.1.5.dist-info}/RECORD +30 -26
- crypticorn/trade/client/models/notification_type.py +0 -37
- crypticorn/trade/client/models/strategy_model.py +0 -158
- {crypticorn-2.1.3.dist-info → crypticorn-2.1.5.dist-info}/WHEEL +0 -0
- {crypticorn-2.1.3.dist-info → crypticorn-2.1.5.dist-info}/top_level.txt +0 -0
@@ -57,8 +57,9 @@ crypticorn/auth/client/models/whoami200_response.py,sha256=uehdq5epgeOphhrIR3tbr
|
|
57
57
|
crypticorn/common/__init__.py,sha256=lY87VMTkIEqto6kcEjC1YWsUvT03QuPmXwxCaeWE854,196
|
58
58
|
crypticorn/common/auth.py,sha256=LEnTh2bqbljCdTNJUqTOTo2Q39gEz0JRumF1Z5MHQz0,319
|
59
59
|
crypticorn/common/auth_client.py,sha256=7ICjLRPOIXzEJXW76BgVxkNfi_QjuRdLZBX6TNvTpJE,7588
|
60
|
-
crypticorn/common/errors.py,sha256=
|
60
|
+
crypticorn/common/errors.py,sha256=Yd3zLtrqCe0NvjfqxIHohT48T4yfSi-V4s_WyYAi8t4,12614
|
61
61
|
crypticorn/common/scopes.py,sha256=pRD9RauSRSxVGo8k5b2x66h3Wy2aaVEcluZvu6aMTE0,1418
|
62
|
+
crypticorn/common/sorter.py,sha256=DPkQmxDeuti4onCiE8IJZUkTc5WZp1j4dIIc7wN9En0,1167
|
62
63
|
crypticorn/common/urls.py,sha256=_NMhvhZXOsZpDBbgucqu0yboRFox6JVMlOoQq_Y5SGA,432
|
63
64
|
crypticorn/hive/__init__.py,sha256=hRfTlEzEql4msytdUC_04vfaHzVKG5CGZle1M-9QFgY,81
|
64
65
|
crypticorn/hive/main.py,sha256=RmCYSR0jwmfYWTK89dt79DuGPjEaip9XQs_LWNWr_tc,1036
|
@@ -135,20 +136,25 @@ crypticorn/klines/client/models/validation_error.py,sha256=TMfS5WKx6jSNPdppQA5Ya
|
|
135
136
|
crypticorn/klines/client/models/validation_error_loc_inner.py,sha256=tUClZ2b89NWJWHagBsZ5rlEjiV1vn4sgpAncHKUIZRg,5411
|
136
137
|
crypticorn/pay/__init__.py,sha256=ux-B-YbNetpTlZTb2fijuGUOEmSm4IB0fYtieGnVDBg,78
|
137
138
|
crypticorn/pay/main.py,sha256=DbwP_DI5Zp3Ow-Fq2khnnb0hOvrpA29e-jeRyrCCbBs,1075
|
138
|
-
crypticorn/pay/client/__init__.py,sha256
|
139
|
+
crypticorn/pay/client/__init__.py,sha256=-Nk_UoRtKtpbY1-9iP1hUdDczdP6eE3T_Z1wVNhkAZo,2377
|
139
140
|
crypticorn/pay/client/api_client.py,sha256=kZqhvF9r2vqqOYnnu6hTAQVWPmzjFKhC9efShUCfr7o,26944
|
140
141
|
crypticorn/pay/client/api_response.py,sha256=WhxwYDSMm6wPixp9CegO8dJzjFxDz3JF1yCq9s0ZqKE,639
|
141
|
-
crypticorn/pay/client/configuration.py,sha256=
|
142
|
+
crypticorn/pay/client/configuration.py,sha256=RzfAPrk-jnixKZacGbYfH96sCnWp4cjsNZ1Oxa6yg60,18837
|
142
143
|
crypticorn/pay/client/exceptions.py,sha256=MDc2SQUS-0mvq7uH_XGfJxYNIRsDrxhRim0CELMn23E,6455
|
143
144
|
crypticorn/pay/client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
144
145
|
crypticorn/pay/client/rest.py,sha256=6ZLCKhRuEMURb6glMbPriHGoN0uspDC_hvlFDKCALxo,6985
|
145
146
|
crypticorn/pay/client/api/__init__.py,sha256=vbisPmBd4c5G3_MHAlInKeu1obSr8witdtwxC43BnN8,302
|
146
|
-
crypticorn/pay/client/api/now_payments_api.py,sha256=
|
147
|
-
crypticorn/pay/client/api/payments_api.py,sha256=
|
148
|
-
crypticorn/pay/client/api/products_api.py,sha256=
|
147
|
+
crypticorn/pay/client/api/now_payments_api.py,sha256=bdqm_blpCcdYAy0cnl7QbGRajQMtsAjh7FN325Kw5es,32998
|
148
|
+
crypticorn/pay/client/api/payments_api.py,sha256=CguFpYEha5sTOwwDB2hcLPd0KxjP6gIFNvwI-SgoiG8,30358
|
149
|
+
crypticorn/pay/client/api/products_api.py,sha256=ecDZ5Y83KpPx5tehTBmbRm-GNJq2I668QjSTqLGF6HE,32947
|
149
150
|
crypticorn/pay/client/api/status_api.py,sha256=8QRvrCSHBRW0n7NlIEA6LDGhsy6Wx4WqPRH81e1X2gs,9928
|
150
|
-
crypticorn/pay/client/models/__init__.py,sha256=
|
151
|
+
crypticorn/pay/client/models/__init__.py,sha256=W2NnF4IInw7iBNVZnPTkxgxos0l-H1O39ebt--aB-Gk,1515
|
151
152
|
crypticorn/pay/client/models/api_status_res.py,sha256=Dt5g0wvtyIkkVcXyFjXzxokeqZb-Y0rJr_YljjeVcfw,2514
|
153
|
+
crypticorn/pay/client/models/body_create_now_invoice.py,sha256=U-71aiNYJwyuFIq8APbZlvXiLGpzrMABp9u8ZmP9XqU,3065
|
154
|
+
crypticorn/pay/client/models/body_create_product.py,sha256=Z1QxcFS9o8z1DNrEMjKtYsBmf0__PYhrBUoWCX0FI-4,3050
|
155
|
+
crypticorn/pay/client/models/body_get_products.py,sha256=BFIGkvlrLXQA1ZjDNOrQZj_8Cnfru9l3pfT0mti9bf4,2629
|
156
|
+
crypticorn/pay/client/models/body_handle_now_webhook.py,sha256=sue_5IALq1lEx6TvZGThczvZMfrk5_WLAQFGtgWP9L0,3056
|
157
|
+
crypticorn/pay/client/models/body_update_product.py,sha256=oLjKuv9oRQYO2Cjn9uhP1MJgmYD7sP8wxOxL1Rb8Dq4,3050
|
152
158
|
crypticorn/pay/client/models/combined_payment_history.py,sha256=FxXpYL4ml1ndTWXP3whAQ0g7GNoqRuVpP_4m3dsT1vg,3194
|
153
159
|
crypticorn/pay/client/models/create_invoice_req.py,sha256=-Ru0Tg6sRu2g_mjmHrQEv6WnLlBOSbsxz2LLWZms5hM,6709
|
154
160
|
crypticorn/pay/client/models/create_invoice_res.py,sha256=irdNTmj4YgJ1n48fE60kMg509AP7AqGy1DpxtDMkgTE,7022
|
@@ -171,8 +177,9 @@ crypticorn/pay/client/models/now_webhook_payload.py,sha256=2h4qfzw6F0RgTv-8IxO2o
|
|
171
177
|
crypticorn/pay/client/models/payment.py,sha256=dPt7eMCNcdiZdZ_Mf_4W0tkufz95YJ9Cdyq8IuIQRgE,8797
|
172
178
|
crypticorn/pay/client/models/payment_status.py,sha256=Nr__kC34aCKqSk-Gq3-mt0SI5bOTlKB1uz9hKGj8sSc,897
|
173
179
|
crypticorn/pay/client/models/product.py,sha256=ndBOZ2ED2T37VDpgbdQOG_WqwK2zlOQYnkwuLcgGrC0,2592
|
174
|
-
crypticorn/pay/client/models/product_model.py,sha256=
|
180
|
+
crypticorn/pay/client/models/product_model.py,sha256=mHfTuzpwGF02kvMY3dzvlk5Rmkdpne5N07L7Rakwo2g,3875
|
175
181
|
crypticorn/pay/client/models/product_subs_model.py,sha256=EbqWBAfin-sn5A8Do5F4EwI59lvCQp3Bp6-lCr0gfYA,3375
|
182
|
+
crypticorn/pay/client/models/scope.py,sha256=lqaeb-uaBFekkOY9RGIAUtpuU_KMeRyFauEC13Ppv-s,2037
|
176
183
|
crypticorn/pay/client/models/services.py,sha256=OJXhv7l2rLKoqrQWNvzBD8eYykan-1KHMJG3TeKVuUk,729
|
177
184
|
crypticorn/pay/client/models/unified_payment_model.py,sha256=_Y9OtWZ-N7QDxsCte0UlMsRlPXKnp4uk2GbxXCPjAGA,3641
|
178
185
|
crypticorn/pay/client/models/validation_error.py,sha256=vzw1GCCSx0Tct-t8b4IfNQe4jaioantmwbwz2Cmi4AA,3226
|
@@ -182,24 +189,24 @@ crypticorn/trade/main.py,sha256=UapbqtrjsgpjouNuCYxnP8iqcSEMRWCvxq8uN-JecvU,1520
|
|
182
189
|
crypticorn/trade/client/__init__.py,sha256=Wa4Pn_QmZfZpScj3eM5hTh1gxcg9j9O13jImEySmQJ0,3480
|
183
190
|
crypticorn/trade/client/api_client.py,sha256=GZFlYDIxGpPWtK6CnTqZLN8kWSSSzcdziNY4kTB1hE4,26956
|
184
191
|
crypticorn/trade/client/api_response.py,sha256=WhxwYDSMm6wPixp9CegO8dJzjFxDz3JF1yCq9s0ZqKE,639
|
185
|
-
crypticorn/trade/client/configuration.py,sha256=
|
192
|
+
crypticorn/trade/client/configuration.py,sha256=Ih111_59QLT7CWHdE3L_5GRuw5ie0gx5mlu2Nyqu8Lc,18841
|
186
193
|
crypticorn/trade/client/exceptions.py,sha256=xSXlQpvCm5JkPI_N49jdTm72mSHMLOIDQ3goHqgyx5s,6455
|
187
194
|
crypticorn/trade/client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
188
195
|
crypticorn/trade/client/rest.py,sha256=o2sJyURJxO3XckjU_VuASM5AN0R5TsRcH1vtKCR97oI,6987
|
189
196
|
crypticorn/trade/client/api/__init__.py,sha256=s6jcukWHyom8Bp9Vj0yrOL37-dNPNvdvMK_aXwpKZzc,668
|
190
|
-
crypticorn/trade/client/api/api_keys_api.py,sha256=
|
191
|
-
crypticorn/trade/client/api/bots_api.py,sha256=
|
192
|
-
crypticorn/trade/client/api/exchanges_api.py,sha256=
|
193
|
-
crypticorn/trade/client/api/futures_trading_panel_api.py,sha256=
|
194
|
-
crypticorn/trade/client/api/notifications_api.py,sha256=
|
195
|
-
crypticorn/trade/client/api/orders_api.py,sha256=
|
197
|
+
crypticorn/trade/client/api/api_keys_api.py,sha256=iATzCULeKgd1rE2Oe8w4vn2ZoSvGJx5KLpD2ZyTs0qY,50862
|
198
|
+
crypticorn/trade/client/api/bots_api.py,sha256=WnrJK7zTGxJhaF6Blps3hXLUo03ud0aN-V3DjOsur20,41988
|
199
|
+
crypticorn/trade/client/api/exchanges_api.py,sha256=PX8yeVZFDWxmsortW0HdphbNtYRYWaLv8nkE8VUmPgg,10166
|
200
|
+
crypticorn/trade/client/api/futures_trading_panel_api.py,sha256=lD_sf4OFg4BGx5LE8sbwriHXRYKCe58b7ExJaoHKfRY,50404
|
201
|
+
crypticorn/trade/client/api/notifications_api.py,sha256=wTwrEj_GxjpxaZNCezKN6BRsI1cgWB3npcNstYZ912E,61442
|
202
|
+
crypticorn/trade/client/api/orders_api.py,sha256=zibuEr3448IefONOEcgti06nxNtJCvi6WYRN7z8Z9mE,11217
|
196
203
|
crypticorn/trade/client/api/status_api.py,sha256=deaW23XWpUMqhFzxO9GqT0MI8ZlAIC_f4ewdPLExBMw,9934
|
197
|
-
crypticorn/trade/client/api/strategies_api.py,sha256=
|
198
|
-
crypticorn/trade/client/api/trading_actions_api.py,sha256=
|
204
|
+
crypticorn/trade/client/api/strategies_api.py,sha256=asNtn8mZDTRu36PGGGHLRtevQ3NFs-6nQ1XRju2xSaU,42444
|
205
|
+
crypticorn/trade/client/api/trading_actions_api.py,sha256=BfW61jUsOZxhzcYgLLF19hGeSHElarxUeK1Re0q_wpY,32402
|
199
206
|
crypticorn/trade/client/models/__init__.py,sha256=qn31GdssVyCozLVuFZfK11ju9yDwY-Y3okMyn_ZmuRA,2234
|
200
207
|
crypticorn/trade/client/models/action_model.py,sha256=W-6IJl9KgeiBkZc95HH9kdvmmb-vzYtJ-HfKN0YzC_U,10131
|
201
|
-
crypticorn/trade/client/models/api_error_identifier.py,sha256=
|
202
|
-
crypticorn/trade/client/models/api_error_level.py,sha256=
|
208
|
+
crypticorn/trade/client/models/api_error_identifier.py,sha256=X1NwUsJJyIYQuoUVaByZ3msoctJIr9w7dzZZPQ-2h-Y,4136
|
209
|
+
crypticorn/trade/client/models/api_error_level.py,sha256=78zYTqbnUGvbjptf04e6-bpF8nN-YWqGxjGrdwNe4_4,799
|
203
210
|
crypticorn/trade/client/models/api_error_type.py,sha256=ANXQ3lPxQ9Jyh_-Q4ljHFHt5uH6ljBHPzK7SDy7etek,840
|
204
211
|
crypticorn/trade/client/models/api_key_model.py,sha256=CM6BeEc3ctmfLMnRht-_k_WDCjGWreOI7670h4KhhAM,5281
|
205
212
|
crypticorn/trade/client/models/bot_model.py,sha256=t1VetjZs20-ekukHlwBaOwvMiDuZ3-hjQa1V6iaUYtE,5875
|
@@ -212,20 +219,17 @@ crypticorn/trade/client/models/http_validation_error.py,sha256=7rSmsYpBLuxIkCgl2
|
|
212
219
|
crypticorn/trade/client/models/margin_mode.py,sha256=Y02aSytOfvROKDZHrdD2xHOCDbW6tT9YL3fNkDyGIus,767
|
213
220
|
crypticorn/trade/client/models/market_type.py,sha256=38cCEUR_8X0Fbxq6fa1-BagTfEuZ2gsO3kihYs7ngCA,747
|
214
221
|
crypticorn/trade/client/models/notification_model.py,sha256=pZc15SJRWPxGWjrKyEtJFLbBEPe-hBvQX9bOOjFeGQg,5010
|
215
|
-
crypticorn/trade/client/models/notification_type.py,sha256=-mFFlW34BEbhIDP_SuAgDWUGlMggvs1HLB2Q76QIa7I,801
|
216
222
|
crypticorn/trade/client/models/order_model.py,sha256=uAP7WxfiNpqV4qdX0UZxjKf70WaelEAVDJlgVTonc3M,12682
|
217
223
|
crypticorn/trade/client/models/order_status.py,sha256=cCS3aGJmqqVhoZ1JfLS-DeRj5qj-D82AI5OFblhAsik,842
|
218
224
|
crypticorn/trade/client/models/post_futures_action.py,sha256=b2HrhvawLj5zju-DXtUl6Cl9thb03-SkP48OEUIEWX8,3113
|
219
225
|
crypticorn/trade/client/models/strategy_exchange_info.py,sha256=YCxqNTgTM9uYKhkpMdMd3Ol681sIito5h37u94o0uSk,2831
|
220
|
-
crypticorn/trade/client/models/strategy_model.py,sha256=bflR-uWhIvrMjTBv6S0JpCO9NiYh588_vqZnmz-fcm4,5636
|
221
226
|
crypticorn/trade/client/models/strategy_model_input.py,sha256=fRHX4shmmFoTMW9FfASbxS4TqEixDxJ8COiOY99LtxE,5807
|
222
227
|
crypticorn/trade/client/models/strategy_model_output.py,sha256=e2bJnZ7IvWr9ch6cWiZzRy5fZODksgmr6wjbTku1gOM,5811
|
223
228
|
crypticorn/trade/client/models/tpsl.py,sha256=QGPhcgadjxAgyzpRSwlZJg_CDLnKxdZgseSpjNnkogo,4341
|
224
229
|
crypticorn/trade/client/models/trading_action_type.py,sha256=jW0OsNz_ZNXlITxAfh979BH5U12oTXSr6qUVcKcGHhw,847
|
225
|
-
crypticorn/trade/client/models/update_notification.py,sha256=B9QUuVRNpk1e5G8o0WFgIg3inm-OX7KJAJcjVnRzYx8,3046
|
226
230
|
crypticorn/trade/client/models/validation_error.py,sha256=uTkvsKrOAt-21UC0YPqCdRl_OMsuu7uhPtWuwRSYvv0,3228
|
227
231
|
crypticorn/trade/client/models/validation_error_loc_inner.py,sha256=22ql-H829xTBgfxNQZsqd8fS3zQt9tLW1pj0iobo0jY,5131
|
228
|
-
crypticorn-2.1.
|
229
|
-
crypticorn-2.1.
|
230
|
-
crypticorn-2.1.
|
231
|
-
crypticorn-2.1.
|
232
|
+
crypticorn-2.1.5.dist-info/METADATA,sha256=8UdisEy21DdJYWNydet6iAgvD2X5qrqANj9_lE5vFdo,3138
|
233
|
+
crypticorn-2.1.5.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
234
|
+
crypticorn-2.1.5.dist-info/top_level.txt,sha256=EP3NY216qIBYfmvGl0L2Zc9ItP0DjGSkiYqd9xJwGcM,11
|
235
|
+
crypticorn-2.1.5.dist-info/RECORD,,
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
"""
|
4
|
-
FastAPI
|
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 NotificationType(str, Enum):
|
22
|
-
"""
|
23
|
-
NotificationType
|
24
|
-
"""
|
25
|
-
|
26
|
-
"""
|
27
|
-
allowed enum values
|
28
|
-
"""
|
29
|
-
ERROR = "error"
|
30
|
-
SUCCESS = "success"
|
31
|
-
INFO = "info"
|
32
|
-
WARNING = "warning"
|
33
|
-
|
34
|
-
@classmethod
|
35
|
-
def from_json(cls, json_str: str) -> Self:
|
36
|
-
"""Create an instance of NotificationType from a JSON string"""
|
37
|
-
return cls(json.loads(json_str))
|
@@ -1,158 +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, Union
|
22
|
-
from typing_extensions import Annotated
|
23
|
-
from crypticorn.trade.client.models.market_type import MarketType
|
24
|
-
from crypticorn.trade.client.models.strategy_exchange_info import StrategyExchangeInfo
|
25
|
-
from typing import Optional, Set
|
26
|
-
from typing_extensions import Self
|
27
|
-
|
28
|
-
|
29
|
-
class StrategyModel(BaseModel):
|
30
|
-
"""
|
31
|
-
StrategyModel
|
32
|
-
""" # noqa: E501
|
33
|
-
|
34
|
-
created_at: Optional[StrictInt] = None
|
35
|
-
updated_at: Optional[StrictInt] = None
|
36
|
-
id: Optional[StrictStr] = None
|
37
|
-
identifier: StrictStr = Field(
|
38
|
-
description="Unique human readable identifier for the strategy e.g. 'daily_trend_momentum'"
|
39
|
-
)
|
40
|
-
name: StrictStr = Field(description="Name of the strategy")
|
41
|
-
description: StrictStr = Field(description="Description of the strategy")
|
42
|
-
exchanges: List[StrategyExchangeInfo] = Field(
|
43
|
-
description="Exchanges supported by the strategy."
|
44
|
-
)
|
45
|
-
enabled: StrictBool = Field(description="Whether the strategy is enabled")
|
46
|
-
leverage: StrictInt = Field(description="Leverage for the strategy")
|
47
|
-
performance_fee: Union[
|
48
|
-
Annotated[float, Field(le=1.0, strict=True)],
|
49
|
-
Annotated[int, Field(le=1, strict=True)],
|
50
|
-
] = Field(description="Performance fee for the strategy")
|
51
|
-
market_type: MarketType = Field(description="Market of operation of the strategy")
|
52
|
-
__properties: ClassVar[List[str]] = [
|
53
|
-
"created_at",
|
54
|
-
"updated_at",
|
55
|
-
"id",
|
56
|
-
"identifier",
|
57
|
-
"name",
|
58
|
-
"description",
|
59
|
-
"exchanges",
|
60
|
-
"enabled",
|
61
|
-
"leverage",
|
62
|
-
"performance_fee",
|
63
|
-
"market_type",
|
64
|
-
]
|
65
|
-
|
66
|
-
model_config = ConfigDict(
|
67
|
-
populate_by_name=True,
|
68
|
-
validate_assignment=True,
|
69
|
-
protected_namespaces=(),
|
70
|
-
)
|
71
|
-
|
72
|
-
def to_str(self) -> str:
|
73
|
-
"""Returns the string representation of the model using alias"""
|
74
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
75
|
-
|
76
|
-
def to_json(self) -> str:
|
77
|
-
"""Returns the JSON representation of the model using alias"""
|
78
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
79
|
-
return json.dumps(self.to_dict())
|
80
|
-
|
81
|
-
@classmethod
|
82
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
83
|
-
"""Create an instance of StrategyModel from a JSON string"""
|
84
|
-
return cls.from_dict(json.loads(json_str))
|
85
|
-
|
86
|
-
def to_dict(self) -> Dict[str, Any]:
|
87
|
-
"""Return the dictionary representation of the model using alias.
|
88
|
-
|
89
|
-
This has the following differences from calling pydantic's
|
90
|
-
`self.model_dump(by_alias=True)`:
|
91
|
-
|
92
|
-
* `None` is only added to the output dict for nullable fields that
|
93
|
-
were set at model initialization. Other fields with value `None`
|
94
|
-
are ignored.
|
95
|
-
"""
|
96
|
-
excluded_fields: Set[str] = set([])
|
97
|
-
|
98
|
-
_dict = self.model_dump(
|
99
|
-
by_alias=True,
|
100
|
-
exclude=excluded_fields,
|
101
|
-
exclude_none=True,
|
102
|
-
)
|
103
|
-
# override the default output from pydantic by calling `to_dict()` of each item in exchanges (list)
|
104
|
-
_items = []
|
105
|
-
if self.exchanges:
|
106
|
-
for _item_exchanges in self.exchanges:
|
107
|
-
if _item_exchanges:
|
108
|
-
_items.append(_item_exchanges.to_dict())
|
109
|
-
_dict["exchanges"] = _items
|
110
|
-
# set to None if created_at (nullable) is None
|
111
|
-
# and model_fields_set contains the field
|
112
|
-
if self.created_at is None and "created_at" in self.model_fields_set:
|
113
|
-
_dict["created_at"] = None
|
114
|
-
|
115
|
-
# set to None if updated_at (nullable) is None
|
116
|
-
# and model_fields_set contains the field
|
117
|
-
if self.updated_at is None and "updated_at" in self.model_fields_set:
|
118
|
-
_dict["updated_at"] = None
|
119
|
-
|
120
|
-
# set to None if id (nullable) is None
|
121
|
-
# and model_fields_set contains the field
|
122
|
-
if self.id is None and "id" in self.model_fields_set:
|
123
|
-
_dict["id"] = None
|
124
|
-
|
125
|
-
return _dict
|
126
|
-
|
127
|
-
@classmethod
|
128
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
129
|
-
"""Create an instance of StrategyModel from a dict"""
|
130
|
-
if obj is None:
|
131
|
-
return None
|
132
|
-
|
133
|
-
if not isinstance(obj, dict):
|
134
|
-
return cls.model_validate(obj)
|
135
|
-
|
136
|
-
_obj = cls.model_validate(
|
137
|
-
{
|
138
|
-
"created_at": obj.get("created_at"),
|
139
|
-
"updated_at": obj.get("updated_at"),
|
140
|
-
"id": obj.get("id"),
|
141
|
-
"identifier": obj.get("identifier"),
|
142
|
-
"name": obj.get("name"),
|
143
|
-
"description": obj.get("description"),
|
144
|
-
"exchanges": (
|
145
|
-
[
|
146
|
-
StrategyExchangeInfo.from_dict(_item)
|
147
|
-
for _item in obj["exchanges"]
|
148
|
-
]
|
149
|
-
if obj.get("exchanges") is not None
|
150
|
-
else None
|
151
|
-
),
|
152
|
-
"enabled": obj.get("enabled"),
|
153
|
-
"leverage": obj.get("leverage"),
|
154
|
-
"performance_fee": obj.get("performance_fee"),
|
155
|
-
"market_type": obj.get("market_type"),
|
156
|
-
}
|
157
|
-
)
|
158
|
-
return _obj
|
File without changes
|
File without changes
|