This commit is contained in:
Overtorment 2018-07-02 10:48:40 +01:00
parent c861aa6456
commit e780dd95b9
2 changed files with 7 additions and 7 deletions

View File

@ -145,6 +145,8 @@ export class AppStorage {
} }
/** /**
* Lookup wallet in list by it's secret and
* remove it from `this.wallets`
* *
* @param wallet {AbstractWallet} * @param wallet {AbstractWallet}
*/ */
@ -290,12 +292,6 @@ export class AppStorage {
return txs; return txs;
} }
saveWallets() {}
listTXs() {}
listUnconfirmed() {}
/** /**
* Getter for a sum of all balances of all wallets * Getter for a sum of all balances of all wallets
* *

View File

@ -16,6 +16,8 @@ export class LegacyWallet extends AbstractWallet {
constructor() { constructor() {
super(); super();
this.type = 'legacy'; this.type = 'legacy';
this._lastTxFetch = 0;
this._lastBalanceFetch = 0;
} }
generate() { generate() {
@ -41,7 +43,7 @@ export class LegacyWallet extends AbstractWallet {
} }
getTypeReadable() { getTypeReadable() {
return 'P2PKH'; return 'Legacy (P2PKH)';
} }
/** /**
@ -90,6 +92,7 @@ export class LegacyWallet extends AbstractWallet {
throw new Error('Could not fetch balance from API'); throw new Error('Could not fetch balance from API');
} }
this.balance = json.final_balance / 100000000; this.balance = json.final_balance / 100000000;
this._lastBalanceFetch = +new Date();
} catch (err) { } catch (err) {
console.warn(err); console.warn(err);
} }
@ -177,6 +180,7 @@ export class LegacyWallet extends AbstractWallet {
} }
this.transactions = json.txs; this.transactions = json.txs;
this._lastTxFetch = +new Date();
// now, calculating value per each transaction... // now, calculating value per each transaction...
for (let tx of this.transactions) { for (let tx of this.transactions) {
// how much came in... // how much came in...