diff --git a/backend/mpc-system/services/session-coordinator/adapters/input/grpc/session_grpc_handler.go b/backend/mpc-system/services/session-coordinator/adapters/input/grpc/session_grpc_handler.go index 2748a45a..95c9fbd0 100644 --- a/backend/mpc-system/services/session-coordinator/adapters/input/grpc/session_grpc_handler.go +++ b/backend/mpc-system/services/session-coordinator/adapters/input/grpc/session_grpc_handler.go @@ -159,6 +159,8 @@ func (s *SessionCoordinatorServer) CreateSession( Participants: participants, MessageHash: req.MessageHash, ExpiresIn: time.Duration(req.ExpiresInSeconds) * time.Second, + WalletName: req.WalletName, + InviteCode: req.InviteCode, } // Parse and set keygen_session_id if provided (for signing sessions) diff --git a/backend/mpc-system/services/session-coordinator/application/ports/input/session_management_port.go b/backend/mpc-system/services/session-coordinator/application/ports/input/session_management_port.go index d3caf58e..6c9cecea 100644 --- a/backend/mpc-system/services/session-coordinator/application/ports/input/session_management_port.go +++ b/backend/mpc-system/services/session-coordinator/application/ports/input/session_management_port.go @@ -55,6 +55,8 @@ type CreateSessionInput struct { ExpiresIn time.Duration DelegateUserShare *DelegateUserShare // For sign sessions with delegate party KeygenSessionID uuid.UUID // For sign sessions: which keygen session's shares to use + WalletName string // For co_managed_keygen: wallet name + InviteCode string // For co_managed_keygen: invite code for participants } // ParticipantInfo contains information about a participant diff --git a/backend/mpc-system/services/session-coordinator/application/use_cases/create_session.go b/backend/mpc-system/services/session-coordinator/application/use_cases/create_session.go index dabd8029..cadb8bf4 100644 --- a/backend/mpc-system/services/session-coordinator/application/use_cases/create_session.go +++ b/backend/mpc-system/services/session-coordinator/application/use_cases/create_session.go @@ -138,6 +138,18 @@ func (uc *CreateSessionUseCase) Execute( zap.String("keygen_session_id", req.KeygenSessionID.String())) } + // 4.2 Set wallet name and invite code for co_managed_keygen sessions + if req.WalletName != "" { + session.WalletName = req.WalletName + } + if req.InviteCode != "" { + session.InviteCode = req.InviteCode + logger.Info("Co-managed keygen session created with invite code", + zap.String("session_id", session.ID.String()), + zap.String("wallet_name", req.WalletName), + zap.String("invite_code", req.InviteCode)) + } + // 5. Add participants and generate join tokens tokens := make(map[string]string) if len(req.Participants) == 0 {