Merge branch 'master' into natsoni/more-fiat-currencies
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpParams, HttpResponse } from '@angular/common/http';
|
||||
import { CpfpInfo, OptimizedMempoolStats, AddressInformation, LiquidPegs, ITranslators,
|
||||
PoolStat, BlockExtended, TransactionStripped, RewardStats, AuditScore, BlockSizesAndWeights, RbfTree, BlockAudit, Acceleration, AccelerationHistoryParams, CurrentPegs, AuditStatus, FederationAddress, FederationUtxo, RecentPeg, PegsVolume } from '../interfaces/node-api.interface';
|
||||
PoolStat, BlockExtended, TransactionStripped, RewardStats, AuditScore, BlockSizesAndWeights, RbfTree, BlockAudit, Acceleration, AccelerationHistoryParams, CurrentPegs, AuditStatus, FederationAddress, FederationUtxo, RecentPeg, PegsVolume, AccelerationInfo } from '../interfaces/node-api.interface';
|
||||
import { BehaviorSubject, Observable, catchError, filter, of, shareReplay, take, tap } from 'rxjs';
|
||||
import { StateService } from './state.service';
|
||||
import { Transaction } from '../interfaces/electrs.interface';
|
||||
@@ -459,4 +459,22 @@ export class ApiService {
|
||||
(queryParams.length > 0 ? `?${queryParams.join('&')}` : '')
|
||||
);
|
||||
}
|
||||
|
||||
getAccelerationsByPool$(slug: string): Observable<AccelerationInfo[]> {
|
||||
return this.httpClient.get<AccelerationInfo[]>(
|
||||
this.apiBaseUrl + this.apiBasePath + `/api/v1/accelerations/pool/${slug}`
|
||||
);
|
||||
}
|
||||
|
||||
getAccelerationsByHeight$(height: number): Observable<AccelerationInfo[]> {
|
||||
return this.httpClient.get<AccelerationInfo[]>(
|
||||
this.apiBaseUrl + this.apiBasePath + `/api/v1/accelerations/block/${height}`
|
||||
);
|
||||
}
|
||||
|
||||
getRecentAccelerations$(interval: string | undefined): Observable<AccelerationInfo[]> {
|
||||
return this.httpClient.get<AccelerationInfo[]>(
|
||||
this.apiBaseUrl + this.apiBasePath + '/api/v1/accelerations/interval' + (interval !== undefined ? `/${interval}` : '')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import { ApiService } from './api.service';
|
||||
import { SeoService } from './seo.service';
|
||||
import { StateService } from './state.service';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -11,9 +12,9 @@ import { ActivatedRoute } from '@angular/router';
|
||||
export class EnterpriseService {
|
||||
exclusiveHostName = '.mempool.space';
|
||||
subdomain: string | null = null;
|
||||
info: object = {};
|
||||
statsUrl: string;
|
||||
siteId: number;
|
||||
info$: BehaviorSubject<object> = new BehaviorSubject(null);
|
||||
|
||||
constructor(
|
||||
@Inject(DOCUMENT) private document: Document,
|
||||
@@ -47,9 +48,9 @@ export class EnterpriseService {
|
||||
|
||||
fetchSubdomainInfo(): void {
|
||||
this.apiService.getEnterpriseInfo$(this.subdomain).subscribe((info) => {
|
||||
this.info = info;
|
||||
this.insertMatomo(info.site_id);
|
||||
this.seoService.setEnterpriseTitle(info.title);
|
||||
this.info$.next(info);
|
||||
},
|
||||
(error) => {
|
||||
if (error.status === 404) {
|
||||
|
||||
@@ -145,8 +145,8 @@ export class ServicesApiServices {
|
||||
return this.httpClient.get<Acceleration[]>(`${SERVICES_API_PREFIX}/accelerator/accelerations`);
|
||||
}
|
||||
|
||||
getAggregatedAccelerationHistory$(params: AccelerationHistoryParams): Observable<Acceleration[]> {
|
||||
return this.httpClient.get<Acceleration[]>(`${SERVICES_API_PREFIX}/accelerator/accelerations/history/aggregated`, { params: { ...params } });
|
||||
getAggregatedAccelerationHistory$(params: AccelerationHistoryParams): Observable<any> {
|
||||
return this.httpClient.get<any>(`${SERVICES_API_PREFIX}/accelerator/accelerations/history/aggregated`, { params: { ...params }, observe: 'response' });
|
||||
}
|
||||
|
||||
getAccelerationHistory$(params: AccelerationHistoryParams): Observable<Acceleration[]> {
|
||||
|
||||
@@ -116,7 +116,7 @@ export class WebsocketService {
|
||||
this.startMultiTrackTransaction(this.trackingTxId);
|
||||
}
|
||||
if (this.isTrackingMempoolBlock) {
|
||||
this.startTrackMempoolBlock(this.trackingMempoolBlock);
|
||||
this.startTrackMempoolBlock(this.trackingMempoolBlock, true);
|
||||
}
|
||||
if (this.isTrackingRbf) {
|
||||
this.startTrackRbf(this.isTrackingRbf);
|
||||
@@ -197,9 +197,9 @@ export class WebsocketService {
|
||||
this.websocketSubject.next({ 'track-asset': 'stop' });
|
||||
}
|
||||
|
||||
startTrackMempoolBlock(block: number) {
|
||||
startTrackMempoolBlock(block: number, force: boolean = false) {
|
||||
// skip duplicate tracking requests
|
||||
if (this.trackingMempoolBlock !== block) {
|
||||
if (force || this.trackingMempoolBlock !== block) {
|
||||
this.websocketSubject.next({ 'track-mempool-block': block });
|
||||
this.isTrackingMempoolBlock = true;
|
||||
this.trackingMempoolBlock = block;
|
||||
|
||||
Reference in New Issue
Block a user