diff --git a/backend/services/identity-service/src/application/services/user-application.service.ts b/backend/services/identity-service/src/application/services/user-application.service.ts index 0fc49254..22cb92ed 100644 --- a/backend/services/identity-service/src/application/services/user-application.service.ts +++ b/backend/services/identity-service/src/application/services/user-application.service.ts @@ -512,6 +512,24 @@ export class UserApplicationService { await this.eventPublisher.publishAll(account.domainEvents); account.clearDomainEvents(); + // 发布 MPC Keygen 请求事件 (触发后台生成钱包) + const sessionId = crypto.randomUUID(); + await this.eventPublisher.publish( + new MpcKeygenRequestedEvent({ + sessionId, + userId: account.userId.toString(), + accountSequence: account.accountSequence.value, + username: `user_${account.accountSequence.value}`, + threshold: 2, + totalParties: 3, + requireDelegate: true, + }), + ); + + this.logger.log( + `Account registered: sequence=${accountSequence.value}, phone=${phoneNumber.value}, MPC keygen requested`, + ); + const tokens = await this.tokenService.generateTokenPair({ userId: account.userId.toString(), accountSequence: account.accountSequence.value,