Push RFQ-T opts to own SwapQuoterOpts subnamespace

Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2541#discussion_r405963240
This commit is contained in:
F. Eugene Aumson 2020-04-09 12:12:52 -04:00
parent 227676c150
commit 93872ad7a3
No known key found for this signature in database
GPG Key ID: 23E6737B1374A24A
3 changed files with 10 additions and 6 deletions

View File

@ -43,8 +43,10 @@ const DEFAULT_SWAP_QUOTER_OPTS: SwapQuoterOpts = {
},
...DEFAULT_ORDER_PRUNER_OPTS,
samplerGasLimit: 250e6,
rfqtTakerApiKeyWhitelist: [],
rfqtMakerEndpoints: [],
rfqt: {
takerApiKeyWhitelist: [],
makerEndpoints: [],
},
};
const DEFAULT_FORWARDER_EXTENSION_CONTRACT_OPTS: ForwarderExtensionContractOpts = {

View File

@ -165,8 +165,8 @@ export class SwapQuoter {
this.orderbook = orderbook;
this.expiryBufferMs = expiryBufferMs;
this.permittedOrderFeeTypes = permittedOrderFeeTypes;
this.rfqtTakerApiKeyWhitelist = options.rfqtTakerApiKeyWhitelist || [];
this.rfqtMakerEndpoints = options.rfqtMakerEndpoints || [];
this.rfqtTakerApiKeyWhitelist = options.rfqt ? options.rfqt.takerApiKeyWhitelist || [] : [];
this.rfqtMakerEndpoints = options.rfqt ? options.rfqt.makerEndpoints || [] : [];
this._contractAddresses = options.contractAddresses || getContractAddressesForChainOrThrow(chainId);
this._devUtilsContract = new DevUtilsContract(this._contractAddresses.devUtils, provider);
this._protocolFeeUtils = new ProtocolFeeUtils(constants.PROTOCOL_FEE_UTILS_POLLING_INTERVAL_IN_MS);

View File

@ -217,8 +217,10 @@ export interface SwapQuoterOpts extends OrderPrunerOpts {
contractAddresses?: ContractAddresses;
samplerGasLimit?: number;
liquidityProviderRegistryAddress?: string;
rfqtTakerApiKeyWhitelist?: string[];
rfqtMakerEndpoints?: string[];
rfqt?: {
takerApiKeyWhitelist?: string[];
makerEndpoints?: string[];
};
quoteRequestor?: QuoteRequestor;
}