diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-08-30 00:40:49 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-08-30 00:40:49 +0800 |
commit | 3f99281309a1a63b52228dd3c787d82971e8ce45 (patch) | |
tree | 9c7a8cac39f693ec42f7a4491d30e1bd75f2b884 /src | |
parent | 28b4ff42ea4db226c96329506a32df46954cd065 (diff) | |
download | dexon-0x-contracts-3f99281309a1a63b52228dd3c787d82971e8ce45.tar.gz dexon-0x-contracts-3f99281309a1a63b52228dd3c787d82971e8ce45.tar.zst dexon-0x-contracts-3f99281309a1a63b52228dd3c787d82971e8ce45.zip |
Support web3@1.0 providers
Diffstat (limited to 'src')
-rw-r--r-- | src/0x.ts | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -163,6 +163,10 @@ export class ZeroEx { * @return An instance of the 0x.js ZeroEx class. */ constructor(provider: Web3Provider, config?: ZeroExConfig) { + if (_.isUndefined(provider.sendAsync)) { + // We assume, that this is a provider from beta web3 + provider.sendAsync = provider.send; + } this._web3Wrapper = new Web3Wrapper(provider); const gasPrice = _.isUndefined(config) ? undefined : config.gasPrice; this.token = new TokenWrapper(this._web3Wrapper, gasPrice); |