示例#1
0
 public override bool InternalSendTip(string User, decimal amount)
 {
     try
     {
         string        cont          = string.Format(System.Globalization.NumberFormatInfo.InvariantInfo, "{{\"text\":\"/tip {1} {2:0.00000000} {0}\",\"room\":\"en\"}}", Currency, User, amount);
         StringContent Content       = new StringContent(cont, Encoding.UTF8, "application/json");
         string        sEmitResponse = Client.PostAsync("chat/send", Content).Result.Content.ReadAsStringAsync().Result;
         //Parent.DumpLog(sEmitResponse, -1);
         QuackWithdraw tmp = json.JsonDeserialize <QuackWithdraw>(sEmitResponse);
         if (tmp.error == null)
         {
             return(true);
         }
     }
     catch (Exception e)
     {
         Parent.DumpLog(e.ToString(), 0);
     }
     return(false);
 }
示例#2
0
 public override bool InternalSendTip(string User, decimal amount)
 {
     try
     {
         string        cont          = string.Format(System.Globalization.NumberFormatInfo.InvariantInfo, "{{\"username\":\"{1}\",\"symbol\":\"{0}\",\"amount\":{2:0.00000000}}}", Currency, User, amount);
         StringContent Content       = new StringContent(cont, Encoding.UTF8, "application/json");
         string        sEmitResponse = Client.PostAsync("tip-username" + "?api_key=" + accesstoken + "&api_version=" + apiversion, Content).Result.Content.ReadAsStringAsync().Result;
         //Parent.DumpLog(sEmitResponse, -1);
         QuackWithdraw tmp = json.JsonDeserialize <QuackWithdraw>(sEmitResponse);
         if (tmp.error == null)
         {
             return(true);
         }
     }
     catch (Exception e)
     {
         Parent.DumpLog(e.ToString(), 0);
     }
     return(false);
 }
示例#3
0
 protected override bool internalWithdraw(decimal Amount, string Address)
 {
     try
     {
         string        cont          = string.Format(System.Globalization.NumberFormatInfo.InvariantInfo, "{{\"symbol\":\"{0}\",\"address\":\"{1}\",\"amount\":\"{2}\", \"otpCode\":\"\"}}", Currency, Address, Amount);
         StringContent Content       = new StringContent(cont, Encoding.UTF8, "application/json");
         string        sEmitResponse = Client.PostAsync("withdraw", Content).Result.Content.ReadAsStringAsync().Result;
         //{"transaction":{"hash":"7a387e334a","symbol":"BTC","type":"withdrawal","status":"pending_payout","amount":"-0.001","address":"1M1zUqZUZg6AH4KQdq9AUoouQgWHdQzySd","txid":null,"created":1489680398},"user":{"balance":"0.00760117","affBalance":"0","affWithdrawals":"0"},"foreign":null}
         //Parent.DumpLog(sEmitResponse, -1);
         QuackWithdraw tmp = json.JsonDeserialize <QuackWithdraw>(sEmitResponse);
         if (tmp.error == null)
         {
             return(true);
         }
     }
     catch (Exception e)
     {
         Parent.DumpLog(e.ToString(), 0);
     }
     return(false);
 }