buzzkillb

pos.watch script.js

Jan 2nd, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.08 KB | None | 0 0
  1. $('#denarius').keyup(function(ev){
  2. var total = $('#denarius').val() * 1;
  3. $('#total').html((total).toFixed(8));
  4. var denariusapr = 0.06;
  5. $('#denariusAPR').html((denariusapr).toFixed(2));
  6. var fortunastakepay = total * denariusapr * 0.33;
  7. $('#fortunastakePay').html((fortunastakepay).toFixed(8));
  8. var fortunastakepaydaily = (total * denariusapr * 0.33) / 365;
  9. $('#fortunastakePayDaily').html((fortunastakepaydaily).toFixed(8));
  10. var fortunastakepaymonthly = (total * denariusapr * 0.33) / 12;
  11. $('#fortunastakePayMonthly').html((fortunastakepaymonthly).toFixed(8));
  12. var stakingpay = total * denariusapr * 0.67;
  13. $('#stakingPay').html((stakingpay).toFixed(8));
  14. var stakingpaydaily = (total * denariusapr * 0.67) / 365;
  15. $('#stakingPayDaily').html((stakingpaydaily).toFixed(8));
  16. var stakingpaymonthly = (total * denariusapr * 0.67) / 12;
  17. $('#stakingPayMonthly').html((stakingpaymonthly).toFixed(8));
  18. var totalpaydaily = (total * denariusapr * 1) / 365;
  19. $('#totalPayDaily').html((totalpaydaily).toFixed(8));
  20. var totalpaymonthly = (total * denariusapr * 1) / 12;
  21. $('#totalPayMonthly').html((totalpaymonthly).toFixed(8));
  22. var totalpayyearly = (total * denariusapr * 1);
  23. $('#totalPayYearly').html((totalpayyearly).toFixed(8));
  24. });
  25.  
  26. $('#fortunastake').keyup(function(ev){
  27. var totalfs = $('#fortunastake').val() * 1;
  28. $('#totalfs').html((totalfs).toFixed(0));
  29. var totalfsd = $('#fortunastake').val() * 5000;
  30. $('#totalfsd').html((totalfsd).toFixed(0));
  31. var dailyrewards = window.DAILYREWARD;
  32. $('#dailyrewards').html((dailyrewards).toFixed(8));
  33. var fortunastakedailypayout = totalfs * dailyrewards;
  34. $('#fortunastakeDailyPayout').html((fortunastakedailypayout).toFixed(8));
  35. var fortunastakemonthlypayout = fortunastakedailypayout * 30;
  36. $('#fortunastakeMonthlyPayout').html((fortunastakemonthlypayout).toFixed(8));
  37. var fortunastakeyearlypayout = fortunastakedailypayout * 365;
  38. $('#fortunastakeYearlyPayout').html((fortunastakeyearlypayout).toFixed(8));
  39. var denariusapr = 0.06;
  40. var fortunastake30days = ((totalfs * 5000 * denariusapr * 0.67) / 365) * 30;
  41. $('#fortunastake30days').html((fortunastake30days).toFixed(8));
  42. var fortunastake90days = ((totalfs * 5000 * denariusapr * 0.67) / 365) * 90;
  43. $('#fortunastake90days').html((fortunastake90days).toFixed(8));
  44. var fortunastake180days = ((totalfs * 5000 * denariusapr * 0.67) / 365) * 180;
  45. $('#fortunastake180days').html((fortunastake180days).toFixed(8));
  46. });
  47.  
  48.  
  49. fetch('height.txt')
  50. .then(function(response) {
  51. return response.json();
  52. })
  53. .then(function(data) {
  54. if (data)
  55. $('#height').html("");
  56. $("#height").append(data);
  57. window.blockheight = (data);
  58. })
  59. .catch(function(err) {
  60. console.log(err);
  61. });
  62.  
  63. fetch('chaindataheight.txt')
  64. .then(function(response) {
  65. return response.json();
  66. })
  67. .then(function(data) {
  68. if (data)
  69. $('#chaindataheight').html("");
  70. $("#chaindataheight").append(data);
  71. window.haindataheight = (data);
  72. })
  73. .catch(function(err) {
  74. console.log(err);
  75. });
  76.  
  77. fetch('md5.txt')
  78. .then(response => response.text())
  79. .then((data) => {
  80. $('#md5').html("");
  81. $("#md5").append(data);
  82. })
  83.  
  84. fetch('fscount.txt', {mode: 'no-cors'})
  85. .then(function(response) {
  86. return response.json();
  87. })
  88. .then(function(data) {
  89. if (data)
  90. $('#fscount').html("");
  91. $("#fscount").append(data);
  92. window.fscounttotal = (data);
  93. })
  94. .catch(function(err) {
  95. console.log(err);
  96. });
  97.  
  98. fetch('getinfo.json')
  99. .then(function(response) {
  100. return response.json();
  101. })
  102. .then(function(data) {
  103. if (data.version)
  104. window.VERSION = (data.version);
  105. $('#version').html("");
  106. $("#version").append(window.VERSION);
  107. if (data.protocolversion)
  108. window.PROTOCOLVERSION = (data.protocolversion);
  109. $('#protocolversion').html("");
  110. $("#protocolversion").append(window.PROTOCOLVERSION);
  111. if (data.blocks)
  112. window.DAEMONBLOCKS = (data.blocks);
  113. $('#daemonblocks').html("");
  114. $("#daemonblocks").append(window.DAEMONBLOCKS);
  115. if (data.connections)
  116. window.CONNECTIONS = (data.connections);
  117. $('#connections').html("");
  118. $("#connections").append(window.CONNECTIONS);
  119. if (data.moneysupply)
  120. window.MONEYSUPPLY = (data.moneysupply);
  121. var moneysupply = (window.MONEYSUPPLY);
  122. var locked = ((window.fscounttotal * 5000) / moneysupply) * 100;
  123. $('#lockeddenarius').html("");
  124. $('#lockeddenarius').html((locked).toFixed(2));
  125. $('#moneysupply').html("");
  126. $("#moneysupply").append(window.MONEYSUPPLY);
  127. if (data.difficulty['proof-of-work'])
  128. window.PROOFOFWORK = (data.difficulty['proof-of-work']);
  129. $('#daemonproofofwork').html("");
  130. $("#daemonproofofwork").append(window.PROOFOFWORK);
  131. if (data.difficulty['proof-of-stake'])
  132. window.PROOFOFSTAKE = (data.difficulty['proof-of-stake']);
  133. $('#daemonproofofstake').html("");
  134. $("#daemonproofofstake").append(window.PROOFOFSTAKE);
  135. })
  136. .catch(function(err) {
  137. console.log(err);
  138. });
  139.  
  140. fetch('getmininginfo.json')
  141. .then(function(response) {
  142. return response.json();
  143. })
  144. .then(function(data) {
  145. if (data.netmhashps)
  146. window.DAEMONHASHRATE = parseFloat((data.netmhashps) / 1000).toFixed(2) + " Gh/s";
  147. $('#daemonhashrate').html("");
  148. $("#daemonhashrate").append(window.DAEMONHASHRATE).hide().fadeIn('slow');
  149. if (data.netstakeweight)
  150. window.DAEMONSTAKEWEIGHT = parseFloat((data.netstakeweight)).toFixed(2);
  151. $('#daemonstakeweight').html("");
  152. $("#daemonstakeweight").append(window.DAEMONSTAKEWEIGHT).hide().fadeIn('slow');
  153.  
  154. })
  155. .catch(function(err) {
  156. console.log(err);
  157. });
  158.  
  159. fetch('win.json')
  160. .then(function(response) {
  161. return response.json();
  162. })
  163. .then(function(data) {
  164. if (data.dailyreward)
  165. window.DAILYREWARD = parseFloat((data.dailyreward).toFixed(8));
  166. $('#windailyreward').html("");
  167. $("#windailyreward").append(window.DAILYREWARD);
  168. if (data.blocktime)
  169. window.WINBLOCKTIME = parseFloat((data.blocktime).toFixed(2));
  170. $('#winblocktime').html("");
  171. $("#winblocktime").append(window.WINBLOCKTIME).hide().fadeIn('slow');
  172. if (data.pos)
  173. window.WINPOS = parseFloat((data.pos) * 100).toFixed(2) + " %";
  174. $('#winpOs').html("");
  175. $("#winpOs").append(window.WINPOS);
  176. if (data.pow)
  177. window.WINPOW = parseFloat((data.pow) * 100).toFixed(2) + " %";
  178. $('#winpOw').html("");
  179. $("#winpOw").append(window.WINPOW);
  180. var emission = parseFloat((data.pow)).toFixed(2);
  181. var emissions = (2880 * 3 * emission);
  182. $('#emissions').html((emissions).toFixed(8));
  183. var hemission = window.WINBLOCKTIME;
  184. var houremissions = (2880 * (hemission / 60)) / 60;
  185. $('#houremissions').html((houremissions).toFixed(8));
  186. var hourlyemissions = (emissions / houremissions);
  187. $('#hourlyemissions').html((hourlyemissions).toFixed(8));
  188. var dailyemissions = (hourlyemissions * 24);
  189. $('#dailyemissions').html((dailyemissions).toFixed(8));
  190. var hourlyblocks = (60 * 60) / hemission;
  191. $('#hourlyblocks').html((hourlyblocks).toFixed(0));
  192. var dailyblocks = (hourlyblocks * 24);
  193. $('#dailyblocks').html((dailyblocks).toFixed(0));
  194. var bossratio = (dailyemissions / dailyblocks);
  195. $('#bossratio').html((bossratio).toFixed(2));
  196. var powrewardend = 3000000;
  197. var powblockrewardend = (powrewardend - window.blockheight);
  198. $('#powblockrewardend').html((powblockrewardend).toFixed(0));
  199. var totalpowleft = (powblockrewardend * bossratio);
  200. $('#totaldleft').html((totalpowleft).toFixed(2));
  201. var estimatedsupply = window.MONEYSUPPLY + totalpowleft;
  202. $('#totalsupplypowend').html((estimatedsupply).toFixed(2));
  203. var tenstakingestimate = (0.10 * estimatedsupply * 0.06) / 365;
  204. $('#tenstakingestimate').html((tenstakingestimate).toFixed(2));
  205. var quarterstakingestimate = (0.25 * estimatedsupply * 0.06) / 365;
  206. $('#quarterstakingestimate').html((quarterstakingestimate).toFixed(2));
  207. var fiftystakingestimate = (0.50 * estimatedsupply * 0.06) / 365;
  208. console.log("Denarius - Better than Bitcoin");
  209. console.log("Block 3mil Daily Emissions Estimates");
  210. console.log("50% Staking Estimate - " + fiftystakingestimate);
  211. $('#fiftystakingestimate').html((fiftystakingestimate).toFixed(2));
  212. var hundredstakingestimate = (1 * estimatedsupply * 0.06) / 365;
  213. console.log("100% Staking Estimate - " + hundredstakingestimate);
  214. $('#hundredstakingestimate').html((hundredstakingestimate).toFixed(2));
  215. })
  216. .catch(function(err) {
  217. console.log(err);
  218. });
Add Comment
Please, Sign In to add comment