Use block count instead of oldest block for timespan selection

This commit is contained in:
nymkappa
2022-04-15 20:43:10 +09:00
parent 056b1db8b3
commit a59bed8cd8
14 changed files with 96 additions and 118 deletions

View File

@@ -125,10 +125,10 @@ export class ApiService {
return this.httpClient.post<any>(this.apiBaseUrl + this.apiBasePath + '/api/tx', hexPayload, { responseType: 'text' as 'json'});
}
listPools$(interval: string | undefined) : Observable<PoolsStats> {
return this.httpClient.get<PoolsStats>(
listPools$(interval: string | undefined) : Observable<any> {
return this.httpClient.get<any>(
this.apiBaseUrl + this.apiBasePath + `/api/v1/mining/pools` +
(interval !== undefined ? `/${interval}` : '')
(interval !== undefined ? `/${interval}` : ''), { observe: 'response' }
);
}
@@ -157,28 +157,28 @@ export class ApiService {
getHistoricalHashrate$(interval: string | undefined): Observable<any> {
return this.httpClient.get<any[]>(
this.apiBaseUrl + this.apiBasePath + `/api/v1/mining/hashrate` +
(interval !== undefined ? `/${interval}` : '')
(interval !== undefined ? `/${interval}` : ''), { observe: 'response' }
);
}
getHistoricalPoolsHashrate$(interval: string | undefined): Observable<any> {
return this.httpClient.get<any[]>(
this.apiBaseUrl + this.apiBasePath + `/api/v1/mining/hashrate/pools` +
(interval !== undefined ? `/${interval}` : '')
(interval !== undefined ? `/${interval}` : ''), { observe: 'response' }
);
}
getHistoricalBlockFees$(interval: string | undefined) : Observable<any> {
return this.httpClient.get<any[]>(
this.apiBaseUrl + this.apiBasePath + `/api/v1/mining/blocks/fees` +
(interval !== undefined ? `/${interval}` : '')
(interval !== undefined ? `/${interval}` : ''), { observe: 'response' }
);
}
getHistoricalBlockRewards$(interval: string | undefined) : Observable<any> {
return this.httpClient.get<any[]>(
this.apiBaseUrl + this.apiBasePath + `/api/v1/mining/blocks/rewards` +
(interval !== undefined ? `/${interval}` : '')
(interval !== undefined ? `/${interval}` : ''), { observe: 'response' }
);
}