Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
await this._emitRevalidateOrdersAsync(orderHashes, transactionHash);
break;
}
case ExchangeEvents.Fill: {
// Invalidate cache
const args = decodedLog.args as ExchangeFillEventArgs;
this._orderFilledCancelledLazyStore.deleteFilledTakerAmount(args.orderHash);
// Revalidate orders
const orderHash = args.orderHash;
const isOrderWatched = this._orderByOrderHash[orderHash] !== undefined;
if (isOrderWatched) {
await this._emitRevalidateOrdersAsync([orderHash], transactionHash);
}
break;
}
case ExchangeEvents.Cancel: {
// Invalidate cache
const args = decodedLog.args as ExchangeCancelEventArgs;
this._orderFilledCancelledLazyStore.deleteIsCancelled(args.orderHash);
// Revalidate orders
const orderHash = args.orderHash;
const isOrderWatched = this._orderByOrderHash[orderHash] !== undefined;
if (isOrderWatched) {
await this._emitRevalidateOrdersAsync([orderHash], transactionHash);
}
break;
}
case ExchangeEvents.CancelUpTo: {
// TODO(logvinov): Do it smarter and actually look at the salt and order epoch
// Invalidate cache
const args = decodedLog.args as ExchangeCancelUpToEventArgs;
this._orderFilledCancelledLazyStore.deleteAllIsCancelled();
public async getCancelEventsAsync(
startBlock: number,
endBlock: number,
): Promise>> {
const getCancelEventsForRangeAsync = this._makeGetterFuncForEventType(
ExchangeEvents.Cancel,
);
return getEventsWithPaginationAsync(getCancelEventsForRangeAsync, startBlock, endBlock);
}
public async cancelOrderAsync(signedOrder: SignedOrder): Promise {
this._showFlashMessageIfLedger();
const txHash = await this._contractWrappers.exchange.cancelOrderAsync(signedOrder, {
gasPrice: this._defaultGasPrice,
});
const receipt = await this._showEtherScanLinkAndAwaitTransactionMinedAsync(txHash);
const logs: Array> = receipt.logs as any;
const logCancel = _.find(logs, { event: ExchangeEvents.Cancel });
const args = (logCancel.args as any) as ExchangeCancelEventArgs;
const cancelledOrderHash = args.orderHash;
return cancelledOrderHash;
}
public async getUnavailableTakerAmountAsync(orderHash: string): Promise {