@@ -68,8 +68,7 @@ interface EddsaSigningParams {
6868}
6969
7070export async function signMpcTransaction ( req : EnclavedApiSpecRouteRequest < 'v1.mpc.sign' , 'post' > ) {
71- const { source, pub, encryptedDataKey } = req . decoded ;
72- const { coin : coinName , shareType } = req . params ;
71+ const { source, pub, coin, encryptedDataKey, shareType } = req . decoded ;
7372
7473 if ( ! source || ! pub ) {
7574 throw new Error ( 'Source and public key are required for MPC signing' ) ;
@@ -80,7 +79,7 @@ export async function signMpcTransaction(req: EnclavedApiSpecRouteRequest<'v1.mp
8079 }
8180
8281 const bitgo = req . bitgo ;
83- const coin = bitgo . coin ( coinName ) ;
82+ const coinInstance = bitgo . coin ( coin ) ;
8483
8584 // Get private key from KMS
8685 const prv = await retrieveKmsPrvKey ( { pub, source, cfg : req . config } ) ;
@@ -92,11 +91,11 @@ export async function signMpcTransaction(req: EnclavedApiSpecRouteRequest<'v1.mp
9291 }
9392
9493 try {
95- const mpcAlgorithm = coin . getMPCAlgorithm ?.( ) || MPCType . ECDSA ; // Default to ECDSA if method doesn't exist
94+ const mpcAlgorithm = coinInstance . getMPCAlgorithm ?.( ) || MPCType . ECDSA ; // Default to ECDSA if method doesn't exist
9695
9796 if ( mpcAlgorithm === MPCType . EDDSA ) {
9897 return await handleEddsaSigning ( req . bitgo , req . config , {
99- coin,
98+ coin : coinInstance ,
10099 shareType,
101100 txRequest : req . decoded . txRequest ,
102101 prv,
0 commit comments