diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-11-21 03:02:24 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-11-21 03:02:24 +0800 |
commit | a613c3b7e7654728cb56cceb67566ab75313e16f (patch) | |
tree | 6202a7873ce66d1a6896b325d37ed78d28119798 /packages/0x.js | |
parent | 35668fe2259323c84a792b575d99df74702ee620 (diff) | |
download | dexon-sol-tools-a613c3b7e7654728cb56cceb67566ab75313e16f.tar dexon-sol-tools-a613c3b7e7654728cb56cceb67566ab75313e16f.tar.gz dexon-sol-tools-a613c3b7e7654728cb56cceb67566ab75313e16f.tar.bz2 dexon-sol-tools-a613c3b7e7654728cb56cceb67566ab75313e16f.tar.lz dexon-sol-tools-a613c3b7e7654728cb56cceb67566ab75313e16f.tar.xz dexon-sol-tools-a613c3b7e7654728cb56cceb67566ab75313e16f.tar.zst dexon-sol-tools-a613c3b7e7654728cb56cceb67566ab75313e16f.zip |
Add defaults
Diffstat (limited to 'packages/0x.js')
-rw-r--r-- | packages/0x.js/src/order_watcher/event_watcher.ts | 10 | ||||
-rw-r--r-- | packages/0x.js/src/order_watcher/order_state_watcher.ts | 4 | ||||
-rw-r--r-- | packages/0x.js/src/types.ts | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/packages/0x.js/src/order_watcher/event_watcher.ts b/packages/0x.js/src/order_watcher/event_watcher.ts index 81529a98c..da824bd09 100644 --- a/packages/0x.js/src/order_watcher/event_watcher.ts +++ b/packages/0x.js/src/order_watcher/event_watcher.ts @@ -12,7 +12,7 @@ import {intervalUtils} from '../utils/interval_utils'; import {assert} from '../utils/assert'; import {utils} from '../utils/utils'; -const DEFAULT_EVENT_POLLING_INTERVAL = 200; +const DEFAULT_EVENT_POLLING_INTERVAL_MS = 200; enum LogEventState { Removed, @@ -28,11 +28,11 @@ export class EventWatcher { private _pollingIntervalMs: number; private _intervalIdIfExists?: NodeJS.Timer; private _lastEvents: Web3.LogEntry[] = []; - constructor(web3Wrapper: Web3Wrapper, pollingIntervalMs: undefined|number) { + constructor(web3Wrapper: Web3Wrapper, pollingIntervalIfExistsMs: undefined|number) { this._web3Wrapper = web3Wrapper; - this._pollingIntervalMs = _.isUndefined(pollingIntervalMs) ? - DEFAULT_EVENT_POLLING_INTERVAL : - pollingIntervalMs; + this._pollingIntervalMs = _.isUndefined(pollingIntervalIfExistsMs) ? + DEFAULT_EVENT_POLLING_INTERVAL_MS : + pollingIntervalIfExistsMs; } public subscribe(callback: EventWatcherCallback): void { assert.isFunction('callback', callback); diff --git a/packages/0x.js/src/order_watcher/order_state_watcher.ts b/packages/0x.js/src/order_watcher/order_state_watcher.ts index 40007805f..27f4c7d29 100644 --- a/packages/0x.js/src/order_watcher/order_state_watcher.ts +++ b/packages/0x.js/src/order_watcher/order_state_watcher.ts @@ -67,8 +67,8 @@ export class OrderStateWatcher { ) { this._abiDecoder = abiDecoder; this._web3Wrapper = web3Wrapper; - const eventPollingIntervalMs = _.isUndefined(config) ? undefined : config.eventPollingIntervalMs; - this._eventWatcher = new EventWatcher(web3Wrapper, eventPollingIntervalMs); + const pollingIntervalIfExistsMs = _.isUndefined(config) ? undefined : config.eventPollingIntervalMs; + this._eventWatcher = new EventWatcher(web3Wrapper, pollingIntervalIfExistsMs); this._balanceAndProxyAllowanceLazyStore = new BalanceAndProxyAllowanceLazyStore(token); this._orderFilledCancelledLazyStore = new OrderFilledCancelledLazyStore(exchange); this._orderStateUtils = new OrderStateUtils( diff --git a/packages/0x.js/src/types.ts b/packages/0x.js/src/types.ts index 45b49e148..37e80e6bc 100644 --- a/packages/0x.js/src/types.ts +++ b/packages/0x.js/src/types.ts @@ -397,8 +397,8 @@ export interface JSONRPCPayload { } /* - * orderExpirationCheckingIntervalMs: How often to check for expired orders - * eventPollingIntervalMs: How often to poll the Ethereum node for new events + * orderExpirationCheckingIntervalMs: How often to check for expired orders. Default: 50 + * eventPollingIntervalMs: How often to poll the Ethereum node for new events. Defaults: 200 */ export interface OrderStateWatcherConfig { orderExpirationCheckingIntervalMs?: number; |