|
|
@ -27,7 +27,12 @@ export default function setupWeb3(log) { |
|
|
|
web3.setProvider = function () { |
|
|
|
web3.setProvider = function () { |
|
|
|
log.debug('MetaMask - overrode web3.setProvider') |
|
|
|
log.debug('MetaMask - overrode web3.setProvider') |
|
|
|
} |
|
|
|
} |
|
|
|
log.debug('MetaMask - injected web3') |
|
|
|
Object.defineProperty(web3, '__isMetaMaskShim__', { |
|
|
|
|
|
|
|
value: true, |
|
|
|
|
|
|
|
enumerable: false, |
|
|
|
|
|
|
|
configurable: false, |
|
|
|
|
|
|
|
writable: false, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(window.ethereum, '_web3Ref', { |
|
|
|
Object.defineProperty(window.ethereum, '_web3Ref', { |
|
|
|
enumerable: false, |
|
|
|
enumerable: false, |
|
|
@ -180,12 +185,13 @@ export default function setupWeb3(log) { |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(global, 'web3', { |
|
|
|
Object.defineProperty(window, 'web3', { |
|
|
|
enumerable: false, |
|
|
|
enumerable: false, |
|
|
|
writable: true, |
|
|
|
writable: true, |
|
|
|
configurable: true, |
|
|
|
configurable: true, |
|
|
|
value: web3Proxy, |
|
|
|
value: web3Proxy, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
log.debug('MetaMask - injected web3') |
|
|
|
|
|
|
|
|
|
|
|
window.ethereum._publicConfigStore.subscribe((state) => { |
|
|
|
window.ethereum._publicConfigStore.subscribe((state) => { |
|
|
|
// if the auto refresh on network change is false do not
|
|
|
|
// if the auto refresh on network change is false do not
|
|
|
@ -231,7 +237,7 @@ export default function setupWeb3(log) { |
|
|
|
|
|
|
|
|
|
|
|
// reload the page
|
|
|
|
// reload the page
|
|
|
|
function triggerReset() { |
|
|
|
function triggerReset() { |
|
|
|
global.location.reload() |
|
|
|
window.location.reload() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|