diff options
unsig tx - show notification on new tx
Diffstat (limited to 'app')
-rw-r--r-- | app/manifest.json | 1 | ||||
-rw-r--r-- | app/scripts/background.js | 18 |
2 files changed, 17 insertions, 2 deletions
diff --git a/app/manifest.json b/app/manifest.json index cc180945d..af64da008 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -36,6 +36,7 @@ } ], "permissions": [ + "notifications", "storage", "tabs", "http://localhost:8545/" diff --git a/app/scripts/background.js b/app/scripts/background.js index aa74cb921..4567dc656 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -45,7 +45,7 @@ var zeroClient = MetaMaskProvider({ var result = selectedAddress ? [selectedAddress] : [] cb(null, result) }, - approveTransaction: idStore.addUnconfirmedTransaction.bind(idStore), + approveTransaction: addUnconfirmedTx, signTransaction: idStore.signTransaction.bind(idStore), }) @@ -71,7 +71,7 @@ function onRpcRequest(remoteStream, payload){ // console.log('MetaMaskPlugin - incoming payload:', payload) zeroClient.sendAsync(payload, function onPayloadHandled(err, response){ // provider engine errors are included in response objects - // if (!payload.isMetamaskInternal) console.log('MetaMaskPlugin - RPC complete:', payload, '->', response) + if (!payload.isMetamaskInternal) console.log('MetaMaskPlugin - RPC complete:', payload, '->', response) try { remoteStream.write(response) } catch (err) { @@ -155,6 +155,20 @@ function updateBadge(state){ } // +// Add unconfirmed Tx +// + +function addUnconfirmedTx(txParams, cb){ + chrome.notifications.create({ + type: 'basic', + iconUrl: '/images/icon-128.png', + title: 'New Transaction', + message: 'click the extension to confirm...', + }) + idStore.addUnconfirmedTransaction(txParams, cb) +} + +// // config // |