@@ -210,17 +210,21 @@ export const getPairsTokenAggregator = (
210210 getQuoteCurrencies ( oracleQuoteCurrency )
211211 ) ;
212212
213- const pairs = Object . entries ( assetsWithoutQuoteCurrency ) . map ( ( [ tokenSymbol , tokenAddress ] ) => {
214- //if (true/*tokenSymbol !== 'WETH' && tokenSymbol !== 'ETH' && tokenSymbol !== 'LpWETH'*/) {
215- const aggregatorAddressIndex = Object . keys ( aggregatorsAddresses ) . findIndex (
216- ( value ) => value === tokenSymbol
217- ) ;
218- const [ , aggregatorAddress ] = (
219- Object . entries ( aggregatorsAddresses ) as [ string , tEthereumAddress ] [ ]
220- ) [ aggregatorAddressIndex ] ;
221- return [ tokenAddress , aggregatorAddress ] ;
222- //}
223- } ) as [ string , string ] [ ] ;
213+ const pairs = Object . entries ( assetsWithoutQuoteCurrency ) . reduce < [ string , string ] [ ] > (
214+ ( acc , [ tokenSymbol , tokenAddress ] ) => {
215+ const aggregatorAddressIndex = Object . keys ( aggregatorsAddresses ) . findIndex (
216+ ( value ) => value === tokenSymbol
217+ ) ;
218+ if ( aggregatorAddressIndex >= 0 ) {
219+ const [ , aggregatorAddress ] = (
220+ Object . entries ( aggregatorsAddresses ) as [ string , tEthereumAddress ] [ ]
221+ ) [ aggregatorAddressIndex ] ;
222+ return [ ...acc , [ tokenAddress , aggregatorAddress ] ] ;
223+ }
224+ return acc ;
225+ } ,
226+ [ ]
227+ ) ;
224228
225229 const mappedPairs = pairs . map ( ( [ asset ] ) => asset ) ;
226230 const mappedAggregators = pairs . map ( ( [ , source ] ) => source ) ;
@@ -424,23 +428,26 @@ export const getFlashLiquidationAdapter = async (address?: tEthereumAddress) =>
424428export const getMockParaSwapAugustus = async ( address ?: tEthereumAddress ) =>
425429 await MockParaSwapAugustusFactory . connect (
426430 address ||
427- ( await getDb ( ) . get ( `${ eContractid . MockParaSwapAugustus } .${ DRE . network . name } ` ) . value ( ) )
428- . address ,
431+ (
432+ await getDb ( ) . get ( `${ eContractid . MockParaSwapAugustus } .${ DRE . network . name } ` ) . value ( )
433+ ) . address ,
429434 await getFirstSigner ( )
430435 ) ;
431436
432437export const getMockParaSwapAugustusRegistry = async ( address ?: tEthereumAddress ) =>
433438 await MockParaSwapAugustusRegistryFactory . connect (
434439 address ||
435- ( await getDb ( ) . get ( `${ eContractid . MockParaSwapAugustusRegistry } .${ DRE . network . name } ` ) . value ( ) )
436- . address ,
440+ (
441+ await getDb ( ) . get ( `${ eContractid . MockParaSwapAugustusRegistry } .${ DRE . network . name } ` ) . value ( )
442+ ) . address ,
437443 await getFirstSigner ( )
438444 ) ;
439445
440446export const getParaSwapLiquiditySwapAdapter = async ( address ?: tEthereumAddress ) =>
441447 await ParaSwapLiquiditySwapAdapterFactory . connect (
442448 address ||
443- ( await getDb ( ) . get ( `${ eContractid . ParaSwapLiquiditySwapAdapter } .${ DRE . network . name } ` ) . value ( ) )
444- . address ,
449+ (
450+ await getDb ( ) . get ( `${ eContractid . ParaSwapLiquiditySwapAdapter } .${ DRE . network . name } ` ) . value ( )
451+ ) . address ,
445452 await getFirstSigner ( )
446453 ) ;
0 commit comments