Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
Remove unnecessary references, fix typos.
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Gamble committed Mar 4, 2018
1 parent 4c6b4b4 commit 53db6d2
Show file tree
Hide file tree
Showing 52 changed files with 87 additions and 181 deletions.
2 changes: 1 addition & 1 deletion CryptoGramBot.Tests/ProfitAndLossTests.cs
Expand Up @@ -80,7 +80,7 @@ private Trade CreateTrade(string ccy1, string ccy2, decimal commision, decimal l
Quantity = quanity,
Side = side,
Limit = limit,
TimeStamp = timeStamp
Timestamp = timeStamp
};
return trade;
}
Expand Down
8 changes: 1 addition & 7 deletions CryptoGramBot/Configuration/BinanceConfig.cs
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CryptoGramBot.Configuration
namespace CryptoGramBot.Configuration
{
public class BinanceConfig : IConfig
{
Expand Down
8 changes: 1 addition & 7 deletions CryptoGramBot/Configuration/TelegramConfig.cs
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CryptoGramBot.Configuration
namespace CryptoGramBot.Configuration
{
public class TelegramConfig
{
Expand Down
4 changes: 1 addition & 3 deletions CryptoGramBot/Data/CryptoGramBotDbContext.cs
@@ -1,9 +1,7 @@
using System.IO;
using CryptoGramBot.Helpers;
using CryptoGramBot.Helpers;
using CryptoGramBot.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.Extensions.Configuration;

namespace CryptoGramBot.Data
{
Expand Down
6 changes: 1 addition & 5 deletions CryptoGramBot/Data/DbInitializer.cs
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;

namespace CryptoGramBot.Data
Expand Down
1 change: 0 additions & 1 deletion CryptoGramBot/EventBus/Commands/SendBalanceInfoCommand.cs
@@ -1,4 +1,3 @@
using System.Collections.Generic;
using CryptoGramBot.Models;
using Enexure.MicroBus;

Expand Down
4 changes: 0 additions & 4 deletions CryptoGramBot/EventBus/Handlers/AddLastCheckedHandler.cs
@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CryptoGramBot.Services;
using CryptoGramBot.Services.Data;
using Enexure.MicroBus;

Expand Down
Expand Up @@ -96,7 +96,7 @@ private async Task SendOpenOrdersNotifications(DateTime lastChecked)
sb.Append($"New {openOrder.Exchange} OPEN order\n");
sb.Append($"{StringContants.StrongOpen}{openOrder.Side} {openOrder.Base}-{openOrder.Terms}{StringContants.StrongClose}\n");
sb.Append($"Price: {openOrder.Price}\n");
sb.Append($"Quanitity: {openOrder.Quantity}");
sb.Append($"Quantity: {openOrder.Quantity}");
await _bus.SendAsync(new SendMessageCommand(sb));
}
}
Expand Down
Expand Up @@ -4,7 +4,6 @@
using CryptoGramBot.EventBus.Events;
using CryptoGramBot.Helpers;
using CryptoGramBot.Models;
using CryptoGramBot.Services;
using CryptoGramBot.Services.Data;
using CryptoGramBot.Services.Exchanges;
using Enexure.MicroBus;
Expand Down
Expand Up @@ -81,7 +81,7 @@ private async Task SendOpenOrdersNotifications(DateTime lastChecked)
sb.Append($"New {openOrder.Exchange} OPEN order\n");
sb.Append($"{StringContants.StrongOpen}{openOrder.Side} {openOrder.Base}-{openOrder.Terms}{StringContants.StrongClose}\n");
sb.Append($"Price: {openOrder.Price}\n");
sb.Append($"Quanitity: {openOrder.Quantity}");
sb.Append($"Quantity: {openOrder.Quantity}");
await _bus.SendAsync(new SendMessageCommand(sb));
}
}
Expand Down
@@ -1,11 +1,8 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using System.Threading.Tasks;
using CryptoGramBot.Configuration;
using CryptoGramBot.EventBus.Commands;
using CryptoGramBot.EventBus.Events;
using CryptoGramBot.Helpers;
using CryptoGramBot.Services;
using CryptoGramBot.Services.Exchanges;
using Enexure.MicroBus;

Expand Down
1 change: 0 additions & 1 deletion CryptoGramBot/EventBus/Handlers/LastCheckedHandler.cs
@@ -1,6 +1,5 @@
using System;
using System.Threading.Tasks;
using CryptoGramBot.Services;
using CryptoGramBot.Services.Data;
using Enexure.MicroBus;

Expand Down
@@ -1,10 +1,8 @@
using System;
using System.Threading.Tasks;
using System.Threading.Tasks;
using CryptoGramBot.Configuration;
using CryptoGramBot.EventBus.Commands;
using CryptoGramBot.EventBus.Events;
using CryptoGramBot.Helpers;
using CryptoGramBot.Services;
using CryptoGramBot.Services.Exchanges;
using Enexure.MicroBus;

Expand Down
Expand Up @@ -95,7 +95,7 @@ private async Task SendOpenOrdersNotifications(DateTime lastChecked)
sb.Append($"New {openOrder.Exchange} OPEN order\n");
sb.Append($"{StringContants.StrongOpen}{openOrder.Side} {openOrder.Base}-{openOrder.Terms}{StringContants.StrongClose}\n");
sb.Append($"Price: {openOrder.Price}\n");
sb.Append($"Quanitity: {openOrder.Quantity}");
sb.Append($"Quantity: {openOrder.Quantity}");
await _bus.SendAsync(new SendMessageCommand(sb));
}
}
Expand Down
@@ -1,6 +1,5 @@
using System.Threading.Tasks;
using CryptoGramBot.Helpers;
using CryptoGramBot.Services;
using CryptoGramBot.Services.Data;
using CryptoGramBot.Services.Exchanges;
using Enexure.MicroBus;
Expand Down
Expand Up @@ -2,7 +2,6 @@
using System.Linq;
using System.Threading.Tasks;
using CryptoGramBot.Models;
using CryptoGramBot.Services;
using CryptoGramBot.Services.Data;
using Enexure.MicroBus;

