aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/util/exchange_wrapper.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-01-25 22:12:46 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-01-30 23:01:37 +0800
commit1e9147b8bb45a251eefdead23573a9e8d68fc34b (patch)
tree5c1f1c4aa80b2ece8c22b36659064cfb9e902b8a /packages/contracts/util/exchange_wrapper.ts
parent2f65fadeaabf350c5fa6d2e822dc211f0632ae2e (diff)
downloaddexon-sol-tools-1e9147b8bb45a251eefdead23573a9e8d68fc34b.tar
dexon-sol-tools-1e9147b8bb45a251eefdead23573a9e8d68fc34b.tar.gz
dexon-sol-tools-1e9147b8bb45a251eefdead23573a9e8d68fc34b.tar.bz2
dexon-sol-tools-1e9147b8bb45a251eefdead23573a9e8d68fc34b.tar.lz
dexon-sol-tools-1e9147b8bb45a251eefdead23573a9e8d68fc34b.tar.xz
dexon-sol-tools-1e9147b8bb45a251eefdead23573a9e8d68fc34b.tar.zst
dexon-sol-tools-1e9147b8bb45a251eefdead23573a9e8d68fc34b.zip
Normalize the dependencies
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(