mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
initial test
This commit is contained in:
parent
3784a7e2c8
commit
6921f94bfe
@ -63,7 +63,8 @@
|
||||
"activeTab",
|
||||
"webRequest",
|
||||
"*://*.eth/",
|
||||
"*://*.test/"
|
||||
"*://*.test/",
|
||||
"notifications"
|
||||
],
|
||||
"web_accessible_resources": [
|
||||
"inpage.js"
|
||||
|
@ -0,0 +1,27 @@
|
||||
const extension = require('extensionizer')
|
||||
|
||||
// Confirmed tx
|
||||
// Transaction ${tx.nonce} confirmed! View on Etherscan
|
||||
|
||||
// Failed tx
|
||||
// Transaction ${tx.nonce} failed. (Maybe append tx.error.message)
|
||||
|
||||
// Dropped tx
|
||||
// A Transaction ${tx.nonce} was dropped, because another transaction with that number was successfully processed.
|
||||
|
||||
function showConfirmedNotification (txMeta) {
|
||||
extension.notifications.create({
|
||||
"type": "basic",
|
||||
"title": "Confirmed transaction",
|
||||
"iconUrl": extension.extension.getURL('../../../../images/icon-64.png'),
|
||||
"message": JSON.stringify(txMeta)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@module
|
||||
*/
|
||||
module.exports = {
|
||||
showConfirmedNotification
|
||||
}
|
@ -5,6 +5,7 @@ const ethUtil = require('ethereumjs-util')
|
||||
const log = require('loglevel')
|
||||
const txStateHistoryHelper = require('./lib/tx-state-history-helper')
|
||||
const createId = require('../../lib/random-id')
|
||||
const transactionNotificationManager = require('./lib/transaction-notification-manager')
|
||||
const { getFinalStates } = require('./lib/util')
|
||||
/**
|
||||
TransactionStateManager is responsible for the state of a transaction and
|
||||
@ -332,6 +333,8 @@ class TransactionStateManager extends EventEmitter {
|
||||
*/
|
||||
setTxStatusConfirmed (txId) {
|
||||
this._setTxStatus(txId, 'confirmed')
|
||||
const txMeta = this.getTx(txId)
|
||||
transactionNotificationManager.showConfirmedNotification(txMeta)
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user