Expand Down Expand Up @@ -40,7 +39,7 @@ public SaveAndFindNewTradesHandler(DatabaseService databaseService)
public async Task<FindNewTradesResponse> Handle(FindNewTradeQuery query)
{
var newTrades = await _databaseService.AddTrades(query.OrderHistory);
IOrderedEnumerable<Trade> orderedEnumerable = newTrades.OrderBy(x => x.TimeStamp);
IOrderedEnumerable<Trade> orderedEnumerable = newTrades.OrderBy(x => x.Timestamp);
return new FindNewTradesResponse(orderedEnumerable);
}
}
Expand Down
6 changes: 1 addition & 5 deletions CryptoGramBot/EventBus/Handlers/SendFileHandler.cs
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading.Tasks;
using CryptoGramBot.Configuration;
using CryptoGramBot.Services;
Expand Down
Expand Up @@ -49,7 +49,7 @@ public async Task Handle(TradeNotificationCommand command)

var sb = new StringBuffer();

sb.Append(string.Format("{0}\n", (newTrade.TimeStamp + TimeSpan.FromHours(_config.TimeOffset)).ToString("g")));
sb.Append(string.Format("{0}\n", (newTrade.Timestamp + TimeSpan.FromHours(_config.TimeOffset)).ToString("g")));
sb.Append(string.Format("New {0} order\n", newTrade.Exchange));
sb.Append(string.Format("{3}{0} {1}-{2}{4}\n", newTrade.Side.ToString(), newTrade.Base, newTrade.Terms, StringContants.StrongOpen, StringContants.StrongClose));
sb.Append(string.Format("Quantity: {0}\n", newTrade.QuantityOfTrade.ToString("##0.###########")));
Expand Down
1 change: 0 additions & 1 deletion CryptoGramBot/EventBus/Handlers/TradeProfitHandler.cs
Expand Up @@ -2,7 +2,6 @@
using System;
using System.Threading.Tasks;
using CryptoGramBot.Helpers;
using CryptoGramBot.Services;
using CryptoGramBot.Services.Data;
using CryptoGramBot.Services.Pricing;

