@@ -547,6 +547,13 @@ export class RampService extends BaseRampService {
547547 rampStates . map ( async ramp => {
548548 const quote = quoteMap . get ( ramp . quoteId ) ;
549549
550+ if ( ! quote ) {
551+ throw new APIError ( {
552+ message : `Associated quote not found for ramp ${ ramp . id } ` ,
553+ status : httpStatus . NOT_FOUND
554+ } ) ;
555+ }
556+
550557 // Get or compute final transaction hash and explorer link (similar to getRampStatus)
551558 let transactionHash = ramp . state . finalTransactionHash ;
552559 let transactionExplorerLink = ramp . state . finalTransactionExplorerLink ;
@@ -555,8 +562,7 @@ export class RampService extends BaseRampService {
555562 if (
556563 ramp . type === RampDirection . BUY &&
557564 ramp . currentPhase === "complete" &&
558- ( ! transactionHash || ! transactionExplorerLink ) &&
559- quote
565+ ( ! transactionHash || ! transactionExplorerLink )
560566 ) {
561567 const result = await getFinalTransactionHashForRamp ( ramp , quote ) ;
562568 transactionHash = result . transactionHash ;
@@ -578,14 +584,14 @@ export class RampService extends BaseRampService {
578584 date : ramp . createdAt . toISOString ( ) ,
579585 externalTxExplorerLink : transactionExplorerLink ,
580586 externalTxHash : transactionHash ,
581- fromAmount : quote ?. inputAmount || "" ,
582- fromCurrency : quote ?. inputCurrency || "" ,
583- fromNetwork : ramp . from ,
587+ from : ramp . from ,
588+ fromAmount : quote . inputAmount ,
589+ fromCurrency : quote . inputCurrency ,
584590 id : ramp . id ,
585591 status : this . mapPhaseToStatus ( ramp . currentPhase ) ,
586- toAmount : quote ?. outputAmount || "" ,
587- toCurrency : quote ?. outputCurrency || "" ,
588- toNetwork : ramp . to ,
592+ to : ramp . to ,
593+ toAmount : quote . outputAmount ,
594+ toCurrency : quote . outputCurrency ,
589595 type : ramp . type
590596 } ;
591597 } )
0 commit comments