|
|
@ -5,7 +5,6 @@ const Dnode = require('dnode') |
|
|
|
const ObservableStore = require('obs-store') |
|
|
|
const ObservableStore = require('obs-store') |
|
|
|
const asStream = require('obs-store/lib/asStream') |
|
|
|
const asStream = require('obs-store/lib/asStream') |
|
|
|
const AccountTracker = require('./lib/account-tracker') |
|
|
|
const AccountTracker = require('./lib/account-tracker') |
|
|
|
const EthQuery = require('eth-query') |
|
|
|
|
|
|
|
const RpcEngine = require('json-rpc-engine') |
|
|
|
const RpcEngine = require('json-rpc-engine') |
|
|
|
const debounce = require('debounce') |
|
|
|
const debounce = require('debounce') |
|
|
|
const createEngineStream = require('json-rpc-middleware-stream/engineStream') |
|
|
|
const createEngineStream = require('json-rpc-middleware-stream/engineStream') |
|
|
@ -94,12 +93,9 @@ module.exports = class MetamaskController extends EventEmitter { |
|
|
|
this.provider = this.initializeProvider() |
|
|
|
this.provider = this.initializeProvider() |
|
|
|
this.blockTracker = this.provider._blockTracker |
|
|
|
this.blockTracker = this.provider._blockTracker |
|
|
|
|
|
|
|
|
|
|
|
// eth data query tools
|
|
|
|
|
|
|
|
this.ethQuery = new EthQuery(this.provider) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.recentBlocksController = new RecentBlocksController({ |
|
|
|
this.recentBlocksController = new RecentBlocksController({ |
|
|
|
blockTracker: this.blockTracker, |
|
|
|
blockTracker: this.blockTracker, |
|
|
|
ethQuery: this.ethQuery, |
|
|
|
provider: this.provider, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// account tracker watches balances, nonces, and any code at their address.
|
|
|
|
// account tracker watches balances, nonces, and any code at their address.
|
|
|
@ -142,7 +138,6 @@ module.exports = class MetamaskController extends EventEmitter { |
|
|
|
signTransaction: this.keyringController.signTransaction.bind(this.keyringController), |
|
|
|
signTransaction: this.keyringController.signTransaction.bind(this.keyringController), |
|
|
|
provider: this.provider, |
|
|
|
provider: this.provider, |
|
|
|
blockTracker: this.blockTracker, |
|
|
|
blockTracker: this.blockTracker, |
|
|
|
ethQuery: this.ethQuery, |
|
|
|
|
|
|
|
getGasPrice: this.getGasPrice.bind(this), |
|
|
|
getGasPrice: this.getGasPrice.bind(this), |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.txController.on('newUnapprovedTx', opts.showUnapprovedTx.bind(opts)) |
|
|
|
this.txController.on('newUnapprovedTx', opts.showUnapprovedTx.bind(opts)) |
|
|
|