@@ -36,7 +36,7 @@ import {
3636 WRAP_QUOTE_GAS ,
3737 ZERO ,
3838} from '../constants' ;
39- import { InsufficientFundsError } from '../errors' ;
39+ import { InsufficientFundsError , ValidationError , ValidationErrorCodes } from '../errors' ;
4040import { logger } from '../logger' ;
4141import { TokenMetadatasForChains } from '../token_metadatas_for_networks' ;
4242import {
@@ -74,8 +74,12 @@ export class SwapService {
7474 ...SWAP_QUOTER_OPTS ,
7575 rfqt : {
7676 ...SWAP_QUOTER_OPTS . rfqt ,
77- warningLogger : logger . warn . bind ( logger ) ,
78- infoLogger : logger . info . bind ( logger ) ,
77+ // tslint:disable-next-line:no-empty
78+ warningLogger : ( ) => { } ,
79+ // tslint:disable-next-line:no-empty
80+ infoLogger : ( ) => { } ,
81+ // warningLogger: logger.warn.bind(logger),
82+ // infoLogger: logger.info.bind(logger),
7983 } ,
8084 } ;
8185 this . _swapQuoter = new SwapQuoter ( this . _provider , orderbook , swapQuoterOpts ) ;
@@ -449,6 +453,16 @@ export class SwapService {
449453 affiliateFee,
450454 } = params ;
451455 let _rfqt : RfqtRequestOpts | undefined ;
456+ const isAllExcluded = Object . values ( ERC20BridgeSource ) . every ( s => excludedSources . includes ( s ) ) ;
457+ if ( isAllExcluded ) {
458+ throw new ValidationError ( [
459+ {
460+ field : 'excludedSources' ,
461+ code : ValidationErrorCodes . ValueOutOfRange ,
462+ reason : 'Request excluded all sources' ,
463+ } ,
464+ ] ) ;
465+ }
452466 if ( apiKey !== undefined && ( isETHSell || from !== undefined ) ) {
453467 let takerAddress ;
454468 switch ( swapVersion ) {
0 commit comments