@@ -480,16 +480,24 @@ export class SorobanService {
480480 * Expects base64-encoded XDR (envelope).
481481 */
482482 async submitTransaction ( transactionXdr : string ) : Promise < SorobanRpc . Api . SendTransactionResponse > {
483- const server = this . makeServer ( ) ;
484- const tx = TransactionBuilder . fromXDR ( transactionXdr , this . networkPassphrase ) ;
485-
486- try {
487- const response = await server . sendTransaction ( tx ) ;
488- if ( response . status === 'ERROR' ) {
489- throw new BadRequestException ( {
490- code : 'TRANSACTION_REJECTED' ,
491- message : 'The transaction was rejected by the network.' ,
492- details : response . errorResult ,
483+ return this . trackRpc ( 'send_transaction' , async ( ) => {
484+ const server = this . makeServer ( ) ;
485+ const tx = TransactionBuilder . fromXDR ( transactionXdr , this . networkPassphrase ) ;
486+ try {
487+ const response = await server . sendTransaction ( tx ) ;
488+ if ( response . status === 'ERROR' ) {
489+ throw new BadRequestException ( {
490+ code : 'TRANSACTION_REJECTED' ,
491+ message : 'The transaction was rejected by the network.' ,
492+ details : response . errorResult ,
493+ } ) ;
494+ }
495+ return response ;
496+ } catch ( err ) {
497+ this . logger . error ( 'Transaction submission error' , err ) ;
498+ throw new ServiceUnavailableException ( {
499+ code : 'SUBMISSION_FAILED' ,
500+ message : 'Failed to submit transaction to the network.' ,
493501 } ) ;
494502 }
495503 } ) ;
0 commit comments