diff options
author | Csaba Solya <csaba.solya@gmail.com> | 2018-07-20 04:34:06 +0800 |
---|---|---|
committer | Csaba Solya <csaba.solya@gmail.com> | 2018-07-20 04:34:06 +0800 |
commit | 6921f94bfe11e618dbe586e608a5b6aeaa8feadf (patch) | |
tree | 863eca1a81a22b46dc2ca4ccf5b0f97639b4025b /app | |
parent | 3784a7e2c852974315cfe17a68673938cf24a7fa (diff) | |
download | tangerine-wallet-browser-6921f94bfe11e618dbe586e608a5b6aeaa8feadf.tar tangerine-wallet-browser-6921f94bfe11e618dbe586e608a5b6aeaa8feadf.tar.gz tangerine-wallet-browser-6921f94bfe11e618dbe586e608a5b6aeaa8feadf.tar.bz2 tangerine-wallet-browser-6921f94bfe11e618dbe586e608a5b6aeaa8feadf.tar.lz tangerine-wallet-browser-6921f94bfe11e618dbe586e608a5b6aeaa8feadf.tar.xz tangerine-wallet-browser-6921f94bfe11e618dbe586e608a5b6aeaa8feadf.tar.zst tangerine-wallet-browser-6921f94bfe11e618dbe586e608a5b6aeaa8feadf.zip |
initial test
Diffstat (limited to 'app')
-rw-r--r-- | app/manifest.json | 3 | ||||
-rw-r--r-- | app/scripts/controllers/transactions/lib/transaction-notification-manager.js | 27 | ||||
-rw-r--r-- | app/scripts/controllers/transactions/tx-state-manager.js | 3 |
3 files changed, 32 insertions, 1 deletions
diff --git a/app/manifest.json b/app/manifest.json index b67cef025..52256c5b7 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -63,7 +63,8 @@ "activeTab", "webRequest", "*://*.eth/", - "*://*.test/" + "*://*.test/", + "notifications" ], "web_accessible_resources": [ "inpage.js" diff --git a/app/scripts/controllers/transactions/lib/transaction-notification-manager.js b/app/scripts/controllers/transactions/lib/transaction-notification-manager.js new file mode 100644 index 000000000..6bdf40b62 --- /dev/null +++ b/app/scripts/controllers/transactions/lib/transaction-notification-manager.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 +}
\ No newline at end of file diff --git a/app/scripts/controllers/transactions/tx-state-manager.js b/app/scripts/controllers/transactions/tx-state-manager.js index 28a18ca2e..72da45913 100644 --- a/app/scripts/controllers/transactions/tx-state-manager.js +++ b/app/scripts/controllers/transactions/tx-state-manager.js @@ -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) } /** |