address best diff

This commit is contained in:
Ben Wilson
2023-07-24 22:23:29 -04:00
parent 8369e9eef2
commit a4b4e517cb
7 changed files with 48 additions and 16 deletions
+7 -3
View File
@@ -1,5 +1,6 @@
import { Controller, Get, NotFoundException, Param } from '@nestjs/common';
import { AddressSettingsService } from '../../ORM/address-settings/address-settings.service';
import { ClientStatisticsService } from '../../ORM/client-statistics/client-statistics.service';
import { ClientService } from '../../ORM/client/client.service';
@@ -9,7 +10,8 @@ export class ClientController {
constructor(
private readonly clientService: ClientService,
private readonly clientStatisticsService: ClientStatisticsService
private readonly clientStatisticsService: ClientStatisticsService,
private readonly addressSettingsService: AddressSettingsService
) { }
@@ -20,10 +22,12 @@ export class ClientController {
const chartData = await this.clientStatisticsService.getChartDataForAddress(address);
const bestDifficulty = await this.clientService.getBestDiff(address);
const addressSettings = await this.addressSettingsService.getSettings(address);
return {
bestDifficulty,
bestDifficulty: addressSettings?.bestDifficulty,
workersCount: workers.length,
workers: await Promise.all(
workers.map(async (worker) => {