@ -174,27 +174,6 @@ log.debug('MetaMask - injected web3')
setupDappAutoReload ( web3 , inpageProvider . publicConfigStore )
// export global web3, with usage-detection and deprecation warning
/ * T O D O : U n c o m m e n t t h i s a r e a o n c e a u t o - r e l o a d . j s h a s b e e n d e p r e c a t e d :
let hasBeenWarned = false
global . web3 = new Proxy ( web3 , {
get : ( _web3 , key ) => {
// show warning once on web3 access
if ( ! hasBeenWarned && key !== 'currentProvider' ) {
console . warn ( 'MetaMask: web3 will be deprecated in the near future in favor of the ethereumProvider \nhttps://github.com/MetaMask/faq/blob/master/detecting_metamask.md#web3-deprecation' )
hasBeenWarned = true
}
// return value normally
return _web3 [ key ]
} ,
set : ( _web3 , key , value ) => {
// set value normally
_web3 [ key ] = value
} ,
} )
* /
// set web3 defaultAccount
inpageProvider . publicConfigStore . subscribe ( function ( state ) {
web3 . eth . defaultAccount = state . selectedAddress