From 3f99281309a1a63b52228dd3c787d82971e8ce45 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 29 Aug 2017 18:40:49 +0200 Subject: Support web3@1.0 providers --- src/0x.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') 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); -- cgit v1.2.3