"""
Configuration module for BrighterTrading - EXAMPLE TEMPLATE.

Copy this file to config.py and either:
1. Set the environment variables below, OR
2. Directly assign your keys (NOT recommended for production)

Environment variables:
  BRIGHTER_BINANCE_API_KEY
  BRIGHTER_BINANCE_API_SECRET
  BRIGHTER_ALPACA_API_KEY
  BRIGHTER_ALPACA_API_SECRET
"""
import os
from pathlib import Path

# API Keys - loaded from environment variables
# To set environment variables:
#   Linux/Mac: export BRIGHTER_BINANCE_API_KEY="your_key_here"
#   Windows:   set BRIGHTER_BINANCE_API_KEY=your_key_here
BINANCE_API_KEY = os.environ.get('BRIGHTER_BINANCE_API_KEY', '')
BINANCE_API_SECRET = os.environ.get('BRIGHTER_BINANCE_API_SECRET', '')
ALPACA_API_KEY = os.environ.get('BRIGHTER_ALPACA_API_KEY', '')
ALPACA_API_SECRET = os.environ.get('BRIGHTER_ALPACA_API_SECRET', '')

# Testnet/sandbox mode - set to True for testnet trading, False for production
# Set via environment variable: export TESTNET_MODE=true
TESTNET_MODE = os.environ.get('TESTNET_MODE', 'false').lower() == 'true'

# Database path - cross-platform, relative to project root
_project_root = Path(__file__).parent.parent
DB_FILE = str(_project_root / 'data' / 'BrighterTrading.db')

# Ensure data directory exists
os.makedirs(os.path.dirname(DB_FILE), exist_ok=True)
