📋 控制面板
监控地址列表:
暂无监控地址
📊 交易记录 (0 笔)
请添加地址并开始监控
async fetchWithTronGrid(address) { try { // 直接使用TronGrid的v1 API,这个API支持CORS const url = `https://nile.trongrid.io/v1/accounts/${address}/transactions/trc20?limit=50&contract_address=${this.usdtContract}`; console.log(`[TronGrid] 检查地址: ${address}`); console.log(`[TronGrid] URL: ${url}`); const response = await fetch(url, { method: 'GET', headers: { 'Accept': 'application/json' } }); console.log(`[TronGrid] 响应状态: ${response.status} ${response.statusText}`); if (response.ok) { const data = await response.json(); console.log(`[TronGrid] 响应数据:`, data); // TronGrid API 成功响应的处理 if (data.success !== false) { if (data.data && Array.isArray(data.data)) { if (data.data.length > 0) { console.log(`[TronGrid] 找到 ${data.data.length} 笔交易`); this.processTransactions(data.data, address); } else { console.log(`[TronGrid] 地址 ${address} 暂无USDT交易记录`); this.createInfoTransaction(address); } } else { console.log(`[TronGrid] 地址数据格式异常或为空`); this.createInfoTransaction(address); } } else { console.log(`[TronGrid] API返回错误:`, data.error || data.message); this.createInfoTransaction(address); } } else { // HTTP错误状态码 const errorText = await response.text(); console.error(`[TronGrid] HTTP错误 ${response.status}: ${errorText}`); this.createInfoTransaction(address, `API调用失败: ${response.status}`); } } catch (error) { console.error('[TronGrid] 网络错误:', error); // 如果是网络问题,尝试备用方案 if (error.message.includes('Failed to fetch') || error.message.includes('CORS') || error.message.includes('Network')) { console.log('[TronGrid] 尝试备用API端点...'); await this.tryBackupEndpoints(address); } else { this.createInfoTransaction(address, '网络连接失败'); } } } async tryBackup
Tron Nile测试网 - 实时监控USDT交易
暂无监控地址
请添加地址并开始监控