aboutsummaryrefslogtreecommitdiffstats
path: root/src/0x.ts
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/0x.ts
parent28b4ff42ea4db226c96329506a32df46954cd065 (diff)
downloaddexon-sol-tools-3f99281309a1a63b52228dd3c787d82971e8ce45.tar
dexon-sol-tools-3f99281309a1a63b52228dd3c787d82971e8ce45.tar.gz
dexon-sol-tools-3f99281309a1a63b52228dd3c787d82971e8ce45.tar.bz2
dexon-sol-tools-3f99281309a1a63b52228dd3c787d82971e8ce45.tar.lz
dexon-sol-tools-3f99281309a1a63b52228dd3c787d82971e8ce45.tar.xz
dexon-sol-tools-3f99281309a1a63b52228dd3c787d82971e8ce45.tar.zst
dexon-sol-tools-3f99281309a1a63b52228dd3c787d82971e8ce45.zip
Support web3@1.0 providers
Diffstat (limited to 'src/0x.ts')
-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);