linting and remove unused function
This commit is contained in:
parent
615874d2ec
commit
120714ecfc
@ -610,15 +610,6 @@ export class SwapQuoter {
|
||||
|
||||
return swapQuote;
|
||||
}
|
||||
private _shouldEnableIndicativeRfqt(opts: CalculateSwapQuoteOpts['rfqt'], op: MarketOperation): boolean {
|
||||
return (
|
||||
opts !== undefined &&
|
||||
opts.isIndicative !== undefined &&
|
||||
opts.isIndicative &&
|
||||
this._rfqtTakerApiKeyWhitelist().includes(opts.apiKey) &&
|
||||
!(op === MarketOperation.Buy && this._shouldSkipRfqtBuyRequests())
|
||||
);
|
||||
}
|
||||
private _rfqtTakerApiKeyWhitelist(): string[] {
|
||||
return this._rfqtOptions ? this._rfqtOptions.takerApiKeyWhitelist : [];
|
||||
}
|
||||
|
@ -402,7 +402,14 @@ export class MarketOperationUtils {
|
||||
multiBridgeAddress: opts.multiBridgeAddress,
|
||||
shouldBatchBridgeOrders: !!opts.shouldBatchBridgeOrders,
|
||||
});
|
||||
const quoteReport = new QuoteReportGenerator(opts.side, _.flatten(opts.dexQuotes), opts.nativeOrders, opts.orderFillableAmounts, _.flatten(optimizedOrders.map(o => o.fills)), opts.quoteRequestor).generateReport();
|
||||
const quoteReport = new QuoteReportGenerator(
|
||||
opts.side,
|
||||
_.flatten(opts.dexQuotes),
|
||||
opts.nativeOrders,
|
||||
opts.orderFillableAmounts,
|
||||
_.flatten(optimizedOrders.map(o => o.fills)),
|
||||
opts.quoteRequestor,
|
||||
).generateReport();
|
||||
return { optimizedOrders, quoteReport };
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { orderHashUtils } from '@0x/order-utils';
|
||||
import { BigNumber, NULL_ADDRESS } from '@0x/utils';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { ERC20BridgeSource, SignedOrder } from '..';
|
||||
@ -44,7 +44,14 @@ export class QuoteReportGenerator {
|
||||
private readonly _collapsedFills: CollapsedFill[];
|
||||
private readonly _quoteRequestor?: QuoteRequestor;
|
||||
|
||||
constructor(marketOperation: MarketOperation, dexQuotes: DexSample[], nativeOrders: SignedOrder[], orderFillableAmounts: BigNumber[], collapsedFills: CollapsedFill[], quoteRequestor?: QuoteRequestor) {
|
||||
constructor(
|
||||
marketOperation: MarketOperation,
|
||||
dexQuotes: DexSample[],
|
||||
nativeOrders: SignedOrder[],
|
||||
orderFillableAmounts: BigNumber[],
|
||||
collapsedFills: CollapsedFill[],
|
||||
quoteRequestor?: QuoteRequestor,
|
||||
) {
|
||||
this._dexQuotes = dexQuotes;
|
||||
this._nativeOrders = nativeOrders;
|
||||
this._marketOperation = marketOperation;
|
||||
@ -68,10 +75,7 @@ export class QuoteReportGenerator {
|
||||
const dexReportSourcesConsidered = this._dexQuotes.map(ds => this._dexSampleToReportSource(ds));
|
||||
const nativeOrderSourcesConsidered = this._nativeOrders.map(no => this._nativeOrderToReportSource(no));
|
||||
|
||||
const sourcesConsidered = [
|
||||
...dexReportSourcesConsidered,
|
||||
...nativeOrderSourcesConsidered,
|
||||
];
|
||||
const sourcesConsidered = [...dexReportSourcesConsidered, ...nativeOrderSourcesConsidered];
|
||||
const sourcesDelivered = this._collapsedFills.map(collapsedFill => {
|
||||
const foundNativeOrder = (collapsedFill as NativeCollapsedFill).nativeOrder;
|
||||
if (foundNativeOrder) {
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { schemas, SchemaValidator } from '@0x/json-schemas';
|
||||
import { assetDataUtils, orderCalculationUtils, SignedOrder, orderHashUtils } from '@0x/order-utils';
|
||||
import { assetDataUtils, orderCalculationUtils, orderHashUtils, SignedOrder } from '@0x/order-utils';
|
||||
import { RFQTFirmQuote, RFQTIndicativeQuote, TakerRequest } from '@0x/quote-server';
|
||||
import { ERC20AssetData } from '@0x/types';
|
||||
import { BigNumber, logUtils } from '@0x/utils';
|
||||
import Axios, { AxiosResponse } from 'axios';
|
||||
import Axios from 'axios';
|
||||
|
||||
import { constants } from '../constants';
|
||||
import { MarketOperation, RfqtMakerAssetOfferings, RfqtRequestOpts } from '../types';
|
||||
@ -156,7 +156,12 @@ export class QuoteRequestor {
|
||||
salt: new BigNumber(orderWithStringInts.salt),
|
||||
};
|
||||
|
||||
if (orderCalculationUtils.willOrderExpire(orderWithBigNumberInts, this._expiryBufferMs / constants.ONE_SECOND_MS)) {
|
||||
if (
|
||||
orderCalculationUtils.willOrderExpire(
|
||||
orderWithBigNumberInts,
|
||||
this._expiryBufferMs / constants.ONE_SECOND_MS,
|
||||
)
|
||||
) {
|
||||
this._warningLogger(orderWithBigNumberInts, 'Expiry too soon in RFQ-T order, filtering out');
|
||||
return;
|
||||
}
|
||||
|
@ -9,7 +9,6 @@ import {
|
||||
MarketOperation,
|
||||
MarketSellSwapQuote,
|
||||
SwapQuote,
|
||||
SwapQuoteBase,
|
||||
SwapQuoteInfo,
|
||||
SwapQuoteOrdersBreakdown,
|
||||
SwapQuoterError,
|
||||
@ -17,7 +16,11 @@ import {
|
||||
|
||||
import { MarketOperationUtils } from './market_operation_utils';
|
||||
import { convertNativeOrderToFullyFillableOptimizedOrders } from './market_operation_utils/orders';
|
||||
import { GetMarketOrdersOpts, OptimizedMarketOrder, OptimizedOrdersAndQuoteReport } from './market_operation_utils/types';
|
||||
import {
|
||||
GetMarketOrdersOpts,
|
||||
OptimizedMarketOrder,
|
||||
OptimizedOrdersAndQuoteReport,
|
||||
} from './market_operation_utils/types';
|
||||
import { isSupportedAssetDataInOrders } from './utils';
|
||||
|
||||
import { QuoteReport } from './quote_report_generator';
|
||||
|
Loading…
x
Reference in New Issue
Block a user