├── .gitattributes ├── .gitignore ├── README.md └── TradingCoins ├── Cob.TradingApps.BtcData ├── Cob.TradingApps.BtcData.csproj ├── Cob.TradingApps.BtcData.csproj.user ├── ExchangeConnectivity.cs ├── Exchanges │ ├── BitfinexExchange.cs │ ├── ExchangeBase.cs │ └── IExchangeInfo.cs ├── Properties │ └── AssemblyInfo.cs ├── bin │ └── Debug │ │ ├── Cob.TradingApps.BtcData.dll │ │ ├── Cob.TradingApps.BtcData.pdb │ │ ├── Newtonsoft.Json.dll │ │ ├── Newtonsoft.Json.xml │ │ ├── RestSharp.dll │ │ ├── RestSharp.xml │ │ ├── TradingApi.Bitfinex.dll │ │ ├── TradingApi.Bitfinex.pdb │ │ ├── TradingApi.ModelObjects.dll │ │ ├── TradingApi.ModelObjects.pdb │ │ ├── log4net.dll │ │ └── log4net.xml └── packages.config ├── TradingApi.Bitfinex ├── BitfinexApi.Events.cs ├── BitfinexApi.cs ├── Properties │ └── AssemblyInfo.cs ├── TradingApi.Bitfinex.csproj ├── TradingApi.Bitfinex.csproj.user ├── bin │ └── Debug │ │ ├── Newtonsoft.Json.dll │ │ ├── Newtonsoft.Json.xml │ │ ├── RestSharp.dll │ │ ├── RestSharp.xml │ │ ├── TradingApi.Bitfinex.dll │ │ ├── TradingApi.Bitfinex.pdb │ │ ├── TradingApi.ModelObjects.dll │ │ ├── TradingApi.ModelObjects.pdb │ │ ├── log4net.dll │ │ └── log4net.xml ├── obj │ └── Debug │ │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ ├── TradingApi.Bitfinex.csproj.FileListAbsolute.txt │ │ ├── TradingApi.Bitfinex.csprojResolveAssemblyReference.cache │ │ ├── TradingApi.Bitfinex.dll │ │ └── TradingApi.Bitfinex.pdb └── packages.config ├── TradingApi.ModelObjects ├── Bitfinex │ ├── BitfinexNewOfferPost.cs │ └── Json │ │ ├── BitfinexActiveCreditsResponse.cs │ │ ├── BitfinexActiveSwapsInMarginResponse.cs │ │ ├── BitfinexBalanceResponse.cs │ │ ├── BitfinexCancelMultipleOrderPost.cs │ │ ├── BitfinexCancelOrderPost.cs │ │ ├── BitfinexCancelReplaceOrderResponse.cs │ │ ├── BitfinexCancelReplacePost.cs │ │ ├── BitfinexClaimPositionPost.cs │ │ ├── BitfinexCloseSwapPost.cs │ │ ├── BitfinexDepositPost.cs │ │ ├── BitfinexDepositResponse.cs │ │ ├── BitfinexHistoryPost.cs │ │ ├── BitfinexHistoryResponse.cs │ │ ├── BitfinexLendbookResponse.cs │ │ ├── BitfinexLendsResponse.cs │ │ ├── BitfinexMarginInfoResponse.cs │ │ ├── BitfinexMarginPositionResponse.cs │ │ ├── BitfinexMultipleNewOrderResponse.cs │ │ ├── BitfinexMultipleNewOrdersPost.cs │ │ ├── BitfinexMyTradesPost.cs │ │ ├── BitfinexMyTradesResponse.cs │ │ ├── BitfinexNewOfferPost.cs │ │ ├── BitfinexNewOrderPost.cs │ │ ├── BitfinexNewOrderResponse.cs │ │ ├── BitfinexOfferStatusPost.cs │ │ ├── BitfinexOfferStatusResponse.cs │ │ ├── BitfinexOrderBookGet.cs │ │ ├── BitfinexOrderStatusPost.cs │ │ ├── BitfinexOrderStatusResponse.cs │ │ ├── BitfinexPostBase.cs │ │ ├── BitfinexPublicTickerGet.cs │ │ ├── BitfinexSymbolStatsResponse.cs │ │ ├── BitfinexSymbolsDetailsResponse.cs │ │ ├── BitfinexTradesGet.cs │ │ ├── ErrorResponse.cs │ │ ├── LendbookTypes │ │ ├── Ask.cs │ │ └── Bid.cs │ │ ├── MarginInfoTypes │ │ └── MarginLimit.cs │ │ ├── MultipleOrderTypes │ │ └── OrderId.cs │ │ └── OrderbookTypes │ │ ├── Ask.cs │ │ └── Bid.cs ├── BtcInfo.cs ├── BtcMarketData.cs ├── Logger.cs ├── Properties │ └── AssemblyInfo.cs ├── TradingApi.ModelObjects.csproj ├── TradingApi.ModelObjects.csproj.user ├── Utility │ └── Common.cs ├── bin │ └── Debug │ │ ├── Newtonsoft.Json.dll │ │ ├── Newtonsoft.Json.xml │ │ ├── TradingApi.ModelObjects.dll │ │ ├── TradingApi.ModelObjects.pdb │ │ ├── log4net.dll │ │ └── log4net.xml └── packages.config ├── TradingCoins.sln ├── TradingCoins ├── App.config ├── Controls │ ├── ExchangeAcctCtrl.Designer.cs │ ├── ExchangeAcctCtrl.cs │ ├── ExchangeAcctCtrl.resx │ ├── MarketDataCtrl.Designer.cs │ ├── MarketDataCtrl.cs │ └── MarketDataCtrl.resx ├── Form1.Designer.cs ├── Form1.cs ├── Form1.resx ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── TradingCoins.csproj ├── TradingCoins.csproj.user ├── bin │ └── Debug │ │ ├── Cob.TradingApps.BtcData.dll │ │ ├── Cob.TradingApps.BtcData.pdb │ │ ├── Newtonsoft.Json.dll │ │ ├── Newtonsoft.Json.xml │ │ ├── RestSharp.dll │ │ ├── RestSharp.xml │ │ ├── TradingApi.Bitfinex.dll │ │ ├── TradingApi.Bitfinex.pdb │ │ ├── TradingApi.ModelObjects.dll │ │ ├── TradingApi.ModelObjects.pdb │ │ ├── TradingCoins.exe │ │ ├── TradingCoins.exe.config │ │ ├── TradingCoins.pdb │ │ ├── TradingCoins.vshost.exe │ │ ├── TradingCoins.vshost.exe.config │ │ ├── TradingCoins.vshost.exe.manifest │ │ ├── log4net.dll │ │ └── log4net.xml └── packages.config └── packages ├── Newtonsoft.Json.6.0.5 ├── Newtonsoft.Json.6.0.5.nupkg ├── lib │ ├── net20 │ │ ├── Newtonsoft.Json.dll │ │ └── Newtonsoft.Json.xml │ ├── net35 │ │ ├── Newtonsoft.Json.dll │ │ └── Newtonsoft.Json.xml │ ├── net40 │ │ ├── Newtonsoft.Json.dll │ │ └── Newtonsoft.Json.xml │ ├── net45 │ │ ├── Newtonsoft.Json.dll │ │ └── Newtonsoft.Json.xml │ ├── netcore45 │ │ ├── Newtonsoft.Json.dll │ │ └── Newtonsoft.Json.xml │ ├── portable-net40+sl5+wp80+win8+wpa81 │ │ ├── Newtonsoft.Json.dll │ │ └── Newtonsoft.Json.xml │ └── portable-net45+wp80+win8+wpa81 │ │ ├── Newtonsoft.Json.dll │ │ └── Newtonsoft.Json.xml └── tools │ └── install.ps1 ├── RestSharp.104.5.0 ├── RestSharp.104.5.0.nupkg ├── lib │ ├── net35-client │ │ ├── RestSharp.dll │ │ └── RestSharp.xml │ ├── net35 │ │ ├── RestSharp.dll │ │ └── RestSharp.xml │ ├── net4-client │ │ ├── RestSharp.dll │ │ └── RestSharp.xml │ ├── net4 │ │ ├── RestSharp.dll │ │ └── RestSharp.xml │ ├── sl4-wp71 │ │ ├── RestSharp.WindowsPhone.dll │ │ └── RestSharp.WindowsPhone.xml │ └── sl4 │ │ ├── RestSharp.Silverlight.dll │ │ └── RestSharp.Silverlight.xml └── readme.txt ├── log4net.2.0.3 ├── lib │ ├── net10-full │ │ ├── log4net.dll │ │ └── log4net.xml │ ├── net11-full │ │ ├── log4net.dll │ │ └── log4net.xml │ ├── net20-full │ │ ├── log4net.dll │ │ └── log4net.xml │ ├── net35-client │ │ ├── log4net.dll │ │ └── log4net.xml │ ├── net35-full │ │ ├── log4net.dll │ │ └── log4net.xml │ ├── net40-client │ │ ├── log4net.dll │ │ └── log4net.xml │ └── net40-full │ │ ├── log4net.dll │ │ └── log4net.xml └── log4net.2.0.3.nupkg └── repositories.config /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # ========================= 18 | # Operating System Files 19 | # ========================= 20 | 21 | # OSX 22 | # ========================= 23 | 24 | .DS_Store 25 | .AppleDouble 26 | .LSOverride 27 | 28 | # Icon must end with two \r 29 | Icon 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | 38 | # Directories potentially created on remote AFP share 39 | .AppleDB 40 | .AppleDesktop 41 | Network Trash Folder 42 | Temporary Items 43 | .apdisk 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | TradingApi.Bitfinex 2 | =================== 3 | 4 | This is a Bitfinex Exchange wrapper written in C#. 5 | 6 | Why? 7 | I thought it would be a good learning experience and I hoped it would add value to others who want to trade on Bitfinex. 8 | It seemed connecting to Bitfinex was difficult with the instructions from the site. I want to create an assembly that would 9 | expose all the functionality one of the better btc exchanges had to offer. If you feel this offers value, I would ask 10 | you to donate: 16nKuxZ11MxY6qvoJuCzNm1hDVsUvnH4t5 11 | 12 | Instructions: 13 | You should be able to add references to the "Trading.Api.Bitfinex.dll" and the "Trading.Api.ModelObjects.dll" to a form/web 14 | application. The constructor for the BitfinexApi class takes two string parameters to connect (ApiSecret and ApiKey). The 15 | instructions on the Bitfinex site are relatively straight forward. 16 | 17 | The "Trading.Api.ModelObjects.dll" has all of the encapsulated return types when you make a call to Bitfinex. A number of helper Enums exist int this assembly to make 18 | passing in the currency and/or pair you want to trade easier. 19 | 20 | Each Api call has two ways of returning data. 1. A simple 21 | function that returns an encapsulated type (public BitfinexOrderBookGet GetOrderBook(BtcInfo.PairTypeEnum pairType)). 2. An 22 | exposed event to provide callback returns of the encapsulated type (public event OrderBookMsgHandler OrderBookMsg;). If you 23 | are working in multiple projects and/or threads the events should be easier to process the data returned from the Api calls 24 | to Bitfinex. 25 | 26 | I've also attached another assembly called "Cob.TradingApps.BtcData.dll." This is a simple assembly that will periodically 27 | poll for price updates for a specific pair. This is mostly a proof of concept to pull pair data from Bitfinex. Additionally, 28 | against my better judgment I have also attached the simple form project I used for testing. This is called "TradingCoins." 29 | Its only value is that you can specifically test all the functionality Bitfinex has to offer on this dopey form application. 30 | I have no desire to support the "TradingCoins" form. 31 | 32 | 3rd party dlls: 33 | log4net.dll (the App.config has the proper configuration) - 2.0.3 34 | RestSharp.dll - 104.5.0 35 | Newtonsoft.Json.dll - 6.0.5 36 | 37 | If you have any questions or wish to collaborate on other btc projects please email me atworkingobrien@gmail.com. I spent 38 | a reasonable amount of time on this project in hopes it adds value to someone who wants to trade more effectively on 39 | bitfinex. Please donate if you feel I was able to add value for you: 16nKuxZ11MxY6qvoJuCzNm1hDVsUvnH4t5. 40 | 41 | 42 | -------------------------------------------------------------------------------- /TradingCoins/Cob.TradingApps.BtcData/Cob.TradingApps.BtcData.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {63F10178-9E10-4495-B376-08DF3A763E1C} 8 | Library 9 | Properties 10 | Cob.TradingApps.BtcData 11 | Cob.TradingApps.BtcData 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | ..\packages\log4net.2.0.3\lib\net40-full\log4net.dll 35 | 36 | 37 | ..\packages\Newtonsoft.Json.6.0.5\lib\net45\Newtonsoft.Json.dll 38 | 39 | 40 | ..\packages\RestSharp.104.5.0\lib\net4\RestSharp.dll 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | {1c6afc5b-4c6d-4f88-97ff-5845d45e94c7} 64 | TradingApi.Bitfinex 65 | 66 | 67 | {f0f159a5-c5d6-4cbf-b061-7943f8f7bc5a} 68 | TradingApi.ModelObjects 69 | 70 | 71 | 72 | 79 | -------------------------------------------------------------------------------- /TradingCoins/Cob.TradingApps.BtcData/Cob.TradingApps.BtcData.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ProjectFiles 5 | 6 | -------------------------------------------------------------------------------- /TradingCoins/Cob.TradingApps.BtcData/ExchangeConnectivity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Concurrent; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Threading; 6 | using Cob.TradingApps.BtcData.Exchanges; 7 | using TradingApi.ModelObjects; 8 | 9 | namespace Cob.TradingApps.BtcData 10 | { 11 | public sealed class ExchangeConnectivity 12 | { 13 | private static volatile ExchangeConnectivity _instance = null; 14 | private static readonly object _lock = new object(); 15 | 16 | private Dictionary _exchanges; 17 | public Dictionary Exchanges { get { return _exchanges; }} 18 | 19 | private ConcurrentQueue _exchangeUpdateQueue; 20 | 21 | public event MarketDataUpdateHandler MarketDataUpdate; 22 | public delegate void MarketDataUpdateHandler(ExchangeBase exchangeBase); 23 | 24 | public ConcurrentDictionary LastExchangeMarketData { get; set; } 25 | 26 | private BtcInfo.PairTypeEnum _pairType; 27 | public BtcInfo.PairTypeEnum PairType { get { return _pairType; }} 28 | 29 | public static ExchangeConnectivity Instance 30 | { 31 | get 32 | { 33 | if (_instance == null) 34 | { 35 | lock (_lock) 36 | { 37 | if (_instance == null) 38 | { 39 | _instance = new ExchangeConnectivity(); 40 | } 41 | } 42 | } 43 | return _instance; 44 | } 45 | } 46 | 47 | public void Initialize() 48 | { 49 | try 50 | { 51 | _exchanges = new Dictionary(); 52 | LastExchangeMarketData = new ConcurrentDictionary(); 53 | _exchangeUpdateQueue = new ConcurrentQueue(); 54 | 55 | var exchanges = Enum.GetValues(typeof (BtcInfo.ExchangeEnum)); 56 | foreach (BtcInfo.ExchangeEnum exchange in exchanges) 57 | { 58 | var exchangeConnection = new BitfinexExchange(); 59 | exchangeConnection.ConnectToApi(); 60 | _exchanges.Add(exchange, exchangeConnection); 61 | var bw = new BackgroundWorker(); 62 | bw.DoWork += BwOnDoWork; 63 | bw.WorkerSupportsCancellation = true; 64 | bw.RunWorkerCompleted += BwOnRunWorkerCompleted; 65 | bw.RunWorkerAsync(exchange); 66 | } 67 | ThreadPool.QueueUserWorkItem(ProcessExchangeUpdate); 68 | } 69 | catch (Exception ex) 70 | { 71 | Logger.LogException(ex); 72 | } 73 | } 74 | 75 | public void SetGlobalPairType(BtcInfo.PairTypeEnum pairType) 76 | { 77 | lock (_lock) 78 | { 79 | _pairType = pairType; 80 | } 81 | } 82 | 83 | private void BwOnDoWork(object sender, DoWorkEventArgs doWorkEventArgs) 84 | { 85 | var btcExchangeEnum = doWorkEventArgs.Argument is BtcInfo.ExchangeEnum 86 | ? (BtcInfo.ExchangeEnum) doWorkEventArgs.Argument 87 | : 0; 88 | while (true) 89 | { 90 | try 91 | { 92 | lock (_lock) 93 | { 94 | ExchangeBase exchangeConnectionBase = null; 95 | switch (btcExchangeEnum) 96 | { 97 | case BtcInfo.ExchangeEnum.BITFINEX: 98 | exchangeConnectionBase = _exchanges[BtcInfo.ExchangeEnum.BITFINEX]; 99 | var bfExchange = exchangeConnectionBase as BitfinexExchange; 100 | if (bfExchange != null) 101 | { 102 | bfExchange.ProcessMarketDataUpdate(PairType); 103 | } 104 | 105 | break; 106 | } 107 | if (exchangeConnectionBase != null) 108 | { 109 | exchangeConnectionBase.SetBtcMarketData(PairType); 110 | _exchangeUpdateQueue.Enqueue(exchangeConnectionBase); 111 | } 112 | } 113 | } 114 | catch (Exception ex) 115 | { 116 | Logger.LogException(ex); 117 | } 118 | finally 119 | { 120 | Thread.Sleep(10000); 121 | } 122 | } 123 | } 124 | 125 | private void ProcessExchangeUpdate(object state) 126 | { 127 | while (true) 128 | { 129 | if (_exchangeUpdateQueue.Count == 0) 130 | Thread.Sleep(2000); 131 | 132 | ExchangeBase exchangeBase = null; 133 | if (_exchangeUpdateQueue.TryDequeue(out exchangeBase)) 134 | { 135 | //TODO: pubish event back to main form... 136 | MarketDataUpdate(exchangeBase); 137 | LastExchangeMarketData[exchangeBase.Exchange] = exchangeBase.MarketData; 138 | } 139 | } 140 | } 141 | 142 | private void BwOnRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs runWorkerCompletedEventArgs) 143 | { 144 | } 145 | 146 | } 147 | } 148 | -------------------------------------------------------------------------------- /TradingCoins/Cob.TradingApps.BtcData/Exchanges/BitfinexExchange.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Configuration; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using TradingApi.Bitfinex; 6 | using TradingApi.ModelObjects; 7 | using TradingApi.ModelObjects.Bitfinex.Json; 8 | 9 | namespace Cob.TradingApps.BtcData.Exchanges 10 | { 11 | public class BitfinexExchange : ExchangeBase 12 | { 13 | private const string BaseUrl = @"https://api.bitfinex.com/"; 14 | 15 | public BitfinexApi Api { get; set; } 16 | private BitfinexOrderBookGet _orderBookGet; 17 | public BitfinexOrderBookGet OrderBook { get { return _orderBookGet; } } 18 | 19 | public BitfinexExchange() : base(BtcInfo.ExchangeEnum.BITFINEX) 20 | { 21 | BaseJsonUrl = BaseUrl; 22 | } 23 | 24 | public override void ConnectToApi() 25 | { 26 | try 27 | { 28 | var apiSecret = ConfigurationManager.AppSettings["ApiSecret"]; 29 | var apiKey = ConfigurationManager.AppSettings["ApiKey"]; 30 | 31 | if (string.IsNullOrEmpty(apiSecret)) 32 | throw new Exception("Missing ApiSecret in App.config"); 33 | 34 | if (string.IsNullOrEmpty(apiKey)) 35 | throw new Exception("Missing ApiKey in App.config"); 36 | 37 | Api = new BitfinexApi(apiSecret, apiKey); 38 | } 39 | catch (Exception ex) 40 | { 41 | Logger.LogException(ex); 42 | } 43 | } 44 | 45 | public override void ProcessMarketDataUpdate(BtcInfo.PairTypeEnum pairType) 46 | { 47 | _orderBookGet = Api.GetOrderBook(pairType); 48 | } 49 | 50 | public override void SetBtcMarketData(BtcInfo.PairTypeEnum pairType) 51 | { 52 | try 53 | { 54 | if (_orderBookGet != null) 55 | { 56 | this.MarketData.PairType = pairType; 57 | var topBid = _orderBookGet.Bids.FirstOrDefault(); 58 | var topAsk = _orderBookGet.Asks.FirstOrDefault(); 59 | 60 | if (topBid != null) 61 | { 62 | this.MarketData.BidSz = topBid.Amount; 63 | this.MarketData.Bid = topBid.Price; 64 | } 65 | 66 | if (topAsk != null) 67 | { 68 | this.MarketData.AskSz = topAsk.Amount; 69 | this.MarketData.Ask = topAsk.Price; 70 | } 71 | } 72 | } 73 | catch (Exception ex) 74 | { 75 | Logger.LogException(ex); 76 | } 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /TradingCoins/Cob.TradingApps.BtcData/Exchanges/ExchangeBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using RestSharp; 3 | using TradingApi.ModelObjects; 4 | 5 | namespace Cob.TradingApps.BtcData.Exchanges 6 | { 7 | public abstract class ExchangeBase : IExchangeInfo 8 | { 9 | public BtcMarketData MarketData { get; set; } 10 | public BtcInfo.ExchangeEnum Exchange { get; set; } 11 | public string BaseJsonUrl { get; set; } 12 | 13 | protected ExchangeBase(BtcInfo.ExchangeEnum exchange) 14 | { 15 | Exchange = exchange; 16 | MarketData = new BtcMarketData(); 17 | } 18 | 19 | public abstract void ConnectToApi(); 20 | public abstract void ProcessMarketDataUpdate(BtcInfo.PairTypeEnum pairType); 21 | public abstract void SetBtcMarketData(BtcInfo.PairTypeEnum pairType); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /TradingCoins/Cob.TradingApps.BtcData/Exchanges/IExchangeInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using TradingApi.ModelObjects; 3 | 4 | namespace Cob.TradingApps.BtcData.Exchanges 5 | { 6 | interface IExchangeInfo 7 | { 8 | BtcMarketData MarketData { get; set; } 9 | BtcInfo.ExchangeEnum Exchange { get; set; } 10 | String BaseJsonUrl { get; set; } 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /TradingCoins/Cob.TradingApps.BtcData/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Cob.TradingApps.BtcData")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Cob.TradingApps.BtcData")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("271cab68-bf20-42f4-a65b-80f7201a7138")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /TradingCoins/Cob.TradingApps.BtcData/bin/Debug/Cob.TradingApps.BtcData.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/Cob.TradingApps.BtcData/bin/Debug/Cob.TradingApps.BtcData.dll -------------------------------------------------------------------------------- /TradingCoins/Cob.TradingApps.BtcData/bin/Debug/Cob.TradingApps.BtcData.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/Cob.TradingApps.BtcData/bin/Debug/Cob.TradingApps.BtcData.pdb -------------------------------------------------------------------------------- /TradingCoins/Cob.TradingApps.BtcData/bin/Debug/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/Cob.TradingApps.BtcData/bin/Debug/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /TradingCoins/Cob.TradingApps.BtcData/bin/Debug/RestSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/Cob.TradingApps.BtcData/bin/Debug/RestSharp.dll -------------------------------------------------------------------------------- /TradingCoins/Cob.TradingApps.BtcData/bin/Debug/TradingApi.Bitfinex.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/Cob.TradingApps.BtcData/bin/Debug/TradingApi.Bitfinex.dll -------------------------------------------------------------------------------- /TradingCoins/Cob.TradingApps.BtcData/bin/Debug/TradingApi.Bitfinex.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/Cob.TradingApps.BtcData/bin/Debug/TradingApi.Bitfinex.pdb -------------------------------------------------------------------------------- /TradingCoins/Cob.TradingApps.BtcData/bin/Debug/TradingApi.ModelObjects.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/Cob.TradingApps.BtcData/bin/Debug/TradingApi.ModelObjects.dll -------------------------------------------------------------------------------- /TradingCoins/Cob.TradingApps.BtcData/bin/Debug/TradingApi.ModelObjects.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/Cob.TradingApps.BtcData/bin/Debug/TradingApi.ModelObjects.pdb -------------------------------------------------------------------------------- /TradingCoins/Cob.TradingApps.BtcData/bin/Debug/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/Cob.TradingApps.BtcData/bin/Debug/log4net.dll -------------------------------------------------------------------------------- /TradingCoins/Cob.TradingApps.BtcData/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.Bitfinex/BitfinexApi.Events.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using TradingApi.ModelObjects; 4 | using TradingApi.ModelObjects.Bitfinex.Json; 5 | 6 | namespace TradingApi.Bitfinex 7 | { 8 | public partial class BitfinexApi 9 | { 10 | private void InitializeEvents() 11 | { 12 | ErrorMessage += OnErrorMessage; 13 | OrderBookMsg += OnOrderBookMsg; 14 | BalanceResponseMsg += OnBalanceResponseMsg; 15 | MultipleOrderFeedMsg += OnMultipleOrderFeedMsg; 16 | OrderFeedMsg += OnOrderFeedMsg; 17 | CancelOrderMsg += OnCancelOrderMsg; 18 | CancelReplaceFeedMsg += OnCancelReplaceFeedMsg; 19 | CancelMultipleOrdersMsg += OnCancelMultipleOrdersMsg; 20 | CancelAllActiveOrdersMsg += OnCancelAllActiveOrdersMsg; 21 | ActiveOffersMsg += OnActiveOffersMsg; 22 | HistoryMsg += OnHistoryMsg; 23 | MyTradesMsg += OnMyTradesMsg; 24 | MarginInformationMsg += OnMarginInformationMsg; 25 | ActivePositionssMsg += OnActivePositionssMsg; 26 | OrderStatusMsg += OnOrderStatusMsg; 27 | NewOfferStatusMsg += OnNewOfferStatusMsg; 28 | CancelOfferMsg += OnCancelOfferMsg; 29 | OfferStatusMsg += OnOfferStatusMsg; 30 | ActiveCreditsMsg += OnActiveCreditsMsg; 31 | ActiveSwapsUsedInMarginMsg += OnActiveSwapsUsedInMarginMsg; 32 | CloseSwapMsg += OnCloseSwapMsg; 33 | ClaimPositionMsg += OnClaimPositionMsg; 34 | LendbookResponseMsg += OnLendbookResponseMsg; 35 | LendsResponseMsg += OnLendsResponseMsg; 36 | } 37 | 38 | public event ErrorMessageHandler ErrorMessage; 39 | public delegate void ErrorMessageHandler(string errorMessage); 40 | 41 | public event OrderBookMsgHandler OrderBookMsg; 42 | public delegate void OrderBookMsgHandler(BitfinexOrderBookGet marketData); 43 | 44 | public event BalanceResponseMsgHandler BalanceResponseMsg; 45 | public delegate void BalanceResponseMsgHandler(IList balanceResponse); 46 | 47 | public event MultipleOrderFeedMsgHandler MultipleOrderFeedMsg; 48 | public delegate void MultipleOrderFeedMsgHandler(BitfinexMultipleNewOrderResponse ordersResponse); 49 | 50 | public event OrderFeedMsgHandler OrderFeedMsg; 51 | public delegate void OrderFeedMsgHandler(BitfinexNewOrderResponse orderResponse); 52 | 53 | public event CancelOrderMsgHandler CancelOrderMsg; 54 | public delegate void CancelOrderMsgHandler(BitfinexOrderStatusResponse cancelResponse); 55 | 56 | public event CancelReplaceFeedMsgHandler CancelReplaceFeedMsg; 57 | public delegate void CancelReplaceFeedMsgHandler(BitfinexCancelReplaceOrderResponse cancelReplaceReponse); 58 | 59 | public event CancelMultipleOrdersMsgHandler CancelMultipleOrdersMsg; 60 | public delegate void CancelMultipleOrdersMsgHandler(string msg); 61 | 62 | public event CancelAllActiveOrdersMsgHandler CancelAllActiveOrdersMsg; 63 | public delegate void CancelAllActiveOrdersMsgHandler(string msg); 64 | 65 | public event ActiveOrdersMsgHandler ActiveOrdersMsg; 66 | public delegate void ActiveOrdersMsgHandler(IList activePositionResponse); 67 | 68 | public event HistoryMsgHandler HistoryMsg; 69 | public delegate void HistoryMsgHandler(IList historyResponse); 70 | 71 | public event MyTradesMsgHandler MyTradesMsg; 72 | public delegate void MyTradesMsgHandler(IList myTradesResponse); 73 | 74 | public event MarginInformationMsgHandler MarginInformationMsg; 75 | public delegate void MarginInformationMsgHandler(BitfinexMarginInfoResponse marginInfoResponse); 76 | 77 | public event ActivePositionsMsgHandler ActivePositionssMsg; 78 | public delegate void ActivePositionsMsgHandler(IList activePositionResponse); 79 | 80 | public event OrderOrderStatusMsgHandler OrderStatusMsg; 81 | public delegate void OrderOrderStatusMsgHandler(BitfinexOrderStatusResponse orderStatusResponse); 82 | 83 | public event NewOfferStatusMsgHandler NewOfferStatusMsg; 84 | public delegate void NewOfferStatusMsgHandler(BitfinexOfferStatusResponse newOfferRespone); 85 | 86 | public event CancelOfferMsgHandler CancelOfferMsg; 87 | public delegate void CancelOfferMsgHandler(BitfinexOfferStatusResponse cancelOfferResponse); 88 | 89 | public event OfferStatusMsgHandler OfferStatusMsg; 90 | public delegate void OfferStatusMsgHandler(BitfinexOfferStatusResponse offerStatusResponse); 91 | 92 | public event ActiveOffersMsgHandler ActiveOffersMsg; 93 | public delegate void ActiveOffersMsgHandler(IList activeOfferResponse); 94 | 95 | public event ActiveCreditsMsgHandler ActiveCreditsMsg; 96 | public delegate void ActiveCreditsMsgHandler(IList activeCreditsResponse); 97 | 98 | public event ActiveSwapsUsedInMarginMsgHandler ActiveSwapsUsedInMarginMsg; 99 | public delegate void ActiveSwapsUsedInMarginMsgHandler(IList activeSwapsInMarginResponse); 100 | 101 | public event CloseSwapMsgHandler CloseSwapMsg; 102 | public delegate void CloseSwapMsgHandler(BitfinexActiveSwapsInMarginResponse closeSwapResponse); 103 | 104 | public event ClaimPositionMsgHandler ClaimPositionMsg; 105 | public delegate void ClaimPositionMsgHandler(BitfinexMarginPositionResponse claimPosResponse); 106 | 107 | public event LendbookResponseMsgHandler LendbookResponseMsg; 108 | public delegate void LendbookResponseMsgHandler(BitfinexLendbookResponse lendbookResponse); 109 | 110 | public event LendsResponseMsgHandler LendsResponseMsg; 111 | public delegate void LendsResponseMsgHandler(IList lendsResponse); 112 | 113 | private void OnLendsResponseMsg(IList lendsResponse) { } 114 | 115 | private void OnLendbookResponseMsg(BitfinexLendbookResponse lendbookResponse) { } 116 | 117 | private void OnClaimPositionMsg(BitfinexMarginPositionResponse claimPosResponse) { } 118 | 119 | private void OnCloseSwapMsg(BitfinexActiveSwapsInMarginResponse closeSwapResponse) { } 120 | 121 | private void OnActiveSwapsUsedInMarginMsg(IList activeSwapsInMarginResponse) { } 122 | 123 | private void OnActiveCreditsMsg(IList activeCreditsResponse) { } 124 | 125 | private void OnOfferStatusMsg(BitfinexOfferStatusResponse offerStatusResponse) { } 126 | 127 | private void OnCancelOfferMsg(BitfinexOfferStatusResponse cancelOfferResponse) { } 128 | 129 | private void OnNewOfferStatusMsg(BitfinexOfferStatusResponse newOfferRespone) { } 130 | 131 | private void OnOrderStatusMsg(BitfinexOrderStatusResponse orderStatusResponse) { } 132 | 133 | private void OnActivePositionssMsg(IList activePositionResponse) { } 134 | 135 | private void OnMarginInformationMsg(BitfinexMarginInfoResponse marginInfoResponse) { } 136 | 137 | private void OnMyTradesMsg(IList myTradesResponse) { } 138 | 139 | private void OnHistoryMsg(IList historyResponse) { } 140 | 141 | private void OnActiveOffersMsg(IList activeOfferResponse) { } 142 | 143 | private void OnCancelAllActiveOrdersMsg(string msg) { } 144 | 145 | private void OnCancelMultipleOrdersMsg(string msg) { } 146 | 147 | private void OnCancelReplaceFeedMsg(BitfinexCancelReplaceOrderResponse cancelReplaceReponse) { } 148 | 149 | private void OnCancelOrderMsg(BitfinexOrderStatusResponse cancelResponse) { } 150 | 151 | private void OnOrderFeedMsg(BitfinexNewOrderResponse orderResponse) { } 152 | 153 | private void OnMultipleOrderFeedMsg(BitfinexMultipleNewOrderResponse ordersResponse) { } 154 | 155 | private void OnBalanceResponseMsg(IList balanceResponse) { } 156 | 157 | private void OnOrderBookMsg(BitfinexOrderBookGet marketData) { } 158 | 159 | private void OnErrorMessage(string errorMessage) { } 160 | 161 | 162 | 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.Bitfinex/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("TradingApi.Bitfinex")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("TradingApi.Bitfinex")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("572544b4-4d30-42d9-be6b-44f1a26581db")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.Bitfinex/TradingApi.Bitfinex.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {1C6AFC5B-4C6D-4F88-97FF-5845D45E94C7} 8 | Library 9 | Properties 10 | TradingApi.Bitfinex 11 | TradingApi.Bitfinex 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | ..\packages\log4net.2.0.3\lib\net40-full\log4net.dll 35 | 36 | 37 | ..\packages\Newtonsoft.Json.6.0.5\lib\net45\Newtonsoft.Json.dll 38 | 39 | 40 | ..\packages\RestSharp.104.5.0\lib\net4\RestSharp.dll 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | {f0f159a5-c5d6-4cbf-b061-7943f8f7bc5a} 57 | TradingApi.ModelObjects 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 72 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.Bitfinex/TradingApi.Bitfinex.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ProjectFiles 5 | 6 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.Bitfinex/bin/Debug/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingApi.Bitfinex/bin/Debug/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /TradingCoins/TradingApi.Bitfinex/bin/Debug/RestSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingApi.Bitfinex/bin/Debug/RestSharp.dll -------------------------------------------------------------------------------- /TradingCoins/TradingApi.Bitfinex/bin/Debug/TradingApi.Bitfinex.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingApi.Bitfinex/bin/Debug/TradingApi.Bitfinex.dll -------------------------------------------------------------------------------- /TradingCoins/TradingApi.Bitfinex/bin/Debug/TradingApi.Bitfinex.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingApi.Bitfinex/bin/Debug/TradingApi.Bitfinex.pdb -------------------------------------------------------------------------------- /TradingCoins/TradingApi.Bitfinex/bin/Debug/TradingApi.ModelObjects.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingApi.Bitfinex/bin/Debug/TradingApi.ModelObjects.dll -------------------------------------------------------------------------------- /TradingCoins/TradingApi.Bitfinex/bin/Debug/TradingApi.ModelObjects.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingApi.Bitfinex/bin/Debug/TradingApi.ModelObjects.pdb -------------------------------------------------------------------------------- /TradingCoins/TradingApi.Bitfinex/bin/Debug/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingApi.Bitfinex/bin/Debug/log4net.dll -------------------------------------------------------------------------------- /TradingCoins/TradingApi.Bitfinex/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingApi.Bitfinex/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /TradingCoins/TradingApi.Bitfinex/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingApi.Bitfinex/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /TradingCoins/TradingApi.Bitfinex/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingApi.Bitfinex/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /TradingCoins/TradingApi.Bitfinex/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingApi.Bitfinex/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /TradingCoins/TradingApi.Bitfinex/obj/Debug/TradingApi.Bitfinex.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | c:\dev\TradingCoins\TradingApi.Bitfinex\bin\Debug\TradingApi.Bitfinex.dll 2 | c:\dev\TradingCoins\TradingApi.Bitfinex\bin\Debug\TradingApi.Bitfinex.pdb 3 | c:\dev\TradingCoins\TradingApi.Bitfinex\bin\Debug\log4net.dll 4 | c:\dev\TradingCoins\TradingApi.Bitfinex\bin\Debug\Newtonsoft.Json.dll 5 | c:\dev\TradingCoins\TradingApi.Bitfinex\bin\Debug\RestSharp.dll 6 | c:\dev\TradingCoins\TradingApi.Bitfinex\bin\Debug\TradingApi.ModelObjects.dll 7 | c:\dev\TradingCoins\TradingApi.Bitfinex\bin\Debug\TradingApi.ModelObjects.pdb 8 | c:\dev\TradingCoins\TradingApi.Bitfinex\bin\Debug\log4net.xml 9 | c:\dev\TradingCoins\TradingApi.Bitfinex\bin\Debug\Newtonsoft.Json.xml 10 | c:\dev\TradingCoins\TradingApi.Bitfinex\bin\Debug\RestSharp.xml 11 | c:\dev\TradingCoins\TradingApi.Bitfinex\obj\Debug\TradingApi.Bitfinex.csprojResolveAssemblyReference.cache 12 | c:\dev\TradingCoins\TradingApi.Bitfinex\obj\Debug\TradingApi.Bitfinex.dll 13 | c:\dev\TradingCoins\TradingApi.Bitfinex\obj\Debug\TradingApi.Bitfinex.pdb 14 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.Bitfinex/obj/Debug/TradingApi.Bitfinex.csprojResolveAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingApi.Bitfinex/obj/Debug/TradingApi.Bitfinex.csprojResolveAssemblyReference.cache -------------------------------------------------------------------------------- /TradingCoins/TradingApi.Bitfinex/obj/Debug/TradingApi.Bitfinex.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingApi.Bitfinex/obj/Debug/TradingApi.Bitfinex.dll -------------------------------------------------------------------------------- /TradingCoins/TradingApi.Bitfinex/obj/Debug/TradingApi.Bitfinex.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingApi.Bitfinex/obj/Debug/TradingApi.Bitfinex.pdb -------------------------------------------------------------------------------- /TradingCoins/TradingApi.Bitfinex/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/BitfinexNewOfferPost.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using TradingApi.ModelObjects.Bitfinex.Json; 7 | 8 | namespace TradingApi.ModelObjects.Bitfinex 9 | { 10 | public class BitfinexNewOfferPost : BitfinexPostBase 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexActiveCreditsResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace TradingApi.ModelObjects.Bitfinex.Json 9 | { 10 | public class BitfinexActiveCreditsResponse 11 | { 12 | 13 | [JsonProperty("id")] 14 | public int Id { get; set; } 15 | 16 | [JsonProperty("currency")] 17 | public string Currency { get; set; } 18 | 19 | [JsonProperty("status")] 20 | public string Status { get; set; } 21 | 22 | [JsonProperty("rate")] 23 | public string Rate { get; set; } 24 | 25 | public decimal DailyRate 26 | { 27 | get 28 | { 29 | if (string.IsNullOrEmpty(Rate)) 30 | return decimal.MinValue; 31 | 32 | var rate = Convert.ToDecimal(Rate); 33 | return rate/365; 34 | } 35 | } 36 | 37 | [JsonProperty("period")] 38 | public int Period { get; set; } 39 | 40 | [JsonProperty("amount")] 41 | public string Amount { get; set; } 42 | 43 | [JsonProperty("timestamp")] 44 | public string Timestamp { get; set; } 45 | 46 | public override string ToString() 47 | { 48 | var str = 49 | string.Format( 50 | "Id: {0}, Currency: {1}, Status: {2}, Rate: {3}, DailyRate: {4}, Period: {5}, Amount: {6}, Timestamp: {7}", 51 | Id, Currency, Status, Rate, DailyRate, Period, Amount, Timestamp); 52 | return str; 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexActiveSwapsInMarginResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace TradingApi.ModelObjects.Bitfinex.Json 9 | { 10 | public class BitfinexActiveSwapsInMarginResponse 11 | { 12 | [JsonProperty("id")] 13 | public int Id { get; set; } 14 | 15 | [JsonProperty("position_id")] 16 | public int PositionId { get; set; } 17 | 18 | [JsonProperty("currency")] 19 | public string Currency { get; set; } 20 | 21 | [JsonProperty("rate")] 22 | public string Rate { get; set; } 23 | 24 | public decimal DailyRate 25 | { 26 | get 27 | { 28 | if (string.IsNullOrEmpty(Rate)) 29 | return decimal.MinValue; 30 | 31 | var rate = Convert.ToDecimal(Rate); 32 | return rate / 365; 33 | } 34 | } 35 | 36 | [JsonProperty("period")] 37 | public int Period { get; set; } 38 | 39 | [JsonProperty("amount")] 40 | public string Amount { get; set; } 41 | 42 | [JsonProperty("timestamp")] 43 | public string Timestamp { get; set; } 44 | 45 | public override string ToString() 46 | { 47 | var str = 48 | string.Format( 49 | "Id: {0}, PositionId: {1}, Currency: {2}, Rate: {3}, Daily Rate: {4}, Period: {5}, Amount: {6}, Timestamp: {7}", 50 | Id, PositionId, Currency, Rate, DailyRate, Period, Amount, Timestamp); 51 | return str; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexBalanceResponse.cs: -------------------------------------------------------------------------------- 1 | // Generated by Xamasoft JSON Class Generator 2 | // http://www.xamasoft.com/json-class-generator 3 | 4 | using Newtonsoft.Json; 5 | 6 | namespace TradingApi.ModelObjects.Bitfinex.Json 7 | { 8 | public class BitfinexBalanceResponse 9 | { 10 | [JsonProperty("type")] 11 | public string Type { get; set; } 12 | 13 | [JsonProperty("currency")] 14 | public string Currency { get; set; } 15 | 16 | [JsonProperty("amount")] 17 | public decimal Amount { get; set; } 18 | 19 | [JsonProperty("available")] 20 | public decimal Available { get; set; } 21 | 22 | public override string ToString() 23 | { 24 | var str = string.Format("Type: {0}, Currency: {1}, Amount: {2}, Available: {3}", Type, Currency, Amount,Available); 25 | return str; 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexCancelMultipleOrderPost.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace TradingApi.ModelObjects.Bitfinex.Json 9 | { 10 | public class BitfinexCancelMultipleOrderPost : BitfinexPostBase 11 | { 12 | [JsonProperty("order_ids")] 13 | public int[] OrderIds { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexCancelOrderPost.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace TradingApi.ModelObjects.Bitfinex.Json 9 | { 10 | public class BitfinexCancelOrderPost : BitfinexPostBase 11 | { 12 | [JsonProperty("order_id")] 13 | public int OrderId { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexCancelReplaceOrderResponse.cs: -------------------------------------------------------------------------------- 1 | namespace TradingApi.ModelObjects.Bitfinex.Json 2 | { 3 | public class BitfinexCancelReplaceOrderResponse : BitfinexNewOrderResponse 4 | { 5 | public int OriginalOrderId { get; set; } 6 | 7 | public override string ToString() 8 | { 9 | var str = string.Format("Cancel Replace (Id: {0}) Symb:{1} {2} Sz:{3} - Px:{4}. Original Order Id: {13} (Type:{5}, IsLive:{6}, Executed Amt:{7} - OrderId: {8})" + 10 | "(IsCancelled: {9}, WasForced: {10}, RemainingAmount: {11}, ExecutedAmount: {12})", 11 | Id, Symbol, Side, OriginalAmount, Price, Type, IsLive, ExecutedAmount, OrderId, 12 | IsCancelled, WasForced, RemainingAmount, ExecutedAmount, OriginalOrderId); 13 | return str; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexCancelReplacePost.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace TradingApi.ModelObjects.Bitfinex.Json 9 | { 10 | public class BitfinexCancelReplacePost : BitfinexNewOrderPost 11 | { 12 | [JsonProperty("order_id")] 13 | public int CancelOrderId { get; set; } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexClaimPositionPost.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace TradingApi.ModelObjects.Bitfinex.Json 9 | { 10 | public class BitfinexClaimPositionPost : BitfinexPostBase 11 | { 12 | [JsonProperty("position_id")] 13 | public int PositionId { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexCloseSwapPost.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace TradingApi.ModelObjects.Bitfinex.Json 4 | { 5 | public class BitfinexCloseSwapPost : BitfinexPostBase 6 | { 7 | [JsonProperty("swap_id")] 8 | public int SwapId { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexDepositPost.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace TradingApi.ModelObjects.Bitfinex.Json 9 | { 10 | public class BitfinexDepositPost : BitfinexPostBase 11 | { 12 | [JsonProperty("currency")] 13 | public string Currency { get; set; } 14 | 15 | [JsonProperty("method")] 16 | public string Method { get; set; } 17 | 18 | [JsonProperty("wallet_name")] 19 | public string WalletName { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexDepositResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace TradingApi.ModelObjects.Bitfinex.Json 9 | { 10 | public class BitfinexDepositResponse 11 | { 12 | [JsonProperty("result")] 13 | public string Result { get; set; } 14 | 15 | [JsonProperty("method")] 16 | public string Method { get; set; } 17 | 18 | [JsonProperty("currency")] 19 | public string Currency { get; set; } 20 | 21 | [JsonProperty("address")] 22 | public string Address { get; set; } 23 | 24 | public override string ToString() 25 | { 26 | var str = string.Format("Result: {0}, Method: {1}, Currency: {2}, Address: {3}",Result,Method,Currency,Address); 27 | return str; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexHistoryPost.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace TradingApi.ModelObjects.Bitfinex.Json 9 | { 10 | public class BitfinexHistoryPost : BitfinexPostBase 11 | { 12 | [JsonProperty("currency")] 13 | public string Currency { get; set; } 14 | 15 | [JsonProperty("since")] 16 | public string Since { get; set; } 17 | 18 | [JsonProperty("until")] 19 | public string Until { get; set; } 20 | 21 | [JsonProperty("limit")] 22 | public int Limit { get; set; } 23 | 24 | [JsonProperty("wallet")] 25 | public string Wallet { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexHistoryResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace TradingApi.ModelObjects.Bitfinex.Json 9 | { 10 | public class BitfinexHistoryResponse 11 | { 12 | [JsonProperty("currency")] 13 | public string Currency { get; set; } 14 | 15 | [JsonProperty("amount")] 16 | public string Amount { get; set; } 17 | 18 | [JsonProperty("balance")] 19 | public string Balance { get; set; } 20 | 21 | [JsonProperty("description")] 22 | public string Description { get; set; } 23 | 24 | [JsonProperty("timestamp")] 25 | public string Timestamp { get; set; } 26 | 27 | public override string ToString() 28 | { 29 | var str = string.Format("Currency: {0}, Amount: {1}, Balance: {2}, Desc: {3}, Timestamp: {4}", 30 | Currency,Amount,Balance,Description,Timestamp); 31 | return str; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexLendbookResponse.cs: -------------------------------------------------------------------------------- 1 |  2 | using Newtonsoft.Json; 3 | using TradingApi.ModelObjects.Bitfinex.Json.LendbookTypes; 4 | 5 | namespace TradingApi.ModelObjects.Bitfinex.Json 6 | { 7 | public class BitfinexLendbookResponse 8 | { 9 | [JsonProperty("bids")] 10 | public Bid[] Bids { get; set; } 11 | 12 | [JsonProperty("asks")] 13 | public Ask[] Asks { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexLendsResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace TradingApi.ModelObjects.Bitfinex.Json 9 | { 10 | public class BitfinexLendsResponse 11 | { 12 | [JsonProperty("rate")] 13 | public string Rate { get; set; } 14 | 15 | [JsonProperty("amount_lent")] 16 | public string AmountLent { get; set; } 17 | 18 | [JsonProperty("timestamp")] 19 | public int Timestamp { get; set; } 20 | 21 | public override string ToString() 22 | { 23 | var str = string.Format("Rate: {0}, AmountLent: {1}, Timestamp: {2}", Rate, AmountLent, Timestamp); 24 | return str; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexMarginInfoResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | using TradingApi.ModelObjects.Bitfinex.Json.MarginInfoTypes; 8 | 9 | namespace TradingApi.ModelObjects.Bitfinex.Json 10 | { 11 | public class BitfinexMarginInfoResponse 12 | { 13 | 14 | [JsonProperty("margin_balance")] 15 | public string MarginBalance { get; set; } 16 | 17 | [JsonProperty("tradable_balance")] 18 | public string TradableBalance { get; set; } 19 | 20 | [JsonProperty("unrealized_pl")] 21 | public string UnrealizedPl { get; set; } 22 | 23 | [JsonProperty("unrealized_swap")] 24 | public string UnrealizedSwap { get; set; } 25 | 26 | [JsonProperty("net_value")] 27 | public string NetValue { get; set; } 28 | 29 | [JsonProperty("required_margin")] 30 | public string RequiredMargin { get; set; } 31 | 32 | [JsonProperty("leverage")] 33 | public string Leverage { get; set; } 34 | 35 | [JsonProperty("margin_requirement")] 36 | public string MarginRequirement { get; set; } 37 | 38 | [JsonProperty("margin_limits")] 39 | public MarginLimit[] MarginLimits { get; set; } 40 | 41 | [JsonProperty("message")] 42 | public string Message { get; set; } 43 | 44 | public override string ToString() 45 | { 46 | var str = string.Format("MarginBalance: {0}, TradeableBalance: {1}, UnrealizedPl: {2}" + 47 | "UnrealizedSwap: {3}, NetValue: {4}, RequiredMargin: {5}, Leverage: {6}" + 48 | "MarginRequirement: {7}, Message: {8}", MarginBalance, TradableBalance, UnrealizedPl, 49 | UnrealizedSwap, NetValue, RequiredMargin, Leverage, MarginRequirement, Message); 50 | return str; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexMarginPositionResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace TradingApi.ModelObjects.Bitfinex.Json 9 | { 10 | public class BitfinexMarginPositionResponse 11 | { 12 | [JsonProperty("id")] 13 | public int Id { get; set; } 14 | 15 | [JsonProperty("symbol")] 16 | public string Symbol { get; set; } 17 | 18 | [JsonProperty("status")] 19 | public string Status { get; set; } 20 | 21 | [JsonProperty("base")] 22 | public string Base { get; set; } 23 | 24 | [JsonProperty("amount")] 25 | public string Amount { get; set; } 26 | 27 | [JsonProperty("timestamp")] 28 | public string Timestamp { get; set; } 29 | 30 | [JsonProperty("swap")] 31 | public string Swap { get; set; } 32 | 33 | [JsonProperty("pl")] 34 | public string Pl { get; set; } 35 | 36 | public override string ToString() 37 | { 38 | var str = string.Format("Id: {0}, Symbol: {1}, Status: {2}, Base: {3}, Amount: {4}, Timestamp: {5}" + 39 | "Swap: {6}, Pl: {7}", Id, Symbol, Status, Base, Amount, Timestamp, Swap, Pl); 40 | return str; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexMultipleNewOrderResponse.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using TradingApi.ModelObjects.Bitfinex.Json.MultipleOrderTypes; 3 | 4 | namespace TradingApi.ModelObjects.Bitfinex.Json 5 | { 6 | public class BitfinexMultipleNewOrderResponse 7 | { 8 | [JsonProperty("order_ids")] 9 | public OrderId[] OrderIds { get; set; } 10 | 11 | [JsonProperty("status")] 12 | public string Status { get; set; } 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexMultipleNewOrdersPost.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace TradingApi.ModelObjects.Bitfinex.Json 9 | { 10 | public class BitfinexMultipleNewOrdersPost : BitfinexPostBase 11 | { 12 | [JsonProperty("orders")] 13 | public BitfinexNewOrderPost[] Orders { get; set; } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexMyTradesPost.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace TradingApi.ModelObjects.Bitfinex.Json 9 | { 10 | public class BitfinexMyTradesPost : BitfinexPostBase 11 | { 12 | [JsonProperty("symbol")] 13 | public string Symbol { get; set; } 14 | 15 | [JsonProperty("timestamp")] 16 | public string Timestamp { get; set; } 17 | 18 | [JsonProperty("limit_trades")] 19 | public int Limit { get; set; } 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexMyTradesResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace TradingApi.ModelObjects.Bitfinex.Json 9 | { 10 | public class BitfinexMyTradesResponse 11 | { 12 | [JsonProperty("price")] 13 | public string Price { get; set; } 14 | 15 | [JsonProperty("amount")] 16 | public string Amount { get; set; } 17 | 18 | [JsonProperty("timestamp")] 19 | public string Timestamp { get; set; } 20 | 21 | [JsonProperty("exchange")] 22 | public string Exchange { get; set; } 23 | 24 | [JsonProperty("type")] 25 | public string Type { get; set; } 26 | 27 | [JsonProperty("fee_currency")] 28 | public string FeeCurrency { get; set; } 29 | 30 | [JsonProperty("fee_amount")] 31 | public string FeeAmount { get; set; } 32 | 33 | [JsonProperty("tid")] 34 | public int Tid { get; set; } 35 | 36 | [JsonProperty("order_id")] 37 | public int OrderId { get; set; } 38 | 39 | public override string ToString() 40 | { 41 | var str = 42 | string.Format( 43 | "Price: {0}, Amount: {1}, Timestamp: {2}, Exchange: {3}, Type: {4}, FeeCurrency: {5}, FeeAmount: {6}, Tid: {7}, OrderId: {8}", 44 | Price, Amount, Timestamp, Exchange, Type, FeeCurrency, FeeAmount, Tid, OrderId); 45 | return str; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexNewOfferPost.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace TradingApi.ModelObjects.Bitfinex.Json 9 | { 10 | public class BitfinexNewOfferPost : BitfinexPostBase 11 | { 12 | [JsonProperty("currency")] 13 | public string Currency { get; set; } 14 | 15 | [JsonProperty("amount")] 16 | public string Amount { get; set; } 17 | 18 | [JsonProperty("rate")] 19 | public string Rate { get; set; } 20 | 21 | public decimal DailyRate 22 | { 23 | get 24 | { 25 | if (string.IsNullOrEmpty(Rate)) 26 | return decimal.MinValue; 27 | 28 | var rate = Convert.ToDecimal(Rate); 29 | return rate / 365; 30 | } 31 | } 32 | [JsonProperty("period")] 33 | public int Period { get; set; } 34 | 35 | [JsonProperty("direction")] 36 | public string Direction { get; set; } 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexNewOrderPost.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace TradingApi.ModelObjects.Bitfinex.Json 4 | { 5 | public class BitfinexNewOrderPost : BitfinexPostBase 6 | { 7 | [JsonProperty("symbol")] 8 | public string Symbol { get; set; } 9 | 10 | [JsonProperty("amount")] 11 | public string Amount { get; set; } 12 | 13 | [JsonProperty("price")] 14 | public string Price { get; set; } 15 | 16 | [JsonProperty("exchange")] 17 | public string Exchange { get; set; } 18 | 19 | [JsonProperty("side")] 20 | public string Side { get; set; } 21 | 22 | [JsonProperty("type")] 23 | public string Type { get; set; } 24 | 25 | //[JsonProperty("is_hidden")] 26 | //public string IsHidden { get; set; } 27 | 28 | public override string ToString() 29 | { 30 | var str = string.Format("Symbol: {0}, Amount: {1}, Price: {2}, Exchange: {3}, Side: {4}, Type: {5}", 31 | Symbol,Amount,Price,Exchange,Side,Type); 32 | return str; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexNewOrderResponse.cs: -------------------------------------------------------------------------------- 1 | // Generated by Xamasoft JSON Class Generator 2 | // http://www.xamasoft.com/json-class-generator 3 | 4 | using Newtonsoft.Json; 5 | 6 | namespace TradingApi.ModelObjects.Bitfinex.Json 7 | { 8 | public class BitfinexNewOrderResponse 9 | { 10 | [JsonProperty("id")] 11 | public int Id { get; set; } 12 | 13 | [JsonProperty("symbol")] 14 | public string Symbol { get; set; } 15 | 16 | [JsonProperty("exchange")] 17 | public string Exchange { get; set; } 18 | 19 | [JsonProperty("price")] 20 | public string Price { get; set; } 21 | 22 | [JsonProperty("avg_execution_price")] 23 | public string AvgExecutionPrice { get; set; } 24 | 25 | [JsonProperty("side")] 26 | public string Side { get; set; } 27 | 28 | [JsonProperty("type")] 29 | public string Type { get; set; } 30 | 31 | [JsonProperty("timestamp")] 32 | public string Timestamp { get; set; } 33 | 34 | [JsonProperty("is_live")] 35 | public bool IsLive { get; set; } 36 | 37 | [JsonProperty("is_cancelled")] 38 | public bool IsCancelled { get; set; } 39 | 40 | [JsonProperty("was_forced")] 41 | public bool WasForced { get; set; } 42 | 43 | [JsonProperty("original_amount")] 44 | public string OriginalAmount { get; set; } 45 | 46 | [JsonProperty("remaining_amount")] 47 | public string RemainingAmount { get; set; } 48 | 49 | [JsonProperty("executed_amount")] 50 | public string ExecutedAmount { get; set; } 51 | 52 | [JsonProperty("order_id")] 53 | public int OrderId { get; set; } 54 | 55 | public override string ToString() 56 | { 57 | var str = string.Format("New Order (Id: {0}) Symb:{1} {2} Sz:{3} - Px:{4}. (Type:{5}, IsLive:{6}, Executed Amt:{7} - OrderId: {8})" + 58 | "(IsCancelled: {9}, WasForced: {10}, RemainingAmount: {11}, ExecutedAmount: {12})", 59 | Id, Symbol, Side, OriginalAmount, Price, Type, IsLive, ExecutedAmount, OrderId, 60 | IsCancelled, WasForced, RemainingAmount, ExecutedAmount); 61 | return str; 62 | } 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexOfferStatusPost.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace TradingApi.ModelObjects.Bitfinex.Json 4 | { 5 | public class BitfinexOfferStatusPost : BitfinexPostBase 6 | { 7 | [JsonProperty("offer_id")] 8 | public int OfferId { get; set; } 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexOfferStatusResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace TradingApi.ModelObjects.Bitfinex.Json 9 | { 10 | public class BitfinexOfferStatusResponse 11 | { 12 | 13 | [JsonProperty("id")] 14 | public int Id { get; set; } 15 | 16 | [JsonProperty("currency")] 17 | public string Currency { get; set; } 18 | 19 | [JsonProperty("rate")] 20 | public string Rate { get; set; } 21 | 22 | public decimal DailyRate 23 | { 24 | get 25 | { 26 | if (string.IsNullOrEmpty(Rate)) 27 | return decimal.MinValue; 28 | 29 | var rate = Convert.ToDecimal(Rate); 30 | return rate / 365; 31 | } 32 | } 33 | 34 | [JsonProperty("period")] 35 | public int Period { get; set; } 36 | 37 | [JsonProperty("direction")] 38 | public string Direction { get; set; } 39 | 40 | [JsonProperty("timestamp")] 41 | public string Timestamp { get; set; } 42 | 43 | [JsonProperty("is_live")] 44 | public bool IsLive { get; set; } 45 | 46 | [JsonProperty("is_cancelled")] 47 | public bool IsCancelled { get; set; } 48 | 49 | [JsonProperty("original_amount")] 50 | public string OriginalAmount { get; set; } 51 | 52 | [JsonProperty("remaining_amount")] 53 | public string RemainingAmount { get; set; } 54 | 55 | [JsonProperty("executed_amount")] 56 | public string ExecutedAmount { get; set; } 57 | 58 | [JsonProperty("offer_id")] 59 | public int OfferId { get; set; } 60 | 61 | public override string ToString() 62 | { 63 | var str = 64 | string.Format( 65 | "Id: {0}, Currency: {1}, Rate: {2}, Period: {3}, Direction: {4}, Timestamp: {5}, IsLive: {6}" + 66 | "IsCancelled: {7}, OrigAmount: {8}, RemainingAmt: {9}, ExeAmt: {10}, OfferId: {11}", 67 | Id,Currency,Rate,Period,Direction,Timestamp,IsLive,IsCancelled,OriginalAmount,RemainingAmount, 68 | ExecutedAmount,OfferId); 69 | return str; 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexOrderBookGet.cs: -------------------------------------------------------------------------------- 1 | // Generated by Xamasoft JSON Class Generator 2 | // http://www.xamasoft.com/json-class-generator 3 | 4 | using Newtonsoft.Json; 5 | using TradingApi.ModelObjects.Bitfinex.Json.OrderbookTypes; 6 | 7 | namespace TradingApi.ModelObjects.Bitfinex.Json 8 | { 9 | 10 | public class BitfinexOrderBookGet 11 | { 12 | 13 | [JsonProperty("bids")] 14 | public Bid[] Bids { get; set; } 15 | 16 | [JsonProperty("asks")] 17 | public Ask[] Asks { get; set; } 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexOrderStatusPost.cs: -------------------------------------------------------------------------------- 1 |  2 | using Newtonsoft.Json; 3 | 4 | namespace TradingApi.ModelObjects.Bitfinex.Json 5 | { 6 | public class BitfinexOrderStatusPost : BitfinexPostBase 7 | { 8 | /// 9 | /// This class can be used to send a cancel message in addition to 10 | /// retrieving the current status of an order. 11 | /// 12 | [JsonProperty("order_id")] 13 | public int OrderId { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexOrderStatusResponse.cs: -------------------------------------------------------------------------------- 1 | // Generated by Xamasoft JSON Class Generator 2 | // http://www.xamasoft.com/json-class-generator 3 | 4 | using Newtonsoft.Json; 5 | 6 | namespace TradingApi.ModelObjects.Bitfinex.Json 7 | { 8 | 9 | public class BitfinexOrderStatusResponse 10 | { 11 | 12 | [JsonProperty("id")] 13 | public int Id { get; set; } 14 | 15 | [JsonProperty("symbol")] 16 | public string Symbol { get; set; } 17 | 18 | [JsonProperty("exchange")] 19 | public string Exchange { get; set; } 20 | 21 | [JsonProperty("price")] 22 | public string Price { get; set; } 23 | 24 | [JsonProperty("avg_execution_price")] 25 | public string AvgExecutionPrice { get; set; } 26 | 27 | [JsonProperty("side")] 28 | public string Side { get; set; } 29 | 30 | [JsonProperty("type")] 31 | public string Type { get; set; } 32 | 33 | [JsonProperty("timestamp")] 34 | public string Timestamp { get; set; } 35 | 36 | [JsonProperty("is_live")] 37 | public bool IsLive { get; set; } 38 | 39 | [JsonProperty("is_cancelled")] 40 | public bool IsCancelled { get; set; } 41 | 42 | [JsonProperty("was_forced")] 43 | public bool WasForced { get; set; } 44 | 45 | [JsonProperty("original_amount")] 46 | public string OriginalAmount { get; set; } 47 | 48 | [JsonProperty("remaining_amount")] 49 | public string RemainingAmount { get; set; } 50 | 51 | [JsonProperty("executed_amount")] 52 | public string ExecutedAmount { get; set; } 53 | 54 | public override string ToString() 55 | { 56 | var str = string.Format("(Id: {0}) Symb:{1} {2} Sz:{3} - Px:{4}. (Type:{5}, IsLive:{6}, Executed Amt:{7})" + 57 | "(IsCancelled: {8}, WasForced: {9}, RemainingAmount: {10}, ExecutedAmount: {11})", 58 | Id, Symbol, Side, OriginalAmount, Price, Type, IsLive, ExecutedAmount, IsCancelled, 59 | WasForced, RemainingAmount, ExecutedAmount); 60 | return str; 61 | } 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexPostBase.cs: -------------------------------------------------------------------------------- 1 | // Generated by Xamasoft JSON Class Generator 2 | // http://www.xamasoft.com/json-class-generator 3 | 4 | using Newtonsoft.Json; 5 | 6 | namespace TradingApi.ModelObjects.Bitfinex.Json 7 | { 8 | 9 | public class BitfinexPostBase 10 | { 11 | [JsonProperty("request")] 12 | public string Request { get; set; } 13 | 14 | [JsonProperty("nonce")] 15 | public string Nonce { get; set; } 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexPublicTickerGet.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace TradingApi.ModelObjects.Bitfinex.Json 9 | { 10 | public class BitfinexPublicTickerGet 11 | { 12 | 13 | [JsonProperty("mid")] 14 | public string Mid { get; set; } 15 | 16 | [JsonProperty("bid")] 17 | public string Bid { get; set; } 18 | 19 | [JsonProperty("ask")] 20 | public string Ask { get; set; } 21 | 22 | [JsonProperty("last_price")] 23 | public string LastPrice { get; set; } 24 | 25 | [JsonProperty("low")] 26 | public string Low { get; set; } 27 | 28 | [JsonProperty("high")] 29 | public string High { get; set; } 30 | 31 | [JsonProperty("volume")] 32 | public string Volume { get; set; } 33 | 34 | [JsonProperty("timestamp")] 35 | public string Timestamp { get; set; } 36 | 37 | public override string ToString() 38 | { 39 | var str = string.Format("mid: {0}, bid: {1}, ask: {2}, last: {3}, low: {4}, high: {5} volume: {6}, timestamp: {7}", 40 | Mid, Bid, Ask, LastPrice, Low, High, Volume, Timestamp); 41 | return str; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexSymbolStatsResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace TradingApi.ModelObjects.Bitfinex.Json 9 | { 10 | public class BitfinexSymbolStatsResponse 11 | { 12 | [JsonProperty("period")] 13 | public int Period { get; set; } 14 | 15 | [JsonProperty("volume")] 16 | public string Volume { get; set; } 17 | 18 | public override string ToString() 19 | { 20 | var str = string.Format("Period: {0}, Volume: {1}", Period, Volume); 21 | return str; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexSymbolsDetailsResponse.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace TradingApi.ModelObjects.Bitfinex.Json 4 | { 5 | public class BitfinexSymbolDetailsResponse 6 | { 7 | 8 | [JsonProperty("pair")] 9 | public string Pair { get; set; } 10 | 11 | [JsonProperty("price_precision")] 12 | public int PricePrecision { get; set; } 13 | 14 | [JsonProperty("initial_margin")] 15 | public string InitialMargin { get; set; } 16 | 17 | [JsonProperty("minimum_margin")] 18 | public string MinimumMargin { get; set; } 19 | 20 | [JsonProperty("maximum_order_size")] 21 | public string MaximumOrderSize { get; set; } 22 | 23 | [JsonProperty("minimum_order_size")] 24 | public string MinimumOrderSize { get; set; } 25 | 26 | [JsonProperty("expiration")] 27 | public string Expiration { get; set; } 28 | 29 | public override string ToString() 30 | { 31 | var str = string.Format("Pair: {0}, PricePrecision: {1}, InitialMargin: {2}, MinimumMargin: {3}, MaxOrderSize: {4}, MinOrderSize: {5}, Expiration: {6}", 32 | Pair,PricePrecision,InitialMargin,MinimumMargin,MaximumOrderSize,MinimumOrderSize,Expiration); 33 | return str; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/BitfinexTradesGet.cs: -------------------------------------------------------------------------------- 1 | // Generated by Xamasoft JSON Class Generator 2 | // http://www.xamasoft.com/json-class-generator 3 | 4 | using Newtonsoft.Json; 5 | 6 | namespace TradingApi.ModelObjects.Bitfinex.Json 7 | { 8 | 9 | public class BitfinexTradesGet 10 | { 11 | 12 | [JsonProperty("timestamp")] 13 | public int Timestamp { get; set; } 14 | 15 | [JsonProperty("tid")] 16 | public int Tid { get; set; } 17 | 18 | [JsonProperty("price")] 19 | public string Price { get; set; } 20 | 21 | [JsonProperty("amount")] 22 | public string Amount { get; set; } 23 | 24 | [JsonProperty("exchange")] 25 | public string Exchange { get; set; } 26 | 27 | [JsonProperty("type")] 28 | public string Type { get; set; } 29 | 30 | public override string ToString() 31 | { 32 | var str = string.Format("Timestamp: {0} - tid: {1}, Price: {2}, Amount: {3}, Exchange: {4}, Type: {5}", 33 | Timestamp, Tid, Price, Amount, Exchange, Type); 34 | return base.ToString(); 35 | } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/ErrorResponse.cs: -------------------------------------------------------------------------------- 1 | // Generated by Xamasoft JSON Class Generator 2 | // http://www.xamasoft.com/json-class-generator 3 | 4 | using Newtonsoft.Json; 5 | 6 | namespace TradingApi.ModelObjects.Bitfinex.Json 7 | { 8 | public class ErrorResponse 9 | { 10 | [JsonProperty("message")] 11 | public string Message { get; set; } 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/LendbookTypes/Ask.cs: -------------------------------------------------------------------------------- 1 | // Generated by Xamasoft JSON Class Generator 2 | // http://www.xamasoft.com/json-class-generator 3 | 4 | using Newtonsoft.Json; 5 | 6 | namespace TradingApi.ModelObjects.Bitfinex.Json.LendbookTypes 7 | { 8 | 9 | public class Ask 10 | { 11 | 12 | [JsonProperty("rate")] 13 | public string Rate { get; set; } 14 | 15 | [JsonProperty("amount")] 16 | public string Amount { get; set; } 17 | 18 | [JsonProperty("period")] 19 | public int Period { get; set; } 20 | 21 | [JsonProperty("timestamp")] 22 | public string Timestamp { get; set; } 23 | 24 | [JsonProperty("frr")] 25 | public string Frr { get; set; } 26 | 27 | public override string ToString() 28 | { 29 | var str = string.Format("Ask - Rate: {0}, Amount: {1}, Period: {2}, Timestamp: {3}, Frr: {4}", 30 | Rate, Amount, Period, Timestamp, Frr); 31 | return str; 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/LendbookTypes/Bid.cs: -------------------------------------------------------------------------------- 1 | // Generated by Xamasoft JSON Class Generator 2 | // http://www.xamasoft.com/json-class-generator 3 | 4 | using Newtonsoft.Json; 5 | 6 | namespace TradingApi.ModelObjects.Bitfinex.Json.LendbookTypes 7 | { 8 | 9 | public class Bid 10 | { 11 | 12 | [JsonProperty("rate")] 13 | public string Rate { get; set; } 14 | 15 | [JsonProperty("amount")] 16 | public string Amount { get; set; } 17 | 18 | [JsonProperty("period")] 19 | public int Period { get; set; } 20 | 21 | [JsonProperty("timestamp")] 22 | public string Timestamp { get; set; } 23 | 24 | [JsonProperty("frr")] 25 | public string Frr { get; set; } 26 | 27 | public override string ToString() 28 | { 29 | var str = string.Format("Bid - Rate: {0}, Amount: {1}, Period: {2}, Timestamp: {3}, Frr: {4}", 30 | Rate, Amount, Period, Timestamp, Frr); 31 | return str; 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/MarginInfoTypes/MarginLimit.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace TradingApi.ModelObjects.Bitfinex.Json.MarginInfoTypes 9 | { 10 | public class MarginLimit 11 | { 12 | [JsonProperty("on_pair")] 13 | public string OnPair { get; set; } 14 | 15 | [JsonProperty("initial_margin")] 16 | public string InitialMargin { get; set; } 17 | 18 | [JsonProperty("margin_requirement")] 19 | public string MarginRequirement { get; set; } 20 | 21 | [JsonProperty("tradable_balance")] 22 | public string TradableBalance { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/MultipleOrderTypes/OrderId.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Newtonsoft.Json; 7 | 8 | namespace TradingApi.ModelObjects.Bitfinex.Json.MultipleOrderTypes 9 | { 10 | public class OrderId 11 | { 12 | [JsonProperty("active")] 13 | public int Active { get; set; } 14 | 15 | [JsonProperty("amount")] 16 | public string Amount { get; set; } 17 | 18 | [JsonProperty("avg_price")] 19 | public string AvgPrice { get; set; } 20 | 21 | [JsonProperty("created_at")] 22 | public string CreatedAt { get; set; } 23 | 24 | [JsonProperty("fiat_currency")] 25 | public string FiatCurrency { get; set; } 26 | 27 | [JsonProperty("hidden")] 28 | public bool Hidden { get; set; } 29 | 30 | [JsonProperty("id")] 31 | public int Id { get; set; } 32 | 33 | [JsonProperty("lockedperiod")] 34 | public object Lockedperiod { get; set; } 35 | 36 | [JsonProperty("maxrate")] 37 | public string Maxrate { get; set; } 38 | 39 | [JsonProperty("nopayback")] 40 | public object Nopayback { get; set; } 41 | 42 | [JsonProperty("notify")] 43 | public int Notify { get; set; } 44 | 45 | [JsonProperty("originalamount")] 46 | public string Originalamount { get; set; } 47 | 48 | [JsonProperty("pair")] 49 | public string Pair { get; set; } 50 | 51 | [JsonProperty("placed_id")] 52 | public object PlacedId { get; set; } 53 | 54 | [JsonProperty("placed_trades")] 55 | public object PlacedTrades { get; set; } 56 | 57 | [JsonProperty("price")] 58 | public string Price { get; set; } 59 | 60 | [JsonProperty("routing")] 61 | public string Routing { get; set; } 62 | 63 | [JsonProperty("status")] 64 | public string Status { get; set; } 65 | 66 | [JsonProperty("trailingprice")] 67 | public string Trailingprice { get; set; } 68 | 69 | [JsonProperty("type")] 70 | public string Type { get; set; } 71 | 72 | [JsonProperty("updated_at")] 73 | public string UpdatedAt { get; set; } 74 | 75 | [JsonProperty("user_id")] 76 | public int UserId { get; set; } 77 | 78 | [JsonProperty("vir")] 79 | public int Vir { get; set; } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/OrderbookTypes/Ask.cs: -------------------------------------------------------------------------------- 1 | // Generated by Xamasoft JSON Class Generator 2 | // http://www.xamasoft.com/json-class-generator 3 | 4 | using Newtonsoft.Json; 5 | 6 | namespace TradingApi.ModelObjects.Bitfinex.Json.OrderbookTypes 7 | { 8 | public class Ask 9 | { 10 | 11 | [JsonProperty("price")] 12 | public decimal Price { get; set; } 13 | 14 | [JsonProperty("amount")] 15 | public decimal Amount { get; set; } 16 | 17 | [JsonProperty("timestamp")] 18 | public string Timestamp { get; set; } 19 | 20 | public override string ToString() 21 | { 22 | var str = string.Format("Ask - Price: {0}, Amount: {1} - Timestamp: {2}", Price, Amount, Timestamp); 23 | return str; 24 | } 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Bitfinex/Json/OrderbookTypes/Bid.cs: -------------------------------------------------------------------------------- 1 | // Generated by Xamasoft JSON Class Generator 2 | // http://www.xamasoft.com/json-class-generator 3 | 4 | using Newtonsoft.Json; 5 | 6 | namespace TradingApi.ModelObjects.Bitfinex.Json.OrderbookTypes 7 | { 8 | public class Bid 9 | { 10 | 11 | [JsonProperty("price")] 12 | public decimal Price { get; set; } 13 | 14 | [JsonProperty("amount")] 15 | public decimal Amount { get; set; } 16 | 17 | [JsonProperty("timestamp")] 18 | public string Timestamp { get; set; } 19 | 20 | public override string ToString() 21 | { 22 | var str = string.Format("Bid - Price: {0}, Amount: {1} - Timestamp: {2}", Price, Amount, Timestamp); 23 | return str; 24 | } 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/BtcInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TradingApi.ModelObjects 4 | { 5 | public static class BtcInfo 6 | { 7 | static BtcInfo() 8 | { 9 | SymbolMapHelper = new Dictionary(); 10 | SymbolMapHelper.Add(ExchangeSymbolEnum.btc,ExchangeSymbolNameEnum.bitcoin); 11 | SymbolMapHelper.Add(ExchangeSymbolEnum.ltc, ExchangeSymbolNameEnum.litecoin); 12 | SymbolMapHelper.Add(ExchangeSymbolEnum.drk, ExchangeSymbolNameEnum.darkcoin); 13 | } 14 | 15 | public static Dictionary SymbolMapHelper; 16 | 17 | public enum PairTypeEnum 18 | { 19 | ltcbtc = 0, 20 | btcusd = 1, 21 | ltcusd = 2 22 | } 23 | 24 | public enum ExchangeSymbolEnum 25 | { 26 | ltc = 0, 27 | btc = 1, 28 | usd = 2, 29 | drk = 3 30 | } 31 | 32 | public enum ExchangeSymbolNameEnum 33 | { 34 | bitcoin = 0, 35 | litecoin = 1, 36 | darkcoin = 2 37 | } 38 | 39 | public enum ExchangeEnum 40 | { 41 | BITFINEX = 0 42 | } 43 | 44 | public enum BitfinexUnauthenicatedCallsEnum 45 | { 46 | pubticker = 0, 47 | stats = 1, 48 | trades = 2, 49 | } 50 | 51 | public enum BitfinexWalletEnum 52 | { 53 | trading = 0, 54 | exchange = 1, 55 | deposit = 2 56 | } 57 | 58 | public enum OfferDirectionEnum 59 | { 60 | lend = 0, 61 | loan = 1 62 | } 63 | 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/BtcMarketData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TradingApi.ModelObjects 4 | { 5 | public sealed class BtcMarketData 6 | { 7 | public BtcMarketData() 8 | { 9 | _timeStamp = DateTime.Now; 10 | } 11 | 12 | private readonly DateTime _timeStamp; 13 | 14 | public BtcInfo.PairTypeEnum PairType { get; set; } 15 | public decimal FairValue { get; set; } 16 | public decimal BidSz { get; set; } 17 | public decimal Bid { get; set; } 18 | public decimal Ask { get; set; } 19 | public decimal AskSz { get; set; } 20 | public decimal Last { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Remoting.Messaging; 3 | using log4net; 4 | 5 | [assembly: log4net.Config.XmlConfigurator(Watch = true)] 6 | namespace TradingApi.ModelObjects 7 | { 8 | public static class Logger 9 | { 10 | private static readonly ILog _log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 11 | 12 | public static ILog Log 13 | { 14 | get { return _log; } 15 | } 16 | 17 | public static void LogException(Exception ex) 18 | { 19 | _log.Error(ex.Message, ex); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("TradingApi.ModelObjects")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("TradingApi.ModelObjects")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("9b6935e9-153a-4c77-bc94-a90c70048fd3")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/TradingApi.ModelObjects.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {F0F159A5-C5D6-4CBF-B061-7943F8F7BC5A} 8 | Library 9 | Properties 10 | TradingApi.ModelObjects 11 | TradingApi.ModelObjects 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | ..\packages\log4net.2.0.3\lib\net40-full\log4net.dll 35 | 36 | 37 | ..\packages\Newtonsoft.Json.6.0.5\lib\net45\Newtonsoft.Json.dll 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 107 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/TradingApi.ModelObjects.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ProjectFiles 5 | 6 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/Utility/Common.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace TradingApi.ModelObjects.Utility 8 | { 9 | public static class Common 10 | { 11 | public static long UnixTimeStampUtc() 12 | { 13 | Int32 unixTimeStamp; 14 | DateTime currentTime = DateTime.Now; 15 | DateTime dt = currentTime.ToUniversalTime(); 16 | DateTime unixEpoch = new DateTime(1970, 1, 1); 17 | unixTimeStamp = (Int32)(dt.Subtract(unixEpoch)).TotalSeconds; 18 | return unixTimeStamp; 19 | } 20 | 21 | public static double GetTimeStamp(DateTime dt) 22 | { 23 | var unixEpoch = new DateTime(1970, 1, 1); 24 | return dt.Subtract(unixEpoch).TotalSeconds; 25 | } 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/bin/Debug/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingApi.ModelObjects/bin/Debug/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/bin/Debug/TradingApi.ModelObjects.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingApi.ModelObjects/bin/Debug/TradingApi.ModelObjects.dll -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/bin/Debug/TradingApi.ModelObjects.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingApi.ModelObjects/bin/Debug/TradingApi.ModelObjects.pdb -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/bin/Debug/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingApi.ModelObjects/bin/Debug/log4net.dll -------------------------------------------------------------------------------- /TradingCoins/TradingApi.ModelObjects/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /TradingCoins/TradingCoins.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TradingCoins", "TradingCoins\TradingCoins.csproj", "{99B93AE3-1414-4677-B62C-1F5103B52B9C}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cob.TradingApps.BtcData", "Cob.TradingApps.BtcData\Cob.TradingApps.BtcData.csproj", "{63F10178-9E10-4495-B376-08DF3A763E1C}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TradingApi.Bitfinex", "TradingApi.Bitfinex\TradingApi.Bitfinex.csproj", "{1C6AFC5B-4C6D-4F88-97FF-5845D45E94C7}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TradingApi.ModelObjects", "TradingApi.ModelObjects\TradingApi.ModelObjects.csproj", "{F0F159A5-C5D6-4CBF-B061-7943F8F7BC5A}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {99B93AE3-1414-4677-B62C-1F5103B52B9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {99B93AE3-1414-4677-B62C-1F5103B52B9C}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {99B93AE3-1414-4677-B62C-1F5103B52B9C}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {99B93AE3-1414-4677-B62C-1F5103B52B9C}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {63F10178-9E10-4495-B376-08DF3A763E1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {63F10178-9E10-4495-B376-08DF3A763E1C}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {63F10178-9E10-4495-B376-08DF3A763E1C}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {63F10178-9E10-4495-B376-08DF3A763E1C}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {1C6AFC5B-4C6D-4F88-97FF-5845D45E94C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {1C6AFC5B-4C6D-4F88-97FF-5845D45E94C7}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {1C6AFC5B-4C6D-4F88-97FF-5845D45E94C7}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {1C6AFC5B-4C6D-4F88-97FF-5845D45E94C7}.Release|Any CPU.Build.0 = Release|Any CPU 30 | {F0F159A5-C5D6-4CBF-B061-7943F8F7BC5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {F0F159A5-C5D6-4CBF-B061-7943F8F7BC5A}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {F0F159A5-C5D6-4CBF-B061-7943F8F7BC5A}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {F0F159A5-C5D6-4CBF-B061-7943F8F7BC5A}.Release|Any CPU.Build.0 = Release|Any CPU 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | EndGlobal 39 | -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/Controls/ExchangeAcctCtrl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace TradingCoins.Controls 2 | { 3 | partial class ExchangeAcctCtrl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.gbAcctInfo = new System.Windows.Forms.GroupBox(); 32 | this.btnSendMultiple = new System.Windows.Forms.Button(); 33 | this.txtBalances = new System.Windows.Forms.TextBox(); 34 | this.btnGetBalances = new System.Windows.Forms.Button(); 35 | this.btnSend = new System.Windows.Forms.Button(); 36 | this.label2 = new System.Windows.Forms.Label(); 37 | this.txtPrice = new System.Windows.Forms.TextBox(); 38 | this.label1 = new System.Windows.Forms.Label(); 39 | this.txtSize = new System.Windows.Forms.TextBox(); 40 | this.lblBuySell = new System.Windows.Forms.Label(); 41 | this.cbBuySell = new System.Windows.Forms.ComboBox(); 42 | this.txtUsdBalance = new System.Windows.Forms.TextBox(); 43 | this.txtLtcBalance = new System.Windows.Forms.TextBox(); 44 | this.txtBtcBalance = new System.Windows.Forms.TextBox(); 45 | this.lblUsdBalance = new System.Windows.Forms.Label(); 46 | this.lblLtcBalance = new System.Windows.Forms.Label(); 47 | this.lblBtcBalance = new System.Windows.Forms.Label(); 48 | this.btnCancelReplace = new System.Windows.Forms.Button(); 49 | this.txtCancelReplaceId = new System.Windows.Forms.TextBox(); 50 | this.gbAcctInfo.SuspendLayout(); 51 | this.SuspendLayout(); 52 | // 53 | // gbAcctInfo 54 | // 55 | this.gbAcctInfo.Controls.Add(this.txtCancelReplaceId); 56 | this.gbAcctInfo.Controls.Add(this.btnCancelReplace); 57 | this.gbAcctInfo.Controls.Add(this.btnSendMultiple); 58 | this.gbAcctInfo.Controls.Add(this.txtBalances); 59 | this.gbAcctInfo.Controls.Add(this.btnGetBalances); 60 | this.gbAcctInfo.Controls.Add(this.btnSend); 61 | this.gbAcctInfo.Controls.Add(this.label2); 62 | this.gbAcctInfo.Controls.Add(this.txtPrice); 63 | this.gbAcctInfo.Controls.Add(this.label1); 64 | this.gbAcctInfo.Controls.Add(this.txtSize); 65 | this.gbAcctInfo.Controls.Add(this.lblBuySell); 66 | this.gbAcctInfo.Controls.Add(this.cbBuySell); 67 | this.gbAcctInfo.Controls.Add(this.txtUsdBalance); 68 | this.gbAcctInfo.Controls.Add(this.txtLtcBalance); 69 | this.gbAcctInfo.Controls.Add(this.txtBtcBalance); 70 | this.gbAcctInfo.Controls.Add(this.lblUsdBalance); 71 | this.gbAcctInfo.Controls.Add(this.lblLtcBalance); 72 | this.gbAcctInfo.Controls.Add(this.lblBtcBalance); 73 | this.gbAcctInfo.Dock = System.Windows.Forms.DockStyle.Fill; 74 | this.gbAcctInfo.Location = new System.Drawing.Point(0, 0); 75 | this.gbAcctInfo.Name = "gbAcctInfo"; 76 | this.gbAcctInfo.Size = new System.Drawing.Size(636, 118); 77 | this.gbAcctInfo.TabIndex = 0; 78 | this.gbAcctInfo.TabStop = false; 79 | this.gbAcctInfo.Text = "Account Info"; 80 | // 81 | // btnSendMultiple 82 | // 83 | this.btnSendMultiple.Location = new System.Drawing.Point(518, 45); 84 | this.btnSendMultiple.Name = "btnSendMultiple"; 85 | this.btnSendMultiple.Size = new System.Drawing.Size(96, 23); 86 | this.btnSendMultiple.TabIndex = 15; 87 | this.btnSendMultiple.Text = "Send Multiple"; 88 | this.btnSendMultiple.UseVisualStyleBackColor = true; 89 | this.btnSendMultiple.Click += new System.EventHandler(this.btnSendMultiple_Click); 90 | // 91 | // txtBalances 92 | // 93 | this.txtBalances.Location = new System.Drawing.Point(132, 58); 94 | this.txtBalances.Name = "txtBalances"; 95 | this.txtBalances.Size = new System.Drawing.Size(337, 20); 96 | this.txtBalances.TabIndex = 14; 97 | // 98 | // btnGetBalances 99 | // 100 | this.btnGetBalances.Location = new System.Drawing.Point(18, 58); 101 | this.btnGetBalances.Name = "btnGetBalances"; 102 | this.btnGetBalances.Size = new System.Drawing.Size(108, 23); 103 | this.btnGetBalances.TabIndex = 13; 104 | this.btnGetBalances.Text = "Get Balances"; 105 | this.btnGetBalances.UseVisualStyleBackColor = true; 106 | this.btnGetBalances.Click += new System.EventHandler(this.button1_Click); 107 | // 108 | // btnSend 109 | // 110 | this.btnSend.Location = new System.Drawing.Point(539, 16); 111 | this.btnSend.Name = "btnSend"; 112 | this.btnSend.Size = new System.Drawing.Size(75, 23); 113 | this.btnSend.TabIndex = 12; 114 | this.btnSend.Text = "Send Order"; 115 | this.btnSend.UseVisualStyleBackColor = true; 116 | this.btnSend.Click += new System.EventHandler(this.btnSend_Click); 117 | // 118 | // label2 119 | // 120 | this.label2.AutoSize = true; 121 | this.label2.Location = new System.Drawing.Point(450, 16); 122 | this.label2.Name = "label2"; 123 | this.label2.Size = new System.Drawing.Size(31, 13); 124 | this.label2.TabIndex = 11; 125 | this.label2.Text = "Price"; 126 | // 127 | // txtPrice 128 | // 129 | this.txtPrice.Location = new System.Drawing.Point(453, 32); 130 | this.txtPrice.Name = "txtPrice"; 131 | this.txtPrice.Size = new System.Drawing.Size(59, 20); 132 | this.txtPrice.TabIndex = 10; 133 | // 134 | // label1 135 | // 136 | this.label1.AutoSize = true; 137 | this.label1.Location = new System.Drawing.Point(375, 16); 138 | this.label1.Name = "label1"; 139 | this.label1.Size = new System.Drawing.Size(22, 13); 140 | this.label1.TabIndex = 9; 141 | this.label1.Text = "Sz:"; 142 | // 143 | // txtSize 144 | // 145 | this.txtSize.Location = new System.Drawing.Point(378, 33); 146 | this.txtSize.Name = "txtSize"; 147 | this.txtSize.Size = new System.Drawing.Size(59, 20); 148 | this.txtSize.TabIndex = 8; 149 | // 150 | // lblBuySell 151 | // 152 | this.lblBuySell.AutoSize = true; 153 | this.lblBuySell.Location = new System.Drawing.Point(272, 16); 154 | this.lblBuySell.Name = "lblBuySell"; 155 | this.lblBuySell.Size = new System.Drawing.Size(68, 13); 156 | this.lblBuySell.TabIndex = 7; 157 | this.lblBuySell.Text = "Usd Balance"; 158 | // 159 | // cbBuySell 160 | // 161 | this.cbBuySell.FormattingEnabled = true; 162 | this.cbBuySell.Location = new System.Drawing.Point(275, 32); 163 | this.cbBuySell.Name = "cbBuySell"; 164 | this.cbBuySell.Size = new System.Drawing.Size(86, 21); 165 | this.cbBuySell.TabIndex = 6; 166 | // 167 | // txtUsdBalance 168 | // 169 | this.txtUsdBalance.Location = new System.Drawing.Point(187, 32); 170 | this.txtUsdBalance.Name = "txtUsdBalance"; 171 | this.txtUsdBalance.Size = new System.Drawing.Size(59, 20); 172 | this.txtUsdBalance.TabIndex = 5; 173 | // 174 | // txtLtcBalance 175 | // 176 | this.txtLtcBalance.Location = new System.Drawing.Point(100, 32); 177 | this.txtLtcBalance.Name = "txtLtcBalance"; 178 | this.txtLtcBalance.Size = new System.Drawing.Size(59, 20); 179 | this.txtLtcBalance.TabIndex = 4; 180 | // 181 | // txtBtcBalance 182 | // 183 | this.txtBtcBalance.Location = new System.Drawing.Point(18, 32); 184 | this.txtBtcBalance.Name = "txtBtcBalance"; 185 | this.txtBtcBalance.Size = new System.Drawing.Size(59, 20); 186 | this.txtBtcBalance.TabIndex = 3; 187 | // 188 | // lblUsdBalance 189 | // 190 | this.lblUsdBalance.AutoSize = true; 191 | this.lblUsdBalance.Location = new System.Drawing.Point(184, 16); 192 | this.lblUsdBalance.Name = "lblUsdBalance"; 193 | this.lblUsdBalance.Size = new System.Drawing.Size(68, 13); 194 | this.lblUsdBalance.TabIndex = 2; 195 | this.lblUsdBalance.Text = "Usd Balance"; 196 | // 197 | // lblLtcBalance 198 | // 199 | this.lblLtcBalance.AutoSize = true; 200 | this.lblLtcBalance.Location = new System.Drawing.Point(97, 16); 201 | this.lblLtcBalance.Name = "lblLtcBalance"; 202 | this.lblLtcBalance.Size = new System.Drawing.Size(64, 13); 203 | this.lblLtcBalance.TabIndex = 1; 204 | this.lblLtcBalance.Text = "Ltc Balance"; 205 | // 206 | // lblBtcBalance 207 | // 208 | this.lblBtcBalance.AutoSize = true; 209 | this.lblBtcBalance.Location = new System.Drawing.Point(15, 16); 210 | this.lblBtcBalance.Name = "lblBtcBalance"; 211 | this.lblBtcBalance.Size = new System.Drawing.Size(62, 13); 212 | this.lblBtcBalance.TabIndex = 0; 213 | this.lblBtcBalance.Text = "BtcBalance"; 214 | // 215 | // btnCancelReplace 216 | // 217 | this.btnCancelReplace.Location = new System.Drawing.Point(416, 89); 218 | this.btnCancelReplace.Name = "btnCancelReplace"; 219 | this.btnCancelReplace.Size = new System.Drawing.Size(96, 23); 220 | this.btnCancelReplace.TabIndex = 16; 221 | this.btnCancelReplace.Text = "Cancel Replace"; 222 | this.btnCancelReplace.UseVisualStyleBackColor = true; 223 | this.btnCancelReplace.Click += new System.EventHandler(this.btnCancelReplace_Click); 224 | // 225 | // txtCancelReplaceId 226 | // 227 | this.txtCancelReplaceId.Location = new System.Drawing.Point(518, 89); 228 | this.txtCancelReplaceId.Name = "txtCancelReplaceId"; 229 | this.txtCancelReplaceId.Size = new System.Drawing.Size(96, 20); 230 | this.txtCancelReplaceId.TabIndex = 17; 231 | // 232 | // ExchangeAcctCtrl 233 | // 234 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 235 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 236 | this.Controls.Add(this.gbAcctInfo); 237 | this.Name = "ExchangeAcctCtrl"; 238 | this.Size = new System.Drawing.Size(636, 118); 239 | this.gbAcctInfo.ResumeLayout(false); 240 | this.gbAcctInfo.PerformLayout(); 241 | this.ResumeLayout(false); 242 | 243 | } 244 | 245 | #endregion 246 | 247 | private System.Windows.Forms.GroupBox gbAcctInfo; 248 | private System.Windows.Forms.Label lblUsdBalance; 249 | private System.Windows.Forms.Label lblLtcBalance; 250 | private System.Windows.Forms.Label lblBtcBalance; 251 | private System.Windows.Forms.TextBox txtUsdBalance; 252 | private System.Windows.Forms.TextBox txtLtcBalance; 253 | private System.Windows.Forms.TextBox txtBtcBalance; 254 | private System.Windows.Forms.Button btnSend; 255 | private System.Windows.Forms.Label label2; 256 | private System.Windows.Forms.TextBox txtPrice; 257 | private System.Windows.Forms.Label label1; 258 | private System.Windows.Forms.TextBox txtSize; 259 | private System.Windows.Forms.Label lblBuySell; 260 | private System.Windows.Forms.ComboBox cbBuySell; 261 | private System.Windows.Forms.Button btnGetBalances; 262 | private System.Windows.Forms.TextBox txtBalances; 263 | private System.Windows.Forms.Button btnSendMultiple; 264 | private System.Windows.Forms.Button btnCancelReplace; 265 | private System.Windows.Forms.TextBox txtCancelReplaceId; 266 | } 267 | } 268 | -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/Controls/ExchangeAcctCtrl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Data; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using Cob.TradingApps.BtcData; 11 | using Cob.TradingApps.BtcData.Exchanges; 12 | using TradingApi.ModelObjects; 13 | using TradingApi.ModelObjects.Bitfinex.Json; 14 | 15 | namespace TradingCoins.Controls 16 | { 17 | public partial class ExchangeAcctCtrl : UserControl 18 | { 19 | private Form1 _frm; 20 | 21 | public ExchangeAcctCtrl(Form1 form1) 22 | { 23 | InitializeComponent(); 24 | _frm = form1; 25 | cbBuySell.Items.Add("buy"); 26 | cbBuySell.Items.Add("sell"); 27 | } 28 | 29 | public BitfinexExchange Exchange 30 | { 31 | get { return ExchangeConnectivity.Instance.Exchanges[BtcInfo.ExchangeEnum.BITFINEX] as BitfinexExchange; } 32 | } 33 | 34 | private void btnSend_Click(object sender, EventArgs e) 35 | { 36 | try 37 | { 38 | var price = decimal.Parse(txtPrice.Text); 39 | var amount = decimal.Parse(txtSize.Text); 40 | var side = cbBuySell.Text; 41 | var orderResponse = Exchange.Api.SendSimpleLimit("ltcusd", amount.ToString(), price.ToString(), side); 42 | } 43 | catch (Exception ex) 44 | { 45 | 46 | } 47 | } 48 | 49 | private void btnSendMultiple_Click(object sender, EventArgs e) 50 | { 51 | var price = decimal.Parse(txtPrice.Text); 52 | var amount = decimal.Parse(txtSize.Text); 53 | var side = cbBuySell.Text; 54 | 55 | var orderList = new List(); 56 | var order1 = new BitfinexNewOrderPost(); 57 | order1.Amount = amount.ToString(); 58 | order1.Exchange = "bitfinex"; 59 | order1.Price = price.ToString(); 60 | order1.Side = side; 61 | order1.Symbol = _frm.cbPair.SelectedItem.ToString().ToLower(); 62 | order1.Type = "exchange limit"; 63 | 64 | orderList.Add(order1); 65 | 66 | order1 = new BitfinexNewOrderPost(); 67 | order1.Amount = amount.ToString(); 68 | order1.Exchange = "bitfinex"; 69 | if (side == "buy") 70 | order1.Price = decimal.Subtract(price, .50m).ToString(); 71 | else 72 | { 73 | order1.Price = decimal.Add(price, .50m).ToString(); 74 | } 75 | order1.Side = side; 76 | order1.Symbol = _frm.cbPair.SelectedItem.ToString().ToLower(); 77 | order1.Type = "exchange limit"; 78 | 79 | orderList.Add(order1); 80 | 81 | var x = Exchange.Api.SendMultipleOrders(orderList.ToArray()); 82 | } 83 | 84 | private void button1_Click(object sender, EventArgs e) 85 | { 86 | //var bfExchange = ExchangeConnectivity.Instance.Exchanges[BtcInfo.ExchangeEnum.BITFINEX] as BitfinexExchange; 87 | if (Exchange != null) 88 | { 89 | var balances = Exchange.Api.GetBalances(); 90 | foreach (var balance in balances) 91 | { 92 | txtBalances.Text = balance.ToString(); 93 | } 94 | } 95 | 96 | } 97 | 98 | private void btnCancelReplace_Click(object sender, EventArgs e) 99 | { 100 | var price = decimal.Parse(txtPrice.Text); 101 | var amount = decimal.Parse(txtSize.Text); 102 | var side = cbBuySell.Text; 103 | 104 | var order = new BitfinexNewOrderPost(); 105 | order.Side = side; 106 | if (side == "buy") 107 | { 108 | order.Price = decimal.Subtract(price, .05m).ToString(); 109 | order.Amount = decimal.Subtract(amount, .20m).ToString(); 110 | } 111 | else 112 | { 113 | order.Price = decimal.Add(price, .05m).ToString(); 114 | order.Amount = decimal.Subtract(amount, .20m).ToString(); 115 | } 116 | order.Exchange = "bitfinex"; 117 | order.Symbol = "ltcusd"; 118 | order.Type = "exchange limit"; 119 | 120 | Exchange.Api.CancelReplaceOrder(Convert.ToInt32(txtCancelReplaceId.Text), order); 121 | } 122 | 123 | 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/Controls/ExchangeAcctCtrl.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/Controls/MarketDataCtrl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace TradingCoins.Controls 2 | { 3 | partial class MarketDataCtrl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.gbMarketData = new System.Windows.Forms.GroupBox(); 32 | this.label4 = new System.Windows.Forms.Label(); 33 | this.label3 = new System.Windows.Forms.Label(); 34 | this.label2 = new System.Windows.Forms.Label(); 35 | this.label1 = new System.Windows.Forms.Label(); 36 | this.txtAskSz = new System.Windows.Forms.TextBox(); 37 | this.txtBidSz = new System.Windows.Forms.TextBox(); 38 | this.txtAskPx = new System.Windows.Forms.TextBox(); 39 | this.txtBidPx = new System.Windows.Forms.TextBox(); 40 | this.gbMarketData.SuspendLayout(); 41 | this.SuspendLayout(); 42 | // 43 | // gbMarketData 44 | // 45 | this.gbMarketData.Controls.Add(this.label4); 46 | this.gbMarketData.Controls.Add(this.label3); 47 | this.gbMarketData.Controls.Add(this.label2); 48 | this.gbMarketData.Controls.Add(this.label1); 49 | this.gbMarketData.Controls.Add(this.txtAskSz); 50 | this.gbMarketData.Controls.Add(this.txtBidSz); 51 | this.gbMarketData.Controls.Add(this.txtAskPx); 52 | this.gbMarketData.Controls.Add(this.txtBidPx); 53 | this.gbMarketData.Dock = System.Windows.Forms.DockStyle.Fill; 54 | this.gbMarketData.Location = new System.Drawing.Point(0, 0); 55 | this.gbMarketData.Name = "gbMarketData"; 56 | this.gbMarketData.Size = new System.Drawing.Size(365, 92); 57 | this.gbMarketData.TabIndex = 4; 58 | this.gbMarketData.TabStop = false; 59 | this.gbMarketData.Text = "MarketData"; 60 | // 61 | // label4 62 | // 63 | this.label4.AutoSize = true; 64 | this.label4.Location = new System.Drawing.Point(230, 27); 65 | this.label4.Name = "label4"; 66 | this.label4.Size = new System.Drawing.Size(40, 13); 67 | this.label4.TabIndex = 8; 68 | this.label4.Text = "Ask Sz"; 69 | // 70 | // label3 71 | // 72 | this.label3.AutoSize = true; 73 | this.label3.Location = new System.Drawing.Point(155, 27); 74 | this.label3.Name = "label3"; 75 | this.label3.Size = new System.Drawing.Size(40, 13); 76 | this.label3.TabIndex = 7; 77 | this.label3.Text = "Ask Px"; 78 | // 79 | // label2 80 | // 81 | this.label2.AutoSize = true; 82 | this.label2.Location = new System.Drawing.Point(84, 27); 83 | this.label2.Name = "label2"; 84 | this.label2.Size = new System.Drawing.Size(37, 13); 85 | this.label2.TabIndex = 6; 86 | this.label2.Text = "Bid Px"; 87 | // 88 | // label1 89 | // 90 | this.label1.AutoSize = true; 91 | this.label1.Location = new System.Drawing.Point(27, 27); 92 | this.label1.Name = "label1"; 93 | this.label1.Size = new System.Drawing.Size(37, 13); 94 | this.label1.TabIndex = 5; 95 | this.label1.Text = "Bid Sz"; 96 | // 97 | // txtAskSz 98 | // 99 | this.txtAskSz.Location = new System.Drawing.Point(233, 43); 100 | this.txtAskSz.Name = "txtAskSz"; 101 | this.txtAskSz.Size = new System.Drawing.Size(50, 20); 102 | this.txtAskSz.TabIndex = 4; 103 | // 104 | // txtBidSz 105 | // 106 | this.txtBidSz.Location = new System.Drawing.Point(30, 43); 107 | this.txtBidSz.Name = "txtBidSz"; 108 | this.txtBidSz.Size = new System.Drawing.Size(51, 20); 109 | this.txtBidSz.TabIndex = 3; 110 | // 111 | // txtAskPx 112 | // 113 | this.txtAskPx.Location = new System.Drawing.Point(158, 43); 114 | this.txtAskPx.Name = "txtAskPx"; 115 | this.txtAskPx.Size = new System.Drawing.Size(56, 20); 116 | this.txtAskPx.TabIndex = 2; 117 | // 118 | // txtBidPx 119 | // 120 | this.txtBidPx.Location = new System.Drawing.Point(87, 43); 121 | this.txtBidPx.Name = "txtBidPx"; 122 | this.txtBidPx.Size = new System.Drawing.Size(56, 20); 123 | this.txtBidPx.TabIndex = 1; 124 | // 125 | // MarketDataCtrl 126 | // 127 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 128 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 129 | this.Controls.Add(this.gbMarketData); 130 | this.Name = "MarketDataCtrl"; 131 | this.Size = new System.Drawing.Size(365, 92); 132 | this.gbMarketData.ResumeLayout(false); 133 | this.gbMarketData.PerformLayout(); 134 | this.ResumeLayout(false); 135 | 136 | } 137 | 138 | #endregion 139 | 140 | private System.Windows.Forms.GroupBox gbMarketData; 141 | private System.Windows.Forms.Label label4; 142 | private System.Windows.Forms.Label label3; 143 | private System.Windows.Forms.Label label2; 144 | private System.Windows.Forms.Label label1; 145 | private System.Windows.Forms.TextBox txtAskSz; 146 | private System.Windows.Forms.TextBox txtBidSz; 147 | private System.Windows.Forms.TextBox txtAskPx; 148 | private System.Windows.Forms.TextBox txtBidPx; 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/Controls/MarketDataCtrl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using Cob.TradingApps.BtcData; 4 | using Cob.TradingApps.BtcData.Exchanges; 5 | using TradingApi.ModelObjects; 6 | 7 | namespace TradingCoins.Controls 8 | { 9 | public partial class MarketDataCtrl : UserControl 10 | { 11 | public MarketDataCtrl() 12 | { 13 | InitializeComponent(); 14 | ExchangeConnectivity.Instance.MarketDataUpdate += InstanceOnMarketDataUpdate; 15 | } 16 | 17 | private void InstanceOnMarketDataUpdate(ExchangeBase exchangeBase) 18 | { 19 | if (txtBidPx.InvokeRequired) 20 | { 21 | txtBidPx.Invoke(new EventHandler((sender, args) => UpdateGui(exchangeBase))); 22 | } 23 | } 24 | 25 | private void UpdateGui(ExchangeBase exchangeBase) 26 | { 27 | try 28 | { 29 | txtBidSz.Text = exchangeBase.MarketData.BidSz.ToString(); 30 | txtBidPx.Text = exchangeBase.MarketData.Bid.ToString(); 31 | txtAskPx.Text = exchangeBase.MarketData.Ask.ToString(); 32 | txtAskSz.Text = exchangeBase.MarketData.AskSz.ToString(); 33 | 34 | } 35 | catch (Exception ex) 36 | { 37 | Logger.LogException(ex); 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/Controls/MarketDataCtrl.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Concurrent; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | using Cob.TradingApps.BtcData; 12 | using Cob.TradingApps.BtcData.Exchanges; 13 | using log4net; 14 | using log4net.Config; 15 | using TradingApi.ModelObjects; 16 | using TradingApi.ModelObjects.Bitfinex.Json; 17 | using TradingApi.ModelObjects.Utility; 18 | using TradingCoins.Controls; 19 | 20 | [assembly: XmlConfigurator(Watch = true)] 21 | namespace TradingCoins 22 | { 23 | public partial class Form1 : Form 24 | { 25 | 26 | private ConcurrentDictionary _marketDataCtrls; 27 | private ConcurrentDictionary _tradingAcctCtrls; 28 | 29 | public BitfinexExchange BfExchange 30 | { 31 | get { return ExchangeConnectivity.Instance.Exchanges[BtcInfo.ExchangeEnum.BITFINEX] as BitfinexExchange; } 32 | } 33 | 34 | public Form1() 35 | { 36 | BasicConfigurator.Configure(); 37 | InitializeComponent(); 38 | _marketDataCtrls = new ConcurrentDictionary(); 39 | _tradingAcctCtrls = new ConcurrentDictionary(); 40 | 41 | var exchanges = Enum.GetValues(typeof(BtcInfo.ExchangeEnum)); 42 | foreach (BtcInfo.ExchangeEnum exchange in exchanges) 43 | { 44 | var ctrlMd = new MarketDataCtrl(); 45 | var ctrlAcct = new ExchangeAcctCtrl(this); 46 | 47 | ctrlMd.Tag = exchange; 48 | ctrlMd.Name = exchange.ToString(); 49 | 50 | ctrlAcct.Tag = exchange; 51 | ctrlAcct.Name = exchange.ToString(); 52 | 53 | _marketDataCtrls[exchange] = ctrlMd; 54 | this.pnlExchange1MarketData.Controls.Add(ctrlMd); 55 | this.pnlExchange1Trading.Controls.Add(ctrlAcct); 56 | 57 | ctrlMd.Dock = DockStyle.Fill; 58 | ctrlAcct.Dock = DockStyle.Fill; 59 | } 60 | 61 | var symbols = Enum.GetValues(typeof(BtcInfo.PairTypeEnum)); 62 | foreach (var symbol in symbols) 63 | { 64 | cbPair.Items.Add(symbol); 65 | } 66 | cbPair.SelectedItem = BtcInfo.PairTypeEnum.btcusd; 67 | 68 | var callTypes = Enum.GetValues(typeof(BtcInfo.BitfinexUnauthenicatedCallsEnum)); 69 | foreach (var callType in callTypes) 70 | { 71 | cbCallTypes.Items.Add(callType); 72 | } 73 | cbCallTypes.SelectedItem = BtcInfo.BitfinexUnauthenicatedCallsEnum.pubticker; 74 | 75 | var walletTypes = Enum.GetValues(typeof(BtcInfo.BitfinexWalletEnum)); 76 | foreach (var walletType in walletTypes) 77 | { 78 | cbWalletType.Items.Add(walletType); 79 | cbDepositTo.Items.Add(walletType); 80 | } 81 | 82 | cbWalletType.SelectedIndex = 0; 83 | 84 | var symbolTypes = Enum.GetValues(typeof(BtcInfo.ExchangeSymbolEnum)); 85 | foreach (var symbolType in symbolTypes) 86 | { 87 | cbSymbols.Items.Add(symbolType); 88 | cbCurrency.Items.Add(symbolType); 89 | } 90 | 91 | cbSymbols.SelectedIndex = 0; 92 | cbCurrency.SelectedIndex = 0; 93 | 94 | var offerDirections = Enum.GetValues(typeof(BtcInfo.OfferDirectionEnum)); 95 | foreach (var offerDirection in offerDirections) 96 | { 97 | cbDirection.Items.Add(offerDirection); 98 | } 99 | 100 | cbDirection.SelectedIndex = 0; 101 | 102 | } 103 | 104 | private void Form1_Load(object sender, EventArgs e) 105 | { 106 | 107 | } 108 | 109 | private void btnStart_Click(object sender, EventArgs e) 110 | { 111 | ExchangeConnectivity.Instance.Initialize(); 112 | BfExchange.Api.ErrorMessage += ApiOnErrrorMessage; 113 | BfExchange.Api.OrderFeedMsg += ApiOnOrderFeedMsg; 114 | } 115 | 116 | private void ApiOnOrderFeedMsg(BitfinexNewOrderResponse orderResponse) 117 | { 118 | lbLogger.Items.Add(orderResponse.ToString()); 119 | } 120 | 121 | private void ApiOnErrrorMessage(string errorMessage) 122 | { 123 | lbLogger.Items.Add(errorMessage); 124 | } 125 | 126 | private void btnGetOrderStatus_Click(object sender, EventArgs e) 127 | { 128 | try 129 | { 130 | var x = BfExchange.Api.GetOrderStatus(Convert.ToInt32(txtOrderId.Text)); 131 | lbLogger.Items.Add(x.Id + " is live: " + x.IsLive + ", Price: " + x.Price); 132 | 133 | } 134 | catch (Exception ex) 135 | { 136 | Logger.LogException(ex); 137 | } 138 | } 139 | 140 | private void btnCancelOrder_Click(object sender, EventArgs e) 141 | { 142 | try 143 | { 144 | var x = BfExchange.Api.CancelOrder(Convert.ToInt32(txtOrderId.Text)); 145 | lbLogger.Items.Add(x.ToString()); 146 | } 147 | catch (Exception ex) 148 | { 149 | Logger.LogException(ex); 150 | } 151 | } 152 | 153 | private void btnCancelAll_Click(object sender, EventArgs e) 154 | { 155 | var x = BfExchange.Api.CancellAllActiveOrders(); 156 | lbLogger.Items.Add(x); 157 | } 158 | 159 | private void btnCancelMultiple_Click(object sender, EventArgs e) 160 | { 161 | var strArr = txtCancelMultiple.Text.Split(','); 162 | var ints = strArr.Select(s => Convert.ToInt32(s)).ToArray(); 163 | var x = BfExchange.Api.CancelMultipleOrders(ints); 164 | } 165 | 166 | private void btnGetDataFromCallType_Click(object sender, EventArgs e) 167 | { 168 | var callType = (BtcInfo.BitfinexUnauthenicatedCallsEnum)cbCallTypes.SelectedItem; 169 | switch (callType) 170 | { 171 | case BtcInfo.BitfinexUnauthenicatedCallsEnum.pubticker: 172 | var x = BfExchange.Api.GetPublicTicker(ExchangeConnectivity.Instance.PairType, callType); 173 | lbGenericData.Items.Add(x.ToString()); 174 | break; 175 | case BtcInfo.BitfinexUnauthenicatedCallsEnum.stats: 176 | var pairStats = BfExchange.Api.GetPairStats(ExchangeConnectivity.Instance.PairType, callType); 177 | foreach (var pairStat in pairStats) 178 | { 179 | lbGenericData.Items.Add(pairStat.ToString()); 180 | } 181 | break; 182 | case BtcInfo.BitfinexUnauthenicatedCallsEnum.trades: 183 | IList bfTrades = BfExchange.Api.GetPairTrades(ExchangeConnectivity.Instance.PairType, callType); 184 | foreach (var bfTrade in bfTrades) 185 | { 186 | lbGenericData.Items.Add(bfTrade.ToString()); 187 | } 188 | break; 189 | } 190 | 191 | } 192 | 193 | private void cbSymbols_SelectedIndexChanged(object sender, EventArgs e) 194 | { 195 | var pairType = (BtcInfo.PairTypeEnum)cbPair.SelectedItem; 196 | ExchangeConnectivity.Instance.SetGlobalPairType(pairType); 197 | } 198 | 199 | private void cbCallTypes_SelectedIndexChanged(object sender, EventArgs e) 200 | { 201 | 202 | } 203 | 204 | private void btnGetSymbols_Click(object sender, EventArgs e) 205 | { 206 | var symbols = BfExchange.Api.GetSymbols(); 207 | foreach (var symbol in symbols) 208 | { 209 | lbGenericData.Items.Add(symbol.ToString()); 210 | } 211 | } 212 | 213 | private void btnGetLendbook_Click(object sender, EventArgs e) 214 | { 215 | var lendbook = BfExchange.Api.GetLendbook(cbSymbols.SelectedItem.ToString().ToLower()); 216 | foreach (var ask in lendbook.Asks) 217 | { 218 | lbGenericData.Items.Add(ask.ToString()); 219 | } 220 | 221 | foreach (var bid in lendbook.Bids) 222 | { 223 | lbGenericData.Items.Add(bid.ToString()); 224 | } 225 | 226 | } 227 | 228 | private void btnGetLends_Click(object sender, EventArgs e) 229 | { 230 | var lends = BfExchange.Api.GetLends(cbSymbols.SelectedItem.ToString().ToLower()); 231 | foreach (var lend in lends) 232 | { 233 | lbGenericData.Items.Add(lend.ToString()); 234 | } 235 | } 236 | 237 | private void btnGetActiveOrders_Click(object sender, EventArgs e) 238 | { 239 | var activeOrders = BfExchange.Api.GetActiveOrders(); 240 | foreach (var activeOrder in activeOrders) 241 | { 242 | lbGenericData.Items.Add(activeOrder.ToString()); 243 | } 244 | } 245 | 246 | private void btnGetActivePos_Click(object sender, EventArgs e) 247 | { 248 | var activePositions = BfExchange.Api.GetActivePositions(); 249 | lbGenericData.Items.Add(activePositions); 250 | } 251 | 252 | private void btnGetHistory_Click(object sender, EventArgs e) 253 | { 254 | var symbol = (BtcInfo.ExchangeSymbolEnum)cbSymbols.SelectedItem; 255 | var since = Common.GetTimeStamp(DateTime.Today.AddDays(-10)); 256 | var until = Common.GetTimeStamp(DateTime.Today); 257 | int limit = 100; 258 | var wallet = (BtcInfo.BitfinexWalletEnum)cbWalletType.SelectedItem; 259 | 260 | var history = BfExchange.Api.GetHistory(symbol.ToString().ToLower(), since.ToString(), until.ToString(), limit, wallet.ToString()); 261 | 262 | foreach (var h in history) 263 | { 264 | lbGenericData.Items.Add(h.ToString()); 265 | } 266 | } 267 | 268 | private void btnGetMyTrades_Click(object sender, EventArgs e) 269 | { 270 | var pair = cbPair.SelectedItem.ToString().ToLower(); 271 | var since = Common.GetTimeStamp(DateTime.Today.AddDays(-10)); 272 | int limit = 100; 273 | 274 | var myTrades = BfExchange.Api.GetMyTrades(pair, since.ToString(), limit); 275 | 276 | foreach (var trade in myTrades) 277 | { 278 | lbGenericData.Items.Add(trade.ToString()); 279 | } 280 | 281 | } 282 | 283 | private void btnDeposit_Click(object sender, EventArgs e) 284 | { 285 | var symbol = cbSymbols.SelectedItem.ToString().ToUpper(); 286 | var method = BtcInfo.SymbolMapHelper[(BtcInfo.ExchangeSymbolEnum)cbSymbols.SelectedItem].ToString().ToLower(); 287 | var depositTo = cbDepositTo.SelectedItem.ToString(); 288 | 289 | var depositResult = BfExchange.Api.Deposit(symbol, method, depositTo); 290 | lbGenericData.Items.Add(depositResult.ToString()); 291 | 292 | } 293 | 294 | private void btnAccountInfo_Click(object sender, EventArgs e) 295 | { 296 | var accountInfo = BfExchange.Api.GetAccountInformation(); 297 | lbGenericData.Items.Add(accountInfo.ToString()); 298 | } 299 | 300 | private void btnMarginInfo_Click(object sender, EventArgs e) 301 | { 302 | var marginInfo = BfExchange.Api.GetMarginInformation(); 303 | lbGenericData.Items.Add(marginInfo.ToString()); 304 | } 305 | 306 | private void btnSendNewOffer_Click(object sender, EventArgs e) 307 | { 308 | try 309 | { 310 | var currency = cbCurrency.SelectedItem.ToString().ToUpper(); 311 | var amount = Convert.ToDecimal(txtOfferAmount.Text); 312 | var rate = Convert.ToDecimal(txtRate.Text) * 365; 313 | var period = Convert.ToInt32(txtDays.Text); 314 | var direction = cbDirection.SelectedItem.ToString(); 315 | 316 | var newOffer = new BitfinexNewOfferPost 317 | { 318 | Currency = currency, 319 | Amount = amount.ToString(), 320 | Rate = rate.ToString(), 321 | Period = period, 322 | Direction = direction 323 | }; 324 | 325 | var newOfferResult = BfExchange.Api.SendNewOffer(newOffer); 326 | lbGenericData.Items.Add(newOfferResult.ToString()); 327 | 328 | } 329 | catch (Exception ex) 330 | { 331 | Logger.LogException(ex); 332 | } 333 | } 334 | 335 | private void btnCancelOffer_Click(object sender, EventArgs e) 336 | { 337 | var cancelledOffer = BfExchange.Api.CancelOffer(Convert.ToInt32(txtOrderId.Text)); 338 | lbLogger.Items.Add(cancelledOffer.ToString()); 339 | } 340 | 341 | private void btnGetOfferStatus_Click(object sender, EventArgs e) 342 | { 343 | var offerStatus = BfExchange.Api.GetOfferStatus(Convert.ToInt32(txtOrderId.Text)); 344 | lbLogger.Items.Add(offerStatus.ToString()); 345 | 346 | } 347 | 348 | private void btnGetActiveOffers_Click(object sender, EventArgs e) 349 | { 350 | var activeOffers = BfExchange.Api.GetActiveOffers(); 351 | foreach (var activeOffer in activeOffers) 352 | { 353 | lbGenericData.Items.Add(activeOffer.ToString()); 354 | } 355 | } 356 | 357 | private void btnGetActiveCredits_Click(object sender, EventArgs e) 358 | { 359 | var activeCredits = BfExchange.Api.GetActiveCredits(); 360 | foreach (var activeCredit in activeCredits) 361 | { 362 | lbGenericData.Items.Add(activeCredit.ToString()); 363 | } 364 | } 365 | 366 | private void btnGetActiveSwapsInMarginPos_Click(object sender, EventArgs e) 367 | { 368 | var activeSwapsInMargin = BfExchange.Api.GetActiveSwapsUsedInMarginPosition(); 369 | 370 | foreach (var activeSwaps in activeSwapsInMargin) 371 | { 372 | lbGenericData.Items.Add(activeSwaps.ToString()); 373 | } 374 | 375 | } 376 | 377 | private void btnCloseSwap_Click(object sender, EventArgs e) 378 | { 379 | var closeSwapResult = BfExchange.Api.CloseSwap(Convert.ToInt32(txtOrderId.Text)); 380 | lbGenericData.Items.Add(closeSwapResult.ToString()); 381 | } 382 | 383 | private void btnClaimPosition_Click(object sender, EventArgs e) 384 | { 385 | var claimPosResult = BfExchange.Api.ClaimPosition(Convert.ToInt32(txtOrderId.Text)); 386 | lbGenericData.Items.Add(claimPosResult.ToString()); 387 | } 388 | } 389 | } 390 | -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/Form1.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace TradingCoins 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new Form1()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("TradingCoins")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("TradingCoins")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("7a85e763-ff39-4fc8-a055-7ee37a7ce7ba")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18444 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace TradingCoins.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TradingCoins.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18444 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace TradingCoins.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/TradingCoins.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {99B93AE3-1414-4677-B62C-1F5103B52B9C} 8 | WinExe 9 | Properties 10 | TradingCoins 11 | TradingCoins 12 | v4.5 13 | 512 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | ..\packages\log4net.2.0.3\lib\net40-full\log4net.dll 37 | 38 | 39 | ..\packages\Newtonsoft.Json.6.0.5\lib\net45\Newtonsoft.Json.dll 40 | 41 | 42 | ..\packages\RestSharp.104.5.0\lib\net4\RestSharp.dll 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | UserControl 58 | 59 | 60 | ExchangeAcctCtrl.cs 61 | 62 | 63 | Form 64 | 65 | 66 | Form1.cs 67 | 68 | 69 | UserControl 70 | 71 | 72 | MarketDataCtrl.cs 73 | 74 | 75 | 76 | 77 | ExchangeAcctCtrl.cs 78 | 79 | 80 | Form1.cs 81 | 82 | 83 | MarketDataCtrl.cs 84 | 85 | 86 | ResXFileCodeGenerator 87 | Resources.Designer.cs 88 | Designer 89 | 90 | 91 | True 92 | Resources.resx 93 | 94 | 95 | 96 | SettingsSingleFileGenerator 97 | Settings.Designer.cs 98 | 99 | 100 | True 101 | Settings.settings 102 | True 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | {63f10178-9e10-4495-b376-08df3a763e1c} 111 | Cob.TradingApps.BtcData 112 | 113 | 114 | {1c6afc5b-4c6d-4f88-97ff-5845d45e94c7} 115 | TradingApi.Bitfinex 116 | 117 | 118 | {f0f159a5-c5d6-4cbf-b061-7943f8f7bc5a} 119 | TradingApi.ModelObjects 120 | 121 | 122 | 123 | 130 | -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/TradingCoins.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ProjectFiles 5 | 6 | -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/bin/Debug/Cob.TradingApps.BtcData.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingCoins/bin/Debug/Cob.TradingApps.BtcData.dll -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/bin/Debug/Cob.TradingApps.BtcData.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingCoins/bin/Debug/Cob.TradingApps.BtcData.pdb -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/bin/Debug/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingCoins/bin/Debug/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/bin/Debug/RestSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingCoins/bin/Debug/RestSharp.dll -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/bin/Debug/TradingApi.Bitfinex.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingCoins/bin/Debug/TradingApi.Bitfinex.dll -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/bin/Debug/TradingApi.Bitfinex.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingCoins/bin/Debug/TradingApi.Bitfinex.pdb -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/bin/Debug/TradingApi.ModelObjects.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingCoins/bin/Debug/TradingApi.ModelObjects.dll -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/bin/Debug/TradingApi.ModelObjects.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingCoins/bin/Debug/TradingApi.ModelObjects.pdb -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/bin/Debug/TradingCoins.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingCoins/bin/Debug/TradingCoins.exe -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/bin/Debug/TradingCoins.exe.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/bin/Debug/TradingCoins.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingCoins/bin/Debug/TradingCoins.pdb -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/bin/Debug/TradingCoins.vshost.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingCoins/bin/Debug/TradingCoins.vshost.exe -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/bin/Debug/TradingCoins.vshost.exe.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/bin/Debug/TradingCoins.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/bin/Debug/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/TradingCoins/bin/Debug/log4net.dll -------------------------------------------------------------------------------- /TradingCoins/TradingCoins/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /TradingCoins/packages/Newtonsoft.Json.6.0.5/Newtonsoft.Json.6.0.5.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/Newtonsoft.Json.6.0.5/Newtonsoft.Json.6.0.5.nupkg -------------------------------------------------------------------------------- /TradingCoins/packages/Newtonsoft.Json.6.0.5/lib/net20/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/Newtonsoft.Json.6.0.5/lib/net20/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /TradingCoins/packages/Newtonsoft.Json.6.0.5/lib/net35/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/Newtonsoft.Json.6.0.5/lib/net35/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /TradingCoins/packages/Newtonsoft.Json.6.0.5/lib/net40/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/Newtonsoft.Json.6.0.5/lib/net40/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /TradingCoins/packages/Newtonsoft.Json.6.0.5/lib/net45/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/Newtonsoft.Json.6.0.5/lib/net45/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /TradingCoins/packages/Newtonsoft.Json.6.0.5/lib/netcore45/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/Newtonsoft.Json.6.0.5/lib/netcore45/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /TradingCoins/packages/Newtonsoft.Json.6.0.5/lib/portable-net40+sl5+wp80+win8+wpa81/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/Newtonsoft.Json.6.0.5/lib/portable-net40+sl5+wp80+win8+wpa81/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /TradingCoins/packages/Newtonsoft.Json.6.0.5/lib/portable-net45+wp80+win8+wpa81/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/Newtonsoft.Json.6.0.5/lib/portable-net45+wp80+win8+wpa81/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /TradingCoins/packages/Newtonsoft.Json.6.0.5/tools/install.ps1: -------------------------------------------------------------------------------- 1 | param($installPath, $toolsPath, $package, $project) 2 | 3 | # open json.net splash page on package install 4 | # don't open if json.net is installed as a dependency 5 | 6 | try 7 | { 8 | $url = "http://james.newtonking.com/json" 9 | $dte2 = Get-Interface $dte ([EnvDTE80.DTE2]) 10 | 11 | if ($dte2.ActiveWindow.Caption -eq "Package Manager Console") 12 | { 13 | # user is installing from VS NuGet console 14 | # get reference to the window, the console host and the input history 15 | # show webpage if "install-package newtonsoft.json" was last input 16 | 17 | $consoleWindow = $(Get-VSComponentModel).GetService([NuGetConsole.IPowerConsoleWindow]) 18 | 19 | $props = $consoleWindow.GetType().GetProperties([System.Reflection.BindingFlags]::Instance -bor ` 20 | [System.Reflection.BindingFlags]::NonPublic) 21 | 22 | $prop = $props | ? { $_.Name -eq "ActiveHostInfo" } | select -first 1 23 | if ($prop -eq $null) { return } 24 | 25 | $hostInfo = $prop.GetValue($consoleWindow) 26 | if ($hostInfo -eq $null) { return } 27 | 28 | $history = $hostInfo.WpfConsole.InputHistory.History 29 | 30 | $lastCommand = $history | select -last 1 31 | 32 | if ($lastCommand) 33 | { 34 | $lastCommand = $lastCommand.Trim().ToLower() 35 | if ($lastCommand.StartsWith("install-package") -and $lastCommand.Contains("newtonsoft.json")) 36 | { 37 | $dte2.ItemOperations.Navigate($url) | Out-Null 38 | } 39 | } 40 | } 41 | else 42 | { 43 | # user is installing from VS NuGet dialog 44 | # get reference to the window, then smart output console provider 45 | # show webpage if messages in buffered console contains "installing...newtonsoft.json" in last operation 46 | 47 | $instanceField = [NuGet.Dialog.PackageManagerWindow].GetField("CurrentInstance", [System.Reflection.BindingFlags]::Static -bor ` 48 | [System.Reflection.BindingFlags]::NonPublic) 49 | $consoleField = [NuGet.Dialog.PackageManagerWindow].GetField("_smartOutputConsoleProvider", [System.Reflection.BindingFlags]::Instance -bor ` 50 | [System.Reflection.BindingFlags]::NonPublic) 51 | if ($instanceField -eq $null -or $consoleField -eq $null) { return } 52 | 53 | $instance = $instanceField.GetValue($null) 54 | if ($instance -eq $null) { return } 55 | 56 | $consoleProvider = $consoleField.GetValue($instance) 57 | if ($consoleProvider -eq $null) { return } 58 | 59 | $console = $consoleProvider.CreateOutputConsole($false) 60 | 61 | $messagesField = $console.GetType().GetField("_messages", [System.Reflection.BindingFlags]::Instance -bor ` 62 | [System.Reflection.BindingFlags]::NonPublic) 63 | if ($messagesField -eq $null) { return } 64 | 65 | $messages = $messagesField.GetValue($console) 66 | if ($messages -eq $null) { return } 67 | 68 | $operations = $messages -split "==============================" 69 | 70 | $lastOperation = $operations | select -last 1 71 | 72 | if ($lastOperation) 73 | { 74 | $lastOperation = $lastOperation.ToLower() 75 | 76 | $lines = $lastOperation -split "`r`n" 77 | 78 | $installMatch = $lines | ? { $_.StartsWith("------- installing...newtonsoft.json ") } | select -first 1 79 | 80 | if ($installMatch) 81 | { 82 | $dte2.ItemOperations.Navigate($url) | Out-Null 83 | } 84 | } 85 | } 86 | } 87 | catch 88 | { 89 | # stop potential errors from bubbling up 90 | # worst case the splash page won't open 91 | } 92 | 93 | # yolo -------------------------------------------------------------------------------- /TradingCoins/packages/RestSharp.104.5.0/RestSharp.104.5.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/RestSharp.104.5.0/RestSharp.104.5.0.nupkg -------------------------------------------------------------------------------- /TradingCoins/packages/RestSharp.104.5.0/lib/net35-client/RestSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/RestSharp.104.5.0/lib/net35-client/RestSharp.dll -------------------------------------------------------------------------------- /TradingCoins/packages/RestSharp.104.5.0/lib/net35/RestSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/RestSharp.104.5.0/lib/net35/RestSharp.dll -------------------------------------------------------------------------------- /TradingCoins/packages/RestSharp.104.5.0/lib/net4-client/RestSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/RestSharp.104.5.0/lib/net4-client/RestSharp.dll -------------------------------------------------------------------------------- /TradingCoins/packages/RestSharp.104.5.0/lib/net4/RestSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/RestSharp.104.5.0/lib/net4/RestSharp.dll -------------------------------------------------------------------------------- /TradingCoins/packages/RestSharp.104.5.0/lib/sl4-wp71/RestSharp.WindowsPhone.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/RestSharp.104.5.0/lib/sl4-wp71/RestSharp.WindowsPhone.dll -------------------------------------------------------------------------------- /TradingCoins/packages/RestSharp.104.5.0/lib/sl4/RestSharp.Silverlight.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/RestSharp.104.5.0/lib/sl4/RestSharp.Silverlight.dll -------------------------------------------------------------------------------- /TradingCoins/packages/RestSharp.104.5.0/readme.txt: -------------------------------------------------------------------------------- 1 | *** IMPORTANT CHANGE IN RESTSHARP VERSION 103 *** 2 | 3 | In 103.0, JSON.NET was removed as a dependency. 4 | 5 | If this is still installed in your project and no other libraries depend on 6 | it you may remove it from your installed packages. 7 | 8 | There is one breaking change: the default Json*Serializer* is no longer 9 | compatible with Json.NET. To use Json.NET for serialization, copy the code 10 | from https://github.com/restsharp/RestSharp/blob/86b31f9adf049d7fb821de8279154f41a17b36f7/RestSharp/Serializers/JsonSerializer.cs 11 | and register it with your client: 12 | 13 | var client = new RestClient(); 14 | client.JsonSerializer = new YourCustomSerializer(); 15 | 16 | The default Json*Deserializer* is mostly compatible, but it does not support 17 | all features which Json.NET has (like the ability to support a custom [JsonConverter] 18 | by decorating a certain property with an attribute). If you need these features, you 19 | must take care of the deserialization yourself to get it working. 20 | 21 | If you run into any compatibility issues with deserialization, 22 | please report it to http://groups.google.com/group/restsharp 23 | -------------------------------------------------------------------------------- /TradingCoins/packages/log4net.2.0.3/lib/net10-full/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/log4net.2.0.3/lib/net10-full/log4net.dll -------------------------------------------------------------------------------- /TradingCoins/packages/log4net.2.0.3/lib/net11-full/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/log4net.2.0.3/lib/net11-full/log4net.dll -------------------------------------------------------------------------------- /TradingCoins/packages/log4net.2.0.3/lib/net20-full/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/log4net.2.0.3/lib/net20-full/log4net.dll -------------------------------------------------------------------------------- /TradingCoins/packages/log4net.2.0.3/lib/net35-client/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/log4net.2.0.3/lib/net35-client/log4net.dll -------------------------------------------------------------------------------- /TradingCoins/packages/log4net.2.0.3/lib/net35-full/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/log4net.2.0.3/lib/net35-full/log4net.dll -------------------------------------------------------------------------------- /TradingCoins/packages/log4net.2.0.3/lib/net40-client/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/log4net.2.0.3/lib/net40-client/log4net.dll -------------------------------------------------------------------------------- /TradingCoins/packages/log4net.2.0.3/lib/net40-full/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/log4net.2.0.3/lib/net40-full/log4net.dll -------------------------------------------------------------------------------- /TradingCoins/packages/log4net.2.0.3/log4net.2.0.3.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workingobrien/TradingApi.Bitfinex/9ffc40149a891f7a3701a3b78ebec6b7b1209a0f/TradingCoins/packages/log4net.2.0.3/log4net.2.0.3.nupkg -------------------------------------------------------------------------------- /TradingCoins/packages/repositories.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | --------------------------------------------------------------------------------