mexc API failed, working on futures API as it what i we need anyway

This commit is contained in:
Dobromir Popov
2025-07-03 00:56:02 +03:00
parent 568ec049db
commit 118c34b990
8 changed files with 17370 additions and 714 deletions

View File

@ -1,13 +1,31 @@
from NN.exchanges.mexc_interface import MEXCInterface
import logging
import os
from NN.exchanges.mexc_interface import MEXCInterface
# Set up logging to see debug info
logging.basicConfig(level=logging.INFO)
# Load API credentials from environment variables or a configuration file
# For testing, prioritize environment variables for CI/CD or sensitive data
# Fallback to a placeholder or configuration reading if env vars are not set
api_key = os.getenv('MEXC_API_KEY', '')
api_secret = os.getenv('MEXC_SECRET_KEY', '')
# If using a config file, you might do something like:
# from core.config import get_config
# config = get_config('config.yaml')
# mexc_config = config.get('mexc_trading', {})
# api_key = mexc_config.get('api_key', api_key)
# api_secret = mexc_config.get('api_secret', api_secret)
if not api_key or not api_secret:
logging.error("API keys are not set. Please set MEXC_API_KEY and MEXC_SECRET_KEY environment variables or configure config.yaml")
exit(1)
# Create interface with API credentials
mexc = MEXCInterface(
api_key='mx0aBYs33eIilxBWC5',
api_secret='45d0b3c26f2644f19bfb98b07741b2f5',
api_key=api_key,
api_secret=api_secret,
trading_mode='simulation'
)