Permalink
Browse files

Add support for WePayBTC.

  • Loading branch information...
1 parent ffd1dcb commit 03d7e3ea3de61255a8bccaf8db29c74954124bd6 @StuffOfInterest StuffOfInterest committed Nov 21, 2014
@@ -177,7 +177,7 @@ private void InitializeComponent()
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(102, 13);
this.label13.TabIndex = 10;
- this.label13.Text = "Miner Control v1.5.4";
+ this.label13.Text = "Miner Control v1.5.5";
//
// notifyIcon
//
@@ -116,6 +116,18 @@
{ "algo": "scrypt", "folder": "_APARAM1_", "command": "_APARAM2_", "arguments": "_APARAM3_ -o stratum+tcp://scrypt.ltcrabbit.com:3333 _ACCOUNT_._WORKER_ _SPARAM2_" }
]
},
+ "wepaybtc": {
+ "account": "MinerControl",
+ "worker": "1",
+ "sparam1": "-o ny",
+ "sparam2": "-p x",
+ "algos": [
+ { "algo": "x11", "folder": "_APARAM1_", "command": "_APARAM2_", "arguments": "_APARAM3_ _SPARAM1_ -u _ACCOUNT_._WORKER_ _SPARAM2_" },
+ { "algo": "x13", "folder": "_APARAM1_", "command": "_APARAM2_", "arguments": "_APARAM3_ _SPARAM1_ -u _ACCOUNT_._WORKER_ _SPARAM2_" },
+ { "algo": "x15", "folder": "_APARAM1_", "command": "_APARAM2_", "arguments": "_APARAM3_ _SPARAM1_ -u _ACCOUNT_._WORKER_ _SPARAM2_" },
+ { "algo": "nist5", "folder": "_APARAM1_", "command": "_APARAM2_", "arguments": "_APARAM3_ _SPARAM1_ -u _ACCOUNT_._WORKER_ _SPARAM2_" }
+ ]
+ },
"manual": {
"account": "myaccount",
"algos": [
@@ -52,7 +52,9 @@
<ItemGroup>
<Compile Include="AlgorithmEntry.cs" />
<Compile Include="PriceEntries\LtcRabbitPriceEntry.cs" />
+ <Compile Include="PriceEntries\WePayBtcPriceEntry.cs" />
<Compile Include="Services\LtcRabbitService.cs" />
+ <Compile Include="Services\WePayBtcService.cs" />
<Compile Include="Utility\ErrorLogger.cs" />
<Compile Include="Extensions.cs" />
<Compile Include="Hardware\PInvokeDelegateFactory.cs" />
@@ -238,6 +238,7 @@ public bool LoadConfig()
LoadService(new YaampService(), data, "yaamp");
LoadService(new WafflePoolService(), data, "wafflepool");
LoadService(new LtcRabbitService(), data, "ltcrabbit");
+ LoadService(new WePayBtcService(), data, "wepaybtc");
LoadService(new ManualService(), data, "manual");
// Set Id for each entry
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace MinerControl.PriceEntries
+{
+ public class WePayBtcPriceEntry : PriceEntryBase
+ {
+ public override decimal Fees
+ {
+ //get { return Earn * 0.02m; }
+ get { return 0m; }
+ set { base.Fees = value; }
+ }
+ }
+}
@@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.5.4.0")]
-[assembly: AssemblyFileVersion("1.5.4.0")]
+[assembly: AssemblyVersion("1.5.5.0")]
+[assembly: AssemblyFileVersion("1.5.5.0")]
@@ -13,6 +13,7 @@ public enum ServiceEnum
YAAMP,
WafflePool,
LTCRabbit,
+ WePayBTC,
Manual
}
}
@@ -0,0 +1,73 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using MinerControl.PriceEntries;
+using MinerControl.Utility;
+
+namespace MinerControl.Services
+{
+ public class WePayBtcService : ServiceBase<WePayBtcPriceEntry>
+ {
+ // http://wepaybtc.com/payouts.json
+
+ //{
+ // "reference": 0.001,
+ // "x11": 0.0002066,
+ // "x13": 0.0002985,
+ // "x15": 0.0003717,
+ // "nist5": 0.00006863
+ //}
+
+ public WePayBtcService()
+ {
+ ServiceEnum = ServiceEnum.WePayBTC;
+ DonationAccount = "1PMj3nrVq5CH4TXdJSnHHLPdvcXinjG72y";
+ }
+
+ public override void Initialize(IDictionary<string, object> data)
+ {
+ ExtractCommon(data);
+
+ var items = data["algos"] as object[];
+ foreach (var rawitem in items)
+ {
+ var item = rawitem as Dictionary<string, object>;
+ var entry = GetEntry(item);
+
+ Add(entry);
+ }
+ }
+
+ public override void CheckPrices()
+ {
+ ClearStalePrices();
+ WebUtil.DownloadJson("http://wepaybtc.com/payouts.json", ProcessPrices);
+ }
+
+ private void ProcessPrices(object jsonData)
+ {
+ var data = jsonData as Dictionary<string, object>;
+
+ lock (MiningEngine)
+ {
+ foreach (var key in data.Keys)
+ {
+ var rawitem = data[key];
+ var item = rawitem as Dictionary<string, object>;
+ var algo = key.ToLower();
+
+ var entry = PriceEntries.FirstOrDefault(o => o.AlgoName == algo);
+ if (entry == null) continue;
+
+ entry.Price = data[key].ExtractDecimal() * 1000;
+ }
+
+ MiningEngine.PricesUpdated = true;
+ MiningEngine.HasPrices = true;
+
+ LastUpdated = DateTime.Now;
+ }
+ }
+ }
+}

0 comments on commit 03d7e3e

Please sign in to comment.