From a98bb1f7ac2ab02115a28ace15e94ed14d2cf861 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 29 Aug 2017 18:45:26 +0200 Subject: Improve the comment --- src/0x.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/0x.ts b/src/0x.ts index 318b0eb23..9613df1be 100644 --- a/src/0x.ts +++ b/src/0x.ts @@ -163,9 +163,11 @@ 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; + if (_.isUndefined((provider as any).sendAsync)) { + // Web3@1.0 provider doesn't support synchronous http requests, + // so it only has `send` method, instead of `send and `sendAsync` in web3@0.x.x + // That's why we reassign the send method. + (provider as any).sendAsync = (provider as any).send; } this._web3Wrapper = new Web3Wrapper(provider); const gasPrice = _.isUndefined(config) ? undefined : config.gasPrice; -- cgit v1.2.3