aboutsummaryrefslogtreecommitdiffstats
path: root/src/0x.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-10-26 17:50:02 +0800
committerFabio Berger <me@fabioberger.com>2017-10-31 00:49:16 +0800
commitf53472e7170798f56ea4837c310cfd4188326af8 (patch)
tree64f4151571e0fc91df67ee07e2ce286a298e0aba /src/0x.ts
parent7fa5d34c45f58ebdf729e9f7a500627ab72fb5c8 (diff)
downloaddexon-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.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/0x.ts b/src/0x.ts
index bc753434c..10db7e158 100644
--- a/src/0x.ts
+++ b/src/0x.ts
@@ -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,