aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'packages/contracts/src/utils')
-rw-r--r--packages/contracts/src/utils/exchange_wrapper.ts23
-rw-r--r--packages/contracts/src/utils/formatters.ts6
-rw-r--r--packages/contracts/src/utils/types.ts1
3 files changed, 6 insertions, 24 deletions
diff --git a/packages/contracts/src/utils/exchange_wrapper.ts b/packages/contracts/src/utils/exchange_wrapper.ts
index 3f56fd52f..bbe9a1baf 100644
--- a/packages/contracts/src/utils/exchange_wrapper.ts
+++ b/packages/contracts/src/utils/exchange_wrapper.ts
@@ -34,17 +34,9 @@ export class ExchangeWrapper {
const tx = await this._getTxWithDecodedExchangeLogsAsync(txHash);
return tx;
}
- public async cancelOrderAsync(
- signedOrder: SignedOrder,
- from: string,
- opts: { takerTokenCancelAmount?: BigNumber } = {},
- ): Promise<TransactionReceiptWithDecodedLogs> {
- const params = orderUtils.createCancel(signedOrder, opts.takerTokenCancelAmount);
- const txHash = await this._exchange.cancelOrder.sendTransactionAsync(
- params.order,
- params.takerTokenCancelAmount,
- { from },
- );
+ public async cancelOrderAsync(signedOrder: SignedOrder, from: string): Promise<TransactionReceiptWithDecodedLogs> {
+ const params = orderUtils.createCancel(signedOrder);
+ const txHash = await this._exchange.cancelOrder.sendTransactionAsync(params.order, { from });
const tx = await this._getTxWithDecodedExchangeLogsAsync(txHash);
return tx;
}
@@ -156,14 +148,9 @@ export class ExchangeWrapper {
public async batchCancelOrdersAsync(
orders: SignedOrder[],
from: string,
- opts: { takerTokenCancelAmounts?: BigNumber[] } = {},
): Promise<TransactionReceiptWithDecodedLogs> {
- const params = formatters.createBatchCancel(orders, opts.takerTokenCancelAmounts);
- const txHash = await this._exchange.batchCancelOrders.sendTransactionAsync(
- params.orders,
- params.takerTokenCancelAmounts,
- { from },
- );
+ const params = formatters.createBatchCancel(orders);
+ const txHash = await this._exchange.batchCancelOrders.sendTransactionAsync(params.orders, { from });
const tx = await this._getTxWithDecodedExchangeLogsAsync(txHash);
return tx;
}
diff --git a/packages/contracts/src/utils/formatters.ts b/packages/contracts/src/utils/formatters.ts
index 4f6116f06..2b261f967 100644
--- a/packages/contracts/src/utils/formatters.ts
+++ b/packages/contracts/src/utils/formatters.ts
@@ -55,10 +55,9 @@ export const formatters = {
});
return marketFillOrders;
},
- createBatchCancel(signedOrders: SignedOrder[], takerTokenCancelAmounts: BigNumber[] = []) {
+ createBatchCancel(signedOrders: SignedOrder[]) {
const batchCancel: BatchCancelOrders = {
orders: [],
- takerTokenCancelAmounts,
};
_.forEach(signedOrders, signedOrder => {
batchCancel.orders.push({
@@ -74,9 +73,6 @@ export const formatters = {
expirationTimeSeconds: signedOrder.expirationTimeSeconds,
salt: signedOrder.salt,
});
- if (takerTokenCancelAmounts.length < signedOrders.length) {
- batchCancel.takerTokenCancelAmounts.push(signedOrder.takerTokenAmount);
- }
});
return batchCancel;
},
diff --git a/packages/contracts/src/utils/types.ts b/packages/contracts/src/utils/types.ts
index 06fe23824..460d0a58a 100644
--- a/packages/contracts/src/utils/types.ts
+++ b/packages/contracts/src/utils/types.ts
@@ -25,7 +25,6 @@ export interface MarketFillOrders {
export interface BatchCancelOrders {
orders: OrderStruct[];
- takerTokenCancelAmounts: BigNumber[];
}
export interface CancelOrdersBefore {