crypticorn 2.15.0__py3-none-any.whl → 2.17.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. crypticorn/__init__.py +2 -2
  2. crypticorn/auth/client/api/admin_api.py +397 -13
  3. crypticorn/auth/client/api/auth_api.py +3610 -341
  4. crypticorn/auth/client/api/service_api.py +249 -7
  5. crypticorn/auth/client/api/user_api.py +2295 -179
  6. crypticorn/auth/client/api/wallet_api.py +1468 -81
  7. crypticorn/auth/client/configuration.py +2 -2
  8. crypticorn/auth/client/models/create_api_key_request.py +2 -1
  9. crypticorn/auth/client/models/get_api_keys200_response_inner.py +2 -1
  10. crypticorn/auth/client/rest.py +23 -4
  11. crypticorn/auth/main.py +8 -5
  12. crypticorn/cli/init.py +1 -1
  13. crypticorn/cli/templates/.env.docker.temp +3 -0
  14. crypticorn/cli/templates/.env.example.temp +4 -0
  15. crypticorn/cli/templates/Dockerfile +5 -2
  16. crypticorn/client.py +226 -59
  17. crypticorn/common/__init__.py +1 -0
  18. crypticorn/common/auth.py +45 -14
  19. crypticorn/common/decorators.py +1 -2
  20. crypticorn/common/enums.py +0 -2
  21. crypticorn/common/errors.py +10 -0
  22. crypticorn/common/metrics.py +30 -0
  23. crypticorn/common/middleware.py +94 -1
  24. crypticorn/common/pagination.py +252 -18
  25. crypticorn/common/router/admin_router.py +2 -2
  26. crypticorn/common/router/status_router.py +40 -2
  27. crypticorn/common/scopes.py +2 -0
  28. crypticorn/common/warnings.py +8 -0
  29. crypticorn/dex/__init__.py +6 -0
  30. crypticorn/dex/client/__init__.py +49 -0
  31. crypticorn/dex/client/api/__init__.py +6 -0
  32. crypticorn/dex/client/api/admin_api.py +2986 -0
  33. crypticorn/dex/client/api/signals_api.py +1798 -0
  34. crypticorn/dex/client/api/status_api.py +892 -0
  35. crypticorn/dex/client/api_client.py +758 -0
  36. crypticorn/dex/client/api_response.py +20 -0
  37. crypticorn/dex/client/configuration.py +620 -0
  38. crypticorn/dex/client/exceptions.py +220 -0
  39. crypticorn/dex/client/models/__init__.py +30 -0
  40. crypticorn/dex/client/models/api_error_identifier.py +121 -0
  41. crypticorn/dex/client/models/api_error_level.py +37 -0
  42. crypticorn/dex/client/models/api_error_type.py +37 -0
  43. crypticorn/dex/client/models/exception_detail.py +117 -0
  44. crypticorn/dex/client/models/log_level.py +38 -0
  45. crypticorn/dex/client/models/paginated_response_signal_with_token.py +134 -0
  46. crypticorn/dex/client/models/risk.py +86 -0
  47. crypticorn/dex/client/models/signal_overview_stats.py +158 -0
  48. crypticorn/dex/client/models/signal_volume.py +84 -0
  49. crypticorn/dex/client/models/signal_with_token.py +163 -0
  50. crypticorn/dex/client/models/token_data.py +127 -0
  51. crypticorn/dex/client/models/token_detail.py +116 -0
  52. crypticorn/dex/client/py.typed +0 -0
  53. crypticorn/dex/client/rest.py +217 -0
  54. crypticorn/dex/main.py +1 -0
  55. crypticorn/hive/client/api/admin_api.py +1173 -47
  56. crypticorn/hive/client/api/data_api.py +499 -17
  57. crypticorn/hive/client/api/models_api.py +1595 -87
  58. crypticorn/hive/client/api/status_api.py +397 -16
  59. crypticorn/hive/client/api_client.py +0 -5
  60. crypticorn/hive/client/models/api_error_identifier.py +1 -1
  61. crypticorn/hive/client/models/coin_info.py +1 -1
  62. crypticorn/hive/client/models/exception_detail.py +1 -1
  63. crypticorn/hive/client/models/target_info.py +1 -1
  64. crypticorn/hive/client/rest.py +23 -4
  65. crypticorn/hive/main.py +99 -25
  66. crypticorn/hive/utils.py +2 -2
  67. crypticorn/klines/client/api/admin_api.py +1173 -47
  68. crypticorn/klines/client/api/change_in_timeframe_api.py +269 -11
  69. crypticorn/klines/client/api/funding_rates_api.py +315 -11
  70. crypticorn/klines/client/api/ohlcv_data_api.py +390 -11
  71. crypticorn/klines/client/api/status_api.py +397 -16
  72. crypticorn/klines/client/api/symbols_api.py +216 -11
  73. crypticorn/klines/client/api/udf_api.py +1268 -51
  74. crypticorn/klines/client/api_client.py +0 -5
  75. crypticorn/klines/client/models/api_error_identifier.py +3 -1
  76. crypticorn/klines/client/models/exception_detail.py +1 -1
  77. crypticorn/klines/client/models/ohlcv.py +1 -1
  78. crypticorn/klines/client/models/symbol_group.py +1 -1
  79. crypticorn/klines/client/models/udf_config.py +1 -1
  80. crypticorn/klines/client/rest.py +23 -4
  81. crypticorn/klines/main.py +89 -12
  82. crypticorn/metrics/client/api/admin_api.py +1173 -47
  83. crypticorn/metrics/client/api/exchanges_api.py +1370 -145
  84. crypticorn/metrics/client/api/indicators_api.py +622 -17
  85. crypticorn/metrics/client/api/logs_api.py +296 -11
  86. crypticorn/metrics/client/api/marketcap_api.py +1207 -67
  87. crypticorn/metrics/client/api/markets_api.py +343 -11
  88. crypticorn/metrics/client/api/quote_currencies_api.py +228 -11
  89. crypticorn/metrics/client/api/status_api.py +397 -16
  90. crypticorn/metrics/client/api/tokens_api.py +382 -15
  91. crypticorn/metrics/client/api_client.py +0 -5
  92. crypticorn/metrics/client/configuration.py +4 -2
  93. crypticorn/metrics/client/models/exception_detail.py +1 -1
  94. crypticorn/metrics/client/models/exchange_mapping.py +1 -1
  95. crypticorn/metrics/client/models/marketcap_ranking.py +1 -1
  96. crypticorn/metrics/client/models/marketcap_symbol_ranking.py +1 -1
  97. crypticorn/metrics/client/models/ohlcv.py +1 -1
  98. crypticorn/metrics/client/rest.py +23 -4
  99. crypticorn/metrics/main.py +113 -19
  100. crypticorn/pay/client/api/admin_api.py +1585 -57
  101. crypticorn/pay/client/api/now_payments_api.py +961 -39
  102. crypticorn/pay/client/api/payments_api.py +562 -17
  103. crypticorn/pay/client/api/products_api.py +880 -30
  104. crypticorn/pay/client/api/status_api.py +397 -16
  105. crypticorn/pay/client/api_client.py +0 -5
  106. crypticorn/pay/client/configuration.py +2 -2
  107. crypticorn/pay/client/models/api_error_identifier.py +7 -7
  108. crypticorn/pay/client/models/exception_detail.py +1 -1
  109. crypticorn/pay/client/models/now_create_invoice_req.py +1 -1
  110. crypticorn/pay/client/models/now_create_invoice_res.py +1 -1
  111. crypticorn/pay/client/models/product.py +1 -1
  112. crypticorn/pay/client/models/product_create.py +1 -1
  113. crypticorn/pay/client/models/product_update.py +1 -1
  114. crypticorn/pay/client/models/scope.py +1 -0
  115. crypticorn/pay/client/rest.py +23 -4
  116. crypticorn/pay/main.py +10 -6
  117. crypticorn/trade/client/__init__.py +11 -1
  118. crypticorn/trade/client/api/__init__.py +0 -1
  119. crypticorn/trade/client/api/admin_api.py +1184 -55
  120. crypticorn/trade/client/api/api_keys_api.py +1678 -162
  121. crypticorn/trade/client/api/bots_api.py +7563 -187
  122. crypticorn/trade/client/api/exchanges_api.py +565 -19
  123. crypticorn/trade/client/api/notifications_api.py +1290 -116
  124. crypticorn/trade/client/api/orders_api.py +393 -55
  125. crypticorn/trade/client/api/status_api.py +397 -13
  126. crypticorn/trade/client/api/strategies_api.py +1133 -77
  127. crypticorn/trade/client/api/trading_actions_api.py +786 -65
  128. crypticorn/trade/client/models/__init__.py +11 -0
  129. crypticorn/trade/client/models/actions_count.py +88 -0
  130. crypticorn/trade/client/models/api_error_identifier.py +8 -7
  131. crypticorn/trade/client/models/bot.py +7 -18
  132. crypticorn/trade/client/models/bot_create.py +17 -1
  133. crypticorn/trade/client/models/bot_update.py +17 -1
  134. crypticorn/trade/client/models/exchange.py +6 -1
  135. crypticorn/trade/client/models/exchange_key.py +1 -1
  136. crypticorn/trade/client/models/exchange_key_balance.py +111 -0
  137. crypticorn/trade/client/models/exchange_key_create.py +17 -1
  138. crypticorn/trade/client/models/exchange_key_update.py +17 -1
  139. crypticorn/trade/client/models/execution_ids.py +1 -1
  140. crypticorn/trade/client/models/futures_balance.py +27 -25
  141. crypticorn/trade/client/models/futures_trading_action.py +6 -28
  142. crypticorn/trade/client/models/futures_trading_action_create.py +10 -13
  143. crypticorn/trade/client/models/notification.py +17 -1
  144. crypticorn/trade/client/models/notification_create.py +18 -2
  145. crypticorn/trade/client/models/notification_update.py +17 -1
  146. crypticorn/trade/client/models/order.py +2 -14
  147. crypticorn/trade/client/models/orders_count.py +88 -0
  148. crypticorn/trade/client/models/paginated_response_futures_trading_action.py +134 -0
  149. crypticorn/trade/client/models/paginated_response_order.py +134 -0
  150. crypticorn/trade/client/models/pn_l.py +95 -0
  151. crypticorn/trade/client/models/post_futures_action.py +1 -1
  152. crypticorn/trade/client/models/spot_balance.py +109 -0
  153. crypticorn/trade/client/models/spot_trading_action_create.py +4 -1
  154. crypticorn/trade/client/models/strategy.py +22 -4
  155. crypticorn/trade/client/models/strategy_create.py +23 -5
  156. crypticorn/trade/client/models/strategy_exchange_info.py +16 -4
  157. crypticorn/trade/client/models/strategy_update.py +19 -3
  158. crypticorn/trade/client/models/tpsl.py +4 -27
  159. crypticorn/trade/client/models/tpsl_create.py +6 -19
  160. crypticorn/trade/client/rest.py +23 -4
  161. crypticorn/trade/main.py +15 -12
  162. {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/METADATA +65 -20
  163. {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/RECORD +167 -132
  164. crypticorn/trade/client/api/futures_trading_panel_api.py +0 -1285
  165. {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/WHEEL +0 -0
  166. {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/entry_points.txt +0 -0
  167. {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/licenses/LICENSE +0 -0
  168. {crypticorn-2.15.0.dist-info → crypticorn-2.17.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,134 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ DEX AI API
5
+
6
+ API for DEX AI
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from crypticorn.dex.client.models.signal_with_token import SignalWithToken
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+
27
+ class PaginatedResponseSignalWithToken(BaseModel):
28
+ """
29
+ PaginatedResponseSignalWithToken
30
+ """ # noqa: E501
31
+
32
+ data: List[SignalWithToken]
33
+ total: StrictInt = Field(description="The total number of items")
34
+ page: StrictInt = Field(description="The current page number")
35
+ page_size: StrictInt = Field(description="The number of items per page")
36
+ prev: Optional[StrictInt] = None
37
+ next: Optional[StrictInt] = None
38
+ last: Optional[StrictInt] = None
39
+ __properties: ClassVar[List[str]] = [
40
+ "data",
41
+ "total",
42
+ "page",
43
+ "page_size",
44
+ "prev",
45
+ "next",
46
+ "last",
47
+ ]
48
+
49
+ model_config = ConfigDict(
50
+ populate_by_name=True,
51
+ validate_assignment=True,
52
+ protected_namespaces=(),
53
+ )
54
+
55
+ def to_str(self) -> str:
56
+ """Returns the string representation of the model using alias"""
57
+ return pprint.pformat(self.model_dump(by_alias=True))
58
+
59
+ def to_json(self) -> str:
60
+ """Returns the JSON representation of the model using alias"""
61
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
62
+ return json.dumps(self.to_dict())
63
+
64
+ @classmethod
65
+ def from_json(cls, json_str: str) -> Optional[Self]:
66
+ """Create an instance of PaginatedResponseSignalWithToken from a JSON string"""
67
+ return cls.from_dict(json.loads(json_str))
68
+
69
+ def to_dict(self) -> Dict[str, Any]:
70
+ """Return the dictionary representation of the model using alias.
71
+
72
+ This has the following differences from calling pydantic's
73
+ `self.model_dump(by_alias=True)`:
74
+
75
+ * `None` is only added to the output dict for nullable fields that
76
+ were set at model initialization. Other fields with value `None`
77
+ are ignored.
78
+ """
79
+ excluded_fields: Set[str] = set([])
80
+
81
+ _dict = self.model_dump(
82
+ by_alias=True,
83
+ exclude=excluded_fields,
84
+ exclude_none=True,
85
+ )
86
+ # override the default output from pydantic by calling `to_dict()` of each item in data (list)
87
+ _items = []
88
+ if self.data:
89
+ for _item_data in self.data:
90
+ if _item_data:
91
+ _items.append(_item_data.to_dict())
92
+ _dict["data"] = _items
93
+ # set to None if prev (nullable) is None
94
+ # and model_fields_set contains the field
95
+ if self.prev is None and "prev" in self.model_fields_set:
96
+ _dict["prev"] = None
97
+
98
+ # set to None if next (nullable) is None
99
+ # and model_fields_set contains the field
100
+ if self.next is None and "next" in self.model_fields_set:
101
+ _dict["next"] = None
102
+
103
+ # set to None if last (nullable) is None
104
+ # and model_fields_set contains the field
105
+ if self.last is None and "last" in self.model_fields_set:
106
+ _dict["last"] = None
107
+
108
+ return _dict
109
+
110
+ @classmethod
111
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
112
+ """Create an instance of PaginatedResponseSignalWithToken from a dict"""
113
+ if obj is None:
114
+ return None
115
+
116
+ if not isinstance(obj, dict):
117
+ return cls.model_validate(obj)
118
+
119
+ _obj = cls.model_validate(
120
+ {
121
+ "data": (
122
+ [SignalWithToken.from_dict(_item) for _item in obj["data"]]
123
+ if obj.get("data") is not None
124
+ else None
125
+ ),
126
+ "total": obj.get("total"),
127
+ "page": obj.get("page"),
128
+ "page_size": obj.get("page_size"),
129
+ "prev": obj.get("prev"),
130
+ "next": obj.get("next"),
131
+ "last": obj.get("last"),
132
+ }
133
+ )
134
+ return _obj
@@ -0,0 +1,86 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ DEX AI API
5
+
6
+ API for DEX AI
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+
26
+ class Risk(BaseModel):
27
+ """
28
+ Model for risk assessment
29
+ """ # noqa: E501
30
+
31
+ rugged: StrictBool = Field(description="Is token rugged")
32
+ score: StrictInt = Field(description="Overall risk score")
33
+ __properties: ClassVar[List[str]] = ["rugged", "score"]
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 Risk 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
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of Risk from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj)
82
+
83
+ _obj = cls.model_validate(
84
+ {"rugged": obj.get("rugged"), "score": obj.get("score")}
85
+ )
86
+ return _obj
@@ -0,0 +1,158 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ DEX AI API
5
+
6
+ API for DEX AI
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional, Union
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+
26
+ class SignalOverviewStats(BaseModel):
27
+ """
28
+ Model for signal statistics response
29
+ """ # noqa: E501
30
+
31
+ timestamp: StrictInt = Field(
32
+ description="The unix timestamp of the stats calculation"
33
+ )
34
+ total: StrictInt = Field(description="Total number of tokens analyzed")
35
+ win_rate: Union[StrictFloat, StrictInt] = Field(
36
+ description="Overall win rate as a percentage"
37
+ )
38
+ avg_performance: Union[StrictFloat, StrictInt] = Field(
39
+ description="Average performance as a percentage"
40
+ )
41
+ median_performance: Union[StrictFloat, StrictInt] = Field(
42
+ description="Median performance as a percentage"
43
+ )
44
+ best_risk_category: Optional[StrictStr] = None
45
+ best_month: Optional[StrictStr] = None
46
+ best_holding_period: Optional[StrictStr] = None
47
+ best_launch_hour: Optional[StrictInt] = None
48
+ best_launch_day: Optional[StrictStr] = None
49
+ __properties: ClassVar[List[str]] = [
50
+ "timestamp",
51
+ "total",
52
+ "win_rate",
53
+ "avg_performance",
54
+ "median_performance",
55
+ "best_risk_category",
56
+ "best_month",
57
+ "best_holding_period",
58
+ "best_launch_hour",
59
+ "best_launch_day",
60
+ ]
61
+
62
+ model_config = ConfigDict(
63
+ populate_by_name=True,
64
+ validate_assignment=True,
65
+ protected_namespaces=(),
66
+ )
67
+
68
+ def to_str(self) -> str:
69
+ """Returns the string representation of the model using alias"""
70
+ return pprint.pformat(self.model_dump(by_alias=True))
71
+
72
+ def to_json(self) -> str:
73
+ """Returns the JSON representation of the model using alias"""
74
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
75
+ return json.dumps(self.to_dict())
76
+
77
+ @classmethod
78
+ def from_json(cls, json_str: str) -> Optional[Self]:
79
+ """Create an instance of SignalOverviewStats from a JSON string"""
80
+ return cls.from_dict(json.loads(json_str))
81
+
82
+ def to_dict(self) -> Dict[str, Any]:
83
+ """Return the dictionary representation of the model using alias.
84
+
85
+ This has the following differences from calling pydantic's
86
+ `self.model_dump(by_alias=True)`:
87
+
88
+ * `None` is only added to the output dict for nullable fields that
89
+ were set at model initialization. Other fields with value `None`
90
+ are ignored.
91
+ """
92
+ excluded_fields: Set[str] = set([])
93
+
94
+ _dict = self.model_dump(
95
+ by_alias=True,
96
+ exclude=excluded_fields,
97
+ exclude_none=True,
98
+ )
99
+ # set to None if best_risk_category (nullable) is None
100
+ # and model_fields_set contains the field
101
+ if (
102
+ self.best_risk_category is None
103
+ and "best_risk_category" in self.model_fields_set
104
+ ):
105
+ _dict["best_risk_category"] = None
106
+
107
+ # set to None if best_month (nullable) is None
108
+ # and model_fields_set contains the field
109
+ if self.best_month is None and "best_month" in self.model_fields_set:
110
+ _dict["best_month"] = None
111
+
112
+ # set to None if best_holding_period (nullable) is None
113
+ # and model_fields_set contains the field
114
+ if (
115
+ self.best_holding_period is None
116
+ and "best_holding_period" in self.model_fields_set
117
+ ):
118
+ _dict["best_holding_period"] = None
119
+
120
+ # set to None if best_launch_hour (nullable) is None
121
+ # and model_fields_set contains the field
122
+ if (
123
+ self.best_launch_hour is None
124
+ and "best_launch_hour" in self.model_fields_set
125
+ ):
126
+ _dict["best_launch_hour"] = None
127
+
128
+ # set to None if best_launch_day (nullable) is None
129
+ # and model_fields_set contains the field
130
+ if self.best_launch_day is None and "best_launch_day" in self.model_fields_set:
131
+ _dict["best_launch_day"] = None
132
+
133
+ return _dict
134
+
135
+ @classmethod
136
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
137
+ """Create an instance of SignalOverviewStats from a dict"""
138
+ if obj is None:
139
+ return None
140
+
141
+ if not isinstance(obj, dict):
142
+ return cls.model_validate(obj)
143
+
144
+ _obj = cls.model_validate(
145
+ {
146
+ "timestamp": obj.get("timestamp"),
147
+ "total": obj.get("total"),
148
+ "win_rate": obj.get("win_rate"),
149
+ "avg_performance": obj.get("avg_performance"),
150
+ "median_performance": obj.get("median_performance"),
151
+ "best_risk_category": obj.get("best_risk_category"),
152
+ "best_month": obj.get("best_month"),
153
+ "best_holding_period": obj.get("best_holding_period"),
154
+ "best_launch_hour": obj.get("best_launch_hour"),
155
+ "best_launch_day": obj.get("best_launch_day"),
156
+ }
157
+ )
158
+ return _obj
@@ -0,0 +1,84 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ DEX AI API
5
+
6
+ API for DEX AI
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+
26
+ class SignalVolume(BaseModel):
27
+ """
28
+ Trading volume data for a signal over different time periods.
29
+ """ # noqa: E501
30
+
31
+ day: StrictStr = Field(description="24-hour trading volume")
32
+ hour: StrictStr = Field(description="1-hour trading volume")
33
+ __properties: ClassVar[List[str]] = ["day", "hour"]
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 SignalVolume 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
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of SignalVolume from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj)
82
+
83
+ _obj = cls.model_validate({"day": obj.get("day"), "hour": obj.get("hour")})
84
+ return _obj
@@ -0,0 +1,163 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ DEX AI API
5
+
6
+ API for DEX AI
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional, Union
22
+ from crypticorn.dex.client.models.signal_volume import SignalVolume
23
+ from crypticorn.dex.client.models.token_data import TokenData
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+
28
+ class SignalWithToken(BaseModel):
29
+ """
30
+ Trading signal enriched with comprehensive token metadata and information.
31
+ """ # noqa: E501
32
+
33
+ ca: StrictStr = Field(description="The contract address of the token")
34
+ name: StrictStr = Field(description="The name of the token")
35
+ type: StrictStr = Field(description="The type of the signal")
36
+ risk: Optional[StrictStr] = None
37
+ performance: StrictStr = Field(
38
+ description="The performance in percent as a string. e.g. +100%"
39
+ )
40
+ price: StrictStr = Field(description="The price of the signal")
41
+ volume: SignalVolume = Field(description="The volume of the signal")
42
+ liquidity: StrictStr = Field(description="The liquidity of the signal")
43
+ mcap: StrictStr = Field(description="The market cap of the signal")
44
+ called_at: StrictInt = Field(description="The timestamp of the call")
45
+ updated_at: StrictInt = Field(description="The timestamp of the last update")
46
+ tg_id: Optional[StrictStr]
47
+ data: TokenData = Field(description="The token info")
48
+ performance_float: Union[StrictFloat, StrictInt] = Field(
49
+ description="The performance in float. e.g. +100% -> 2.0"
50
+ )
51
+ __properties: ClassVar[List[str]] = [
52
+ "ca",
53
+ "name",
54
+ "type",
55
+ "risk",
56
+ "performance",
57
+ "price",
58
+ "volume",
59
+ "liquidity",
60
+ "mcap",
61
+ "called_at",
62
+ "updated_at",
63
+ "tg_id",
64
+ "data",
65
+ "performance_float",
66
+ ]
67
+
68
+ model_config = ConfigDict(
69
+ populate_by_name=True,
70
+ validate_assignment=True,
71
+ protected_namespaces=(),
72
+ )
73
+
74
+ def to_str(self) -> str:
75
+ """Returns the string representation of the model using alias"""
76
+ return pprint.pformat(self.model_dump(by_alias=True))
77
+
78
+ def to_json(self) -> str:
79
+ """Returns the JSON representation of the model using alias"""
80
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
81
+ return json.dumps(self.to_dict())
82
+
83
+ @classmethod
84
+ def from_json(cls, json_str: str) -> Optional[Self]:
85
+ """Create an instance of SignalWithToken from a JSON string"""
86
+ return cls.from_dict(json.loads(json_str))
87
+
88
+ def to_dict(self) -> Dict[str, Any]:
89
+ """Return the dictionary representation of the model using alias.
90
+
91
+ This has the following differences from calling pydantic's
92
+ `self.model_dump(by_alias=True)`:
93
+
94
+ * `None` is only added to the output dict for nullable fields that
95
+ were set at model initialization. Other fields with value `None`
96
+ are ignored.
97
+ * OpenAPI `readOnly` fields are excluded.
98
+ """
99
+ excluded_fields: Set[str] = set(
100
+ [
101
+ "performance_float",
102
+ ]
103
+ )
104
+
105
+ _dict = self.model_dump(
106
+ by_alias=True,
107
+ exclude=excluded_fields,
108
+ exclude_none=True,
109
+ )
110
+ # override the default output from pydantic by calling `to_dict()` of volume
111
+ if self.volume:
112
+ _dict["volume"] = self.volume.to_dict()
113
+ # override the default output from pydantic by calling `to_dict()` of data
114
+ if self.data:
115
+ _dict["data"] = self.data.to_dict()
116
+ # set to None if risk (nullable) is None
117
+ # and model_fields_set contains the field
118
+ if self.risk is None and "risk" in self.model_fields_set:
119
+ _dict["risk"] = None
120
+
121
+ # set to None if tg_id (nullable) is None
122
+ # and model_fields_set contains the field
123
+ if self.tg_id is None and "tg_id" in self.model_fields_set:
124
+ _dict["tg_id"] = None
125
+
126
+ return _dict
127
+
128
+ @classmethod
129
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
130
+ """Create an instance of SignalWithToken from a dict"""
131
+ if obj is None:
132
+ return None
133
+
134
+ if not isinstance(obj, dict):
135
+ return cls.model_validate(obj)
136
+
137
+ _obj = cls.model_validate(
138
+ {
139
+ "ca": obj.get("ca"),
140
+ "name": obj.get("name"),
141
+ "type": obj.get("type"),
142
+ "risk": obj.get("risk"),
143
+ "performance": obj.get("performance"),
144
+ "price": obj.get("price"),
145
+ "volume": (
146
+ SignalVolume.from_dict(obj["volume"])
147
+ if obj.get("volume") is not None
148
+ else None
149
+ ),
150
+ "liquidity": obj.get("liquidity"),
151
+ "mcap": obj.get("mcap"),
152
+ "called_at": obj.get("called_at"),
153
+ "updated_at": obj.get("updated_at"),
154
+ "tg_id": obj.get("tg_id"),
155
+ "data": (
156
+ TokenData.from_dict(obj["data"])
157
+ if obj.get("data") is not None
158
+ else None
159
+ ),
160
+ "performance_float": obj.get("performance_float"),
161
+ }
162
+ )
163
+ return _obj