Normalize the dependencies

This commit is contained in:
Leonid Logvinov
2018-01-25 15:12:46 +01:00
parent 2f65fadeaa
commit 1e9147b8bb
21 changed files with 76 additions and 147 deletions

View File

@@ -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(