aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-10-07 03:50:33 +0800
committerDan Finlay <dan@danfinlay.com>2017-10-07 03:50:33 +0800
commit94513cae7bf3c8310ae6a248e12a9b7dd73e306f (patch)
treedaf460fe9b459b83de38bb8cf5c84e1f89e4b239 /app/scripts
parenta32d71e8ed4c91c8ad73f4a7afc52e506ccf5247 (diff)
downloadtangerine-wallet-browser-94513cae7bf3c8310ae6a248e12a9b7dd73e306f.tar
tangerine-wallet-browser-94513cae7bf3c8310ae6a248e12a9b7dd73e306f.tar.gz
tangerine-wallet-browser-94513cae7bf3c8310ae6a248e12a9b7dd73e306f.tar.bz2
tangerine-wallet-browser-94513cae7bf3c8310ae6a248e12a9b7dd73e306f.tar.lz
tangerine-wallet-browser-94513cae7bf3c8310ae6a248e12a9b7dd73e306f.tar.xz
tangerine-wallet-browser-94513cae7bf3c8310ae6a248e12a9b7dd73e306f.tar.zst
tangerine-wallet-browser-94513cae7bf3c8310ae6a248e12a9b7dd73e306f.zip
Provide method for tx tracker to refer to all txs
Diffstat (limited to 'app/scripts')
-rw-r--r--app/scripts/controllers/transactions.js1
-rw-r--r--app/scripts/lib/tx-state-manager.js8
2 files changed, 8 insertions, 1 deletions
diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js
index a0f983deb..ef659a300 100644
--- a/app/scripts/controllers/transactions.js
+++ b/app/scripts/controllers/transactions.js
@@ -62,6 +62,7 @@ module.exports = class TransactionController extends EventEmitter {
retryTimePeriod: 86400000, // Retry 3500 blocks, or about 1 day.
publishTransaction: (rawTx) => this.query.sendRawTransaction(rawTx),
getPendingTransactions: this.txStateManager.getPendingTransactions.bind(this.txStateManager),
+ getCompletedTransactions: this.txStateManager.getConfirmedTransactions.bind(this.txStateManager),
})
this.txStateManager.store.subscribe(() => this.emit('update:badge'))
diff --git a/app/scripts/lib/tx-state-manager.js b/app/scripts/lib/tx-state-manager.js
index cf8117864..2250403f6 100644
--- a/app/scripts/lib/tx-state-manager.js
+++ b/app/scripts/lib/tx-state-manager.js
@@ -46,6 +46,12 @@ module.exports = class TransactionStateManger extends EventEmitter {
return this.getFilteredTxList(opts)
}
+ getConfirmedTransactions (address) {
+ const opts = { status: 'confirmed' }
+ if (address) opts.from = address
+ return this.getFilteredTxList(opts)
+ }
+
addTx (txMeta) {
this.once(`${txMeta.id}:signed`, function (txId) {
this.removeAllListeners(`${txMeta.id}:rejected`)
@@ -242,4 +248,4 @@ module.exports = class TransactionStateManger extends EventEmitter {
_saveTxList (transactions) {
this.store.updateState({ transactions })
}
-} \ No newline at end of file
+}