aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-08-30 00:40:49 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-08-30 00:40:49 +0800
commit3f99281309a1a63b52228dd3c787d82971e8ce45 (patch)
tree9c7a8cac39f693ec42f7a4491d30e1bd75f2b884 /src
parent28b4ff42ea4db226c96329506a32df46954cd065 (diff)
downloaddexon-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.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/0x.ts b/src/0x.ts
index 7fe6331c1..318b0eb23 100644
--- a/src/0x.ts
+++ b/src/0x.ts
@@ -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);