mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
ui - remove web3, use eth-query
This commit is contained in:
parent
1c44dd3353
commit
68be86abe9
@ -1,7 +1,7 @@
|
|||||||
const EventEmitter = require('events').EventEmitter
|
const EventEmitter = require('events').EventEmitter
|
||||||
const async = require('async')
|
const async = require('async')
|
||||||
const Dnode = require('dnode')
|
const Dnode = require('dnode')
|
||||||
const Web3 = require('web3')
|
const EthQuery = require('eth-query')
|
||||||
const launchMetamaskUi = require('../../ui')
|
const launchMetamaskUi = require('../../ui')
|
||||||
const StreamProvider = require('web3-stream-provider')
|
const StreamProvider = require('web3-stream-provider')
|
||||||
const setupMultiplex = require('./lib/stream-utils.js').setupMultiplex
|
const setupMultiplex = require('./lib/stream-utils.js').setupMultiplex
|
||||||
@ -32,7 +32,8 @@ function setupWeb3Connection (connectionStream) {
|
|||||||
providerStream.pipe(connectionStream).pipe(providerStream)
|
providerStream.pipe(connectionStream).pipe(providerStream)
|
||||||
connectionStream.on('error', console.error.bind(console))
|
connectionStream.on('error', console.error.bind(console))
|
||||||
providerStream.on('error', console.error.bind(console))
|
providerStream.on('error', console.error.bind(console))
|
||||||
global.web3 = new Web3(providerStream)
|
global.ethereumProvider = providerStream
|
||||||
|
global.ethQuery = new EthQuery(providerStream)
|
||||||
}
|
}
|
||||||
|
|
||||||
function setupControllerConnection (connectionStream, cb) {
|
function setupControllerConnection (connectionStream, cb) {
|
||||||
|
@ -393,7 +393,7 @@ function signPersonalMsg (msgData) {
|
|||||||
|
|
||||||
function signTx (txData) {
|
function signTx (txData) {
|
||||||
return (dispatch) => {
|
return (dispatch) => {
|
||||||
web3.eth.sendTransaction(txData, (err, data) => {
|
global.ethQuery.sendTransaction(txData, (err, data) => {
|
||||||
dispatch(actions.hideLoadingIndication())
|
dispatch(actions.hideLoadingIndication())
|
||||||
if (err) return dispatch(actions.displayWarning(err.message))
|
if (err) return dispatch(actions.displayWarning(err.message))
|
||||||
dispatch(actions.hideWarning())
|
dispatch(actions.hideWarning())
|
||||||
|
@ -75,7 +75,7 @@ EnsInput.prototype.componentDidMount = function () {
|
|||||||
const resolverAddress = networkResolvers[network]
|
const resolverAddress = networkResolvers[network]
|
||||||
|
|
||||||
if (resolverAddress) {
|
if (resolverAddress) {
|
||||||
const provider = web3.currentProvider
|
const provider = global.ethereumProvider
|
||||||
this.ens = new ENS({ provider, network })
|
this.ens = new ENS({ provider, network })
|
||||||
this.checkName = debounce(this.lookupEnsName.bind(this), 200)
|
this.checkName = debounce(this.lookupEnsName.bind(this), 200)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user