diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-09-19 22:02:52 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-09-19 22:02:52 +0800 |
commit | 14345ab24e0cd8db7bd2804b169acfaf18040ea4 (patch) | |
tree | 2ab0a7f1836c5cbfb91ea1174eb16ea5282007c4 /packages/asset-buyer/src/asset_buyer.ts | |
parent | 60e2dfdbda1e089ee4d4419243167eaeb769ff6a (diff) | |
download | dexon-sol-tools-14345ab24e0cd8db7bd2804b169acfaf18040ea4.tar dexon-sol-tools-14345ab24e0cd8db7bd2804b169acfaf18040ea4.tar.gz dexon-sol-tools-14345ab24e0cd8db7bd2804b169acfaf18040ea4.tar.bz2 dexon-sol-tools-14345ab24e0cd8db7bd2804b169acfaf18040ea4.tar.lz dexon-sol-tools-14345ab24e0cd8db7bd2804b169acfaf18040ea4.tar.xz dexon-sol-tools-14345ab24e0cd8db7bd2804b169acfaf18040ea4.tar.zst dexon-sol-tools-14345ab24e0cd8db7bd2804b169acfaf18040ea4.zip |
Rename forceOrderRefresh to shouldForceOrderRefresh
Diffstat (limited to 'packages/asset-buyer/src/asset_buyer.ts')
-rw-r--r-- | packages/asset-buyer/src/asset_buyer.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/asset-buyer/src/asset_buyer.ts b/packages/asset-buyer/src/asset_buyer.ts index 7becb8285..81b46d89a 100644 --- a/packages/asset-buyer/src/asset_buyer.ts +++ b/packages/asset-buyer/src/asset_buyer.ts @@ -160,20 +160,20 @@ export class AssetBuyer { * @return An object that conforms to BuyQuote that satisfies the request. See type definition for more information. */ public async getBuyQuoteAsync(assetBuyAmount: BigNumber, options: Partial<BuyQuoteRequestOpts>): Promise<BuyQuote> { - const { feePercentage, forceOrderRefresh, slippagePercentage } = { + const { feePercentage, shouldForceOrderRefresh, slippagePercentage } = { ...options, ...constants.DEFAULT_BUY_QUOTE_REQUEST_OPTS, }; assert.isBigNumber('assetBuyAmount', assetBuyAmount); assert.isValidPercentage('feePercentage', feePercentage); - assert.isBoolean('forceOrderRefresh', forceOrderRefresh); + assert.isBoolean('shouldForceOrderRefresh', shouldForceOrderRefresh); // we should refresh if: // we do not have any orders OR // we are forced to OR // we have some last refresh time AND that time was sufficiently long ago const shouldRefresh = _.isUndefined(this._currentOrdersAndFillableAmountsIfExists) || - forceOrderRefresh || + shouldForceOrderRefresh || (!_.isUndefined(this._lastRefreshTimeIfExists) && this._lastRefreshTimeIfExists + this.orderRefreshIntervalMs < Date.now()); let ordersAndFillableAmounts: AssetBuyerOrdersAndFillableAmounts; |