@@ -310,6 +310,73 @@ const MpcV2RecoveryResponse = {
310310const MpcV2RecoveryResponseType = t . type ( MpcV2RecoveryResponse ) ;
311311export type MpcV2RecoveryResponseType = t . TypeOf < typeof MpcV2RecoveryResponseType > ;
312312
313+ // EdDSA MPCv2 key generation types
314+ const EddsaMPCv2KeyGenSignedMessage = t . type ( {
315+ message : t . string ,
316+ signature : t . string ,
317+ } ) ;
318+
319+ const EddsaMPCv2KeyGenInitializeRequest = {
320+ source : t . union ( [ t . literal ( 'user' ) , t . literal ( 'backup' ) ] ) ,
321+ enterprise : t . string ,
322+ bitgoPublicGpgKey : t . string ,
323+ } ;
324+ const EddsaMPCv2KeyGenInitializeRequestType = t . type ( EddsaMPCv2KeyGenInitializeRequest ) ;
325+ export type EddsaMPCv2KeyGenInitializeRequestType = t . TypeOf <
326+ typeof EddsaMPCv2KeyGenInitializeRequestType
327+ > ;
328+
329+ const EddsaMPCv2KeyGenInitializeResponse = {
330+ gpgPublicKey : t . string ,
331+ signedMsg1 : EddsaMPCv2KeyGenSignedMessage ,
332+ encryptedState : t . string ,
333+ encryptedStateKey : t . string ,
334+ } ;
335+ const EddsaMPCv2KeyGenInitializeResponseType = t . type ( EddsaMPCv2KeyGenInitializeResponse ) ;
336+ export type EddsaMPCv2KeyGenInitializeResponseType = t . TypeOf <
337+ typeof EddsaMPCv2KeyGenInitializeResponseType
338+ > ;
339+
340+ const EddsaMPCv2KeyGenRound1Request = {
341+ source : t . union ( [ t . literal ( 'user' ) , t . literal ( 'backup' ) ] ) ,
342+ bitgoMsg1 : EddsaMPCv2KeyGenSignedMessage ,
343+ encryptedState : t . string ,
344+ encryptedStateKey : t . string ,
345+ } ;
346+ const EddsaMPCv2KeyGenRound1RequestType = t . type ( EddsaMPCv2KeyGenRound1Request ) ;
347+ export type EddsaMPCv2KeyGenRound1RequestType = t . TypeOf < typeof EddsaMPCv2KeyGenRound1RequestType > ;
348+
349+ const EddsaMPCv2KeyGenRound1Response = {
350+ signedMsg2 : EddsaMPCv2KeyGenSignedMessage ,
351+ encryptedState : t . string ,
352+ encryptedStateKey : t . string ,
353+ } ;
354+ const EddsaMPCv2KeyGenRound1ResponseType = t . type ( EddsaMPCv2KeyGenRound1Response ) ;
355+ export type EddsaMPCv2KeyGenRound1ResponseType = t . TypeOf <
356+ typeof EddsaMPCv2KeyGenRound1ResponseType
357+ > ;
358+
359+ const EddsaMPCv2KeyGenFinalizeRequest = {
360+ source : t . union ( [ t . literal ( 'user' ) , t . literal ( 'backup' ) ] ) ,
361+ bitgoMsg2 : EddsaMPCv2KeyGenSignedMessage ,
362+ commonPublicKeychain : t . string ,
363+ encryptedState : t . string ,
364+ encryptedStateKey : t . string ,
365+ } ;
366+ const EddsaMPCv2KeyGenFinalizeRequestType = t . type ( EddsaMPCv2KeyGenFinalizeRequest ) ;
367+ export type EddsaMPCv2KeyGenFinalizeRequestType = t . TypeOf <
368+ typeof EddsaMPCv2KeyGenFinalizeRequestType
369+ > ;
370+
371+ const EddsaMPCv2KeyGenFinalizeResponse = {
372+ source : t . union ( [ t . literal ( 'user' ) , t . literal ( 'backup' ) ] ) ,
373+ commonKeychain : t . string ,
374+ } ;
375+ const EddsaMPCv2KeyGenFinalizeResponseType = t . type ( EddsaMPCv2KeyGenFinalizeResponse ) ;
376+ export type EddsaMPCv2KeyGenFinalizeResponseType = t . TypeOf <
377+ typeof EddsaMPCv2KeyGenFinalizeResponseType
378+ > ;
379+
313380// API Specification
314381export const AdvancedWalletManagerApiSpec = apiSpec ( {
315382 'v1.multisig.sign' : {
@@ -481,6 +548,51 @@ export const AdvancedWalletManagerApiSpec = apiSpec({
481548 description : 'Recover a MPC transaction' ,
482549 } ) ,
483550 } ,
551+ 'v1.eddsampcv2.keygen.initialize' : {
552+ post : httpRoute ( {
553+ method : 'POST' ,
554+ path : '/api/{coin}/eddsampcv2/keygen/initialize' ,
555+ request : httpRequest ( {
556+ params : { coin : t . string } ,
557+ body : EddsaMPCv2KeyGenInitializeRequest ,
558+ } ) ,
559+ response : {
560+ 200 : EddsaMPCv2KeyGenInitializeResponseType ,
561+ ...ErrorResponses ,
562+ } ,
563+ description : 'Initialize EdDSA MPCv2 key generation' ,
564+ } ) ,
565+ } ,
566+ 'v1.eddsampcv2.keygen.round1' : {
567+ post : httpRoute ( {
568+ method : 'POST' ,
569+ path : '/api/{coin}/eddsampcv2/keygen/round1' ,
570+ request : httpRequest ( {
571+ params : { coin : t . string } ,
572+ body : EddsaMPCv2KeyGenRound1Request ,
573+ } ) ,
574+ response : {
575+ 200 : EddsaMPCv2KeyGenRound1ResponseType ,
576+ ...ErrorResponses ,
577+ } ,
578+ description : 'EdDSA MPCv2 key generation round 1' ,
579+ } ) ,
580+ } ,
581+ 'v1.eddsampcv2.keygen.finalize' : {
582+ post : httpRoute ( {
583+ method : 'POST' ,
584+ path : '/api/{coin}/eddsampcv2/keygen/finalize' ,
585+ request : httpRequest ( {
586+ params : { coin : t . string } ,
587+ body : EddsaMPCv2KeyGenFinalizeRequest ,
588+ } ) ,
589+ response : {
590+ 200 : EddsaMPCv2KeyGenFinalizeResponseType ,
591+ ...ErrorResponses ,
592+ } ,
593+ description : 'Finalize EdDSA MPCv2 key generation' ,
594+ } ) ,
595+ } ,
484596} ) ;
485597
486598export type AkmApiSpecRouteHandler <
@@ -613,5 +725,23 @@ export function createKeyGenRouter(
613725 } ) ,
614726 ] ) ;
615727
728+ router . post ( 'v1.eddsampcv2.keygen.initialize' , [
729+ responseHandler < AdvancedWalletManagerConfig > ( async ( _req ) => {
730+ throw new NotImplementedError ( 'EdDSA MPCv2 key generation initialize not implemented' ) ;
731+ } ) ,
732+ ] ) ;
733+
734+ router . post ( 'v1.eddsampcv2.keygen.round1' , [
735+ responseHandler < AdvancedWalletManagerConfig > ( async ( _req ) => {
736+ throw new NotImplementedError ( 'EdDSA MPCv2 key generation round1 not implemented' ) ;
737+ } ) ,
738+ ] ) ;
739+
740+ router . post ( 'v1.eddsampcv2.keygen.finalize' , [
741+ responseHandler < AdvancedWalletManagerConfig > ( async ( _req ) => {
742+ throw new NotImplementedError ( 'EdDSA MPCv2 key generation finalize not implemented' ) ;
743+ } ) ,
744+ ] ) ;
745+
616746 return router ;
617747}
0 commit comments