@@ -29,7 +29,6 @@ import {
2929 type BridgeControllerMessenger ,
3030 type FetchFunction ,
3131 RequestStatus ,
32- ChainId ,
3332} from './types' ;
3433import { getAssetIdsForToken , toExchangeRates } from './utils/assets' ;
3534import { hasSufficientBalance } from './utils/balance' ;
@@ -70,7 +69,6 @@ import {
7069import type {
7170 QuoteFetchData ,
7271 RequestMetadata ,
73- RequestParams ,
7472 RequiredEventContextFromClient ,
7573} from './utils/metrics/types' ;
7674import { type CrossChainSwapsEventProperties } from './utils/metrics/types' ;
@@ -778,16 +776,6 @@ export class BridgeController extends StaticIntervalPollingController<BridgePoll
778776 return networkClient ;
779777 }
780778
781- readonly #getRequestParams = ( ) : Omit <
782- RequestParams ,
783- 'token_symbol_source' | 'token_symbol_destination'
784- > => {
785- const srcChainIdCaip = formatChainIdToCaip (
786- this . state . quoteRequest . srcChainId ?? ChainId . ETH ,
787- ) ;
788- return getRequestParams ( this . state . quoteRequest , srcChainIdCaip ) ;
789- } ;
790-
791779 readonly #getRequestMetadata = ( ) : Omit <
792780 RequestMetadata ,
793781 | 'stx_enabled'
@@ -830,18 +818,18 @@ export class BridgeController extends StaticIntervalPollingController<BridgePoll
830818 case UnifiedSwapBridgeEventName . ButtonClicked :
831819 case UnifiedSwapBridgeEventName . PageViewed :
832820 return {
833- ...this . # getRequestParams( ) ,
821+ ...getRequestParams ( this . state . quoteRequest ) ,
834822 ...baseProperties ,
835823 } ;
836824 case UnifiedSwapBridgeEventName . QuotesValidationFailed :
837825 return {
838- ...this . # getRequestParams( ) ,
826+ ...getRequestParams ( this . state . quoteRequest ) ,
839827 refresh_count : this . state . quotesRefreshCount ,
840828 ...baseProperties ,
841829 } ;
842830 case UnifiedSwapBridgeEventName . QuotesReceived :
843831 return {
844- ...this . # getRequestParams( ) ,
832+ ...getRequestParams ( this . state . quoteRequest ) ,
845833 ...this . #getRequestMetadata( ) ,
846834 ...this . #getQuoteFetchData( ) ,
847835 is_hardware_wallet : isHardwareWallet (
@@ -852,7 +840,7 @@ export class BridgeController extends StaticIntervalPollingController<BridgePoll
852840 } ;
853841 case UnifiedSwapBridgeEventName . QuotesRequested :
854842 return {
855- ...this . # getRequestParams( ) ,
843+ ...getRequestParams ( this . state . quoteRequest ) ,
856844 ...this . #getRequestMetadata( ) ,
857845 is_hardware_wallet : isHardwareWallet (
858846 this . #getMultichainSelectedAccount( ) ,
@@ -862,7 +850,7 @@ export class BridgeController extends StaticIntervalPollingController<BridgePoll
862850 } ;
863851 case UnifiedSwapBridgeEventName . QuotesError :
864852 return {
865- ...this . # getRequestParams( ) ,
853+ ...getRequestParams ( this . state . quoteRequest ) ,
866854 ...this . #getRequestMetadata( ) ,
867855 is_hardware_wallet : isHardwareWallet (
868856 this . #getMultichainSelectedAccount( ) ,
@@ -875,7 +863,7 @@ export class BridgeController extends StaticIntervalPollingController<BridgePoll
875863 case UnifiedSwapBridgeEventName . AllQuotesSorted :
876864 case UnifiedSwapBridgeEventName . QuoteSelected :
877865 return {
878- ...this . # getRequestParams( ) ,
866+ ...getRequestParams ( this . state . quoteRequest ) ,
879867 ...this . #getRequestMetadata( ) ,
880868 ...this . #getQuoteFetchData( ) ,
881869 is_hardware_wallet : isHardwareWallet (
@@ -887,7 +875,7 @@ export class BridgeController extends StaticIntervalPollingController<BridgePoll
887875 // Populate the properties that the error occurred before the tx was submitted
888876 return {
889877 ...baseProperties ,
890- ...this . # getRequestParams( ) ,
878+ ...getRequestParams ( this . state . quoteRequest ) ,
891879 ...this . #getRequestMetadata( ) ,
892880 ...this . #getQuoteFetchData( ) ,
893881 ...propertiesFromClient ,
0 commit comments