From 81d9397d07922f984ce04c90e135659a7aec9a30 Mon Sep 17 00:00:00 2001 From: yuriy0803 Date: Mon, 5 Sep 2022 23:03:54 +0200 Subject: [PATCH] Earnings per day (3h avg) --- www/app/controllers/account.js | 16 +++++++++++++--- www/app/templates/account.hbs | 1 + www/config/environment.js | 1 + 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/www/app/controllers/account.js b/www/app/controllers/account.js index e8f7200..e40e564 100644 --- a/www/app/controllers/account.js +++ b/www/app/controllers/account.js @@ -1,8 +1,10 @@ import Ember from 'ember'; export default Ember.Controller.extend({ - applicationController: Ember.inject.controller('application'), - stats: Ember.computed.reads('applicationController.model.stats'), + applicationController: Ember.inject.controller('application'), + config: Ember.computed.reads('applicationController.config'), + stats: Ember.computed.reads('applicationController.model.stats'), + hashrate: Ember.computed.reads('applicationController.hashrate'), PersonalLuck: Ember.computed("stats", "model", { get() { @@ -26,5 +28,13 @@ export default Ember.Controller.extend({ } return percent; } - }) + }), + + earnPerDay: Ember.computed('model', { + get() { + return 24 * 60 * 60 / this.get('applicationController.blockTime') * this.get('config').BlockReward * + this.getWithDefault('model.hashrate') / this.get('hashrate'); + } + }) + }); \ No newline at end of file diff --git a/www/app/templates/account.hbs b/www/app/templates/account.hbs index 9bca454..cfda837 100644 --- a/www/app/templates/account.hbs +++ b/www/app/templates/account.hbs @@ -23,6 +23,7 @@ {{/if}}
Total Paid: {{format-balance model.stats.paid}}
Last 24h Reward: {{format-balance model.24hreward}}
+
Earnings per day (3h avg):{{format-number earnPerDay}}
{{#if model.stats.lastShare}} diff --git a/www/config/environment.js b/www/config/environment.js index 01cfa40..bf9d249 100644 --- a/www/config/environment.js +++ b/www/config/environment.js @@ -31,6 +31,7 @@ module.exports = function(environment) { // Fee and payout details PoolFee: '1%', PayoutThreshold: '0.5 ETC', + BlockReward: 2.56, // For network hashrate (change for your favourite fork) BlockTime: 13.2