crypticorn 2.4.3__py3-none-any.whl → 2.4.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/auth/client/__init__.py +5 -5
- crypticorn/auth/client/api/admin_api.py +6 -6
- crypticorn/auth/client/api/auth_api.py +5 -5
- crypticorn/auth/client/api/service_api.py +5 -5
- crypticorn/auth/client/api/user_api.py +8 -8
- crypticorn/auth/client/api/wallet_api.py +5 -5
- crypticorn/auth/client/api_client.py +5 -5
- crypticorn/auth/client/configuration.py +13 -6
- crypticorn/auth/client/exceptions.py +5 -5
- crypticorn/auth/client/models/__init__.py +5 -5
- crypticorn/auth/client/models/add_wallet200_response.py +5 -5
- crypticorn/auth/client/models/add_wallet_request.py +5 -5
- crypticorn/auth/client/models/authorize_user200_response.py +5 -5
- crypticorn/auth/client/models/authorize_user200_response_auth.py +5 -5
- crypticorn/auth/client/models/authorize_user_request.py +5 -5
- crypticorn/auth/client/models/create_api_key200_response.py +5 -5
- crypticorn/auth/client/models/create_api_key_request.py +5 -5
- crypticorn/auth/client/models/create_user_request.py +5 -5
- crypticorn/auth/client/models/get_api_keys200_response_inner.py +5 -5
- crypticorn/auth/client/models/list_wallets200_response.py +5 -5
- crypticorn/auth/client/models/list_wallets200_response_balances_inner.py +5 -5
- crypticorn/auth/client/models/list_wallets200_response_balances_inner_sale_round.py +5 -5
- crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet.py +5 -5
- crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet_vesting_wallets_inner.py +5 -5
- crypticorn/auth/client/models/list_wallets200_response_data_inner.py +5 -5
- crypticorn/auth/client/models/list_wallets200_response_user_value.py +5 -5
- crypticorn/auth/client/models/logout_default_response.py +5 -5
- crypticorn/auth/client/models/logout_default_response_issues_inner.py +5 -5
- crypticorn/auth/client/models/oauth_callback200_response.py +5 -5
- crypticorn/auth/client/models/oauth_callback200_response_user.py +5 -5
- crypticorn/auth/client/models/refresh_token_info200_response.py +5 -5
- crypticorn/auth/client/models/refresh_token_info200_response_user_session.py +5 -5
- crypticorn/auth/client/models/resend_verification_email_request.py +5 -5
- crypticorn/auth/client/models/revoke_user_tokens_request.py +5 -5
- crypticorn/auth/client/models/rotate_tokens200_response.py +5 -5
- crypticorn/auth/client/models/token_info200_response.py +5 -5
- crypticorn/auth/client/models/unlink_wallet_request.py +5 -5
- crypticorn/auth/client/models/update_user_request.py +8 -6
- crypticorn/auth/client/models/user_reset_password_request.py +5 -5
- crypticorn/auth/client/models/user_set_password_request.py +5 -5
- crypticorn/auth/client/models/verify200_response.py +5 -5
- crypticorn/auth/client/models/verify_email200_response.py +5 -5
- crypticorn/auth/client/models/verify_email200_response_auth.py +5 -5
- crypticorn/auth/client/models/verify_email200_response_auth_auth.py +5 -5
- crypticorn/auth/client/models/verify_email_request.py +5 -5
- crypticorn/auth/client/models/verify_wallet_request.py +5 -5
- crypticorn/auth/client/models/wallet_verified200_response.py +5 -5
- crypticorn/auth/client/models/whoami200_response.py +5 -5
- crypticorn/auth/client/rest.py +9 -6
- crypticorn/client.py +28 -11
- crypticorn/common/auth.py +1 -1
- crypticorn/common/errors.py +11 -14
- crypticorn/common/scopes.py +5 -0
- crypticorn/common/sorter.py +2 -2
- crypticorn/common/utils.py +4 -2
- crypticorn/hive/client/__init__.py +5 -5
- crypticorn/hive/client/api/data_api.py +5 -5
- crypticorn/hive/client/api/models_api.py +5 -5
- crypticorn/hive/client/api/status_api.py +5 -5
- crypticorn/hive/client/api_client.py +5 -5
- crypticorn/hive/client/configuration.py +5 -5
- crypticorn/hive/client/exceptions.py +5 -5
- crypticorn/hive/client/models/__init__.py +5 -5
- crypticorn/hive/client/models/coins.py +5 -5
- crypticorn/hive/client/models/data_download_response.py +5 -5
- crypticorn/hive/client/models/data_info.py +5 -5
- crypticorn/hive/client/models/data_value_value_value_inner.py +5 -5
- crypticorn/hive/client/models/data_version.py +5 -5
- crypticorn/hive/client/models/download_links.py +5 -5
- crypticorn/hive/client/models/evaluation.py +5 -5
- crypticorn/hive/client/models/evaluation_response.py +5 -5
- crypticorn/hive/client/models/feature_size.py +5 -5
- crypticorn/hive/client/models/http_validation_error.py +5 -5
- crypticorn/hive/client/models/model.py +5 -5
- crypticorn/hive/client/models/model_create.py +5 -5
- crypticorn/hive/client/models/model_status.py +5 -5
- crypticorn/hive/client/models/model_update.py +5 -5
- crypticorn/hive/client/models/target.py +5 -5
- crypticorn/hive/client/models/target_type.py +5 -5
- crypticorn/hive/client/models/validation_error.py +5 -5
- crypticorn/hive/client/models/validation_error_loc_inner.py +5 -5
- crypticorn/hive/client/rest.py +5 -5
- crypticorn/klines/client/__init__.py +5 -5
- crypticorn/klines/client/api/funding_rates_api.py +5 -5
- crypticorn/klines/client/api/health_check_api.py +5 -5
- crypticorn/klines/client/api/ohlcv_data_api.py +5 -5
- crypticorn/klines/client/api/symbols_api.py +5 -5
- crypticorn/klines/client/api/udf_api.py +5 -5
- crypticorn/klines/client/api_client.py +5 -5
- crypticorn/klines/client/configuration.py +5 -5
- crypticorn/klines/client/exceptions.py +5 -5
- crypticorn/klines/client/models/__init__.py +5 -5
- crypticorn/klines/client/models/base_response_health_check_response.py +5 -5
- crypticorn/klines/client/models/base_response_list_funding_rate_response.py +5 -5
- crypticorn/klines/client/models/base_response_list_str.py +5 -5
- crypticorn/klines/client/models/base_response_ohlcv_response.py +5 -5
- crypticorn/klines/client/models/error_response.py +5 -5
- crypticorn/klines/client/models/exchange.py +5 -5
- crypticorn/klines/client/models/funding_rate_response.py +5 -5
- crypticorn/klines/client/models/health_check_response.py +5 -5
- crypticorn/klines/client/models/history_error_response.py +5 -5
- crypticorn/klines/client/models/history_no_data_response.py +5 -5
- crypticorn/klines/client/models/history_success_response.py +5 -5
- crypticorn/klines/client/models/http_validation_error.py +5 -5
- crypticorn/klines/client/models/market.py +5 -5
- crypticorn/klines/client/models/ohlcv_response.py +5 -5
- crypticorn/klines/client/models/resolution.py +5 -5
- crypticorn/klines/client/models/response_get_history_udf_history_get.py +5 -5
- crypticorn/klines/client/models/search_symbol_response.py +5 -5
- crypticorn/klines/client/models/sort_direction.py +5 -5
- crypticorn/klines/client/models/symbol_group_response.py +5 -5
- crypticorn/klines/client/models/symbol_info_response.py +5 -5
- crypticorn/klines/client/models/symbol_type.py +5 -5
- crypticorn/klines/client/models/timeframe.py +5 -5
- crypticorn/klines/client/models/udf_config_response.py +5 -5
- crypticorn/klines/client/models/validation_error.py +5 -5
- crypticorn/klines/client/models/validation_error_loc_inner.py +5 -5
- crypticorn/klines/client/rest.py +5 -5
- crypticorn/metrics/client/__init__.py +8 -6
- crypticorn/metrics/client/api/exchanges_api.py +62 -42
- crypticorn/metrics/client/api/health_check_api.py +5 -5
- crypticorn/metrics/client/api/indicators_api.py +47 -35
- crypticorn/metrics/client/api/logs_api.py +6 -6
- crypticorn/metrics/client/api/marketcap_api.py +22 -22
- crypticorn/metrics/client/api/markets_api.py +41 -28
- crypticorn/metrics/client/api/tokens_api.py +6 -6
- crypticorn/metrics/client/api_client.py +5 -5
- crypticorn/metrics/client/configuration.py +84 -39
- crypticorn/metrics/client/exceptions.py +5 -5
- crypticorn/metrics/client/models/__init__.py +8 -6
- crypticorn/metrics/client/models/base_response_dict.py +5 -5
- crypticorn/metrics/client/models/base_response_health_check_response.py +5 -5
- crypticorn/metrics/client/models/base_response_list_dict.py +5 -5
- crypticorn/metrics/client/models/base_response_list_exchange_mapping.py +5 -5
- crypticorn/metrics/client/models/base_response_list_str.py +5 -5
- crypticorn/metrics/client/models/error_response.py +5 -5
- crypticorn/metrics/client/models/exchange_mapping.py +5 -5
- crypticorn/metrics/client/models/health_check_response.py +5 -5
- crypticorn/metrics/client/models/http_validation_error.py +5 -5
- crypticorn/metrics/client/models/market.py +5 -5
- crypticorn/metrics/client/models/market_type.py +35 -0
- crypticorn/metrics/client/models/severity.py +5 -5
- crypticorn/metrics/client/models/time_interval.py +38 -0
- crypticorn/metrics/client/models/trading_status.py +35 -0
- crypticorn/metrics/client/models/validation_error.py +5 -5
- crypticorn/metrics/client/models/validation_error_loc_inner.py +5 -5
- crypticorn/metrics/client/rest.py +9 -6
- crypticorn/metrics/main.py +2 -2
- crypticorn/pay/client/__init__.py +6 -8
- crypticorn/pay/client/api/now_payments_api.py +5 -5
- crypticorn/pay/client/api/payments_api.py +73 -6
- crypticorn/pay/client/api/products_api.py +21 -23
- crypticorn/pay/client/api/status_api.py +5 -5
- crypticorn/pay/client/api_client.py +5 -5
- crypticorn/pay/client/configuration.py +13 -6
- crypticorn/pay/client/exceptions.py +5 -5
- crypticorn/pay/client/models/__init__.py +6 -8
- crypticorn/pay/client/models/api_status_res.py +5 -5
- crypticorn/pay/client/models/body_create_now_invoice.py +5 -5
- crypticorn/pay/client/models/body_create_product.py +5 -5
- crypticorn/pay/client/models/body_get_products.py +5 -5
- crypticorn/pay/client/models/body_handle_now_webhook.py +5 -5
- crypticorn/pay/client/models/body_update_product.py +5 -5
- crypticorn/pay/client/models/combined_payment_history.py +5 -5
- crypticorn/pay/client/models/create_invoice_req.py +5 -5
- crypticorn/pay/client/models/create_invoice_res.py +5 -5
- crypticorn/pay/client/models/currency.py +5 -5
- crypticorn/pay/client/models/estimate_price_req.py +5 -5
- crypticorn/pay/client/models/estimate_price_res.py +5 -5
- crypticorn/pay/client/models/get_currencies_res.py +5 -5
- crypticorn/pay/client/models/get_payment_status_res.py +5 -5
- crypticorn/pay/client/models/get_payments_list_res.py +5 -5
- crypticorn/pay/client/models/http_validation_error.py +5 -5
- crypticorn/pay/client/models/min_amount_req.py +5 -5
- crypticorn/pay/client/models/min_amount_res.py +5 -5
- crypticorn/pay/client/models/now_api_status_res.py +5 -5
- crypticorn/pay/client/models/now_create_invoice_req.py +5 -5
- crypticorn/pay/client/models/now_create_invoice_res.py +5 -5
- crypticorn/pay/client/models/now_fee_structure.py +5 -5
- crypticorn/pay/client/models/now_payment_model.py +5 -5
- crypticorn/pay/client/models/now_payment_status.py +5 -5
- crypticorn/pay/client/models/now_webhook_payload.py +5 -5
- crypticorn/pay/client/models/partial_product_update_model.py +5 -5
- crypticorn/pay/client/models/payment.py +5 -5
- crypticorn/pay/client/models/payment_status.py +5 -5
- crypticorn/pay/client/models/product.py +5 -5
- crypticorn/pay/client/models/product_model.py +5 -5
- crypticorn/pay/client/models/product_subs_model.py +5 -5
- crypticorn/pay/client/models/product_update_model.py +11 -11
- crypticorn/pay/client/models/scope.py +7 -7
- crypticorn/pay/client/models/services.py +5 -5
- crypticorn/pay/client/models/unified_payment_model.py +5 -5
- crypticorn/pay/client/models/validation_error.py +5 -5
- crypticorn/pay/client/models/validation_error_loc_inner.py +5 -5
- crypticorn/pay/client/rest.py +9 -6
- crypticorn/trade/client/__init__.py +5 -5
- crypticorn/trade/client/api/api_keys_api.py +5 -5
- crypticorn/trade/client/api/bots_api.py +5 -5
- crypticorn/trade/client/api/exchanges_api.py +5 -5
- crypticorn/trade/client/api/futures_trading_panel_api.py +5 -5
- crypticorn/trade/client/api/notifications_api.py +5 -5
- crypticorn/trade/client/api/orders_api.py +5 -5
- crypticorn/trade/client/api/status_api.py +5 -5
- crypticorn/trade/client/api/strategies_api.py +5 -5
- crypticorn/trade/client/api/trading_actions_api.py +5 -5
- crypticorn/trade/client/api_client.py +5 -5
- crypticorn/trade/client/configuration.py +13 -6
- crypticorn/trade/client/exceptions.py +5 -5
- crypticorn/trade/client/models/__init__.py +5 -5
- crypticorn/trade/client/models/action_model.py +5 -5
- crypticorn/trade/client/models/api_error_identifier.py +7 -6
- crypticorn/trade/client/models/api_error_level.py +5 -5
- crypticorn/trade/client/models/api_error_type.py +5 -5
- crypticorn/trade/client/models/api_key_model.py +5 -5
- crypticorn/trade/client/models/bot_model.py +5 -5
- crypticorn/trade/client/models/bot_status.py +5 -5
- crypticorn/trade/client/models/exchange.py +5 -5
- crypticorn/trade/client/models/exchange_key_model.py +5 -5
- crypticorn/trade/client/models/execution_ids.py +7 -7
- crypticorn/trade/client/models/futures_balance.py +5 -5
- crypticorn/trade/client/models/futures_trading_action.py +5 -5
- crypticorn/trade/client/models/http_validation_error.py +5 -5
- crypticorn/trade/client/models/margin_mode.py +5 -5
- crypticorn/trade/client/models/market_type.py +5 -5
- crypticorn/trade/client/models/notification_model.py +5 -5
- crypticorn/trade/client/models/order_model.py +5 -5
- crypticorn/trade/client/models/order_status.py +5 -5
- crypticorn/trade/client/models/post_futures_action.py +5 -5
- crypticorn/trade/client/models/strategy_exchange_info.py +5 -5
- crypticorn/trade/client/models/strategy_model_input.py +5 -5
- crypticorn/trade/client/models/strategy_model_output.py +5 -5
- crypticorn/trade/client/models/tpsl.py +5 -5
- crypticorn/trade/client/models/trading_action_type.py +5 -5
- crypticorn/trade/client/models/validation_error.py +5 -5
- crypticorn/trade/client/models/validation_error_loc_inner.py +5 -5
- crypticorn/trade/client/rest.py +9 -6
- {crypticorn-2.4.3.dist-info → crypticorn-2.4.5.dist-info}/METADATA +8 -9
- crypticorn-2.4.5.dist-info/RECORD +280 -0
- crypticorn-2.4.3.dist-info/RECORD +0 -277
- {crypticorn-2.4.3.dist-info → crypticorn-2.4.5.dist-info}/WHEEL +0 -0
- {crypticorn-2.4.3.dist-info → crypticorn-2.4.5.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.4.3.dist-info → crypticorn-2.4.5.dist-info}/top_level.txt +0 -0
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Crypticorn Auth API
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI compliant REST API built using tRPC with Express
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Crypticorn Auth API
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI compliant REST API built using tRPC with Express
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Crypticorn Auth API
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI compliant REST API built using tRPC with Express
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Crypticorn Auth API
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI compliant REST API built using tRPC with Express
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Crypticorn Auth API
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI compliant REST API built using tRPC with Express
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Crypticorn Auth API
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI compliant REST API built using tRPC with Express
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Crypticorn Auth API
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI compliant REST API built using tRPC with Express
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Crypticorn Auth API
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI compliant REST API built using tRPC with Express
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Crypticorn Auth API
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI compliant REST API built using tRPC with Express
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Crypticorn Auth API
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI compliant REST API built using tRPC with Express
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -32,7 +32,8 @@ class UpdateUserRequest(BaseModel):
|
|
32
32
|
name: Optional[StrictStr] = None
|
33
33
|
email: Optional[StrictStr] = None
|
34
34
|
username: Optional[StrictStr] = None
|
35
|
-
|
35
|
+
picture: Optional[StrictStr] = None
|
36
|
+
__properties: ClassVar[List[str]] = ["id", "name", "email", "username", "picture"]
|
36
37
|
|
37
38
|
model_config = ConfigDict(
|
38
39
|
populate_by_name=True,
|
@@ -88,6 +89,7 @@ class UpdateUserRequest(BaseModel):
|
|
88
89
|
"name": obj.get("name"),
|
89
90
|
"email": obj.get("email"),
|
90
91
|
"username": obj.get("username"),
|
92
|
+
"picture": obj.get("picture"),
|
91
93
|
}
|
92
94
|
)
|
93
95
|
return _obj
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Crypticorn Auth API
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI compliant REST API built using tRPC with Express
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Crypticorn Auth API
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI compliant REST API built using tRPC with Express
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Crypticorn Auth API
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI compliant REST API built using tRPC with Express
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Crypticorn Auth API
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI compliant REST API built using tRPC with Express
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Crypticorn Auth API
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI compliant REST API built using tRPC with Express
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Crypticorn Auth API
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI compliant REST API built using tRPC with Express
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Crypticorn Auth API
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI compliant REST API built using tRPC with Express
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Crypticorn Auth API
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI compliant REST API built using tRPC with Express
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Crypticorn Auth API
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI compliant REST API built using tRPC with Express
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Crypticorn Auth API
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI compliant REST API built using tRPC with Express
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
crypticorn/auth/client/rest.py
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
"""
|
4
|
-
|
4
|
+
Crypticorn Auth API
|
5
5
|
|
6
|
-
|
6
|
+
OpenAPI compliant REST API built using tRPC with Express
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
10
|
|
11
|
-
|
11
|
+
Do not edit the class manually.
|
12
12
|
""" # noqa: E501
|
13
13
|
|
14
14
|
|
@@ -57,7 +57,10 @@ class RESTClientObject:
|
|
57
57
|
# maxsize is number of requests to host that are allowed in parallel
|
58
58
|
self.maxsize = configuration.connection_pool_maxsize
|
59
59
|
|
60
|
-
self.ssl_context = ssl.create_default_context(
|
60
|
+
self.ssl_context = ssl.create_default_context(
|
61
|
+
cafile=configuration.ssl_ca_cert,
|
62
|
+
cadata=configuration.ca_cert_data,
|
63
|
+
)
|
61
64
|
if configuration.cert_file:
|
62
65
|
self.ssl_context.load_cert_chain(
|
63
66
|
configuration.cert_file, keyfile=configuration.key_file
|
crypticorn/client.py
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
-
from
|
2
|
-
|
3
|
-
from crypticorn.
|
4
|
-
from crypticorn.
|
5
|
-
from crypticorn.
|
6
|
-
from crypticorn.
|
1
|
+
from typing import Union
|
2
|
+
|
3
|
+
from crypticorn.hive import HiveClient, Configuration as HiveConfig
|
4
|
+
from crypticorn.klines import KlinesClient, Configuration as KlinesConfig
|
5
|
+
from crypticorn.pay import PayClient, Configuration as PayConfig
|
6
|
+
from crypticorn.trade import TradeClient, Configuration as TradeConfig
|
7
|
+
from crypticorn.metrics import MetricsClient, Configuration as MetricsConfig
|
8
|
+
from crypticorn.auth import AuthClient, Configuration as AuthConfig
|
7
9
|
from crypticorn.common import BaseUrl, ApiVersion, Service, apikey_header as aph
|
8
10
|
import warnings
|
9
11
|
|
@@ -64,16 +66,31 @@ class ApiClient:
|
|
64
66
|
"""
|
65
67
|
Get the default configuration for a given service.
|
66
68
|
"""
|
67
|
-
|
69
|
+
config_class = {
|
70
|
+
Service.HIVE: HiveConfig,
|
71
|
+
Service.TRADE: TradeConfig,
|
72
|
+
Service.KLINES: KlinesConfig,
|
73
|
+
Service.PAY: PayConfig,
|
74
|
+
Service.METRICS: MetricsConfig,
|
75
|
+
Service.AUTH: AuthConfig,
|
76
|
+
}[service]
|
77
|
+
return config_class(
|
68
78
|
host=f"{self.base_url}/{version}/{service}",
|
69
79
|
access_token=self.jwt,
|
70
80
|
api_key={aph.scheme_name: self.api_key} if self.api_key else None,
|
71
|
-
|
72
|
-
|
73
|
-
|
81
|
+
# not necessary
|
82
|
+
# api_key_prefix=(
|
83
|
+
# {aph.scheme_name: aph.model.name} if self.api_key else None
|
84
|
+
# ),
|
74
85
|
)
|
75
86
|
|
76
|
-
def configure(
|
87
|
+
def configure(
|
88
|
+
self,
|
89
|
+
config: Union[
|
90
|
+
HiveConfig, TradeConfig, KlinesConfig, PayConfig, MetricsConfig, AuthConfig
|
91
|
+
],
|
92
|
+
sub_client: any,
|
93
|
+
):
|
77
94
|
"""
|
78
95
|
Update a sub-client's configuration by overriding with the values set in the new config.
|
79
96
|
Useful for testing a specific service against a local server instead of the default proxy.
|
crypticorn/common/auth.py
CHANGED
crypticorn/common/errors.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from enum import Enum, EnumMeta
|
1
|
+
from enum import Enum, EnumMeta, StrEnum
|
2
2
|
import logging
|
3
3
|
from fastapi import status
|
4
4
|
|
@@ -6,15 +6,19 @@ logger = logging.getLogger(__name__)
|
|
6
6
|
|
7
7
|
|
8
8
|
class Fallback(EnumMeta):
|
9
|
+
"""Fallback to UNKNOWN_ERROR for error codes not yet published to PyPI."""
|
10
|
+
|
9
11
|
def __getattr__(cls, name):
|
10
|
-
|
12
|
+
# Let Pydantic/internal stuff pass silently ! fragile
|
13
|
+
if name.startswith("__"):
|
14
|
+
raise AttributeError(name)
|
11
15
|
logger.warning(
|
12
16
|
f"Unknown error code '{name}' - update crypticorn package or check for typos"
|
13
17
|
)
|
14
18
|
return cls.UNKNOWN_ERROR
|
15
19
|
|
16
20
|
|
17
|
-
class ApiErrorType(
|
21
|
+
class ApiErrorType(StrEnum):
|
18
22
|
"""Type of API error"""
|
19
23
|
|
20
24
|
USER_ERROR = "user error"
|
@@ -27,7 +31,7 @@ class ApiErrorType(str, Enum):
|
|
27
31
|
"""error that does not need to be handled or does not affect the program or is a placeholder."""
|
28
32
|
|
29
33
|
|
30
|
-
class ApiErrorIdentifier(
|
34
|
+
class ApiErrorIdentifier(StrEnum):
|
31
35
|
"""API error identifiers"""
|
32
36
|
|
33
37
|
ALLOCATION_BELOW_EXPOSURE = "allocation_below_current_exposure"
|
@@ -97,7 +101,7 @@ class ApiErrorIdentifier(str, Enum):
|
|
97
101
|
URL_NOT_FOUND = "requested_resource_not_found"
|
98
102
|
|
99
103
|
|
100
|
-
class ApiErrorLevel(
|
104
|
+
class ApiErrorLevel(StrEnum):
|
101
105
|
"""API error levels"""
|
102
106
|
|
103
107
|
ERROR = "error"
|
@@ -445,7 +449,7 @@ class ApiError(Enum, metaclass=Fallback):
|
|
445
449
|
def level(self) -> ApiErrorLevel:
|
446
450
|
"""Level of the error."""
|
447
451
|
return self.value[2]
|
448
|
-
|
452
|
+
|
449
453
|
@property
|
450
454
|
def status_code(self) -> int:
|
451
455
|
"""HTTP status code for the error."""
|
@@ -454,6 +458,7 @@ class ApiError(Enum, metaclass=Fallback):
|
|
454
458
|
|
455
459
|
class HttpStatusMapper:
|
456
460
|
"""Map API errors to HTTP status codes."""
|
461
|
+
|
457
462
|
# TODO: decide if we need all of these mappings, since most errors are not exposed to the client via HTTP
|
458
463
|
# in case we remove some, update the pytest length check
|
459
464
|
_mapping = {
|
@@ -466,33 +471,27 @@ class HttpStatusMapper:
|
|
466
471
|
ApiError.EXCHANGE_PERMISSION_DENIED: status.HTTP_403_FORBIDDEN,
|
467
472
|
ApiError.EXCHANGE_USER_FROZEN: status.HTTP_403_FORBIDDEN,
|
468
473
|
ApiError.TRADING_LOCKED: status.HTTP_403_FORBIDDEN,
|
469
|
-
|
470
474
|
# Not Found
|
471
475
|
ApiError.URL_NOT_FOUND: status.HTTP_404_NOT_FOUND,
|
472
476
|
ApiError.OBJECT_NOT_FOUND: status.HTTP_404_NOT_FOUND,
|
473
477
|
ApiError.ORDER_NOT_FOUND: status.HTTP_404_NOT_FOUND,
|
474
478
|
ApiError.POSITION_NOT_FOUND: status.HTTP_404_NOT_FOUND,
|
475
479
|
ApiError.SYMBOL_NOT_FOUND: status.HTTP_404_NOT_FOUND,
|
476
|
-
|
477
480
|
# Conflicts/Duplicates
|
478
481
|
ApiError.CLIENT_ORDER_ID_REPEATED: status.HTTP_409_CONFLICT,
|
479
482
|
ApiError.OBJECT_ALREADY_EXISTS: status.HTTP_409_CONFLICT,
|
480
483
|
ApiError.EXCHANGE_KEY_ALREADY_EXISTS: status.HTTP_409_CONFLICT,
|
481
484
|
ApiError.BOT_ALREADY_DELETED: status.HTTP_409_CONFLICT,
|
482
|
-
|
483
485
|
# Invalid Content
|
484
486
|
ApiError.CONTENT_TYPE_ERROR: status.HTTP_415_UNSUPPORTED_MEDIA_TYPE,
|
485
|
-
|
486
487
|
# Rate Limits
|
487
488
|
ApiError.EXCHANGE_RATE_LIMIT: status.HTTP_429_TOO_MANY_REQUESTS,
|
488
489
|
ApiError.REQUEST_SCOPE_EXCEEDED: status.HTTP_429_TOO_MANY_REQUESTS,
|
489
|
-
|
490
490
|
# Server Errors
|
491
491
|
ApiError.UNKNOWN_ERROR: status.HTTP_500_INTERNAL_SERVER_ERROR,
|
492
492
|
ApiError.EXCHANGE_SYSTEM_ERROR: status.HTTP_500_INTERNAL_SERVER_ERROR,
|
493
493
|
ApiError.NOW_API_DOWN: status.HTTP_500_INTERNAL_SERVER_ERROR,
|
494
494
|
ApiError.RPC_TIMEOUT: status.HTTP_500_INTERNAL_SERVER_ERROR,
|
495
|
-
|
496
495
|
# Service Unavailable
|
497
496
|
ApiError.EXCHANGE_SERVICE_UNAVAILABLE: status.HTTP_503_SERVICE_UNAVAILABLE,
|
498
497
|
ApiError.EXCHANGE_MAINTENANCE: status.HTTP_503_SERVICE_UNAVAILABLE,
|
@@ -500,7 +499,6 @@ class HttpStatusMapper:
|
|
500
499
|
ApiError.SETTLEMENT_IN_PROGRESS: status.HTTP_503_SERVICE_UNAVAILABLE,
|
501
500
|
ApiError.POSITION_SUSPENDED: status.HTTP_503_SERVICE_UNAVAILABLE,
|
502
501
|
ApiError.TRADING_SUSPENDED: status.HTTP_503_SERVICE_UNAVAILABLE,
|
503
|
-
|
504
502
|
# Bad Requests (400) - Invalid parameters or states
|
505
503
|
ApiError.ALLOCATION_BELOW_EXPOSURE: status.HTTP_400_BAD_REQUEST,
|
506
504
|
ApiError.ALLOCATION_BELOW_MINIMUM: status.HTTP_400_BAD_REQUEST,
|
@@ -535,7 +533,6 @@ class HttpStatusMapper:
|
|
535
533
|
ApiError.STRATEGY_NOT_SUPPORTING_EXCHANGE: status.HTTP_400_BAD_REQUEST,
|
536
534
|
ApiError.TRADING_ACTION_EXPIRED: status.HTTP_400_BAD_REQUEST,
|
537
535
|
ApiError.TRADING_ACTION_SKIPPED: status.HTTP_400_BAD_REQUEST,
|
538
|
-
|
539
536
|
# Success cases
|
540
537
|
ApiError.SUCCESS: status.HTTP_200_OK,
|
541
538
|
ApiError.BOT_STOPPING_COMPLETED: status.HTTP_200_OK,
|
crypticorn/common/scopes.py
CHANGED
@@ -6,8 +6,13 @@ logger = logging.getLogger("uvicorn")
|
|
6
6
|
|
7
7
|
class Fallback(EnumMeta):
|
8
8
|
"""Fallback to no scope for unknown scopes."""
|
9
|
+
# Note: This is a workaround to avoid the AttributeError when an unknown scope is accessed.
|
10
|
+
# As soon as we have stable scopes, we can remove this.
|
9
11
|
|
10
12
|
def __getattr__(cls, name):
|
13
|
+
# Let Pydantic/internal stuff pass silently ! fragile
|
14
|
+
if name.startswith("__"):
|
15
|
+
raise AttributeError(name)
|
11
16
|
logger.warning(
|
12
17
|
f"Unknown scope '{name}' - falling back to no scope - update crypticorn package or check for typos"
|
13
18
|
)
|