Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
Pass QuoteRequestor via SwapQuoteOpts not ctor arg
Browse files Browse the repository at this point in the history
Addresses review comment #2541 (comment)
  • Loading branch information
feuGeneA committed Apr 9, 2020
1 parent 5c39291 commit 7096a70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions packages/asset-swapper/src/swap_quoter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ export class SwapQuoter {
supportedProvider: SupportedProvider,
orderbook: Orderbook,
options: Partial<SwapQuoterOpts> = {},
quoteRequestor?: QuoteRequestor,
) {
const {
chainId,
Expand All @@ -176,7 +175,7 @@ export class SwapQuoter {
this._devUtilsContract = new DevUtilsContract(this._contractAddresses.devUtils, provider);
this._protocolFeeUtils = new ProtocolFeeUtils(constants.PROTOCOL_FEE_UTILS_POLLING_INTERVAL_IN_MS);
this._orderStateUtils = new OrderStateUtils(this._devUtilsContract);
this._quoteRequestor = quoteRequestor || new QuoteRequestor(this.rfqtMakerEndpoints);
this._quoteRequestor = options.quoteRequestor || new QuoteRequestor(this.rfqtMakerEndpoints);
const sampler = new DexOrderSampler(
new IERC20BridgeSamplerContract(this._contractAddresses.erc20BridgeSampler, this.provider, {
gas: samplerGasLimit,
Expand Down
2 changes: 2 additions & 0 deletions packages/asset-swapper/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { SignedOrder } from '@0x/types';
import { BigNumber } from '@0x/utils';

import { GetMarketOrdersOpts } from './utils/market_operation_utils/types';
import { QuoteRequestor } from './utils/quote_requestor';

/**
* expiryBufferMs: The number of seconds to add when calculating whether an order is expired or not. Defaults to 300s (5m).
Expand Down Expand Up @@ -219,6 +220,7 @@ export interface SwapQuoterOpts extends OrderPrunerOpts {
liquidityProviderRegistryAddress?: string;
rfqtTakerApiKeyWhitelist?: string[];
rfqtMakerEndpoints?: string[];
quoteRequestor?: QuoteRequestor;
}

/**
Expand Down

0 comments on commit 7096a70

Please sign in to comment.