VimUnDoхoз RЭSїЉѓГ3M>*Ghђпся-$; "coin_short_name": coin.short_name.upper(),#YYYY^rTJ$_аџџџџ^ORѕѕ5_аџџџџ^ORѕ5_а џџџџ^OUѕ Kclass SupportMinerReport:5_а џџџџ^OWѕ K class Report:5_аџџџџ^OrѕKѕK5_аџџџџ^OuѕP/ MineOSMiner.objects.select_related(5_аAџџџџ^OwѕPA .filter(config__wallet__coin__short_name__in=["btc"])5_а џџџџ^OzѕS "status", "config", "config__wallet", "owner", "owner__userprofile"5_а џџџџ^O{ѕ )5_а 3џџџџ^O|ѕN3 len(MineOSMiner.objects.select_related(5_а $џџџџ^OѕN$ len(MineOSMiner.objects.5_а џџџџ^OѕN# len(MineOSMiner.objects5_а џџџџ^OѕB return len(SupportMiner.objects.filter(wallet__coin=coin))5_а џџџџ^OѕM from django.db.models import Sumfrom decimal import Decimal0from coinmine.devices.models import SupportMiner<from coinmine.balance_adjustment.models.credit import Credit,from coinmine.user.models import UserProfile.from coinmine.worker.utils import ServiceUtilsclass BTCModeReport:3 def __init__(self, accumulated_period_seconds):# self.service = ServiceUtilsD self.accumulated_period_seconds = accumulated_period_seconds& def _get_miners_count(self, coin):& return len(MineOSMiner.objects .exclude(owner=None)B .filter(config__wallet__coin__short_name__in=["btc"]))' def _get_total_credits(self, coin): return (T Credit.objects.filter(coin=coin, support_miner__isnull=False).aggregate(/ Sum("amount_in_smallest_units"). )["amount_in_smallest_units__sum"] or Decimal(0) ) * coin.smallest_unit+ def _get_total_credits_usd(self, coin):= return self._get_total_credits(coin) * coin.usd_value& def _get_coin_per_day(self, coin): return coin.coin_per_day% def _get_usd_per_day(self, coin):1 return coin.coin_per_day * coin.usd_value@ def _get_tier_rates(self, coin, accumulated_period_seconds): rate = coin.coin_per_day result = {}0 for fee in UserProfile.USER_FEE_CHOICES: fee_id = fee[0] fee_rate = fee[1]3 fee_name = UserProfile.fee_name(fee_id)T units_earned_per_second = self.service.adjusted_units_earned_per_second(2 rate, coin.smallest_unit, fee_rate )O units_earned = units_earned_per_second * accumulated_period_seconds@ coin_earned = self.service.smallest_unit_to_decimal(0 units_earned, coin.smallest_unit )5 usd_earned = coin_earned * coin.usd_value result[fee_name] = {% "fee_rate": fee_rate,+ "coin_earned": coin_earned,) "usd_earned": usd_earned, } return result def generate(self, coins):G report = {"accounting_period": self.accumulated_period_seconds} for coin in coins:! report[coin.name] = {< "miner_count": self._get_miners_count(coin),, "usd_value": coin.usd_value,3 "coin_short_name": coin.short_name,? "total_credits": self._get_total_credits(coin),G "total_credits_usd": self._get_total_credits_usd(coin),= "coin_per_day": self._get_coin_per_day(coin),; "usd_per_day": self._get_usd_per_day(coin),3 "tier_rates": self._get_tier_rates(9 coin, self.accumulated_period_seconds ), } return report5_а0џџџџ^OѕO0from coinmine.devices.models import SupportMiner5_аџџџџ^OЄѕOfrom coinmine.5_а%џџџџ^OГѕO3from coinmine.mineosminer.models imoprt MineOSMiner5_а$џџџџ^OЗѕO4from coinmine.mineosminer.models imoport MineOSMiner5_а<џџџџ^OМѕO< config__wallet__coin__short_name__in=["btc"]5_аџџџџ V ^O< ѕ+ def _get_total_credits_usd(self, coin):= return self._get_total_credits(coin) * coin.usd_value5_аDџџџџDEV^OL ѕCD? "total_credits": self._get_total_credits(coin),G "total_credits_usd": self._get_total_credits_usd(coin),5_а%џџџџDDV^OЌѕ$&J rate = coin.coin_per_day5_а%џџџџDDV^Oѕ%'K ѕ%'J5_а&џџџџEEV^O;ѕ%& smallest_units = 5_а1џџџџDDV^Oѕ J3 def __init__(self, accumulated_period_seconds):5_а CџџџџDDV^Oѕ K ѕ J5_а)џџџџEEV^O$ѕKѕK5_аџџџџFFV^O'ѕL* self.btc_usd_value = btc_usd_value5_аџџџџFFV^O'ѕL! self.btc_ = btc_usd_value5_а %џџџџFFV^O,ѕL. self.btc_smallest_unit = btc_usd_value5_а! 2џџџџFFV^O-ѕL; self.btc_smallest_unit = btc_smallest_unitusd_value5_а "!0џџџџFFV^Owѕ/1L2 rate, coin.smallest_unit, fee_rate5_а!#"0џџџџFFV^Oxѕ/1L rate, , fee_rate5_а"$#4џџџџFFV^Oѕ35L0 units_earned, coin.smallest_unit5_а#%$4џџџџFFV^Oѕ35L units_earned, 5_а$&%6'џџџџFFV^Oѕ57L5 usd_earned = coin_earned * coin.usd_value5_а%'&6&џџџџFFV^O ѕ57L' usd_earned = coin_earned * 5_а&('!џџџџFFV^O ѕ "L return coin.coin_per_day5_а')(џџџџV^O %ѕ' def _get_total_credits(self, coin): return (T Credit.objects.filter(coin=coin, support_miner__isnull=False).aggregate(/ Sum("amount_in_smallest_units"). )["amount_in_smallest_units__sum"] or Decimal(0) ) * coin.smallest_unit5_а(*)џџџџV^O &ѕ5_а)+*џџџџV^O -ѕ from django.db.models import Sumfrom decimal import Decimal5_а*,+џџџџV^O /ѕ<from coinmine.balance_adjustment.models.credit import Credit5_а+-,: џџџџV^PUѕ9;@= "coin_per_day": self._get_coin_per_day(coin),5_а,.-:!џџџџV^PVѕ9;@' "coin_per_day": (coin),5_а-0.:%џџџџV^PXѕ9;@& "coin_per_day": coin),5_а.1/0;џџџџV^Peѕ:<@; "usd_per_day": self._get_usd_per_day(coin),ѕ;<@5_а021;AџџџџV^Pfѕ:<@] "usd_per_day": coin.coin_per_day * coin.usd_valueself._get_usd_per_day(coin),5_а132џџџџV^Pjѕ& def _get_coin_per_day(self, coin): return coin.btc_per_day% def _get_usd_per_day(self, coin):1 return coin.coin_per_day * coin.usd_value5_а243џџџџV^Plѕ5_а354,џџџџ,:V^P lѕ+, def generate(self, coins):G report = {"accounting_period": self.accumulated_period_seconds} for coin in coins:! report[coin.name] = {< "miner_count": self._get_miners_count(coin),, "usd_value": coin.usd_value,3 "coin_short_name": coin.short_name,2 "coin_per_day": coin.coin_per_day,B "usd_per_day": coin.coin_per_day * coin.usd_value,3 "tier_rates": self._get_tier_rates(9 coin, self.accumulated_period_seconds ), } return report5_а465џџџџ,,V^P oѕ+ѕ+5_а576)џџџџ*)v)^P"(ѕ:2 "coin_per_day": coin.coin_per_day,5_а687(џџџџ*)v)^P";ѕ:B "usd_per_day": coin.coin_per_day * coin.usd_value,5_а7982џџџџ*)v)^P"Eѕ:A "usd_per_day": coin.btc_per_day * coin.usd_value,5_а8:92џџџџ*)v)^P"Eѕ:2 "usd_per_day": coin.btc_per_day * 5_а9<:Dџџџџ*)v)^P"Lѕ:D "usd_per_day": coin.btc_per_day * self.btc_usd_value5_а:=;<#"џџџџ3&39v9^P& ѕ"$:@ def _get_tier_rates(self, coin, accumulated_period_seconds):5_а<>=#+џџџџ3&39v9^P&"ѕ"$:H def _get_tier_rates(self, coin_per_day, accumulated_period_seconds):5_а=?>#Nџџџџ3&39v9^P&/ѕ:3from coinmine.mineosminer.models import MineOSMiner,from coinmine.user.models import UserProfile.from coinmine.worker.utils import ServiceUtilsclass BTCModeReport:U def __init__(self, accumulated_period_seconds, btc_usd_value, btc_smallest_unit):# self.service = ServiceUtilsD self.accumulated_period_seconds = accumulated_period_seconds* self.btc_usd_value = btc_usd_value2 self.btc_smallest_unit = btc_smallest_unit def generate(self, coins):G report = {"accounting_period": self.accumulated_period_seconds} for coin in coins:! report[coin.name] = {< "miner_count": self._get_miners_count(coin),, "usd_value": coin.usd_value,3 "coin_short_name": coin.short_name,1 "coin_per_day": coin.btc_per_day,E "usd_per_day": coin.btc_per_day * self.btc_usd_value,3 "tier_rates": self._get_tier_rates(9 coin, self.accumulated_period_seconds ), } return report& def _get_miners_count(self, coin): return len(; MineOSMiner.objects.exclude(owner=None).filter(X config__wallet__coin__short_name__in=["btc"], config__btc_mode_coin=coin ) )l def _get_tier_rates(self, coin_per_day, coin_smallest_unit, coin_usd_value, accumulated_period_seconds): rate = coin.btc_per_day result = {}0 for fee in UserProfile.USER_FEE_CHOICES: fee_id = fee[0] fee_rate = fee[1]3 fee_name = UserProfile.fee_name(fee_id)T units_earned_per_second = self.service.adjusted_units_earned_per_second(6 rate, self.btc_smallest_unit, fee_rate )O units_earned = units_earned_per_second * accumulated_period_seconds@ coin_earned = self.service.smallest_unit_to_decimal(4 units_earned, self.btc_smallest_unit )9 usd_earned = coin_earned * self.btc_usd_value result[fee_name] = {% "fee_rate": fee_rate,+ "coin_earned": coin_earned,) "usd_earned": usd_earned, } return result5_а>@?*џџџџ&9v9^P&:ѕ)* rate = coin.btc_per_day5_а?A@2џџџџ&9v9^P&<ѕ13?6 rate, self.btc_smallest_unit, fee_rate5_а@BA2џџџџ&9v9^P&Aѕ13?> coin_per_day, self.btc_smallest_unit, fee_rate5_аACB2џџџџ&9v9^P&Bѕ13?( coin_per_day, , fee_rate5_аBDC6џџџџ&9v9^P&Kѕ57?4 units_earned, self.btc_smallest_unit5_аCGD6џџџџ&9v9^P&Lѕ57? units_earned, 5_аDHEG8'џџџџ&9v9^P&Zѕ79?9 usd_earned = coin_earned * self.btc_usd_value5_аGIH8'џџџџ&9v9^P&Zѕ79?' usd_earned = coin_earned * 5_аHJI"џџџџ"?V^P&kѕ!" def _get_tier_rates( self, coin_per_day, coin_smallest_unit, coin_usd_value,# accumulated_period_seconds, ): result = {}0 for fee in UserProfile.USER_FEE_CHOICES: fee_id = fee[0] fee_rate = fee[1]3 fee_name = UserProfile.fee_name(fee_id)T units_earned_per_second = self.service.adjusted_units_earned_per_second(: coin_per_day, coin_smallest_unit, fee_rate )O units_earned = units_earned_per_second * accumulated_period_seconds@ coin_earned = self.service.smallest_unit_to_decimal(0 units_earned, coin_smallest_unit
Vim�UnDo�]�Vԉ����ɬ ��t��(X����^j�\�!^P&g_�����^P��5�_�����^P�� �5�_�����^P��9 def _get_tier_rates(self, accumulated_period_seconds)5�_�G����^P��G def _get_tier_rates(self, coin_per_day, accumulated_period_seconds)5�_�*����^P��H def _get_tier_rates(self, coin_per_day, accumulated_period_seconds):5�_�!����^P���5�_�����^P��class BaseReport:@ def _get_tier_rates(self, coin, accumulated_period_seconds):% rate = self.coin.coin_per_day result = {}0 for fee in UserProfile.USER_FEE_CHOICES: fee_id = fee[0] fee_rate = fee[1]3 fee_name = UserProfile.fee_name(fee_id)T units_earned_per_second = self.service.adjusted_units_earned_per_second(7 rate, self.coin.smallest_unit, fee_rate )O units_earned = units_earned_per_second * accumulated_period_seconds@ coin_earned = self.service.smallest_unit_to_decimal(5 units_earned, self.coin.smallest_unit ): usd_earned = coin_earned * self.coin.usd_value result[fee_name] = {% "fee_rate": fee_rate,+ "coin_earned": coin_earned,) "usd_earned": usd_earned, } return result5�_� ����^P��% rate = self.coin.coin_per_day5�_� ����^P�� 7 rate, self.coin.smallest_unit, fee_rate5�_� '����^P��: usd_earned = coin_earned * self.coin.usd_value5�_� ����^P��5 units_earned, self.coin.smallest_unit5�_� ����^P���5�_� ����^P��5�_� ����^P��,from coinmine.user.models import UserProfileclass BaseReport:@ def _get_tier_rates(self, coin, accumulated_period_seconds): rate = coin.coin_per_day result = {}0 for fee in UserProfile.USER_FEE_CHOICES: fee_id = fee[0] fee_rate = fee[1]3 fee_name = UserProfile.fee_name(fee_id)T units_earned_per_second = self.service.adjusted_units_earned_per_second(2 rate, coin.smallest_unit, fee_rate )O units_earned = units_earned_per_second * accumulated_period_seconds@ coin_earned = self.service.smallest_unit_to_decimal(0 units_earned, coin.smallest_unit )5 usd_earned = coin_earned * coin.usd_value result[fee_name] = {% "fee_rate": fee_rate,+ "coin_earned": coin_earned,) "usd_earned": usd_earned, } return result5�_�����'5v<^P&b�"�5�_�"����"9V^P&f�!"@ def _get_tier_rates(self, coin, accumulated_period_seconds): rate = coin.coin_per_day result = {}0 for fee in UserProfile.USER_FEE_CHOICES: fee_id = fee[0] fee_rate = fee[1]3 fee_name = UserProfile.fee_name(fee_id)T units_earned_per_second = self.service.adjusted_units_earned_per_second(2 rate, coin.smallest_unit, fee_rate )O units_earned = units_earned_per_second * accumulated_period_seconds@ coin_earned = self.service.smallest_unit_to_decimal(0 units_earned, coin.smallest_unit )5 usd_earned = coin_earned * coin.usd_value result[fee_name] = {% "fee_rate": fee_rate,+ "coin_earned": coin_earned,) "usd_earned": usd_earned, } return result5��