feat: 添加交易历史、错误提示和打包优化

1. 交易历史记录功能
   - 新增 useTransactionHistory hook 管理交易记录
   - 新增 TransactionHistory 组件显示历史
   - 交易记录保存到 localStorage

2. 错误处理和用户提示
   - 新增 Toast 通知组件
   - 交易提交/成功/失败时显示提示
   - 解析并显示友好的错误信息

3. 打包优化
   - 配置代码分割 (manualChunks)
   - 分离 react/web3/walletconnect/i18n
   - 提高 chunk 大小警告阈值

🤖 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-15 17:35:36 +00:00
parent 79fede5cb0
commit 553ff58c4d
12 changed files with 711 additions and 58 deletions

View File

@@ -9,5 +9,26 @@ export default defineConfig({
host: '0.0.0.0',
strictPort: true,
allowedHosts: ['maxfight.vip', 'localhost', '127.0.0.1'],
}
},
build: {
rollupOptions: {
output: {
manualChunks: {
// React 相关
'react-vendor': ['react', 'react-dom'],
// Web3 相关
'web3-vendor': ['wagmi', 'viem', '@tanstack/react-query'],
// WalletConnect 相关
'walletconnect': [
'@web3modal/wagmi',
'@walletconnect/ethereum-provider',
],
// i18n
'i18n': ['react-i18next', 'i18next', 'i18next-browser-languagedetector'],
},
},
},
// 提高 chunk 大小警告阈值
chunkSizeWarningLimit: 600,
},
})