asset-s: Clarify indicative quote enablement
Addresses review comment https://github.com/0xProject/0x-monorepo/pull/2555#discussion_r411498729
This commit is contained in:
@@ -566,13 +566,8 @@ export class SwapQuoter {
|
||||
let swapQuote: SwapQuote;
|
||||
|
||||
const calcOpts: CalculateSwapQuoteOpts = opts;
|
||||
if (
|
||||
// we should request indicative quotes:
|
||||
calcOpts.rfqt &&
|
||||
!calcOpts.rfqt.intentOnFilling &&
|
||||
calcOpts.rfqt.apiKey &&
|
||||
this._rfqtTakerApiKeyWhitelist.includes(calcOpts.rfqt.apiKey)
|
||||
) {
|
||||
|
||||
if (calcOpts.rfqt !== undefined && this._shouldEnableIndicativeRfqt(calcOpts.rfqt)) {
|
||||
calcOpts.rfqt.quoteRequestor = this._quoteRequestor;
|
||||
}
|
||||
|
||||
@@ -594,5 +589,8 @@ export class SwapQuoter {
|
||||
|
||||
return swapQuote;
|
||||
}
|
||||
private _shouldEnableIndicativeRfqt(opts: CalculateSwapQuoteOpts['rfqt']): boolean {
|
||||
return opts !== undefined && !opts.intentOnFilling && this._rfqtTakerApiKeyWhitelist.includes(opts.apiKey);
|
||||
}
|
||||
}
|
||||
// tslint:disable-next-line: max-file-line-count
|
||||
|
||||
Reference in New Issue
Block a user