diff --git a/src/app/api/types/account/account-won-block.ts b/src/app/api/types/account/account-won-block.ts
index 5fbbfb4..1fd4239 100644
--- a/src/app/api/types/account/account-won-block.ts
+++ b/src/app/api/types/account/account-won-block.ts
@@ -24,6 +24,7 @@ export interface AccountWonBlock {
createdAt: string
remarks: Remark[]
historicalRate?: HistoricalRate
+ farmTimeInSeconds?: number
}
diff --git a/src/app/farmer-won-blocks/farmer-won-blocks.component.html b/src/app/farmer-won-blocks/farmer-won-blocks.component.html
index 2bc3e76..cbcaa05 100644
--- a/src/app/farmer-won-blocks/farmer-won-blocks.component.html
+++ b/src/app/farmer-won-blocks/farmer-won-blocks.component.html
@@ -32,18 +32,19 @@
{{snippetService.getSnippet('blocks-won-component.header.height')}} |
{{snippetService.getSnippet('blocks-won-component.header.effort')}} |
- Farmer Reward |
+ Farmer Reward |
+ Farm Time |
Remarks |
-
+ |
|
-
+ |
|
@@ -57,6 +58,8 @@
{{getFarmerRewardFormatted(block)}}
+ N/A |
+ {{formatFarmTime(block.farmTimeInSeconds)}} sec |
|
diff --git a/src/app/farmer-won-blocks/farmer-won-blocks.component.ts b/src/app/farmer-won-blocks/farmer-won-blocks.component.ts
index 298ad00..a7136c3 100644
--- a/src/app/farmer-won-blocks/farmer-won-blocks.component.ts
+++ b/src/app/farmer-won-blocks/farmer-won-blocks.component.ts
@@ -285,6 +285,24 @@ export class FarmerWonBlocksComponent implements OnInit, OnDestroy {
}))
}
+ public getFarmTimeColor(farmTimeInSeconds: number): string {
+ if (farmTimeInSeconds < 9) {
+ return '#46cf76'
+ }
+ if (farmTimeInSeconds < 17) {
+ return '#b9a44c'
+ }
+ if (farmTimeInSeconds < 25) {
+ return '#ffaa00'
+ }
+
+ return '#ff4d4d'
+ }
+
+ public formatFarmTime(farmTimeInSeconds: number): number {
+ return (new BigNumber(farmTimeInSeconds)).decimalPlaces(3).toNumber()
+ }
+
private makeChartUpdateOptions(wonBlocks: AccountWonBlock[]): EChartsOption {
const wonBlocksWithEffort = wonBlocks.filter(wonBlock => wonBlock.effort !== null)