aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorPaul Bouchon <mail@bitpshr.net>2018-09-18 00:11:10 +0800
committerGitHub <noreply@github.com>2018-09-18 00:11:10 +0800
commitdaca7f9b41d784a44c7f5469b8f9b710e0a08e4b (patch)
treef00bcf3853428dc785024bc07564d1f02c061c3e /app
parent42fdcf6239fc9278cfa85b6ae6cc025cef0e35ae (diff)
parent2f14f978e390772e78e4cc2ee7a778c9106d053c (diff)
downloadtangerine-wallet-browser-daca7f9b41d784a44c7f5469b8f9b710e0a08e4b.tar
tangerine-wallet-browser-daca7f9b41d784a44c7f5469b8f9b710e0a08e4b.tar.gz
tangerine-wallet-browser-daca7f9b41d784a44c7f5469b8f9b710e0a08e4b.tar.bz2
tangerine-wallet-browser-daca7f9b41d784a44c7f5469b8f9b710e0a08e4b.tar.lz
tangerine-wallet-browser-daca7f9b41d784a44c7f5469b8f9b710e0a08e4b.tar.xz
tangerine-wallet-browser-daca7f9b41d784a44c7f5469b8f9b710e0a08e4b.tar.zst
tangerine-wallet-browser-daca7f9b41d784a44c7f5469b8f9b710e0a08e4b.zip
Merge branch 'develop' into eip-712
Diffstat (limited to 'app')
-rw-r--r--app/scripts/inpage.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js
index 1a170c617..d9fda1feb 100644
--- a/app/scripts/inpage.js
+++ b/app/scripts/inpage.js
@@ -22,6 +22,25 @@ var metamaskStream = new LocalMessageDuplexStream({
// compose the inpage provider
var inpageProvider = new MetamaskInpageProvider(metamaskStream)
+// Augment the provider with its enable method
+inpageProvider.enable = function (options = {}) {
+ return new Promise((resolve, reject) => {
+ if (options.mockRejection) {
+ reject('User rejected account access')
+ } else {
+ inpageProvider.sendAsync({ method: 'eth_accounts', params: [] }, (error, response) => {
+ if (error) {
+ reject(error)
+ } else {
+ resolve(response.result)
+ }
+ })
+ }
+ })
+}
+
+window.ethereum = inpageProvider
+
//
// setup web3
//