File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed
Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 11import { KmsClient } from '../../kms/kmsClient' ;
2- import { RequestTracer , TransactionPrebuild } from 'bitgo' ;
2+ import { TransactionPrebuild } from 'bitgo' ;
33import logger from '../../logger' ;
44import { EnclavedApiSpecRouteRequest } from '../../enclavedBitgoExpress/routers/enclavedApiSpec' ;
55
Original file line number Diff line number Diff line change @@ -32,9 +32,17 @@ winston.addColors(colors);
3232const format = winston . format . combine (
3333 winston . format . timestamp ( { format : 'YYYY-MM-DD HH:mm:ss:ms' } ) ,
3434 winston . format . colorize ( { all : true } ) ,
35- winston . format . printf (
36- ( info : winston . Logform . TransformableInfo ) => `${ info . timestamp } ${ info . level } : ${ info . message } ` ,
37- ) ,
35+ winston . format . printf ( ( info : winston . Logform . TransformableInfo ) => {
36+ // Handle both string interpolation and object logging
37+ const message = typeof info . message === 'string' ? info . message : JSON . stringify ( info . message ) ;
38+
39+ // If there are additional arguments, format them
40+ const args = ( info [ Symbol . for ( 'splat' ) ] as any [ ] ) || [ ] ;
41+ const formattedMessage =
42+ args . length > 0 ? message . replace ( / % s / g, ( ) => String ( args . shift ( ) || '' ) ) : message ;
43+
44+ return `${ info . timestamp } ${ info . level } : ${ formattedMessage } ` ;
45+ } ) ,
3846) ;
3947
4048// Define which transports the logger must use
Original file line number Diff line number Diff line change 11import { RequestTracer , PrebuildTransactionOptions , Memo } from '@bitgo/sdk-core' ;
2- import { BitGoRequest } from '../types/request' ;
32import { createEnclavedExpressClient } from './enclavedExpressClient' ;
43import logger from '../logger' ;
54import { MasterApiSpecRouteRequest } from './routers/masterApiSpec' ;
5+ import { isMasterExpressConfig } from '../config' ;
66
77/**
88 * Defines the structure for a single recipient in a send-many transaction.
@@ -18,6 +18,9 @@ interface Recipient {
1818}
1919
2020export 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+ }
2124 const enclavedExpressClient = createEnclavedExpressClient ( req . config , req . params . coin ) ;
2225 if ( ! enclavedExpressClient ) {
2326 throw new Error ( 'Please configure enclaved express configs to sign the transactions.' ) ;
You can’t perform that action at this time.
0 commit comments