Skip to content

Commit

Permalink
Update URLs in info.py and general_info.py
Browse files Browse the repository at this point in the history
  • Loading branch information
saleh-mir committed Mar 4, 2024
1 parent dc9a9ca commit d606d88
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
14 changes: 8 additions & 6 deletions jesse/info.py
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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'],
Expand All @@ -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'],
Expand Down Expand Up @@ -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'],
Expand All @@ -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'],
Expand All @@ -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'],
Expand All @@ -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'],
Expand Down
7 changes: 3 additions & 4 deletions jesse/services/general_info.py
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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(
Expand Down
3 changes: 2 additions & 1 deletion jesse/services/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions jesse/services/jesse_trade.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down Expand Up @@ -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}'}
Expand Down

0 comments on commit d606d88

Please sign in to comment.