@0x/instant: Fix for changed asset-swapper configs.

This commit is contained in:
Lawrence Forman 2020-03-09 14:31:33 -04:00
parent 95bebd6d1d
commit 847a7f470c
3 changed files with 4 additions and 8 deletions

View File

@ -9,6 +9,10 @@
{
"note": "Fix ERC721 asset support",
"pr": 2491
},
{
"note": "Remove `bridgeSlippage` SwapQuoter config.",
"pr": 2513
}
]
},

View File

@ -30,8 +30,6 @@ export const ONE_SECOND_MS = 1000;
export const ONE_MINUTE_MS = ONE_SECOND_MS * 60;
export const GIT_SHA = process.env.GIT_SHA;
export const NODE_ENV = process.env.NODE_ENV;
export const ERC20_SWAP_QUOTE_SLIPPAGE_PERCENTAGE = 0.2;
export const ERC721_SWAP_QUOTE_SLIPPAGE_PERCENTAGE = 0;
export const NPM_PACKAGE_VERSION = process.env.NPM_PACKAGE_VERSION;
export const DEFAULT_UNKOWN_ASSET_NAME = '???';
export const ACCOUNT_UPDATE_INTERVAL_TIME_MS = ONE_SECOND_MS * 5;

View File

@ -4,7 +4,6 @@ import { BigNumber } from '@0x/utils';
import { Web3Wrapper } from '@0x/web3-wrapper';
import { Dispatch } from 'redux';
import { ERC20_SWAP_QUOTE_SLIPPAGE_PERCENTAGE, ERC721_SWAP_QUOTE_SLIPPAGE_PERCENTAGE } from '../constants';
import { Action, actions } from '../redux/actions';
import { Asset, QuoteFetchOrigin } from '../types';
@ -37,10 +36,6 @@ export const swapQuoteUpdater = {
}
const wethAssetData = await swapQuoter.getEtherTokenAssetDataOrThrowAsync();
let newSwapQuote: MarketBuySwapQuote | undefined;
const slippagePercentage =
asset.metaData.assetProxyId === AssetProxyId.ERC20
? ERC20_SWAP_QUOTE_SLIPPAGE_PERCENTAGE
: ERC721_SWAP_QUOTE_SLIPPAGE_PERCENTAGE;
try {
const gasInfo = await gasPriceEstimator.getGasInfoAsync();
newSwapQuote = await swapQuoter.getMarketBuySwapQuoteForAssetDataAsync(
@ -48,7 +43,6 @@ export const swapQuoteUpdater = {
wethAssetData,
baseUnitValue,
{
slippagePercentage,
gasPrice: gasInfo.gasPriceInWei,
// Only use native orders
// excludedSources: [ERC20BridgeSource.Eth2Dai, ERC20BridgeSource.Kyber, ERC20BridgeSource.Uniswap],