aboutsummaryrefslogtreecommitdiffstats
path: root/packages/subproviders/src
diff options
context:
space:
mode:
authorJacob Evans <dekz@dekz.net>2018-02-06 09:16:34 +0800
committerGitHub <noreply@github.com>2018-02-06 09:16:34 +0800
commit61434a91218eb4adec0de6095a51d07203f1f5bb (patch)
treef0d695cf1960ce1068a5ed4be2e646a2ffe2a904 /packages/subproviders/src
parent2205e2b9a0dab345a14724731098043d04827c4f (diff)
parentd14ae70776e82c8a61e1c41219c40ec283890a8a (diff)
downloaddexon-sol-tools-61434a91218eb4adec0de6095a51d07203f1f5bb.tar
dexon-sol-tools-61434a91218eb4adec0de6095a51d07203f1f5bb.tar.gz
dexon-sol-tools-61434a91218eb4adec0de6095a51d07203f1f5bb.tar.bz2
dexon-sol-tools-61434a91218eb4adec0de6095a51d07203f1f5bb.tar.lz
dexon-sol-tools-61434a91218eb4adec0de6095a51d07203f1f5bb.tar.xz
dexon-sol-tools-61434a91218eb4adec0de6095a51d07203f1f5bb.tar.zst
dexon-sol-tools-61434a91218eb4adec0de6095a51d07203f1f5bb.zip
Merge pull request #363 from 0xProject/refactor/subproviders/injected-provider-constructor
Change the InjectedWeb3Subprovider to accept Web3.Provider
Diffstat (limited to 'packages/subproviders/src')
-rw-r--r--packages/subproviders/src/subproviders/injected_web3.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/subproviders/src/subproviders/injected_web3.ts b/packages/subproviders/src/subproviders/injected_web3.ts
index bd29acb22..a74a6c4b2 100644
--- a/packages/subproviders/src/subproviders/injected_web3.ts
+++ b/packages/subproviders/src/subproviders/injected_web3.ts
@@ -1,17 +1,16 @@
import * as _ from 'lodash';
import Web3 = require('web3');
-import Web3ProviderEngine = require('web3-provider-engine');
/*
* This class implements the web3-provider-engine subprovider interface and forwards
* requests involving user accounts (getAccounts, sendTransaction, etc...) to the injected
- * web3 instance in their browser.
+ * provider instance in their browser.
* Source: https://github.com/MetaMask/provider-engine/blob/master/subproviders/subprovider.js
*/
export class InjectedWeb3Subprovider {
private _injectedWeb3: Web3;
- constructor(injectedWeb3: Web3) {
- this._injectedWeb3 = injectedWeb3;
+ constructor(subprovider: Web3.Provider) {
+ this._injectedWeb3 = new Web3(subprovider);
}
public handleRequest(
payload: Web3.JSONRPCRequestPayload,
@@ -42,8 +41,9 @@ export class InjectedWeb3Subprovider {
}
}
// Required to implement this method despite not needing it for this subprovider
+ // This type is Web3ProviderEngine, but there is no need to import this for a noop.
// tslint:disable-next-line:prefer-function-over-method
- public setEngine(engine: Web3ProviderEngine) {
+ public setEngine(engine: any) {
// noop
}
}