diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-10-26 09:53:22 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-10-26 09:53:22 +0800 |
commit | 27d9e516e1cf6a8bea469998bc92513bec3d91c5 (patch) | |
tree | 2db73b2d26e432236034c411f0edd62b94dd9144 /packages/asset-buyer/src/asset_buyer.ts | |
parent | 948d62200a23b4da59278f976e9757cfc3c9234e (diff) | |
parent | 4a96dbe085004be49dbbaa435d4552a9c920d823 (diff) | |
download | dexon-sol-tools-27d9e516e1cf6a8bea469998bc92513bec3d91c5.tar dexon-sol-tools-27d9e516e1cf6a8bea469998bc92513bec3d91c5.tar.gz dexon-sol-tools-27d9e516e1cf6a8bea469998bc92513bec3d91c5.tar.bz2 dexon-sol-tools-27d9e516e1cf6a8bea469998bc92513bec3d91c5.tar.lz dexon-sol-tools-27d9e516e1cf6a8bea469998bc92513bec3d91c5.tar.xz dexon-sol-tools-27d9e516e1cf6a8bea469998bc92513bec3d91c5.tar.zst dexon-sol-tools-27d9e516e1cf6a8bea469998bc92513bec3d91c5.zip |
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/instant/fixed-orders-in-render-method
Diffstat (limited to 'packages/asset-buyer/src/asset_buyer.ts')
-rw-r--r-- | packages/asset-buyer/src/asset_buyer.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/asset-buyer/src/asset_buyer.ts b/packages/asset-buyer/src/asset_buyer.ts index 80437c10e..34e2d9639 100644 --- a/packages/asset-buyer/src/asset_buyer.ts +++ b/packages/asset-buyer/src/asset_buyer.ts @@ -132,9 +132,14 @@ export class AssetBuyer { assert.isBoolean('shouldForceOrderRefresh', shouldForceOrderRefresh); assert.isNumber('slippagePercentage', slippagePercentage); const zrxTokenAssetData = this._getZrxTokenAssetDataOrThrow(); + const isMakerAssetZrxToken = assetData === zrxTokenAssetData; + // get the relevant orders for the makerAsset and fees + // if the requested assetData is ZRX, don't get the fee info const [ordersAndFillableAmounts, feeOrdersAndFillableAmounts] = await Promise.all([ this._getOrdersAndFillableAmountsAsync(assetData, shouldForceOrderRefresh), - this._getOrdersAndFillableAmountsAsync(zrxTokenAssetData, shouldForceOrderRefresh), + isMakerAssetZrxToken + ? Promise.resolve(constants.EMPTY_ORDERS_AND_FILLABLE_AMOUNTS) + : this._getOrdersAndFillableAmountsAsync(zrxTokenAssetData, shouldForceOrderRefresh), shouldForceOrderRefresh, ]); if (ordersAndFillableAmounts.orders.length === 0) { @@ -146,6 +151,7 @@ export class AssetBuyer { assetBuyAmount, feePercentage, slippagePercentage, + isMakerAssetZrxToken, ); return buyQuote; } |