diff options
Diffstat (limited to 'packages/order-watcher/src/order_watcher/order_watcher.ts')
-rw-r--r-- | packages/order-watcher/src/order_watcher/order_watcher.ts | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/packages/order-watcher/src/order_watcher/order_watcher.ts b/packages/order-watcher/src/order_watcher/order_watcher.ts index 0ee56592e..cac3a0923 100644 --- a/packages/order-watcher/src/order_watcher/order_watcher.ts +++ b/packages/order-watcher/src/order_watcher/order_watcher.ts @@ -1,10 +1,7 @@ import { BalanceAndProxyAllowanceLazyStore, ContractWrappers, - LogCancelContractEventArgs, - LogFillContractEventArgs, OrderFilledCancelledLazyStore, - WithdrawalContractEventArgs, } from '@0xproject/contract-wrappers'; import { schemas } from '@0xproject/json-schemas'; import { getOrderHashHex, OrderStateUtils } from '@0xproject/order-utils'; @@ -23,16 +20,22 @@ import * as _ from 'lodash'; import { artifacts } from '../artifacts'; import { - DepositContractEventArgs, - EtherTokenContractEventArgs, + EtherTokenDepositEventArgs, + EtherTokenEventArgs, EtherTokenEvents, + EtherTokenWithdrawalEventArgs, } from '../generated_contract_wrappers/ether_token'; -import { ExchangeContractEventArgs, ExchangeEvents } from '../generated_contract_wrappers/exchange'; import { - ApprovalContractEventArgs, - TokenContractEventArgs, + ExchangeEventArgs, + ExchangeEvents, + ExchangeLogCancelEventArgs, + ExchangeLogFillEventArgs, +} from '../generated_contract_wrappers/exchange'; +import { + TokenApprovalEventArgs, + TokenEventArgs, TokenEvents, - TransferContractEventArgs, + TokenTransferEventArgs, } from '../generated_contract_wrappers/token'; import { OnOrderStateChangeCallback, OrderWatcherConfig, OrderWatcherError } from '../types'; import { assert } from '../utils/assert'; @@ -40,7 +43,7 @@ import { assert } from '../utils/assert'; import { EventWatcher } from './event_watcher'; import { ExpirationWatcher } from './expiration_watcher'; -type ContractEventArgs = EtherTokenContractEventArgs | ExchangeContractEventArgs | TokenContractEventArgs; +type ContractEventArgs = EtherTokenEventArgs | ExchangeEventArgs | TokenEventArgs; interface DependentOrderHashes { [makerAddress: string]: { @@ -249,7 +252,7 @@ export class OrderWatcher { switch (decodedLog.event) { case TokenEvents.Approval: { // Invalidate cache - const args = decodedLog.args as ApprovalContractEventArgs; + const args = decodedLog.args as TokenApprovalEventArgs; this._balanceAndProxyAllowanceLazyStore.deleteProxyAllowance(decodedLog.address, args._owner); // Revalidate orders makerToken = decodedLog.address; @@ -265,7 +268,7 @@ export class OrderWatcher { } case TokenEvents.Transfer: { // Invalidate cache - const args = decodedLog.args as TransferContractEventArgs; + const args = decodedLog.args as TokenTransferEventArgs; this._balanceAndProxyAllowanceLazyStore.deleteBalance(decodedLog.address, args._from); this._balanceAndProxyAllowanceLazyStore.deleteBalance(decodedLog.address, args._to); // Revalidate orders @@ -282,7 +285,7 @@ export class OrderWatcher { } case EtherTokenEvents.Deposit: { // Invalidate cache - const args = decodedLog.args as DepositContractEventArgs; + const args = decodedLog.args as EtherTokenDepositEventArgs; this._balanceAndProxyAllowanceLazyStore.deleteBalance(decodedLog.address, args._owner); // Revalidate orders makerToken = decodedLog.address; @@ -298,8 +301,7 @@ export class OrderWatcher { } case EtherTokenEvents.Withdrawal: { // Invalidate cache - // tslint:disable-next-line:no-unnecessary-type-assertion - const args = decodedLog.args as WithdrawalContractEventArgs; + const args = decodedLog.args as EtherTokenWithdrawalEventArgs; this._balanceAndProxyAllowanceLazyStore.deleteBalance(decodedLog.address, args._owner); // Revalidate orders makerToken = decodedLog.address; @@ -315,8 +317,7 @@ export class OrderWatcher { } case ExchangeEvents.LogFill: { // Invalidate cache - // tslint:disable-next-line:no-unnecessary-type-assertion - const args = decodedLog.args as LogFillContractEventArgs; + const args = decodedLog.args as ExchangeLogFillEventArgs; this._orderFilledCancelledLazyStore.deleteFilledTakerAmount(args.orderHash); // Revalidate orders const orderHash = args.orderHash; @@ -328,8 +329,7 @@ export class OrderWatcher { } case ExchangeEvents.LogCancel: { // Invalidate cache - // tslint:disable-next-line:no-unnecessary-type-assertion - const args = decodedLog.args as LogCancelContractEventArgs; + const args = decodedLog.args as ExchangeLogCancelEventArgs; this._orderFilledCancelledLazyStore.deleteCancelledTakerAmount(args.orderHash); // Revalidate orders const orderHash = args.orderHash; |