unsig tx - show notification on new tx
This commit is contained in:
parent
1ffc98917d
commit
4ac689c1e3
|
@ -36,6 +36,7 @@
|
|||
}
|
||||
],
|
||||
"permissions": [
|
||||
"notifications",
|
||||
"storage",
|
||||
"tabs",
|
||||
"http://localhost:8545/"
|
||||
|
|
|
@ -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) {
|
||||
|
@ -154,6 +154,20 @@ function updateBadge(state){
|
|||
chrome.browserAction.setBadgeBackgroundColor({ color: '#506F8B' })
|
||||
}
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue