diff options
Diffstat (limited to 'packages/asset-buyer')
-rw-r--r-- | packages/asset-buyer/src/asset_buyer.ts | 6 | ||||
-rw-r--r-- | packages/asset-buyer/src/types.ts | 2 | ||||
-rw-r--r-- | packages/asset-buyer/src/utils/order_utils.ts | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/packages/asset-buyer/src/asset_buyer.ts b/packages/asset-buyer/src/asset_buyer.ts index 7ec39e012..50343efde 100644 --- a/packages/asset-buyer/src/asset_buyer.ts +++ b/packages/asset-buyer/src/asset_buyer.ts @@ -183,7 +183,7 @@ export class AssetBuyer { buyQuote: BuyQuote, options: Partial<BuyQuoteExecutionOpts> = {}, ): Promise<string> { - const { ethAmount, takerAddress, feeRecipient } = { + const { ethAmount, takerAddress, feeRecipient, gasLimit, gasPrice } = { ...constants.DEFAULT_BUY_QUOTE_EXECUTION_OPTS, ...options, }; @@ -219,6 +219,10 @@ export class AssetBuyer { feeOrders, feePercentage, feeRecipient, + { + gasLimit, + gasPrice, + }, ); return txHash; } diff --git a/packages/asset-buyer/src/types.ts b/packages/asset-buyer/src/types.ts index b96795bb6..f779d123f 100644 --- a/packages/asset-buyer/src/types.ts +++ b/packages/asset-buyer/src/types.ts @@ -82,6 +82,8 @@ export interface BuyQuoteRequestOpts { export interface BuyQuoteExecutionOpts { ethAmount?: BigNumber; takerAddress?: string; + gasLimit?: number; + gasPrice?: BigNumber; feeRecipient: string; } diff --git a/packages/asset-buyer/src/utils/order_utils.ts b/packages/asset-buyer/src/utils/order_utils.ts index 62166eb76..cfc13a8a1 100644 --- a/packages/asset-buyer/src/utils/order_utils.ts +++ b/packages/asset-buyer/src/utils/order_utils.ts @@ -10,7 +10,7 @@ export const orderUtils = { willOrderExpire(order: SignedOrder, secondsFromNow: number): boolean { const millisecondsInSecond = 1000; const currentUnixTimestampSec = new BigNumber(Date.now() / millisecondsInSecond).round(); - return order.expirationTimeSeconds.lessThan(currentUnixTimestampSec.minus(secondsFromNow)); + return order.expirationTimeSeconds.lessThan(currentUnixTimestampSec.plus(secondsFromNow)); }, calculateRemainingMakerAssetAmount(order: SignedOrder, remainingTakerAssetAmount: BigNumber): BigNumber { if (remainingTakerAssetAmount.eq(0)) { |