Expand Down
2 changes: 1 addition & 1 deletion CryptoGramBot/Extensions/Binance/OrderExtension.cs
Expand Up @@ -4,7 +4,7 @@ public static class OrderExtension
{
public static bool IsOpen(this Order order)
{
if(order == null)
if (order == null)
{
return false;
}
Expand Down
4 changes: 1 addition & 3 deletions CryptoGramBot/Extensions/MessageBusExtension.cs
@@ -1,5 +1,4 @@
using CryptoGramBot.Configuration;
using CryptoGramBot.EventBus;
using CryptoGramBot.EventBus;
using CryptoGramBot.EventBus.Commands;
using CryptoGramBot.EventBus.Events;
using CryptoGramBot.EventBus.Handlers;
Expand All @@ -8,7 +7,6 @@
using CryptoGramBot.EventBus.Handlers.Bittrex;
using CryptoGramBot.EventBus.Handlers.Coinigy;
using CryptoGramBot.EventBus.Handlers.Poloniex;
using CryptoGramBot.Services;
using Enexure.MicroBus;

namespace CryptoGramBot.Extensions
Expand Down
1 change: 0 additions & 1 deletion CryptoGramBot/Helpers/Constants.cs
@@ -1,5 +1,4 @@
using System;
using System.IO;

namespace CryptoGramBot.Helpers
{
Expand Down
2 changes: 1 addition & 1 deletion CryptoGramBot/Helpers/Convertors/BinanceConverter.cs
Expand Up @@ -82,7 +82,7 @@ public static List<Trade> BinanceToTrades(IEnumerable<AccountTrade> response, st
Limit = completedOrder.Price,
Quantity = completedOrder.Quantity,
QuantityRemaining = 0,
TimeStamp = completedOrder.Time(),
Timestamp = completedOrder.Time(),
Side = completedOrder.IsBuyer ? TradeSide.Buy : TradeSide.Sell
};

Expand Down
4 changes: 2 additions & 2 deletions CryptoGramBot/Helpers/Convertors/BittrexConvertor.cs
Expand Up @@ -102,7 +102,7 @@ public static List<Trade> BittrexToTrades(BittrexOrder[] bittrexTrades, ILogger
Limit = completedOrder.Limit,
Quantity = completedOrder.Quantity,
QuantityRemaining = completedOrder.QuantityRemaining,
TimeStamp = completedOrder.Closed.GetValueOrDefault(),
Timestamp = completedOrder.Closed.GetValueOrDefault(),
Side = completedOrder.OrderType == OrderTypeExtended.LimitBuy ? TradeSide.Buy : TradeSide.Sell
};

Expand Down Expand Up @@ -192,7 +192,7 @@ private static Trade ConvertBittrexCsvToCompletedOrder(IReadOnlyList<string> csv
Limit = Decimal.Parse(csvCurrentRecord[4]),
Commission = Decimal.Parse(csvCurrentRecord[5]),
Cost = Decimal.Parse(csvCurrentRecord[6]) * Decimal.Parse(csvCurrentRecord[3]),
TimeStamp = DateTime.Parse(csvCurrentRecord[8], CultureInfo.CreateSpecificCulture("en-US"))
Timestamp = DateTime.Parse(csvCurrentRecord[8], CultureInfo.CreateSpecificCulture("en-US"))
};

if (csvCurrentRecord[2] == "LIMIT_BUY")
Expand Down
5 changes: 1 addition & 4 deletions CryptoGramBot/Helpers/Convertors/PoloniexConvertor.cs
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CryptoGramBot.Models;
using Jojatekok.PoloniexAPI.TradingTools;
using Jojatekok.PoloniexAPI.WalletTools;
Expand Down Expand Up @@ -79,7 +76,7 @@ public static List<Trade> PoloniexToTrades(IList<ITrade> trades)
Terms = ccy[1],
ExchangeId = completedOrder.IdOrder.ToString(),
Limit = Convert.ToDecimal(completedOrder.PricePerCoin),
TimeStamp = completedOrder.Time,
Timestamp = completedOrder.Time,
};

var baseAmount = Convert.ToDecimal(completedOrder.AmountBase);
Expand Down
1 change: 0 additions & 1 deletion CryptoGramBot/Helpers/Helpers.cs
@@ -1,6 +1,5 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;

namespace CryptoGramBot.Helpers
Expand Down
2 changes: 0 additions & 2 deletions CryptoGramBot/Helpers/MultiFieldIgnoreOrderComparer.cs
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CryptoGramBot.Helpers
{
Expand Down
10 changes: 5 additions & 5 deletions CryptoGramBot/Helpers/StringContants.cs
Expand Up @@ -11,7 +11,7 @@ public static class StringContants
"30 or more open binance orders available to send. Will not send them to avoid spam.";

public static string BinanceMoreThan30Trades =
"There are more than 30 binance trades to send. Not going to send them to avoid spamming you";
"There are more than 30 binance trades to send. Not going to send them to avoid spamming you.";

public static string BinanceMoreThan30Withdrawals = "30 or more binance withdrawals available to send. Will not send them to avoid spam.";

Expand All @@ -23,7 +23,7 @@ public static class StringContants
"30 or more open bittrex orders available to send. Will not send them to avoid spam.";

public static string BittrexMoreThan30Trades =
"There are more than 30 bittrex trades to send. Not going to send them to avoid spamming you";
"There are more than 30 bittrex trades to send. Not going to send them to avoid spamming you.";

public static string BittrexMoreThan30Withdrawals = "30 or more bittrex withdrawals available to send. Will not send them to avoid spam.";

Expand All @@ -32,13 +32,13 @@ public static class StringContants

public static string CommonCommands = $"{StringContants.StrongOpen}Common commands{StringContants.StrongClose}\n";

public static string CouldNotProcessCommand = "Could not process your command. Check your logs";
public static string CouldNotProcessCommand = "Could not process your command. Check your logs.";
public static string CouldNotProcessFile = "Could not process file.";
public static string CouldNotWorkOutPair = "Could not work out what the pair you typed was";
public static string DatabaseLocation = "Data Source=" + Directory.GetCurrentDirectory() + "/database/cryptogrambot.sqlite;cache=shared";
public static string DidNotRecieveFile = "Did not receive a file";
public static string DidNotReceiveFile = "Did not receive a file";
public static string Help = $"{StringContants.StrongOpen}Help{StringContants.StrongClose}\n\n";
public static string No24HourOfData = "Could not calculate percentages. Probably because we don't have 24 hours of data yet";
public static string No24HourOfData = "Could not calculate percentages. Probably because we don't have 24 hours of data yet.";

public static string PairProfitError = "Something went wrong. Probably because you entered in a dud currency or I have no trade details";
public static string PoloCommands = $"\n{StringContants.StrongOpen}Poloniex commands{StringContants.StrongClose})\n";
Expand Down
1 change: 0 additions & 1 deletion CryptoGramBot/Models/BalanceHistory.cs
@@ -1,6 +1,5 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace CryptoGramBot.Models
{
Expand Down
6 changes: 1 addition & 5 deletions CryptoGramBot/Models/BalanceInformation.cs
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;

namespace CryptoGramBot.Models
{
Expand Down
7 changes: 1 addition & 6 deletions CryptoGramBot/Models/CoinigyAccount.cs
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;

namespace CryptoGramBot.Models
{
Expand Down
8 changes: 1 addition & 7 deletions CryptoGramBot/Models/Currency.cs
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CryptoGramBot.Models
namespace CryptoGramBot.Models
{
public class Currency
{
Expand Down
6 changes: 0 additions & 6 deletions CryptoGramBot/Models/Deposit.cs
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Poloniex;

namespace CryptoGramBot.Models
{
Expand Down
8 changes: 1 addition & 7 deletions CryptoGramBot/Models/Setting.cs
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CryptoGramBot.Models
namespace CryptoGramBot.Models
{
public class Setting
{
Expand Down
2 changes: 1 addition & 1 deletion CryptoGramBot/Models/Trade.cs
Expand Up @@ -16,6 +16,6 @@ public class Trade
public decimal QuantityRemaining { get; set; }
public TradeSide Side { get; set; }
public string Terms { get; set; }
public DateTime TimeStamp { get; set; }
public DateTime Timestamp { get; set; }
}
}
8 changes: 1 addition & 7 deletions CryptoGramBot/Models/TradeSide.cs
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CryptoGramBot.Models
namespace CryptoGramBot.Models
{
public enum TradeSide
{
Expand Down

0 comments on commit 53db6d2

Please sign in to comment.