diff options
-rw-r--r-- | src/contract_wrappers/exchange_wrapper.ts | 30 | ||||
-rw-r--r-- | src/types.ts | 5 |
2 files changed, 8 insertions, 27 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts index 326f0e812..e824108de 100644 --- a/src/contract_wrappers/exchange_wrapper.ts +++ b/src/contract_wrappers/exchange_wrapper.ts @@ -200,34 +200,10 @@ export class ExchangeWrapper extends ContractWrapper { */ public async cancelOrderAsync( order: Order|SignedOrder, takerTokenCancelAmount: BigNumber.BigNumber): Promise<void> { - assert.doesConformToSchema('order', - SchemaValidator.convertToJSONSchemaCompatibleObject(order as object), - orderSchema); - assert.isBigNumber('takerTokenCancelAmount', takerTokenCancelAmount); - await assert.isSenderAddressAvailableAsync(this.web3Wrapper, 'order.maker', order.maker); - - const exchangeInstance = await this.getExchangeContractAsync(); - await this.validateCancelOrderAndThrowIfInvalidAsync(order, takerTokenCancelAmount); - - const [orderAddresses, orderValues] = ExchangeWrapper.getOrderAddressesAndValues(order); - const gas = await exchangeInstance.cancel.estimateGas( - orderAddresses, - orderValues, + await this.batchCancelOrderAsync([{ + order, takerTokenCancelAmount, - { - from: order.maker, - }, - ); - const response: ContractResponse = await exchangeInstance.cancel( - orderAddresses, - orderValues, - takerTokenCancelAmount, - { - from: order.maker, - gas, - }, - ); - this.throwErrorLogsAsErrors(response.logs); + }]); } /** * Batch version of cancelOrderAsync. Atomically cancels multiple orders in a single transaction. diff --git a/src/types.ts b/src/types.ts index 84f16b9b9..f3cfa440c 100644 --- a/src/types.ts +++ b/src/types.ts @@ -233,3 +233,8 @@ export interface OrderCancellationRequest { order: Order|SignedOrder; takerTokenCancelAmount: BigNumber.BigNumber; } + +export interface OrderFillRequest { + signedOrder: SignedOrder; + takerTokenFillAmount: BigNumber.BigNumber; +} |