From 1bf7f57e1258703f8a2fdf6a4ada40767e919d6d Mon Sep 17 00:00:00 2001 From: hailin Date: Tue, 30 Dec 2025 06:57:59 -0800 Subject: [PATCH] fix(transfer): pass sessionId and participants to executeSign MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add signSessionId state to store the session ID from createSignSession - Add ParticipantInfo interface and participants field to ShareInfo - Build participants list from share data for executeSign call - Fix "Party not found in participants list" error 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../service-party-app/src/pages/Transfer.tsx | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/backend/mpc-system/services/service-party-app/src/pages/Transfer.tsx b/backend/mpc-system/services/service-party-app/src/pages/Transfer.tsx index 3da5b690..dbc2a164 100644 --- a/backend/mpc-system/services/service-party-app/src/pages/Transfer.tsx +++ b/backend/mpc-system/services/service-party-app/src/pages/Transfer.tsx @@ -16,12 +16,18 @@ import { } from '../utils/transaction'; import { deriveEvmAddress, formatAddress } from '../utils/address'; +interface ParticipantInfo { + partyId: string; + name?: string; +} + interface ShareInfo { id: string; walletName: string; publicKey: string; sessionId: string; threshold: { t: number; n: number }; + participants?: ParticipantInfo[]; evmAddress?: string; balance?: string; } @@ -52,6 +58,7 @@ export default function Transfer() { // 签名会话 const [inviteCode, setInviteCode] = useState(''); + const [signSessionId, setSignSessionId] = useState(''); // 错误信息 const [error, setError] = useState(''); @@ -206,6 +213,7 @@ export default function Transfer() { } setInviteCode(result.inviteCode || ''); + setSignSessionId(result.sessionId || ''); setTxHash(messageHash); // 显示邀请码,等待用户通知其他参与方 @@ -219,17 +227,23 @@ export default function Transfer() { // 执行签名并广播 const handleExecuteAndBroadcast = async () => { - if (!txParams || !share || !txHash) return; + if (!txParams || !share || !txHash || !signSessionId) return; try { + // 构建 participants 列表 + const participants = (share.participants || []).map((p, index) => ({ + partyId: p.partyId, + partyIndex: index, + })); + // 执行 TSS 签名 if (window.electronAPI) { const signResult = await window.electronAPI.grpc.executeSign({ - sessionId: '', // 将从邀请码获取 + sessionId: signSessionId, shareId: share.id, password, messageHash: txHash.slice(2), - participants: [], // 将从会话获取 + participants, threshold: share.threshold, });