diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-10-26 17:50:02 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-10-31 00:49:16 +0800 |
commit | f53472e7170798f56ea4837c310cfd4188326af8 (patch) | |
tree | 64f4151571e0fc91df67ee07e2ce286a298e0aba /src/0x.ts | |
parent | 7fa5d34c45f58ebdf729e9f7a500627ab72fb5c8 (diff) | |
download | dexon-sol-tools-f53472e7170798f56ea4837c310cfd4188326af8.tar dexon-sol-tools-f53472e7170798f56ea4837c310cfd4188326af8.tar.gz dexon-sol-tools-f53472e7170798f56ea4837c310cfd4188326af8.tar.bz2 dexon-sol-tools-f53472e7170798f56ea4837c310cfd4188326af8.tar.lz dexon-sol-tools-f53472e7170798f56ea4837c310cfd4188326af8.tar.xz dexon-sol-tools-f53472e7170798f56ea4837c310cfd4188326af8.tar.zst dexon-sol-tools-f53472e7170798f56ea4837c310cfd4188326af8.zip |
Add initial mempool watching implememtation
Diffstat (limited to 'src/0x.ts')
-rw-r--r-- | src/0x.ts | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -11,6 +11,7 @@ import {assert} from './utils/assert'; import {AbiDecoder} from './utils/abi_decoder'; import {intervalUtils} from './utils/interval_utils'; import {artifacts} from './artifacts'; +import {MempoolWatcher} from './mempool/mempool_watcher'; import {ExchangeWrapper} from './contract_wrappers/exchange_wrapper'; import {TokenRegistryWrapper} from './contract_wrappers/token_registry_wrapper'; import {EtherTokenWrapper} from './contract_wrappers/ether_token_wrapper'; @@ -65,6 +66,10 @@ export class ZeroEx { * tokenTransferProxy smart contract. */ public proxy: TokenTransferProxyWrapper; + /** + * An instance of the MempoolWatcher class containing methods for watching pending events. + */ + public mempool: MempoolWatcher; private _web3Wrapper: Web3Wrapper; private _abiDecoder: AbiDecoder; /** @@ -191,6 +196,11 @@ export class ZeroEx { gasPrice, }; this._web3Wrapper = new Web3Wrapper(provider, defaults); + const mempoolPollingIntervalMs = _.isUndefined(config) ? undefined : config.mempoolPollingIntervalMs; + this.mempool = new MempoolWatcher( + this._web3Wrapper, + mempoolPollingIntervalMs, + ); this.token = new TokenWrapper( this._web3Wrapper, this._abiDecoder, |