diff options
Diffstat (limited to 'packages/subproviders')
-rw-r--r-- | packages/subproviders/CHANGELOG.md | 6 | ||||
-rw-r--r-- | packages/subproviders/README.md | 2 | ||||
-rw-r--r-- | packages/subproviders/package.json | 12 | ||||
-rw-r--r-- | packages/subproviders/src/subproviders/injected_web3.ts | 11 |
4 files changed, 19 insertions, 12 deletions
diff --git a/packages/subproviders/CHANGELOG.md b/packages/subproviders/CHANGELOG.md index 0469150c0..6ee8e2455 100644 --- a/packages/subproviders/CHANGELOG.md +++ b/packages/subproviders/CHANGELOG.md @@ -1,6 +1,10 @@ # CHANGELOG -## v0.4.0 - _January 28, 2017_ +## v0.4.0 - _Feburary 02, 2018_ + + * InjectedWeb3Subprovider accepts a Provider in the constructor, previously it was a Web3 object. + +## v0.3.5 - _January 28, 2018_ * Return a transaction hash from `_sendTransactionAsync` (#303) diff --git a/packages/subproviders/README.md b/packages/subproviders/README.md index 78643ad55..0d8f85910 100644 --- a/packages/subproviders/README.md +++ b/packages/subproviders/README.md @@ -2,6 +2,8 @@ A few useful web3 subproviders including a LedgerSubprovider useful for adding Ledger Nano S support. +We have written up a [Wiki](https://0xproject.com/wiki#Web3-Provider-Examples) article detailing some use cases of this subprovider package. + ## Installation ``` diff --git a/packages/subproviders/package.json b/packages/subproviders/package.json index ee283dff3..9137f3c77 100644 --- a/packages/subproviders/package.json +++ b/packages/subproviders/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/subproviders", - "version": "0.3.5", + "version": "0.3.6", "main": "lib/src/index.js", "types": "lib/src/index.d.ts", "license": "Apache-2.0", @@ -18,8 +18,8 @@ "test:integration": "run-s clean build run_mocha_integration" }, "dependencies": { - "@0xproject/assert": "^0.0.15", - "@0xproject/utils": "^0.2.4", + "@0xproject/assert": "^0.0.16", + "@0xproject/utils": "^0.3.0", "bn.js": "^4.11.8", "es6-promisify": "^5.0.0", "ethereumjs-tx": "^1.3.3", @@ -32,8 +32,8 @@ "web3-provider-engine": "^13.0.1" }, "devDependencies": { - "@0xproject/tslint-config": "^0.4.6", - "@0xproject/utils": "^0.2.4", + "@0xproject/tslint-config": "^0.4.7", + "@0xproject/utils": "^0.3.0", "@types/lodash": "^4.14.86", "@types/mocha": "^2.2.42", "@types/node": "^8.0.53", @@ -50,7 +50,7 @@ "types-bn": "^0.0.1", "types-ethereumjs-util": "0xProject/types-ethereumjs-util", "typescript": "2.7.1", - "web3-typescript-typings": "^0.9.8", + "web3-typescript-typings": "^0.9.9", "webpack": "^3.1.0" } } diff --git a/packages/subproviders/src/subproviders/injected_web3.ts b/packages/subproviders/src/subproviders/injected_web3.ts index bd29acb22..0d70180c4 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,10 @@ export class InjectedWeb3Subprovider { } } // Required to implement this method despite not needing it for this subprovider + // The engine argument type should be Web3ProviderEngine, but we've decided to keep it as type any + // to remove the provider engine depdency given this method is a noop // tslint:disable-next-line:prefer-function-over-method - public setEngine(engine: Web3ProviderEngine) { + public setEngine(engine: any) { // noop } } |