Use mining pool slug in urls

This commit is contained in:
nymkappa
2022-03-25 14:22:22 +09:00
parent 328ebf56a9
commit 3096e0f577
18 changed files with 76 additions and 55 deletions

View File

@@ -132,17 +132,17 @@ export class ApiService {
);
}
getPoolStats$(poolId: number): Observable<PoolStat> {
return this.httpClient.get<PoolStat>(this.apiBaseUrl + this.apiBasePath + `/api/v1/mining/pool/${poolId}`);
getPoolStats$(slug: string): Observable<PoolStat> {
return this.httpClient.get<PoolStat>(this.apiBaseUrl + this.apiBasePath + `/api/v1/mining/pool/${slug}`);
}
getPoolHashrate$(poolId: number): Observable<any> {
return this.httpClient.get<any>(this.apiBaseUrl + this.apiBasePath + `/api/v1/mining/pool/${poolId}/hashrate`);
getPoolHashrate$(slug: string): Observable<any> {
return this.httpClient.get<any>(this.apiBaseUrl + this.apiBasePath + `/api/v1/mining/pool/${slug}/hashrate`);
}
getPoolBlocks$(poolId: number, fromHeight: number): Observable<BlockExtended[]> {
getPoolBlocks$(slug: string, fromHeight: number): Observable<BlockExtended[]> {
return this.httpClient.get<BlockExtended[]>(
this.apiBaseUrl + this.apiBasePath + `/api/v1/mining/pool/${poolId}/blocks` +
this.apiBaseUrl + this.apiBasePath + `/api/v1/mining/pool/${slug}/blocks` +
(fromHeight !== undefined ? `/${fromHeight}` : '')
);
}