#!/bin/bash

# Split自动化脚本安装和配置脚本

echo "开始安装Split自动化脚本..."

# 创建环境变量配置文件
cat > .env << EOL
# Split自动化配置
TON_WALLET_PATH=/path/to/ton/wallet/extension
WALLET_SEED=your-wallet-seed-phrase
WALLET_PASSWORD=your-wallet-password
HEADLESS=false
TIMEOUT=30000

# USDT监听配置
WALLET_ADDRESS=TRmvaTGuK7SsHX72xFZcekcWBxNoRv8888
CONTRACT_ADDRESS=TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t
TRONGRID_API_KEY=dd3a8cbf-3a49-4a03-a2fe-7ffff5907329
CHECK_INTERVAL=60000

# 测试配置
TEST_TELEGRAM_ID=123456789
TEST_MONTHS=1
RUN_PURCHASE_TEST=false
EOL

echo "创建环境变量配置文件完成"

# 安装依赖
echo "安装Node.js依赖..."
npm install

# 创建必要的目录
mkdir -p logs data

echo "Split自动化脚本安装完成！"
echo "请编辑.env文件，填入您的实际配置信息"
echo "然后运行 'npm start' 启动自动化服务"
