aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2018-01-09 06:57:57 +0800
committerkumavis <aaron@kumavis.me>2018-01-09 06:57:57 +0800
commitab7701efb35f39e73fcccc2110a754384e23d695 (patch)
tree7de60dc666d339c2ba058e7ddcd7bc099f4d43cc
parent63ae7fb589b43d2af87f31d51f5b5f96669dabe0 (diff)
downloadtangerine-wallet-browser-ab7701efb35f39e73fcccc2110a754384e23d695.tar
tangerine-wallet-browser-ab7701efb35f39e73fcccc2110a754384e23d695.tar.gz
tangerine-wallet-browser-ab7701efb35f39e73fcccc2110a754384e23d695.tar.bz2
tangerine-wallet-browser-ab7701efb35f39e73fcccc2110a754384e23d695.tar.lz
tangerine-wallet-browser-ab7701efb35f39e73fcccc2110a754384e23d695.tar.xz
tangerine-wallet-browser-ab7701efb35f39e73fcccc2110a754384e23d695.tar.zst
tangerine-wallet-browser-ab7701efb35f39e73fcccc2110a754384e23d695.zip
provider - infura - use infura REST api
-rw-r--r--app/scripts/controllers/network.js7
-rw-r--r--package.json4
2 files changed, 7 insertions, 4 deletions
diff --git a/app/scripts/controllers/network.js b/app/scripts/controllers/network.js
index 377ba6eca..a1db8946a 100644
--- a/app/scripts/controllers/network.js
+++ b/app/scripts/controllers/network.js
@@ -1,6 +1,7 @@
const assert = require('assert')
const EventEmitter = require('events')
const createMetamaskProvider = require('web3-provider-engine/zero.js')
+const SubproviderFromProvider = require('web3-provider-engine/subproviders/web3.js')
const createInfuraProvider = require('eth-json-rpc-infura/src/createProvider')
const ObservableStore = require('obs-store')
const ComposedStore = require('obs-store/lib/composed')
@@ -133,15 +134,17 @@ module.exports = class NetworkController extends EventEmitter {
_configureInfuraProvider (opts) {
log.info('_configureInfuraProvider', opts)
- const blockTrackerProvider = createInfuraProvider({
+ const infuraProvider = createInfuraProvider({
network: opts.type,
})
+ const infuraSubprovider = new SubproviderFromProvider(infuraProvider)
const providerParams = extend(this._baseProviderParams, {
rpcUrl: opts.rpcUrl,
engineParams: {
pollingInterval: 8000,
- blockTrackerProvider,
+ blockTrackerProvider: infuraProvider,
},
+ dataSubprovider: infuraSubprovider,
})
const provider = createMetamaskProvider(providerParams)
this._setProvider(provider)
diff --git a/package.json b/package.json
index df532b01e..71a3268a4 100644
--- a/package.json
+++ b/package.json
@@ -74,7 +74,7 @@
"eth-contract-metadata": "^1.1.4",
"eth-hd-keyring": "^1.2.1",
"eth-json-rpc-filters": "^1.2.4",
- "eth-json-rpc-infura": "^1.0.2",
+ "eth-json-rpc-infura": "^2.0.3",
"eth-keyring-controller": "^2.1.2",
"eth-phishing-detect": "^1.1.4",
"eth-query": "^2.1.2",
@@ -154,7 +154,7 @@
"valid-url": "^1.0.9",
"vreme": "^3.0.2",
"web3": "^0.20.1",
- "web3-provider-engine": "^13.4.0",
+ "web3-provider-engine": "^13.5.0",
"web3-stream-provider": "^3.0.1",
"xtend": "^4.0.1"
},