diff options
Diffstat (limited to 'packages/contracts/src/utils')
-rw-r--r-- | packages/contracts/src/utils/exchange_wrapper.ts | 12 | ||||
-rw-r--r-- | packages/contracts/src/utils/types.ts | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/packages/contracts/src/utils/exchange_wrapper.ts b/packages/contracts/src/utils/exchange_wrapper.ts index 5996867cb..d4206adc3 100644 --- a/packages/contracts/src/utils/exchange_wrapper.ts +++ b/packages/contracts/src/utils/exchange_wrapper.ts @@ -167,6 +167,18 @@ export class ExchangeWrapper { const tx = await this._getTxWithDecodedExchangeLogsAsync(txHash); return tx; } + public async cancelOrdersBeforeAsync( + timestamp: BigNumber, + from: string, + ): Promise<TransactionReceiptWithDecodedLogs> { + const txHash = await this._exchange.cancelOrdersBefore.sendTransactionAsync( + timestamp, + { from }, + ); + const tx = await this._getTxWithDecodedExchangeLogsAsync(txHash); + return tx; + } + public async getOrderHashAsync(signedOrder: SignedOrder): Promise<string> { const order = orderUtils.getOrderStruct(signedOrder); const orderHash = await this._exchange.getOrderHash.callAsync(order); diff --git a/packages/contracts/src/utils/types.ts b/packages/contracts/src/utils/types.ts index 9f874d9ec..1a924a66d 100644 --- a/packages/contracts/src/utils/types.ts +++ b/packages/contracts/src/utils/types.ts @@ -28,6 +28,10 @@ export interface BatchCancelOrders { takerTokenCancelAmounts: BigNumber[]; } +export interface CancelOrdersBefore { + timestamp: BigNumber; +} + export interface DefaultOrderParams { exchangeAddress: string; makerAddress: string; |