feat: 支持 Magic(邮箱/社交登录)账户导入和赎回

- 前端:启用 Magic 账户导入选项(移除 disabled 和"暂不支持"提示)
- 订单签名:根据钱包类型自动设置 signatureType(Magic=1, Safe=2)
- Builder Relayer API:添加 relay-payload 接口和 PROXY 请求类型支持
- RelayClientService:实现 Magic PROXY 赎回流程(Gasless,需 Builder API Key)
  - 获取 relay payload(relay 地址和 nonce)
  - 编码 ProxyFactory.proxy(calls) 调用数据
  - 创建并签名 PROXY 结构哈希
  - 提交 PROXY 类型交易到 Builder Relayer
- BlockchainService:redeemPositions 支持 walletType 参数
- AccountService:移除 Magic 账户赎回限制,传递 walletType 参数

Magic 账户赎回要求配置 Builder API Key(Gasless),Safe 账户保持原有逻辑不变。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
WrBug
2026-02-13 22:51:18 +08:00
co-authored by Cursor
parent a067a20a02
commit bd323fca35
11 changed files with 253 additions and 41 deletions
@@ -227,8 +227,8 @@ const AccountImportForm: React.FC<AccountImportFormProps> = ({
<Radio value="safe">
{t('accountImport.walletTypeSafe')}
</Radio>
<Radio value="magic" disabled>
{t('accountImport.walletTypeMagic')} {t('accountImport.magicNotSupported')}
<Radio value="magic">
{t('accountImport.walletTypeMagic')}
</Radio>
</Radio.Group>
</Form.Item>
+1 -1
View File
@@ -215,7 +215,7 @@
"walletTypeHelp": "Web3 Wallet: Polymarket accounts connected via browser wallets like MetaMask\nMagic: Polymarket accounts logged in via email or social accounts (Google, Twitter, etc.)",
"walletTypeMagic": "Magic (Email/Social Login)",
"walletTypeSafe": "Web3 Wallet",
"magicNotSupported": "(Not Supported)"
"magicNotSupported": ""
},
"leader": {
"title": "Leader Management",
+1 -1
View File
@@ -215,7 +215,7 @@
"walletTypeHelp": "Web3钱包:使用 MetaMask 等浏览器钱包连接的 Polymarket 账户\nMagic:通过邮箱或社交账号(如 Google、Twitter)登录的 Polymarket 账户",
"walletTypeMagic": "Magic(邮箱/社交账号登录)",
"walletTypeSafe": "Web3钱包",
"magicNotSupported": "(暂不支持)"
"magicNotSupported": ""
},
"leader": {
"title": "Leader 管理",
+1 -1
View File
@@ -215,7 +215,7 @@
"walletTypeHelp": "Web3錢包:使用 MetaMask 等瀏覽器錢包連接的 Polymarket 帳戶\nMagic:透過郵箱或社群帳號(如 Google、Twitter)登入的 Polymarket 帳戶",
"walletTypeMagic": "Magic(郵箱/社群帳號登入)",
"walletTypeSafe": "Web3錢包",
"magicNotSupported": "(暫不支持)"
"magicNotSupported": ""
},
"leader": {
"title": "Leader 管理",