custom dashboard wallet widgets

This commit is contained in:
Mononaut
2024-07-25 22:34:52 +00:00
parent 862c9591a1
commit e095192968
18 changed files with 149 additions and 24 deletions

View File

@@ -34,6 +34,8 @@ export class WebsocketService {
private isTrackingAddress: string | false = false;
private isTrackingAddresses: string[] | false = false;
private isTrackingAccelerations: boolean = false;
private isTrackingWallet: boolean = false;
private trackingWalletName: string;
private trackingMempoolBlock: number;
private stoppingTrackMempoolBlock: any | null = null;
private latestGitCommit = '';
@@ -137,6 +139,9 @@ export class WebsocketService {
if (this.isTrackingAccelerations) {
this.startTrackAccelerations();
}
if (this.isTrackingWallet) {
this.startTrackingWallet(this.trackingWalletName);
}
this.stateService.connectionState$.next(2);
}
@@ -196,6 +201,18 @@ export class WebsocketService {
this.isTrackingAddresses = false;
}
startTrackingWallet(walletName: string) {
this.websocketSubject.next({ 'track-wallet': walletName });
this.isTrackingWallet = true;
this.trackingWalletName = walletName;
}
stopTrackingWallet() {
this.websocketSubject.next({ 'track-wallet': 'stop' });
this.isTrackingWallet = false;
this.trackingWalletName = '';
}
startTrackAsset(asset: string) {
this.websocketSubject.next({ 'track-asset': asset });
}
@@ -452,6 +469,10 @@ export class WebsocketService {
}
}
if (response['wallet-transactions']) {
this.stateService.walletTransactions$.next(response['wallet-transactions']);
}
if (response['accelerations']) {
if (response['accelerations'].accelerations) {
this.stateService.accelerations$.next({