diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-08-30 00:45:26 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-08-30 00:45:26 +0800 |
commit | a98bb1f7ac2ab02115a28ace15e94ed14d2cf861 (patch) | |
tree | 708a894836771b88a8f56fbf6324d7b316903a9b /src | |
parent | da2661cf332a5d884184c376c2fedd3937a1b6ac (diff) | |
download | dexon-sol-tools-a98bb1f7ac2ab02115a28ace15e94ed14d2cf861.tar dexon-sol-tools-a98bb1f7ac2ab02115a28ace15e94ed14d2cf861.tar.gz dexon-sol-tools-a98bb1f7ac2ab02115a28ace15e94ed14d2cf861.tar.bz2 dexon-sol-tools-a98bb1f7ac2ab02115a28ace15e94ed14d2cf861.tar.lz dexon-sol-tools-a98bb1f7ac2ab02115a28ace15e94ed14d2cf861.tar.xz dexon-sol-tools-a98bb1f7ac2ab02115a28ace15e94ed14d2cf861.tar.zst dexon-sol-tools-a98bb1f7ac2ab02115a28ace15e94ed14d2cf861.zip |
Improve the comment
Diffstat (limited to 'src')
-rw-r--r-- | src/0x.ts | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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; |