Add liquidity source breakdown to asset-swapper (#2465)
* add liquidity source breakdown to asset-swapper * remove debug line * use OptimizedMarketOrder metadata * updated change-log * prettier + lint * bug fixes * fixes * Prettier * Fix types Co-authored-by: Jacob Evans <dekz@dekz.net>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { ERC20BridgeSource } from '../../src';
|
||||
import { constants } from '../../src/constants';
|
||||
import { MarketOperation, SignedOrderWithFillableAmounts, SwapQuote } from '../../src/types';
|
||||
import { ProtocolFeeUtils } from '../../src/utils/protocol_fee_utils';
|
||||
@@ -26,6 +27,10 @@ export async function getFullyFillableSwapQuoteWithNoFeesAsync(
|
||||
protocolFeeInWeiAmount: await protocolFeeUtils.calculateWorstCaseProtocolFeeAsync(orders, gasPrice),
|
||||
};
|
||||
|
||||
const breakdown = {
|
||||
[ERC20BridgeSource.Native]: new BigNumber(1),
|
||||
};
|
||||
|
||||
const quoteBase = {
|
||||
makerAssetData,
|
||||
takerAssetData,
|
||||
@@ -33,6 +38,7 @@ export async function getFullyFillableSwapQuoteWithNoFeesAsync(
|
||||
gasPrice,
|
||||
bestCaseQuoteInfo: quoteInfo,
|
||||
worstCaseQuoteInfo: quoteInfo,
|
||||
sourceBreakdown: breakdown,
|
||||
};
|
||||
|
||||
if (operation === MarketOperation.Buy) {
|
||||
|
||||
Reference in New Issue
Block a user