crypticorn 1.0.2rc3__py3-none-any.whl → 2.0.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 (259) hide show
  1. crypticorn/__init__.py +3 -3
  2. crypticorn/auth/__init__.py +2 -0
  3. crypticorn/auth/client/__init__.py +112 -0
  4. crypticorn/auth/client/api/__init__.py +8 -0
  5. crypticorn/auth/client/api/admin_api.py +522 -0
  6. crypticorn/auth/client/api/auth_api.py +2089 -0
  7. crypticorn/auth/client/api/service_api.py +309 -0
  8. crypticorn/auth/client/api/user_api.py +2540 -0
  9. crypticorn/auth/client/api/wallet_api.py +1698 -0
  10. crypticorn/auth/client/api_client.py +758 -0
  11. crypticorn/auth/client/api_response.py +20 -0
  12. crypticorn/auth/client/configuration.py +584 -0
  13. crypticorn/auth/client/exceptions.py +220 -0
  14. crypticorn/auth/client/models/__init__.py +91 -0
  15. crypticorn/auth/client/models/add_wallet200_response.py +86 -0
  16. crypticorn/auth/client/models/add_wallet_request.py +107 -0
  17. crypticorn/auth/client/models/authorize_user200_response.py +107 -0
  18. crypticorn/auth/client/models/authorize_user200_response_auth.py +101 -0
  19. crypticorn/auth/client/models/authorize_user_request.py +96 -0
  20. crypticorn/auth/client/models/create_user_request.py +114 -0
  21. crypticorn/auth/client/models/list_wallets200_response.py +137 -0
  22. crypticorn/auth/client/models/list_wallets200_response_balances_inner.py +115 -0
  23. crypticorn/auth/client/models/list_wallets200_response_balances_inner_sale_round.py +115 -0
  24. crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet.py +168 -0
  25. crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet_vesting_wallets_inner.py +191 -0
  26. crypticorn/auth/client/models/list_wallets200_response_data_inner.py +102 -0
  27. crypticorn/auth/client/models/list_wallets200_response_user_value.py +118 -0
  28. crypticorn/auth/client/models/logout_default_response.py +108 -0
  29. crypticorn/auth/client/models/logout_default_response_issues_inner.py +83 -0
  30. crypticorn/auth/client/models/refresh_token_info200_response.py +97 -0
  31. crypticorn/auth/client/models/refresh_token_info200_response_user_session.py +105 -0
  32. crypticorn/auth/client/models/resend_verification_email_request.py +84 -0
  33. crypticorn/auth/client/models/revoke_user_tokens_request.py +83 -0
  34. crypticorn/auth/client/models/rotate_tokens200_response.py +110 -0
  35. crypticorn/auth/client/models/token_info200_response.py +97 -0
  36. crypticorn/auth/client/models/unlink_wallet_request.py +83 -0
  37. crypticorn/auth/client/models/update_user_request.py +93 -0
  38. crypticorn/auth/client/models/user_reset_password_request.py +87 -0
  39. crypticorn/auth/client/models/user_set_password_request.py +89 -0
  40. crypticorn/auth/client/models/verify200_response.py +110 -0
  41. crypticorn/auth/client/models/verify_email200_response.py +107 -0
  42. crypticorn/auth/client/models/verify_email200_response_auth.py +101 -0
  43. crypticorn/auth/client/models/verify_email200_response_auth_auth.py +110 -0
  44. crypticorn/auth/client/models/verify_email_request.py +83 -0
  45. crypticorn/auth/client/models/verify_wallet_request.py +91 -0
  46. crypticorn/auth/client/models/wallet_verified200_response.py +83 -0
  47. crypticorn/auth/client/models/whoami200_response.py +104 -0
  48. crypticorn/auth/client/rest.py +195 -0
  49. crypticorn/auth/main.py +45 -0
  50. crypticorn/client.py +46 -8
  51. crypticorn/common/__init__.py +5 -0
  52. crypticorn/common/auth.py +43 -0
  53. crypticorn/common/auth_client.py +163 -0
  54. crypticorn/common/errors.py +432 -0
  55. crypticorn/common/scopes.py +29 -0
  56. crypticorn/common/urls.py +25 -0
  57. crypticorn/hive/__init__.py +2 -1
  58. crypticorn/hive/client/__init__.py +57 -0
  59. crypticorn/hive/client/api/__init__.py +6 -0
  60. crypticorn/hive/client/api/data_api.py +594 -0
  61. crypticorn/hive/client/api/models_api.py +1680 -0
  62. crypticorn/hive/client/api/status_api.py +263 -0
  63. crypticorn/hive/client/api_client.py +758 -0
  64. crypticorn/hive/client/api_response.py +20 -0
  65. crypticorn/hive/client/configuration.py +612 -0
  66. crypticorn/hive/client/exceptions.py +220 -0
  67. crypticorn/hive/client/models/__init__.py +38 -0
  68. crypticorn/hive/client/models/coins.py +44 -0
  69. crypticorn/hive/client/models/data_download_response.py +113 -0
  70. crypticorn/hive/client/models/data_info.py +115 -0
  71. crypticorn/hive/client/models/data_value_value_value_inner.py +154 -0
  72. crypticorn/hive/client/models/data_version.py +35 -0
  73. crypticorn/hive/client/models/download_links.py +91 -0
  74. crypticorn/hive/client/models/evaluation.py +86 -0
  75. crypticorn/hive/client/models/evaluation_response.py +85 -0
  76. crypticorn/hive/client/models/feature_size.py +36 -0
  77. crypticorn/hive/client/models/http_validation_error.py +99 -0
  78. crypticorn/hive/client/models/model.py +133 -0
  79. crypticorn/hive/client/models/model_create.py +93 -0
  80. crypticorn/hive/client/models/model_status.py +35 -0
  81. crypticorn/hive/client/models/model_update.py +83 -0
  82. crypticorn/hive/client/models/target.py +36 -0
  83. crypticorn/hive/client/models/target_type.py +35 -0
  84. crypticorn/hive/client/models/validation_error.py +105 -0
  85. crypticorn/hive/client/models/validation_error_loc_inner.py +159 -0
  86. crypticorn/hive/client/py.typed +0 -0
  87. crypticorn/hive/client/rest.py +195 -0
  88. crypticorn/hive/main.py +27 -100
  89. crypticorn/klines/client/__init__.py +21 -7
  90. crypticorn/klines/client/api/__init__.py +0 -1
  91. crypticorn/klines/client/api/funding_rates_api.py +90 -79
  92. crypticorn/klines/client/api/health_check_api.py +29 -45
  93. crypticorn/klines/client/api/ohlcv_data_api.py +104 -87
  94. crypticorn/klines/client/api/symbols_api.py +36 -54
  95. crypticorn/klines/client/api/udf_api.py +228 -352
  96. crypticorn/klines/client/api_client.py +106 -148
  97. crypticorn/klines/client/api_response.py +2 -3
  98. crypticorn/klines/client/configuration.py +64 -50
  99. crypticorn/klines/client/exceptions.py +20 -16
  100. crypticorn/klines/client/models/__init__.py +21 -7
  101. crypticorn/klines/client/models/base_response_health_check_response.py +21 -15
  102. crypticorn/klines/client/models/base_response_list_funding_rate_response.py +21 -15
  103. crypticorn/klines/client/models/base_response_list_str.py +16 -14
  104. crypticorn/klines/client/models/base_response_ohlcv_response.py +21 -15
  105. crypticorn/klines/client/models/error_response.py +23 -15
  106. crypticorn/klines/client/models/exchange.py +11 -11
  107. crypticorn/klines/client/models/funding_rate_response.py +11 -11
  108. crypticorn/klines/client/models/health_check_response.py +14 -12
  109. crypticorn/klines/client/models/history_error_response.py +11 -11
  110. crypticorn/klines/client/models/history_no_data_response.py +16 -16
  111. crypticorn/klines/client/models/history_success_response.py +16 -16
  112. crypticorn/klines/client/models/http_validation_error.py +14 -10
  113. crypticorn/klines/client/models/market.py +2 -4
  114. crypticorn/klines/client/models/ohlcv_response.py +22 -15
  115. crypticorn/klines/client/models/resolution.py +5 -7
  116. crypticorn/klines/client/models/response_get_history_udf_history_get.py +71 -22
  117. crypticorn/klines/client/models/search_symbol_response.py +22 -15
  118. crypticorn/klines/client/models/sort_direction.py +2 -4
  119. crypticorn/klines/client/models/symbol_group_response.py +5 -9
  120. crypticorn/klines/client/models/symbol_info_response.py +40 -24
  121. crypticorn/klines/client/models/symbol_type.py +5 -10
  122. crypticorn/klines/client/models/timeframe.py +5 -7
  123. crypticorn/klines/client/models/udf_config_response.py +60 -21
  124. crypticorn/klines/client/models/validation_error.py +19 -13
  125. crypticorn/klines/client/models/validation_error_loc_inner.py +32 -11
  126. crypticorn/klines/client/rest.py +30 -41
  127. crypticorn/klines/main.py +52 -15
  128. crypticorn/pay/__init__.py +2 -0
  129. crypticorn/pay/client/__init__.py +52 -0
  130. crypticorn/pay/client/api/__init__.py +7 -0
  131. crypticorn/pay/client/api/now_payments_api.py +813 -0
  132. crypticorn/pay/client/api/payments_api.py +799 -0
  133. crypticorn/pay/client/api/products_api.py +891 -0
  134. crypticorn/pay/client/api/status_api.py +260 -0
  135. crypticorn/pay/client/api_client.py +758 -0
  136. crypticorn/pay/client/api_response.py +20 -0
  137. crypticorn/pay/client/configuration.py +612 -0
  138. crypticorn/pay/client/exceptions.py +220 -0
  139. crypticorn/pay/client/models/__init__.py +32 -0
  140. crypticorn/pay/client/models/api_status_res.py +83 -0
  141. crypticorn/pay/client/models/combined_payment_history.py +101 -0
  142. crypticorn/pay/client/models/create_invoice_req.py +188 -0
  143. crypticorn/pay/client/models/create_invoice_res.py +188 -0
  144. crypticorn/pay/client/models/currency.py +165 -0
  145. crypticorn/pay/client/models/estimate_price_req.py +91 -0
  146. crypticorn/pay/client/models/estimate_price_res.py +102 -0
  147. crypticorn/pay/client/models/get_currencies_res.py +99 -0
  148. crypticorn/pay/client/models/get_payment_status_res.py +222 -0
  149. crypticorn/pay/client/models/get_payments_list_res.py +109 -0
  150. crypticorn/pay/client/models/http_validation_error.py +99 -0
  151. crypticorn/pay/client/models/min_amount_req.py +124 -0
  152. crypticorn/pay/client/models/min_amount_res.py +105 -0
  153. crypticorn/pay/client/models/now_api_status_res.py +83 -0
  154. crypticorn/pay/client/models/now_create_invoice_req.py +188 -0
  155. crypticorn/pay/client/models/now_create_invoice_res.py +188 -0
  156. crypticorn/pay/client/models/now_fee_structure.py +104 -0
  157. crypticorn/pay/client/models/now_payment_model.py +124 -0
  158. crypticorn/pay/client/models/now_payment_status.py +42 -0
  159. crypticorn/pay/client/models/now_webhook_payload.py +181 -0
  160. crypticorn/pay/client/models/payment.py +231 -0
  161. crypticorn/pay/client/models/payment_status.py +40 -0
  162. crypticorn/pay/client/models/product.py +87 -0
  163. crypticorn/pay/client/models/product_model.py +119 -0
  164. crypticorn/pay/client/models/product_subs_model.py +108 -0
  165. crypticorn/pay/client/models/services.py +34 -0
  166. crypticorn/pay/client/models/unified_payment_model.py +112 -0
  167. crypticorn/pay/client/models/validation_error.py +105 -0
  168. crypticorn/pay/client/models/validation_error_loc_inner.py +159 -0
  169. crypticorn/pay/client/py.typed +0 -0
  170. crypticorn/pay/client/rest.py +195 -0
  171. crypticorn/pay/main.py +35 -0
  172. crypticorn/trade/client/__init__.py +9 -4
  173. crypticorn/trade/client/api/__init__.py +0 -1
  174. crypticorn/trade/client/api/api_keys_api.py +203 -304
  175. crypticorn/trade/client/api/bots_api.py +177 -250
  176. crypticorn/trade/client/api/exchanges_api.py +38 -57
  177. crypticorn/trade/client/api/futures_trading_panel_api.py +223 -321
  178. crypticorn/trade/client/api/notifications_api.py +247 -364
  179. crypticorn/trade/client/api/orders_api.py +44 -63
  180. crypticorn/trade/client/api/status_api.py +35 -53
  181. crypticorn/trade/client/api/strategies_api.py +852 -64
  182. crypticorn/trade/client/api/trading_actions_api.py +126 -203
  183. crypticorn/trade/client/api_client.py +115 -154
  184. crypticorn/trade/client/api_response.py +2 -3
  185. crypticorn/trade/client/configuration.py +128 -90
  186. crypticorn/trade/client/exceptions.py +21 -17
  187. crypticorn/trade/client/models/__init__.py +9 -4
  188. crypticorn/trade/client/models/action_model.py +114 -50
  189. crypticorn/trade/client/models/api_error_identifier.py +60 -51
  190. crypticorn/trade/client/models/api_error_level.py +37 -0
  191. crypticorn/trade/client/models/api_error_type.py +37 -0
  192. crypticorn/trade/client/models/api_key_model.py +49 -28
  193. crypticorn/trade/client/models/bot_model.py +76 -31
  194. crypticorn/trade/client/models/bot_status.py +37 -0
  195. crypticorn/trade/client/models/exchange.py +3 -5
  196. crypticorn/trade/client/models/execution_ids.py +14 -14
  197. crypticorn/trade/client/models/futures_balance.py +39 -23
  198. crypticorn/trade/client/models/futures_trading_action.py +98 -46
  199. crypticorn/trade/client/models/http_validation_error.py +15 -11
  200. crypticorn/trade/client/models/margin_mode.py +3 -5
  201. crypticorn/trade/client/models/market_type.py +3 -5
  202. crypticorn/trade/client/models/notification_model.py +60 -27
  203. crypticorn/trade/client/models/notification_type.py +4 -6
  204. crypticorn/trade/client/models/order_model.py +125 -65
  205. crypticorn/trade/client/models/order_status.py +6 -8
  206. crypticorn/trade/client/models/post_futures_action.py +16 -12
  207. crypticorn/trade/client/models/strategy_exchange_info.py +11 -12
  208. crypticorn/trade/client/models/strategy_model.py +66 -27
  209. crypticorn/trade/client/models/strategy_model_input.py +160 -0
  210. crypticorn/trade/client/models/strategy_model_output.py +160 -0
  211. crypticorn/trade/client/models/tpsl.py +35 -21
  212. crypticorn/trade/client/models/trading_action_type.py +5 -7
  213. crypticorn/trade/client/models/update_notification.py +17 -13
  214. crypticorn/trade/client/models/validation_error.py +20 -14
  215. crypticorn/trade/client/models/validation_error_loc_inner.py +33 -12
  216. crypticorn/trade/client/rest.py +108 -170
  217. crypticorn/trade/main.py +26 -19
  218. crypticorn-2.0.0.dist-info/METADATA +74 -0
  219. crypticorn-2.0.0.dist-info/RECORD +226 -0
  220. {crypticorn-1.0.2rc3.dist-info → crypticorn-2.0.0.dist-info}/WHEEL +1 -1
  221. crypticorn/hive/requirements.txt +0 -4
  222. crypticorn/hive/utils.py +0 -109
  223. crypticorn/klines/requirements.txt +0 -4
  224. crypticorn/klines/test/test_base_response_health_check_response.py +0 -56
  225. crypticorn/klines/test/test_base_response_list_funding_rate_response.py +0 -59
  226. crypticorn/klines/test/test_base_response_list_str.py +0 -56
  227. crypticorn/klines/test/test_base_response_ohlcv_response.py +0 -72
  228. crypticorn/klines/test/test_error_response.py +0 -57
  229. crypticorn/klines/test/test_exchange.py +0 -56
  230. crypticorn/klines/test/test_funding_rate_response.py +0 -56
  231. crypticorn/klines/test/test_funding_rates_api.py +0 -38
  232. crypticorn/klines/test/test_health_check_api.py +0 -38
  233. crypticorn/klines/test/test_health_check_response.py +0 -52
  234. crypticorn/klines/test/test_history_error_response.py +0 -53
  235. crypticorn/klines/test/test_history_no_data_response.py +0 -69
  236. crypticorn/klines/test/test_history_success_response.py +0 -87
  237. crypticorn/klines/test/test_http_validation_error.py +0 -58
  238. crypticorn/klines/test/test_market.py +0 -33
  239. crypticorn/klines/test/test_ohlcv_data_api.py +0 -38
  240. crypticorn/klines/test/test_ohlcv_response.py +0 -86
  241. crypticorn/klines/test/test_resolution.py +0 -33
  242. crypticorn/klines/test/test_response_get_history_udf_history_get.py +0 -89
  243. crypticorn/klines/test/test_search_symbol_response.py +0 -62
  244. crypticorn/klines/test/test_sort_direction.py +0 -33
  245. crypticorn/klines/test/test_symbol_group_response.py +0 -53
  246. crypticorn/klines/test/test_symbol_info_response.py +0 -84
  247. crypticorn/klines/test/test_symbol_type.py +0 -54
  248. crypticorn/klines/test/test_symbols_api.py +0 -38
  249. crypticorn/klines/test/test_timeframe.py +0 -33
  250. crypticorn/klines/test/test_udf_api.py +0 -80
  251. crypticorn/klines/test/test_udf_config_response.py +0 -95
  252. crypticorn/klines/test/test_validation_error.py +0 -60
  253. crypticorn/klines/test/test_validation_error_loc_inner.py +0 -50
  254. crypticorn/trade/requirements.txt +0 -4
  255. crypticorn-1.0.2rc3.dist-info/LICENSE.md +0 -19
  256. crypticorn-1.0.2rc3.dist-info/METADATA +0 -47
  257. crypticorn-1.0.2rc3.dist-info/RECORD +0 -128
  258. /crypticorn/{klines/test/__init__.py → auth/client/py.typed} +0 -0
  259. {crypticorn-1.0.2rc3.dist-info → crypticorn-2.0.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,432 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ApiErrorType(str, Enum):
5
+ """Type of API error"""
6
+
7
+ USER_ERROR = "user error"
8
+ """user error by people using our services"""
9
+ EXCHANGE_ERROR = "exchange error"
10
+ """re-tryable error by the exchange or network conditions"""
11
+ SERVER_ERROR = "server error"
12
+ """server error that needs a new version rollout for a fix"""
13
+ NO_ERROR = "no error"
14
+ """error that does not need to be handled or does not affect the program or is a placeholder."""
15
+
16
+
17
+ class ApiErrorIdentifier(str, Enum):
18
+ """API error identifiers"""
19
+
20
+ SUCCESS = "success"
21
+ UNAUTHORIZED = "invalid_api_key"
22
+ INVALID_SIGNATURE = "invalid_signature"
23
+ INVALID_TIMESTAMP = "invalid_timestamp"
24
+ IP_RESTRICTED = "ip_address_is_not_authorized"
25
+ PERMISSION_DENIED = "insufficient_permissions_spot_and_futures_required"
26
+ USER_FROZEN = "user_account_is_frozen"
27
+ RATE_LIMIT = "rate_limit_exceeded"
28
+ INVALID_PARAMETER = "invalid_parameter_provided"
29
+ REQUEST_SCOPE_EXCEEDED = "request_scope_limit_exceeded"
30
+ CONTENT_TYPE_ERROR = "invalid_content_type"
31
+ URL_NOT_FOUND = "requested_resource_not_found"
32
+ ORDER_NOT_FOUND = "order_does_not_exist"
33
+ ORDER_ALREADY_FILLED = "order_is_already_filled"
34
+ ORDER_IN_PROCESS = "order_is_being_processed"
35
+ ORDER_LIMIT_EXCEEDED = "order_quantity_limit_exceeded"
36
+ ORDER_PRICE_INVALID = "order_price_is_invalid"
37
+ POST_ONLY_REJECTED = "post_only_order_would_immediately_match"
38
+ SYMBOL_NOT_FOUND = "symbol_does_not_exist"
39
+ CLIENT_ORDER_ID_REPEATED = "client_order_id_already_exists"
40
+
41
+ POSITION_NOT_FOUND = "position_does_not_exist"
42
+ POSITION_LIMIT_EXCEEDED = "position_limit_exceeded"
43
+ POSITION_SUSPENDED = "position_opening_temporarily_suspended"
44
+ INSUFFICIENT_BALANCE = "insufficient_balance"
45
+ INSUFFICIENT_MARGIN = "insufficient_margin"
46
+
47
+ LEVERAGE_EXCEEDED = "leverage_limit_exceeded"
48
+ RISK_LIMIT_EXCEEDED = "risk_limit_exceeded"
49
+ LIQUIDATION_PRICE_VIOLATION = "order_violates_liquidation_price_constraints"
50
+ INVALID_MARGIN_MODE = "invalid_margin_mode"
51
+
52
+ SYSTEM_ERROR = "internal_system_error"
53
+ SYSTEM_CONFIG_ERROR = "system_configuration_error"
54
+ SERVICE_UNAVAILABLE = "service_temporarily_unavailable"
55
+ SYSTEM_BUSY = "system_is_busy_please_try_again_later"
56
+ MAINTENANCE = "system_under_maintenance"
57
+ RPC_TIMEOUT = "rpc_timeout"
58
+ SETTLEMENT_IN_PROGRESS = "system_settlement_in_process"
59
+
60
+ TRADING_SUSPENDED = "trading_is_suspended"
61
+ TRADING_LOCKED = "trading_has_been_locked"
62
+
63
+ UNKNOWN_ERROR = "unknown_error_occurred"
64
+ HTTP_ERROR = "http_request_error"
65
+ BLACK_SWAN = "black_swan"
66
+
67
+ # our bot errors
68
+ ACTION_EXPIRED = "trading_action_expired"
69
+ ACTION_SKIPPED = "trading_action_skipped"
70
+ BOT_DISABLED = "bot_disabled"
71
+ ORDER_SIZE_TOO_SMALL = "order_size_too_small"
72
+ ORDER_SIZE_TOO_LARGE = "order_size_too_large"
73
+ HEDGE_MODE_NOT_ACTIVE = "hedge_mode_not_active"
74
+
75
+ # our API errors
76
+ API_KEY_ALREADY_EXISTS = "api_key_already_exists"
77
+ DELETE_BOT_ERROR = "delete_bot_error"
78
+ JWT_EXPIRED = "jwt_expired"
79
+ BOT_STOPPING_COMPLETED = "bot_stopping_completed"
80
+ OBJECT_NOT_FOUND = "object_not_found"
81
+ STRATEGY_DISABLED = "strategy_disabled"
82
+ API_KEY_IN_USE = "api_key_in_use_by_bots"
83
+ BOT_ALREADY_DELETED = "bot_already_deleted"
84
+
85
+ # our auth errors
86
+ INVALID_API_KEY = "invalid_api_key"
87
+ INVALID_BEARER = "invalid_bearer"
88
+ NO_CREDENTIALS = "no_credentials"
89
+ INSUFFICIENT_SCOPES = "insufficient_scopes"
90
+
91
+
92
+ class ApiErrorLevel(str, Enum):
93
+ ERROR = "error"
94
+ SUCCESS = "success"
95
+ INFO = "info"
96
+ WARNING = "warning"
97
+
98
+
99
+ class ApiError(Enum):
100
+ """API error codes"""
101
+
102
+ # Success
103
+ SUCCESS = (ApiErrorIdentifier.SUCCESS, ApiErrorType.NO_ERROR, ApiErrorLevel.SUCCESS)
104
+ # Authentication/Authorization
105
+ UNAUTHORIZED = (
106
+ ApiErrorIdentifier.UNAUTHORIZED,
107
+ ApiErrorType.SERVER_ERROR,
108
+ ApiErrorLevel.ERROR,
109
+ )
110
+ INVALID_SIGNATURE = (
111
+ ApiErrorIdentifier.INVALID_SIGNATURE,
112
+ ApiErrorType.SERVER_ERROR,
113
+ ApiErrorLevel.ERROR,
114
+ )
115
+ INVALID_TIMESTAMP = (
116
+ ApiErrorIdentifier.INVALID_TIMESTAMP,
117
+ ApiErrorType.SERVER_ERROR,
118
+ ApiErrorLevel.ERROR,
119
+ )
120
+ IP_RESTRICTED = (
121
+ ApiErrorIdentifier.IP_RESTRICTED,
122
+ ApiErrorType.SERVER_ERROR,
123
+ ApiErrorLevel.ERROR,
124
+ )
125
+ PERMISSION_DENIED = (
126
+ ApiErrorIdentifier.PERMISSION_DENIED,
127
+ ApiErrorType.USER_ERROR,
128
+ ApiErrorLevel.ERROR,
129
+ )
130
+ USER_FROZEN = (
131
+ ApiErrorIdentifier.USER_FROZEN,
132
+ ApiErrorType.USER_ERROR,
133
+ ApiErrorLevel.ERROR,
134
+ )
135
+
136
+ # Rate Limiting
137
+ RATE_LIMIT = (
138
+ ApiErrorIdentifier.RATE_LIMIT,
139
+ ApiErrorType.EXCHANGE_ERROR,
140
+ ApiErrorLevel.ERROR,
141
+ )
142
+
143
+ # Invalid Parameters
144
+ INVALID_PARAMETER = (
145
+ ApiErrorIdentifier.INVALID_PARAMETER,
146
+ ApiErrorType.SERVER_ERROR,
147
+ ApiErrorLevel.ERROR,
148
+ )
149
+ REQUEST_SCOPE_EXCEEDED = (
150
+ ApiErrorIdentifier.REQUEST_SCOPE_EXCEEDED,
151
+ ApiErrorType.EXCHANGE_ERROR,
152
+ ApiErrorLevel.ERROR,
153
+ )
154
+ CONTENT_TYPE_ERROR = (
155
+ ApiErrorIdentifier.CONTENT_TYPE_ERROR,
156
+ ApiErrorType.SERVER_ERROR,
157
+ ApiErrorLevel.ERROR,
158
+ )
159
+ URL_NOT_FOUND = (
160
+ ApiErrorIdentifier.URL_NOT_FOUND,
161
+ ApiErrorType.SERVER_ERROR,
162
+ ApiErrorLevel.ERROR,
163
+ )
164
+ SYMBOL_NOT_FOUND = (
165
+ ApiErrorIdentifier.SYMBOL_NOT_FOUND,
166
+ ApiErrorType.SERVER_ERROR,
167
+ ApiErrorLevel.ERROR,
168
+ )
169
+
170
+ # Order Related
171
+ ORDER_NOT_FOUND = (
172
+ ApiErrorIdentifier.ORDER_NOT_FOUND,
173
+ ApiErrorType.SERVER_ERROR,
174
+ ApiErrorLevel.ERROR,
175
+ )
176
+ ORDER_ALREADY_FILLED = (
177
+ ApiErrorIdentifier.ORDER_ALREADY_FILLED,
178
+ ApiErrorType.SERVER_ERROR,
179
+ ApiErrorLevel.INFO,
180
+ )
181
+ ORDER_IN_PROCESS = (
182
+ ApiErrorIdentifier.ORDER_IN_PROCESS,
183
+ ApiErrorType.NO_ERROR,
184
+ ApiErrorLevel.INFO,
185
+ )
186
+ ORDER_LIMIT_EXCEEDED = (
187
+ ApiErrorIdentifier.ORDER_LIMIT_EXCEEDED,
188
+ ApiErrorType.USER_ERROR,
189
+ ApiErrorLevel.ERROR,
190
+ )
191
+ ORDER_PRICE_INVALID = (
192
+ ApiErrorIdentifier.ORDER_PRICE_INVALID,
193
+ ApiErrorType.SERVER_ERROR,
194
+ ApiErrorLevel.ERROR,
195
+ )
196
+ POST_ONLY_REJECTED = (
197
+ ApiErrorIdentifier.POST_ONLY_REJECTED,
198
+ ApiErrorType.SERVER_ERROR,
199
+ ApiErrorLevel.ERROR,
200
+ )
201
+ BLACK_SWAN = (
202
+ ApiErrorIdentifier.BLACK_SWAN,
203
+ ApiErrorType.USER_ERROR,
204
+ ApiErrorLevel.INFO,
205
+ )
206
+ CLIENT_ORDER_ID_REPEATED = (
207
+ ApiErrorIdentifier.CLIENT_ORDER_ID_REPEATED,
208
+ ApiErrorType.SERVER_ERROR,
209
+ ApiErrorLevel.ERROR,
210
+ )
211
+ # CONTRA_ORDER_MISSING = "No contra order available"
212
+
213
+ # Position Related
214
+ POSITION_NOT_FOUND = (
215
+ ApiErrorIdentifier.POSITION_NOT_FOUND,
216
+ ApiErrorType.NO_ERROR,
217
+ ApiErrorLevel.INFO,
218
+ ) # not an error because user can close a position manually which we don't know about
219
+ POSITION_LIMIT_EXCEEDED = (
220
+ ApiErrorIdentifier.POSITION_LIMIT_EXCEEDED,
221
+ ApiErrorType.USER_ERROR,
222
+ ApiErrorLevel.ERROR,
223
+ )
224
+ POSITION_SUSPENDED = (
225
+ ApiErrorIdentifier.POSITION_SUSPENDED,
226
+ ApiErrorType.EXCHANGE_ERROR,
227
+ ApiErrorLevel.ERROR,
228
+ )
229
+ # FUTURES_BRAWL_RESTRICTED = "Operation restricted for Futures Brawl", ApiErrorType.USER_ERROR
230
+
231
+ # Balance/Margin
232
+ INSUFFICIENT_BALANCE = (
233
+ ApiErrorIdentifier.INSUFFICIENT_BALANCE,
234
+ ApiErrorType.USER_ERROR,
235
+ ApiErrorLevel.ERROR,
236
+ )
237
+ INSUFFICIENT_MARGIN = (
238
+ ApiErrorIdentifier.INSUFFICIENT_MARGIN,
239
+ ApiErrorType.USER_ERROR,
240
+ ApiErrorLevel.ERROR,
241
+ )
242
+
243
+ # Leverage/Risk
244
+ LEVERAGE_EXCEEDED = (
245
+ ApiErrorIdentifier.LEVERAGE_EXCEEDED,
246
+ ApiErrorType.SERVER_ERROR,
247
+ ApiErrorLevel.ERROR,
248
+ )
249
+ RISK_LIMIT_EXCEEDED = (
250
+ ApiErrorIdentifier.RISK_LIMIT_EXCEEDED,
251
+ ApiErrorType.SERVER_ERROR,
252
+ ApiErrorLevel.ERROR,
253
+ )
254
+ LIQUIDATION_PRICE_VIOLATION = (
255
+ ApiErrorIdentifier.LIQUIDATION_PRICE_VIOLATION,
256
+ ApiErrorType.SERVER_ERROR,
257
+ ApiErrorLevel.ERROR,
258
+ )
259
+ INVALID_MARGIN_MODE = (
260
+ ApiErrorIdentifier.INVALID_MARGIN_MODE,
261
+ ApiErrorType.SERVER_ERROR,
262
+ ApiErrorLevel.ERROR,
263
+ )
264
+
265
+ # System Status
266
+ SYSTEM_ERROR = (
267
+ ApiErrorIdentifier.SYSTEM_ERROR,
268
+ ApiErrorType.EXCHANGE_ERROR,
269
+ ApiErrorLevel.ERROR,
270
+ )
271
+ SYSTEM_CONFIG_ERROR = (
272
+ ApiErrorIdentifier.SYSTEM_CONFIG_ERROR,
273
+ ApiErrorType.EXCHANGE_ERROR,
274
+ ApiErrorLevel.ERROR,
275
+ )
276
+ SERVICE_UNAVAILABLE = (
277
+ ApiErrorIdentifier.SERVICE_UNAVAILABLE,
278
+ ApiErrorType.EXCHANGE_ERROR,
279
+ ApiErrorLevel.ERROR,
280
+ )
281
+ SYSTEM_BUSY = (
282
+ ApiErrorIdentifier.SYSTEM_BUSY,
283
+ ApiErrorType.EXCHANGE_ERROR,
284
+ ApiErrorLevel.ERROR,
285
+ )
286
+ MAINTENANCE = (
287
+ ApiErrorIdentifier.MAINTENANCE,
288
+ ApiErrorType.EXCHANGE_ERROR,
289
+ ApiErrorLevel.ERROR,
290
+ )
291
+ RPC_TIMEOUT = (
292
+ ApiErrorIdentifier.RPC_TIMEOUT,
293
+ ApiErrorType.EXCHANGE_ERROR,
294
+ ApiErrorLevel.ERROR,
295
+ )
296
+ SETTLEMENT_IN_PROGRESS = (
297
+ ApiErrorIdentifier.SETTLEMENT_IN_PROGRESS,
298
+ ApiErrorType.EXCHANGE_ERROR,
299
+ ApiErrorLevel.ERROR,
300
+ )
301
+
302
+ # Trading Status
303
+ TRADING_SUSPENDED = (
304
+ ApiErrorIdentifier.TRADING_SUSPENDED,
305
+ ApiErrorType.EXCHANGE_ERROR,
306
+ ApiErrorLevel.ERROR,
307
+ )
308
+ TRADING_LOCKED = (
309
+ ApiErrorIdentifier.TRADING_LOCKED,
310
+ ApiErrorType.EXCHANGE_ERROR,
311
+ ApiErrorLevel.ERROR,
312
+ )
313
+
314
+ # Generic
315
+ UNKNOWN_ERROR = (
316
+ ApiErrorIdentifier.UNKNOWN_ERROR,
317
+ ApiErrorType.EXCHANGE_ERROR,
318
+ ApiErrorLevel.ERROR,
319
+ )
320
+ HTTP_ERROR = (
321
+ ApiErrorIdentifier.HTTP_ERROR,
322
+ ApiErrorType.EXCHANGE_ERROR,
323
+ ApiErrorLevel.ERROR,
324
+ )
325
+
326
+ # Our Bot Errors
327
+ ACTION_EXPIRED = (
328
+ ApiErrorIdentifier.ACTION_EXPIRED,
329
+ ApiErrorType.NO_ERROR,
330
+ ApiErrorLevel.INFO,
331
+ )
332
+ ACTION_SKIPPED = (
333
+ ApiErrorIdentifier.ACTION_SKIPPED,
334
+ ApiErrorType.NO_ERROR,
335
+ ApiErrorLevel.INFO,
336
+ )
337
+ BOT_DISABLED = (
338
+ ApiErrorIdentifier.BOT_DISABLED,
339
+ ApiErrorType.USER_ERROR,
340
+ ApiErrorLevel.WARNING,
341
+ )
342
+ ORDER_SIZE_TOO_SMALL = (
343
+ ApiErrorIdentifier.ORDER_SIZE_TOO_SMALL,
344
+ ApiErrorType.USER_ERROR,
345
+ ApiErrorLevel.WARNING,
346
+ )
347
+ ORDER_SIZE_TOO_LARGE = (
348
+ ApiErrorIdentifier.ORDER_SIZE_TOO_LARGE,
349
+ ApiErrorType.USER_ERROR,
350
+ ApiErrorLevel.WARNING,
351
+ )
352
+ HEDGE_MODE_NOT_ACTIVE = (
353
+ ApiErrorIdentifier.HEDGE_MODE_NOT_ACTIVE,
354
+ ApiErrorType.USER_ERROR,
355
+ ApiErrorLevel.ERROR,
356
+ )
357
+
358
+ # our API errors
359
+ API_KEY_ALREADY_EXISTS = (
360
+ ApiErrorIdentifier.API_KEY_ALREADY_EXISTS,
361
+ ApiErrorType.USER_ERROR,
362
+ ApiErrorLevel.ERROR,
363
+ )
364
+ DELETE_BOT_ERROR = (
365
+ ApiErrorIdentifier.DELETE_BOT_ERROR,
366
+ ApiErrorType.SERVER_ERROR,
367
+ ApiErrorLevel.ERROR,
368
+ )
369
+ JWT_EXPIRED = (
370
+ ApiErrorIdentifier.JWT_EXPIRED,
371
+ ApiErrorType.SERVER_ERROR,
372
+ ApiErrorLevel.ERROR,
373
+ )
374
+ BOT_STOPPING_COMPLETED = (
375
+ ApiErrorIdentifier.BOT_STOPPING_COMPLETED,
376
+ ApiErrorType.NO_ERROR,
377
+ ApiErrorLevel.INFO,
378
+ )
379
+ OBJECT_NOT_FOUND = (
380
+ ApiErrorIdentifier.OBJECT_NOT_FOUND,
381
+ ApiErrorType.SERVER_ERROR,
382
+ ApiErrorLevel.ERROR,
383
+ )
384
+ STRATEGY_DISABLED = (
385
+ ApiErrorIdentifier.STRATEGY_DISABLED,
386
+ ApiErrorType.SERVER_ERROR,
387
+ ApiErrorLevel.ERROR,
388
+ )
389
+ API_KEY_IN_USE = (
390
+ ApiErrorIdentifier.API_KEY_IN_USE,
391
+ ApiErrorType.SERVER_ERROR,
392
+ ApiErrorLevel.ERROR,
393
+ )
394
+ BOT_ALREADY_DELETED = (
395
+ ApiErrorIdentifier.BOT_ALREADY_DELETED,
396
+ ApiErrorType.SERVER_ERROR,
397
+ ApiErrorLevel.ERROR,
398
+ )
399
+
400
+ # our auth errors
401
+ INVALID_API_KEY = (
402
+ ApiErrorIdentifier.INVALID_API_KEY,
403
+ ApiErrorType.USER_ERROR,
404
+ ApiErrorLevel.ERROR,
405
+ )
406
+ INVALID_BEARER = (
407
+ ApiErrorIdentifier.INVALID_BEARER,
408
+ ApiErrorType.USER_ERROR,
409
+ ApiErrorLevel.ERROR,
410
+ )
411
+ NO_CREDENTIALS = (
412
+ ApiErrorIdentifier.NO_CREDENTIALS,
413
+ ApiErrorType.USER_ERROR,
414
+ ApiErrorLevel.ERROR,
415
+ )
416
+ INSUFFICIENT_SCOPES = (
417
+ ApiErrorIdentifier.INSUFFICIENT_SCOPES,
418
+ ApiErrorType.USER_ERROR,
419
+ ApiErrorLevel.ERROR,
420
+ )
421
+
422
+ @property
423
+ def identifier(self) -> str:
424
+ return self.value[0]
425
+
426
+ @property
427
+ def type(self) -> ApiErrorType:
428
+ return self.value[1]
429
+
430
+ @property
431
+ def level(self) -> ApiErrorLevel:
432
+ return self.value[2]
@@ -0,0 +1,29 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ApiScope(str, Enum):
5
+ """
6
+ The permission scopes for the API.
7
+ """
8
+
9
+ # Hive scopes
10
+ HIVE_MODEL_READ = "hive:model:read"
11
+ HIVE_DATA_READ = "hive:data:read"
12
+ HIVE_MODEL_WRITE = "hive:model:write"
13
+ HIVE_DATA_WRITE = "hive:data:write"
14
+
15
+ # Trade scopes
16
+ TRADE_BOTS_READ = "trade:bots:read"
17
+ TRADE_BOTS_WRITE = "trade:bots:write"
18
+ TRADE_API_KEYS_READ = "trade:api_keys:read"
19
+ TRADE_API_KEYS_WRITE = "trade:api_keys:write"
20
+ TRADE_ORDERS_READ = "trade:orders:read"
21
+ TRADE_ACTIONS_READ = "trade:actions:read"
22
+ TRADE_ACTIONS_WRITE = "trade:actions:write"
23
+ TRADE_EXCHANGES_READ = "trade:exchanges:read"
24
+ TRADE_FUTURES_READ = "trade:futures:read"
25
+ TRADE_FUTURES_WRITE = "trade:futures:write"
26
+ TRADE_NOTIFICATIONS_READ = "trade:notifications:read"
27
+ TRADE_NOTIFICATIONS_WRITE = "trade:notifications:write"
28
+ TRADE_STRATEGIES_READ = "trade:strategies:read"
29
+ TRADE_STRATEGIES_WRITE = "trade:strategies:write"
@@ -0,0 +1,25 @@
1
+ from enum import Enum
2
+
3
+
4
+ class Domain(Enum):
5
+ PROD = "crypticorn.com"
6
+ DEV = "crypticorn.dev"
7
+
8
+
9
+ class BaseURL(Enum):
10
+ PROD = "https://api.crypticorn.com"
11
+ DEV = "https://api.crypticorn.dev"
12
+ LOCAL = "http://localhost"
13
+ DOCKER = "http://host.docker.internal"
14
+
15
+
16
+ class ApiVersion(Enum):
17
+ V1 = "v1"
18
+
19
+
20
+ class Service(Enum):
21
+ HIVE = "hive"
22
+ KLINES = "klines"
23
+ PAY = "pay"
24
+ TRADE = "trade"
25
+ AUTH = "auth"
@@ -1 +1,2 @@
1
- from crypticorn.hive.main import HiveClient
1
+ from crypticorn.hive.client import *
2
+ from crypticorn.hive.main import HiveClient
@@ -0,0 +1,57 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+
5
+ """
6
+ Hive AI API
7
+
8
+ API for Hive AI model training and evaluation
9
+
10
+ The version of the OpenAPI document: 1.0.0
11
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
12
+
13
+ Do not edit the class manually.
14
+ """ # noqa: E501
15
+
16
+
17
+ __version__ = "1.0.0"
18
+
19
+ # import apis into sdk package
20
+ from crypticorn.hive.client.api.data_api import DataApi
21
+ from crypticorn.hive.client.api.models_api import ModelsApi
22
+ from crypticorn.hive.client.api.status_api import StatusApi
23
+
24
+ # import ApiClient
25
+ from crypticorn.hive.client.api_response import ApiResponse
26
+ from crypticorn.hive.client.api_client import ApiClient
27
+ from crypticorn.hive.client.configuration import Configuration
28
+ from crypticorn.hive.client.exceptions import OpenApiException
29
+ from crypticorn.hive.client.exceptions import ApiTypeError
30
+ from crypticorn.hive.client.exceptions import ApiValueError
31
+ from crypticorn.hive.client.exceptions import ApiKeyError
32
+ from crypticorn.hive.client.exceptions import ApiAttributeError
33
+ from crypticorn.hive.client.exceptions import ApiException
34
+
35
+ # import models into sdk package
36
+ from crypticorn.hive.client.models.coins import Coins
37
+ from crypticorn.hive.client.models.data_download_response import DataDownloadResponse
38
+ from crypticorn.hive.client.models.data_info import DataInfo
39
+ from crypticorn.hive.client.models.data_value_value_value_inner import (
40
+ DataValueValueValueInner,
41
+ )
42
+ from crypticorn.hive.client.models.data_version import DataVersion
43
+ from crypticorn.hive.client.models.download_links import DownloadLinks
44
+ from crypticorn.hive.client.models.evaluation import Evaluation
45
+ from crypticorn.hive.client.models.evaluation_response import EvaluationResponse
46
+ from crypticorn.hive.client.models.feature_size import FeatureSize
47
+ from crypticorn.hive.client.models.http_validation_error import HTTPValidationError
48
+ from crypticorn.hive.client.models.model import Model
49
+ from crypticorn.hive.client.models.model_create import ModelCreate
50
+ from crypticorn.hive.client.models.model_status import ModelStatus
51
+ from crypticorn.hive.client.models.model_update import ModelUpdate
52
+ from crypticorn.hive.client.models.target import Target
53
+ from crypticorn.hive.client.models.target_type import TargetType
54
+ from crypticorn.hive.client.models.validation_error import ValidationError
55
+ from crypticorn.hive.client.models.validation_error_loc_inner import (
56
+ ValidationErrorLocInner,
57
+ )
@@ -0,0 +1,6 @@
1
+ # flake8: noqa
2
+
3
+ # import apis into api package
4
+ from crypticorn.hive.client.api.data_api import DataApi
5
+ from crypticorn.hive.client.api.models_api import ModelsApi
6
+ from crypticorn.hive.client.api.status_api import StatusApi