@0x/asset-swapper: rename
getMinBuyAmount() to
getSwapMinBuyAmount()` and export for use in API.
This commit is contained in:
parent
99de5a3814
commit
de7f1fc207
@ -84,6 +84,7 @@ export {
|
||||
export { artifacts } from './artifacts';
|
||||
export { InsufficientAssetLiquidityError } from './errors';
|
||||
export { SwapQuoteConsumer } from './quote_consumers/swap_quote_consumer';
|
||||
export { getSwapMinBuyAmount } from './quote_consumers/utils';
|
||||
export { SwapQuoter } from './swap_quoter';
|
||||
export {
|
||||
AffiliateFee,
|
||||
|
@ -30,7 +30,7 @@ import { assert } from '../utils/assert';
|
||||
import { ERC20BridgeSource, UniswapV2FillData } from '../utils/market_operation_utils/types';
|
||||
import { getTokenFromAssetData } from '../utils/utils';
|
||||
|
||||
import { getMinBuyAmount } from './utils';
|
||||
import { getSwapMinBuyAmount } from './utils';
|
||||
|
||||
// tslint:disable-next-line:custom-no-magic-numbers
|
||||
const MAX_UINT256 = new BigNumber(2).pow(256).minus(1);
|
||||
@ -95,7 +95,7 @@ export class ExchangeProxySwapQuoteConsumer implements SwapQuoteConsumerBase {
|
||||
const sellToken = getTokenFromAssetData(quote.takerAssetData);
|
||||
const buyToken = getTokenFromAssetData(quote.makerAssetData);
|
||||
const sellAmount = quote.worstCaseQuoteInfo.totalTakerAssetAmount;
|
||||
let minBuyAmount = getMinBuyAmount(quote);
|
||||
let minBuyAmount = getSwapMinBuyAmount(quote);
|
||||
|
||||
// VIP routes.
|
||||
if (isDirectUniswapCompatible(quote, optsWithDefaults)) {
|
||||
|
@ -9,7 +9,7 @@ import { MarketOperation, SwapQuote } from '../types';
|
||||
* `worstCaseQuoteInfo.makerAssetAmount` because that does not stop at
|
||||
* maximum slippage.
|
||||
*/
|
||||
export function getMinBuyAmount(quote: SwapQuote): BigNumber {
|
||||
export function getSwapMinBuyAmount(quote: SwapQuote): BigNumber {
|
||||
// Infer the allowed maker asset slippage from the orders.
|
||||
const totalOrderMakerAssetAmount = BigNumber.sum(...quote.orders.map(o => o.makerAssetAmount));
|
||||
const totalFillMakerAssetAmount =
|
||||
|
Loading…
x
Reference in New Issue
Block a user