@@ -7,14 +7,12 @@ import {
77 SendManyOptions ,
88 BitGoBase ,
99 PendingApprovals ,
10- RequestType ,
1110 PrebuildTransactionResult ,
1211 Keychain ,
1312 TxRequest ,
1413} from '@bitgo/sdk-core' ;
1514import logger from '../../../logger' ;
1615import { MasterApiSpecRouteRequest } from '../routers/masterApiSpec' ;
17- import { sendTxRequest } from '@bitgo/sdk-core/dist/src/bitgo/tss/common' ;
1816import { handleEddsaSigning } from './eddsa' ;
1917import { EnclavedExpressClient } from '../clients/enclavedExpressClient' ;
2018
@@ -216,21 +214,22 @@ async function signAndSendTxRequests(
216214 throw new Error ( 'txRequestId missing from signed transaction' ) ;
217215 }
218216
219- if ( signedTxRequest . apiVersion === 'full' ) {
220- bitgo . setRequestTracer ( reqId ) ;
221- if ( signedTxRequest . state === 'pendingApproval' ) {
222- const pendingApprovals = new PendingApprovals ( bitgo , wallet . baseCoin ) ;
223- const pendingApproval = await pendingApprovals . get ( { id : signedTxRequest . pendingApprovalId } ) ;
224- return {
225- pendingApproval : pendingApproval . toJSON ( ) ,
226- txRequest : signedTxRequest ,
227- } ;
228- }
217+ if ( signedTxRequest . apiVersion !== 'full' ) {
218+ throw new Error ( 'Only TxRequest API version full is supported.' ) ;
219+ }
220+
221+ bitgo . setRequestTracer ( reqId ) ;
222+ if ( signedTxRequest . state === 'pendingApproval' ) {
223+ const pendingApprovals = new PendingApprovals ( bitgo , wallet . baseCoin ) ;
224+ const pendingApproval = await pendingApprovals . get ( { id : signedTxRequest . pendingApprovalId } ) ;
229225 return {
226+ pendingApproval : pendingApproval . toJSON ( ) ,
230227 txRequest : signedTxRequest ,
231- txid : ( signedTxRequest . transactions ?? [ ] ) [ 0 ] ?. signedTx ?. id ,
232- tx : ( signedTxRequest . transactions ?? [ ] ) [ 0 ] ?. signedTx ?. tx ,
233228 } ;
234229 }
235- return sendTxRequest ( bitgo , wallet . id ( ) , signedTxRequest . txRequestId , RequestType . tx , reqId ) ;
230+ return {
231+ txRequest : signedTxRequest ,
232+ txid : ( signedTxRequest . transactions ?? [ ] ) [ 0 ] ?. signedTx ?. id ,
233+ tx : ( signedTxRequest . transactions ?? [ ] ) [ 0 ] ?. signedTx ?. tx ,
234+ } ;
236235}
0 commit comments