diff --git a/jesse/info.py b/jesse/info.py index 921167a1b..941780fe9 100644 --- a/jesse/info.py +++ b/jesse/info.py @@ -1,5 +1,7 @@ from jesse.enums import exchanges as exchanges_enums, timeframes +JESSE_API_URL = 'https://api1.jesse.trade/api' +JESSE_WEBSITE_URL = 'https://jesse.trade' BYBIT_TIMEFRAMES = [timeframes.MINUTE_1, timeframes.MINUTE_3, timeframes.MINUTE_5, timeframes.MINUTE_15, timeframes.MINUTE_30, timeframes.HOUR_1, timeframes.HOUR_2, timeframes.HOUR_4, timeframes.HOUR_6, timeframes.HOUR_12, timeframes.DAY_1] FTX_TIMEFRAMES = [timeframes.MINUTE_1, timeframes.MINUTE_3, timeframes.MINUTE_5, timeframes.MINUTE_15, timeframes.MINUTE_30, timeframes.HOUR_1, timeframes.HOUR_2, timeframes.HOUR_4, timeframes.HOUR_6, timeframes.HOUR_12, timeframes.DAY_1] @@ -12,7 +14,7 @@ # BYBIT_USDT_PERPETUAL exchanges_enums.BYBIT_USDT_PERPETUAL: { 'name': exchanges_enums.BYBIT_USDT_PERPETUAL, - 'url': 'https://jesse.trade/bybit', + 'url': JESSE_WEBSITE_URL + '/bybit', 'fee': 0.00075, 'type': 'futures', 'supported_leverage_modes': ['cross', 'isolated'], @@ -26,7 +28,7 @@ # BYBIT_USDT_PERPETUAL_TESTNET exchanges_enums.BYBIT_USDT_PERPETUAL_TESTNET: { 'name': exchanges_enums.BYBIT_USDT_PERPETUAL_TESTNET, - 'url': 'https://jesse.trade/bybit', + 'url': JESSE_WEBSITE_URL + '/bybit', 'fee': 0.00075, 'type': 'futures', 'supported_leverage_modes': ['cross', 'isolated'], @@ -166,7 +168,7 @@ # BITGET_USDT_PERPETUAL_TESTNET exchanges_enums.BITGET_USDT_PERPETUAL_TESTNET: { 'name': exchanges_enums.BITGET_USDT_PERPETUAL_TESTNET, - 'url': 'https://jesse.trade/bitget', + 'url': JESSE_WEBSITE_URL + '/bitget', 'fee': 0.0006, 'type': 'futures', 'supported_leverage_modes': ['cross', 'isolated'], @@ -180,7 +182,7 @@ # BITGET_USDT_PERPETUAL exchanges_enums.BITGET_USDT_PERPETUAL: { 'name': exchanges_enums.BITGET_USDT_PERPETUAL, - 'url': 'https://jesse.trade/bitget', + 'url': JESSE_WEBSITE_URL + '/bitget', 'fee': 0.0006, 'type': 'futures', 'supported_leverage_modes': ['cross', 'isolated'], @@ -194,7 +196,7 @@ # BITGET_SPOT exchanges_enums.BITGET_SPOT: { 'name': exchanges_enums.BITGET_SPOT, - 'url': 'https://jesse.trade/bitget', + 'url': JESSE_WEBSITE_URL + '/bitget', 'fee': 0.0006, 'type': 'spot', 'supported_leverage_modes': ['cross', 'isolated'], @@ -209,7 +211,7 @@ # DyDx exchanges_enums.DYDX_PERPETUAL: { 'name': exchanges_enums.DYDX_PERPETUAL, - 'url': 'https://jesse.trade/dydx', + 'url': JESSE_WEBSITE_URL + '/dydx', 'fee': 0.0005, 'type': 'futures', 'supported_leverage_modes': ['cross'], diff --git a/jesse/services/general_info.py b/jesse/services/general_info.py index d6ed30453..9254764f0 100644 --- a/jesse/services/general_info.py +++ b/jesse/services/general_info.py @@ -1,8 +1,7 @@ import os import requests import jesse.helpers as jh -from jesse.info import exchange_info, jesse_supported_timeframes -from jesse.enums import exchanges +from jesse.info import exchange_info, jesse_supported_timeframes, JESSE_API_URL def get_general_info(has_live=False) -> dict: @@ -26,7 +25,7 @@ def get_general_info(has_live=False) -> dict: # get the account plan info via the access_token try: response = requests.post( - 'https://jesse.trade/api/user-info', + JESSE_API_URL + '/user-info', headers={'Authorization': f'Bearer {access_token}'} ) except requests.exceptions.RequestException: @@ -55,7 +54,7 @@ def get_general_info(has_live=False) -> dict: update_info['jesse_latest_version'] = response.json()['info']['version'] try: response = requests.get( - 'https://jesse.trade/api/plugins/live/releases/info' + JESSE_API_URL + '/plugins/live/releases/info' ) except requests.exceptions.RequestException: response = requests.get( diff --git a/jesse/services/installer.py b/jesse/services/installer.py index ab20ddd86..cda741ffe 100644 --- a/jesse/services/installer.py +++ b/jesse/services/installer.py @@ -6,6 +6,7 @@ import sys import click import os +from jesse.info import JESSE_API_URL def _pip_install(package): subprocess.check_call([sys.executable, "-m", "pip", "install", package]) @@ -67,7 +68,7 @@ def install(is_live_plugin_already_installed: bool, strict: bool): print('Downloading the latest version of the live-trade plugin...') try: response = requests.post( - 'https://jesse.trade/api/download-release', + JESSE_API_URL + '/download-release', headers={'Authorization': 'Bearer ' + access_token}, params={ 'os': formatted_os_name, diff --git a/jesse/services/jesse_trade.py b/jesse/services/jesse_trade.py index d3ad4f80e..5560016b2 100644 --- a/jesse/services/jesse_trade.py +++ b/jesse/services/jesse_trade.py @@ -3,13 +3,14 @@ from jesse.services.auth import get_access_token import jesse.helpers as jh import json +from jesse.info import JESSE_API_URL def feedback(description: str, email: str = None) -> JSONResponse: access_token = get_access_token() res = requests.post( - 'https://jesse.trade/api/feedback', { + JESSE_API_URL + '/feedback', { 'description': description, 'email': email }, @@ -65,7 +66,7 @@ def report_exception( 'info': json.dumps(info) } res = requests.post( - 'https://jesse.trade/api/exception', + JESSE_API_URL + '/exception', data=params, files=files, headers={'Authorization': f'Bearer {access_token}'}