Transaction tracking revamped.

Blockchain block arrow.
This commit is contained in:
Simon Lindh
2020-02-19 23:50:23 +07:00
committed by wiz
parent 34645908e9
commit f3cfa038d3
15 changed files with 232 additions and 145 deletions

View File

@@ -16,6 +16,7 @@ export class WebsocketService {
private goneOffline = false;
private lastWant: string[] | null = null;
private trackingTxId: string | null = null;
private trackingAddress: string | null = null;
constructor(
private stateService: StateService,
@@ -86,7 +87,10 @@ export class WebsocketService {
this.want(this.lastWant);
}
if (this.trackingTxId) {
this.startTrackTx(this.trackingTxId);
this.startTrackTransaction(this.trackingTxId);
}
if (this.trackingAddress) {
this.startTrackTransaction(this.trackingAddress);
}
this.stateService.isOffline$.next(false);
}
@@ -99,11 +103,16 @@ export class WebsocketService {
});
}
startTrackTx(txId: string) {
this.websocketSubject.next({ txId });
startTrackTransaction(txId: string) {
this.websocketSubject.next({ 'track-tx': txId });
this.trackingTxId = txId;
}
startTrackAddress(address: string) {
this.websocketSubject.next({ 'track-address': address });
this.trackingAddress = address;
}
fetchStatistics(historicalDate: string) {
this.websocketSubject.next({ historicalDate });
}