@@ -6,6 +6,7 @@ import debug from 'debug';
66import https from 'https' ;
77import http from 'http' ;
88import superagent from 'superagent' ;
9+ import bodyParser from 'body-parser' ;
910
1011import {
1112 createServer as createExpressApp ,
@@ -29,7 +30,6 @@ import {
2930 prepareIpc ,
3031 readCertificates ,
3132} from './shared/appUtils' ;
32- import bodyParser from 'body-parser' ;
3333import { ProxyAgent } from 'proxy-agent' ;
3434import pjson from '../package.json' ;
3535import { handleGenerateWalletOnPrem } from './masterBitgoExpress/generateWallet' ;
@@ -197,8 +197,6 @@ const handleGenerateWallet: ServiceFunction<typeof GenerateWalletRequest> = asyn
197197 coin,
198198 enterprise,
199199 label,
200- authorization,
201- 'user-agent' : userAgent ,
202200} ) => {
203201 try {
204202 const cfg = config ( ) as MasterExpressConfig ;
@@ -207,29 +205,24 @@ const handleGenerateWallet: ServiceFunction<typeof GenerateWalletRequest> = asyn
207205 const bitGo = new BitGo ( {
208206 env : cfg . env ,
209207 customRootURI : cfg . customRootUri ,
210- accessToken : authorization ?. startsWith ( 'Bearer ' ) ? authorization . substring ( 7 ) : undefined ,
211- userAgent : userAgent ? BITGOEXPRESS_USER_AGENT + ' ' + userAgent : BITGOEXPRESS_USER_AGENT ,
208+ // accessToken: Authorization?.startsWith('Bearer ') ? Authorization.substring(7) : undefined,
209+ accessToken : 'v2xa0f0fa5fffa0ff7529b47c969cf544f4df1b21a5508109bed488a9d2c9d74f54' ,
210+ // userAgent: userAgent ? BITGOEXPRESS_USER_AGENT + ' ' + userAgent : BITGOEXPRESS_USER_AGENT,
212211 } ) ;
213212
214- // Prepare the request object for the existing handler
215- // const bitgoReq = {
216- // bitgo,
217- // body: req.body,
218- // params: req.pathParams,
219- // config: cfg,
220- // } as BitGoRequest;
221-
222213 // Call the existing implementation
214+ console . log ( 'here' , bitGo ) ;
223215 const result = await handleGenerateWalletOnPrem ( {
224216 bitGo,
225217 params : {
226218 coin,
227- label,
228- enterprise,
219+ label : 'world' ,
220+ enterprise : '6750c2d327511bc4e5f83ccfcfe1b3eb' ,
229221 multisigType : 'onchain' , // Default multisig type
230222 isDistributedCustody : false , // Default value
231223 } ,
232224 } ) ;
225+ console . log ( result ) ;
233226 return Response . ok ( result ) ;
234227 } catch ( error ) {
235228 debugLogger ( 'Failed to generate wallet:' , error ) ;
@@ -258,7 +251,8 @@ export function app(cfg: MasterExpressConfig): express.Application {
258251 console . log ( 'Certificate length:' , cfg . enclavedExpressSSLCert . length ) ;
259252 console . log ( 'Certificate content:' , cfg . enclavedExpressSSLCert ) ;
260253
261- const app = createExpressApp ( MasterExpressApi , ( _app ) => {
254+ const app = createExpressApp ( MasterExpressApi , ( app ) => {
255+ app . use ( bodyParser . json ( { limit : '1mb' } ) ) ;
262256 return {
263257 'api.v1.health.pingMasterExpress' : {
264258 post : routeHandler ( {
0 commit comments