aboutsummaryrefslogtreecommitdiffstats
path: root/src/0x.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-10-26 17:50:02 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-11-10 03:11:45 +0800
commitcb3cae0f30404abffc238e47e17e0c842f720c97 (patch)
treedc80b20e8f242ccaef735274071bfb6782dd3394 /src/0x.ts
parenta7bedad9f020cf0bbd91d3823a14a0711ea78e0b (diff)
downloaddexon-sol-tools-cb3cae0f30404abffc238e47e17e0c842f720c97.tar
dexon-sol-tools-cb3cae0f30404abffc238e47e17e0c842f720c97.tar.gz
dexon-sol-tools-cb3cae0f30404abffc238e47e17e0c842f720c97.tar.bz2
dexon-sol-tools-cb3cae0f30404abffc238e47e17e0c842f720c97.tar.lz
dexon-sol-tools-cb3cae0f30404abffc238e47e17e0c842f720c97.tar.xz
dexon-sol-tools-cb3cae0f30404abffc238e47e17e0c842f720c97.tar.zst
dexon-sol-tools-cb3cae0f30404abffc238e47e17e0c842f720c97.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,