mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
unsig tx - show notification on new tx
This commit is contained in:
parent
1ffc98917d
commit
4ac689c1e3
@ -36,6 +36,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"permissions": [
|
"permissions": [
|
||||||
|
"notifications",
|
||||||
"storage",
|
"storage",
|
||||||
"tabs",
|
"tabs",
|
||||||
"http://localhost:8545/"
|
"http://localhost:8545/"
|
||||||
|
@ -45,7 +45,7 @@ var zeroClient = MetaMaskProvider({
|
|||||||
var result = selectedAddress ? [selectedAddress] : []
|
var result = selectedAddress ? [selectedAddress] : []
|
||||||
cb(null, result)
|
cb(null, result)
|
||||||
},
|
},
|
||||||
approveTransaction: idStore.addUnconfirmedTransaction.bind(idStore),
|
approveTransaction: addUnconfirmedTx,
|
||||||
signTransaction: idStore.signTransaction.bind(idStore),
|
signTransaction: idStore.signTransaction.bind(idStore),
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ function onRpcRequest(remoteStream, payload){
|
|||||||
// console.log('MetaMaskPlugin - incoming payload:', payload)
|
// console.log('MetaMaskPlugin - incoming payload:', payload)
|
||||||
zeroClient.sendAsync(payload, function onPayloadHandled(err, response){
|
zeroClient.sendAsync(payload, function onPayloadHandled(err, response){
|
||||||
// provider engine errors are included in response objects
|
// 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 {
|
try {
|
||||||
remoteStream.write(response)
|
remoteStream.write(response)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@ -154,6 +154,20 @@ function updateBadge(state){
|
|||||||
chrome.browserAction.setBadgeBackgroundColor({ color: '#506F8B' })
|
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
|
// config
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user