aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-08-30 00:45:26 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-08-30 00:45:26 +0800
commita98bb1f7ac2ab02115a28ace15e94ed14d2cf861 (patch)
tree708a894836771b88a8f56fbf6324d7b316903a9b /src
parentda2661cf332a5d884184c376c2fedd3937a1b6ac (diff)
downloaddexon-0x-contracts-a98bb1f7ac2ab02115a28ace15e94ed14d2cf861.tar.gz
dexon-0x-contracts-a98bb1f7ac2ab02115a28ace15e94ed14d2cf861.tar.zst
dexon-0x-contracts-a98bb1f7ac2ab02115a28ace15e94ed14d2cf861.zip
Improve the comment
Diffstat (limited to 'src')
-rw-r--r--src/0x.ts8
1 files changed, 5 insertions, 3 deletions
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;