22a6544373
- 更新 EIP-712 签名结构: domain version "1"→"2", 移除 taker/expiration/nonce/feeRateBps, 新增 timestamp/metadata/builder - 更新合约地址为 V2 (CTF_EXCHANGE, NEG_RISK_EXCHANGE) - CLOB URL 切换到 clob-v2.polymarket.com - 抵押品代币 USDC.e → pUSD (0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB) - 新增 USDC.e → pUSD wrap 功能 (CollateralOnramp 合约) - SignedOrderObject 补充 API payload 必需的 taker/expiration 字段 - NewOrderRequest 补充 deferExec/postOnly 字段 - 前端账户管理新增 pUSD 迁移按钮 - 移除所有 feeRateBps 相关逻辑 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Polymarket 跟单系统前端
技术栈
- 框架: React 18 + TypeScript
- 构建工具: Vite
- UI 库: Ant Design + Ant Design Mobile
- HTTP 客户端: axios
- 状态管理: Zustand
- 路由: React Router
- 以太坊库: ethers.js
功能特性
- ✅ 账户管理(通过私钥导入,支持多账户)
- ✅ Leader 管理(被跟单者管理)
- ✅ 跟单配置管理
- ✅ 订单管理
- ✅ 统计信息
- ✅ 移动端适配
开发
# 安装依赖
npm install
# 启动开发服务器
npm run dev
# 构建生产版本
npm run build
项目结构
frontend/
├── src/
│ ├── components/ # 公共组件
│ │ └── Layout.tsx # 布局组件(支持移动端)
│ ├── pages/ # 页面组件
│ │ ├── AccountList.tsx
│ │ ├── AccountImport.tsx
│ │ ├── LeaderList.tsx
│ │ ├── LeaderAdd.tsx
│ │ ├── ConfigPage.tsx
│ │ ├── OrderList.tsx
│ │ └── Statistics.tsx
│ ├── services/ # API 服务
│ │ └── api.ts
│ ├── store/ # 状态管理
│ │ └── accountStore.ts
│ ├── types/ # TypeScript 类型定义
│ │ └── index.ts
│ ├── utils/ # 工具函数
│ │ └── ethers.ts
│ ├── styles/ # 样式文件
│ │ └── index.css
│ ├── App.tsx # 根组件
│ └── main.tsx # 入口文件
├── index.html
├── package.json
├── tsconfig.json
└── vite.config.ts
移动端适配
- 使用
react-responsive检测设备类型 - 移动端使用 Ant Design Mobile 组件
- 响应式布局(移动端 < 768px,桌面端 >= 768px)
- 触摸友好的按钮尺寸(>= 44x44px)