@@ -61,4 +61,16 @@ export class ApiService {
|
||||
});
|
||||
return this.httpClient.get<number[]>(this.apiBaseUrl + '/transaction-times', { params });
|
||||
}
|
||||
|
||||
requestDonation$(amount: number, orderId: string): Observable<any> {
|
||||
const params = {
|
||||
amount: amount,
|
||||
orderId: orderId,
|
||||
};
|
||||
return this.httpClient.post<any>(this.apiBaseUrl + '/donations', params);
|
||||
}
|
||||
|
||||
getDonation$(): Observable<any[]> {
|
||||
return this.httpClient.get<any[]>(this.apiBaseUrl + '/donations');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ export class StateService {
|
||||
vbytesPerSecond$ = new ReplaySubject<number>(1);
|
||||
lastDifficultyAdjustment$ = new ReplaySubject<number>(1);
|
||||
gitCommit$ = new ReplaySubject<string>(1);
|
||||
donationConfirmed$ = new Subject();
|
||||
|
||||
live2Chart$ = new Subject<OptimizedMempoolStats>();
|
||||
|
||||
|
||||
@@ -155,6 +155,10 @@ export class WebsocketService {
|
||||
this.stateService.gitCommit$.next(response['git-commit']);
|
||||
}
|
||||
|
||||
if (response.donationConfirmed) {
|
||||
this.stateService.donationConfirmed$.next(true);
|
||||
}
|
||||
|
||||
if (this.goneOffline === true) {
|
||||
this.goneOffline = false;
|
||||
if (this.lastWant) {
|
||||
@@ -189,6 +193,10 @@ export class WebsocketService {
|
||||
this.isTrackingTx = true;
|
||||
}
|
||||
|
||||
trackDonation(id: string) {
|
||||
this.websocketSubject.next({ 'track-donation': id });
|
||||
}
|
||||
|
||||
stopTrackingTransaction() {
|
||||
if (!this.isTrackingTx) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user