diff --git a/backend/mpc-system/services/service-party-app/electron/main.ts b/backend/mpc-system/services/service-party-app/electron/main.ts index 1794a93e..27e2477c 100644 --- a/backend/mpc-system/services/service-party-app/electron/main.ts +++ b/backend/mpc-system/services/service-party-app/electron/main.ts @@ -1810,6 +1810,8 @@ function setupIpcHandlers() { ipcMain.handle('cosign:getSessionStatus', async (_event, { sessionId }) => { try { const result = await accountClient?.getSignSessionStatus(sessionId); + // API 返回的是 participants 字段 + const apiParticipants = (result as { participants?: Array<{ party_id: string; party_index: number; status: string }> })?.participants || []; return { success: true, session: { @@ -1817,15 +1819,15 @@ function setupIpcHandlers() { status: result?.status, joinedCount: result?.joined_count, threshold: { - t: activeCoSignSession?.threshold?.t || 0, - n: activeCoSignSession?.threshold?.n || 0, + t: result?.threshold_t || activeCoSignSession?.threshold?.t || 0, + n: result?.threshold_n || activeCoSignSession?.threshold?.n || 0, }, - participants: result?.parties?.map((p: { party_id: string; party_index: number }, idx: number) => ({ + participants: apiParticipants.map((p, idx) => ({ partyId: p.party_id, partyIndex: p.party_index, name: activeCoSignSession?.participants?.find(ap => ap.partyId === p.party_id)?.name || `参与方 ${idx + 1}`, - status: 'ready', - })) || [], + status: p.status || 'waiting', + })), messageHash: activeCoSignSession?.messageHash || '', walletName: activeCoSignSession?.walletName || '', }, diff --git a/backend/mpc-system/services/service-party-app/electron/modules/account-client.ts b/backend/mpc-system/services/service-party-app/electron/modules/account-client.ts index 42ee099d..79cedf1e 100644 --- a/backend/mpc-system/services/service-party-app/electron/modules/account-client.ts +++ b/backend/mpc-system/services/service-party-app/electron/modules/account-client.ts @@ -144,9 +144,14 @@ export interface GetSignSessionByInviteCodeResponse { export interface GetSignSessionStatusResponse { session_id: string; status: string; + session_type: string; threshold_t: number; - joined_count: number; - parties: SignPartyInfo[]; + threshold_n: number; + completed_parties: number; + total_parties: number; + joined_count?: number; + parties?: SignPartyInfo[]; + participants?: Array<{ party_id: string; party_index: number; status: string }>; message_hash?: string; signature?: string; }