feat: 优化金库交易和LP流动池功能

主要更新:
- 金库交易动态读取: 从合约动态获取所有金库地址和名称
- 边界值测试优化: 修复 buy_exceed_hardcap 计算逻辑和错误处理
- 新增 ErrorBoundary 组件: 全局错误边界处理
- vite 配置优化: 添加 optimizeDeps 解决动态导入问题
- 交易历史和连接按钮改进

技术改进:
- 使用 useReadContract/useReadContracts 批量读取合约数据
- 改进 parseError 函数处理 ccip 模块加载失败
- 添加测试状态管理 (isTestRunning, testTypeRef)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-16 18:57:26 +00:00
parent dbb287b814
commit 3da0bf24d0
15 changed files with 1826 additions and 179 deletions

View File

@@ -10,6 +10,30 @@ export default defineConfig({
strictPort: true,
allowedHosts: ['maxfight.vip', 'localhost', '127.0.0.1'],
},
// 优化依赖预构建
optimizeDeps: {
include: [
'wagmi',
'viem',
'viem/actions',
'viem/chains',
'@tanstack/react-query',
'react',
'react-dom',
'react-i18next',
'i18next',
],
// 强制预构建这些依赖,避免动态导入问题
esbuildOptions: {
target: 'esnext',
},
},
// 解析配置
resolve: {
alias: {
// 解决 viem 动态导入问题
},
},
build: {
rollupOptions: {
output: {