Renamed /mining/pool-blocks/xxx -> /mining/pool/:poolId/blocks

This commit is contained in:
nymkappa 2022-02-14 13:58:40 +09:00
parent 4f02efd7fe
commit 09180c4f91
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04
2 changed files with 7 additions and 5 deletions

View File

@ -274,10 +274,10 @@ class Server {
.get(config.MEMPOOL.API_URL_PREFIX + 'mining/pools/2y', routes.$getPools.bind(routes, '2y')) .get(config.MEMPOOL.API_URL_PREFIX + 'mining/pools/2y', routes.$getPools.bind(routes, '2y'))
.get(config.MEMPOOL.API_URL_PREFIX + 'mining/pools/3y', routes.$getPools.bind(routes, '3y')) .get(config.MEMPOOL.API_URL_PREFIX + 'mining/pools/3y', routes.$getPools.bind(routes, '3y'))
.get(config.MEMPOOL.API_URL_PREFIX + 'mining/pools/all', routes.$getPools.bind(routes, 'all')) .get(config.MEMPOOL.API_URL_PREFIX + 'mining/pools/all', routes.$getPools.bind(routes, 'all'))
.get(config.MEMPOOL.API_URL_PREFIX + 'mining/pool/:poolId/blocks', routes.$getPoolBlocks)
.get(config.MEMPOOL.API_URL_PREFIX + 'mining/pool/:poolId/blocks/:height', routes.$getPoolBlocks)
.get(config.MEMPOOL.API_URL_PREFIX + 'mining/pool/:poolId', routes.$getPool) .get(config.MEMPOOL.API_URL_PREFIX + 'mining/pool/:poolId', routes.$getPool)
.get(config.MEMPOOL.API_URL_PREFIX + 'mining/pool/:poolId/:interval', routes.$getPool) .get(config.MEMPOOL.API_URL_PREFIX + 'mining/pool/:poolId/:interval', routes.$getPool);
.get(config.MEMPOOL.API_URL_PREFIX + 'mining/pool-blocks/:poolId', routes.$getPoolBlocks)
.get(config.MEMPOOL.API_URL_PREFIX + 'mining/pool-blocks/:poolId/:height', routes.$getPoolBlocks);
} }
if (config.BISQ.ENABLED) { if (config.BISQ.ENABLED) {

View File

@ -139,9 +139,11 @@ export class ApiService {
getPoolBlocks$(poolId: number, fromHeight: number): Observable<BlockExtended[]> { getPoolBlocks$(poolId: number, fromHeight: number): Observable<BlockExtended[]> {
if (fromHeight !== undefined) { if (fromHeight !== undefined) {
return this.httpClient.get<BlockExtended[]>(this.apiBaseUrl + this.apiBasePath +`/api/v1/mining/pool-blocks/${poolId}/${fromHeight}`); return this.httpClient.get<BlockExtended[]>(this.apiBaseUrl + this.apiBasePath +
`/api/v1/mining/pool/${poolId}/blocks/${fromHeight}`);
} else { } else {
return this.httpClient.get<BlockExtended[]>(this.apiBaseUrl + this.apiBasePath +`/api/v1/mining/pool-blocks/${poolId}`); return this.httpClient.get<BlockExtended[]>(this.apiBaseUrl + this.apiBasePath +
`/api/v1/mining/pool/${poolId}/blocks`);
} }
} }
} }