diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-03-27 21:19:23 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-03-27 23:56:21 +0800 |
commit | d72b7299c66ea6d63eb14595b06456c02b2ad99b (patch) | |
tree | e026f0af7f779c0c94ddc1261f630dd8ca923af5 /packages/0x.js/src/order_watcher/event_watcher.ts | |
parent | 066d13f5b7260d28b13195c4f9aed48b4ae96cc3 (diff) | |
download | dexon-0x-contracts-d72b7299c66ea6d63eb14595b06456c02b2ad99b.tar dexon-0x-contracts-d72b7299c66ea6d63eb14595b06456c02b2ad99b.tar.gz dexon-0x-contracts-d72b7299c66ea6d63eb14595b06456c02b2ad99b.tar.bz2 dexon-0x-contracts-d72b7299c66ea6d63eb14595b06456c02b2ad99b.tar.lz dexon-0x-contracts-d72b7299c66ea6d63eb14595b06456c02b2ad99b.tar.xz dexon-0x-contracts-d72b7299c66ea6d63eb14595b06456c02b2ad99b.tar.zst dexon-0x-contracts-d72b7299c66ea6d63eb14595b06456c02b2ad99b.zip |
Move common types out of web3 types
Diffstat (limited to 'packages/0x.js/src/order_watcher/event_watcher.ts')
-rw-r--r-- | packages/0x.js/src/order_watcher/event_watcher.ts | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/packages/0x.js/src/order_watcher/event_watcher.ts b/packages/0x.js/src/order_watcher/event_watcher.ts index e67b93251..246ab8292 100644 --- a/packages/0x.js/src/order_watcher/event_watcher.ts +++ b/packages/0x.js/src/order_watcher/event_watcher.ts @@ -1,9 +1,7 @@ +import { BlockParamLiteral, LogEntry } from '@0xproject/types'; import { intervalUtils } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; -import * as Web3 from 'web3'; - -import { BlockParamLiteral } from '@0xproject/types'; import { EventWatcherCallback, ZeroExError } from '../types'; import { assert } from '../utils/assert'; @@ -23,7 +21,7 @@ export class EventWatcher { private _web3Wrapper: Web3Wrapper; private _pollingIntervalMs: number; private _intervalIdIfExists?: NodeJS.Timer; - private _lastEvents: Web3.LogEntry[] = []; + private _lastEvents: LogEntry[] = []; constructor(web3Wrapper: Web3Wrapper, pollingIntervalIfExistsMs: undefined | number) { this._web3Wrapper = web3Wrapper; this._pollingIntervalMs = _.isUndefined(pollingIntervalIfExistsMs) @@ -69,7 +67,7 @@ export class EventWatcher { await this._emitDifferencesAsync(newEvents, LogEventState.Added, callback); this._lastEvents = pendingEvents; } - private async _getEventsAsync(): Promise<Web3.LogEntry[]> { + private async _getEventsAsync(): Promise<LogEntry[]> { const eventFilter = { fromBlock: BlockParamLiteral.Pending, toBlock: BlockParamLiteral.Pending, @@ -78,7 +76,7 @@ export class EventWatcher { return events; } private async _emitDifferencesAsync( - logs: Web3.LogEntry[], + logs: LogEntry[], logEventState: LogEventState, callback: EventWatcherCallback, ): Promise<void> { |