aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/util/exchange_wrapper.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/contracts/util/exchange_wrapper.ts')
-rw-r--r--packages/contracts/util/exchange_wrapper.ts16
1 files changed, 9 insertions, 7 deletions
diff --git a/packages/contracts/util/exchange_wrapper.ts b/packages/contracts/util/exchange_wrapper.ts
index 84123c5f4..7a07239f5 100644
--- a/packages/contracts/util/exchange_wrapper.ts
+++ b/packages/contracts/util/exchange_wrapper.ts
@@ -1,4 +1,4 @@
-import { ExchangeContractEventArgs, TransactionReceiptWithDecodedLogs, ZeroEx } from '0x.js';
+import { TransactionReceiptWithDecodedLogs, ZeroEx } from '0x.js';
import { BigNumber } from '@0xproject/utils';
import * as _ from 'lodash';
import * as Web3 from 'web3';
@@ -108,9 +108,14 @@ export class ExchangeWrapper {
public async batchFillOrKillOrdersAsync(
orders: Order[],
from: string,
- opts: { fillTakerTokenAmounts?: BigNumber[] } = {},
+ opts: { fillTakerTokenAmounts?: BigNumber[]; shouldThrowOnInsufficientBalanceOrAllowance?: boolean } = {},
): Promise<TransactionReceiptWithDecodedLogs> {
- const params = formatters.createBatchFill(orders, undefined, opts.fillTakerTokenAmounts);
+ const shouldThrowOnInsufficientBalanceOrAllowance = !!opts.shouldThrowOnInsufficientBalanceOrAllowance;
+ const params = formatters.createBatchFill(
+ orders,
+ shouldThrowOnInsufficientBalanceOrAllowance,
+ opts.fillTakerTokenAmounts,
+ );
const txHash = await this._exchange.batchFillOrKillOrders(
params.orderAddresses,
params.orderValues,
@@ -128,10 +133,7 @@ export class ExchangeWrapper {
public async fillOrdersUpToAsync(
orders: Order[],
from: string,
- opts: {
- fillTakerTokenAmount?: BigNumber;
- shouldThrowOnInsufficientBalanceOrAllowance?: boolean;
- } = {},
+ opts: { fillTakerTokenAmount: BigNumber; shouldThrowOnInsufficientBalanceOrAllowance?: boolean },
): Promise<TransactionReceiptWithDecodedLogs> {
const shouldThrowOnInsufficientBalanceOrAllowance = !!opts.shouldThrowOnInsufficientBalanceOrAllowance;
const params = formatters.createFillUpTo(