11import { RequestTracer , PrebuildTransactionOptions , Memo , KeyIndices } from '@bitgo/sdk-core' ;
2- import { createEnclavedExpressClient } from './enclavedExpressClient' ;
32import logger from '../logger' ;
43import { MasterApiSpecRouteRequest } from './routers/masterApiSpec' ;
54import { isMasterExpressConfig } from '../initConfig' ;
@@ -18,13 +17,7 @@ interface Recipient {
1817}
1918
2019export async function handleSendMany ( req : MasterApiSpecRouteRequest < 'v1.wallet.sendMany' , 'post' > ) {
21- if ( ! isMasterExpressConfig ( req . config ) ) {
22- throw new Error ( 'Configuration must be in master express mode' ) ;
23- }
24- const enclavedExpressClient = createEnclavedExpressClient ( req . config , req . params . coin ) ;
25- if ( ! enclavedExpressClient ) {
26- throw new Error ( 'Please configure enclaved express configs to sign the transactions.' ) ;
27- }
20+ const enclavedExpressClient = req . enclavedExpressClient ;
2821 const reqId = new RequestTracer ( ) ;
2922 const bitgo = req . bitgo ;
3023 const baseCoin = bitgo . coin ( req . params . coin ) ;
@@ -96,7 +89,7 @@ export async function handleSendMany(req: MasterApiSpecRouteRequest<'v1.wallet.s
9689 const err = e as Error ;
9790 logger . error ( 'transaction prebuild failed local validation:' , err . message ) ;
9891 logger . error ( 'transaction prebuild:' , JSON . stringify ( txPrebuilt , null , 2 ) ) ;
99- throw new Error ( `Transaction prebuild failed local validation: ${ err . message } ` ) ;
92+ throw new Error ( `Transaction prebuild failed local validation: ${ err . message } ` ) ;
10093 }
10194
10295 logger . debug ( 'Tx prebuild: %s' , JSON . stringify ( txPrebuilt , null , 2 ) ) ;
0 commit comments