{"id":29682334,"url":"https://github.com/ryukote/cexcore","last_synced_at":"2025-07-23T02:31:31.099Z","repository":{"id":38036248,"uuid":"191298587","full_name":"Ryukote/CexCore","owner":"Ryukote","description":"CexCore is complete and easy to use .NET Core API for communicating with cex.io cryptocurrency exchange.","archived":false,"fork":false,"pushed_at":"2023-10-11T10:23:10.000Z","size":134,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-25T23:44:27.238Z","etag":null,"topics":["altcoin","api","api-client","api-rest","api-wrapper","bitcoin","blockchain","cexio","cryptocurrency","csharp","ethereum","exchange","exchange-api","netcore","rest-api"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ryukote.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":"paypal.me/ryukote"}},"created_at":"2019-06-11T05:15:32.000Z","updated_at":"2025-03-06T19:01:45.000Z","dependencies_parsed_at":"2023-01-24T15:00:40.196Z","dependency_job_id":null,"html_url":"https://github.com/Ryukote/CexCore","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Ryukote/CexCore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryukote%2FCexCore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryukote%2FCexCore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryukote%2FCexCore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryukote%2FCexCore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ryukote","download_url":"https://codeload.github.com/Ryukote/CexCore/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryukote%2FCexCore/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266605983,"owners_count":23955195,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["altcoin","api","api-client","api-rest","api-wrapper","bitcoin","blockchain","cexio","cryptocurrency","csharp","ethereum","exchange","exchange-api","netcore","rest-api"],"created_at":"2025-07-23T02:30:58.519Z","updated_at":"2025-07-23T02:31:31.087Z","avatar_url":"https://github.com/Ryukote.png","language":"C#","readme":"# .NET Core Wrapper for *[CEX.IO](https://cex.io/)*\n\nCexCore is a first (at least on NuGet) .NET Core version of CEX.IO that covers all methods CEX.IO is providing.\n\nCexCore was originally forked Github project from \u003ca href=\"https://github.com/fasetto\"\u003efasetto\u003c/a\u003e which was then ported to .NET Core. I have maintained it until CexCore hit version 2.0.0. In that version I have build CexCore from scratch which means I have moved away from original forked code.\n\nOlder code that was forked and maintained is now under \u003ca href=\"https://github.com/Ryukote/CexCoreOld\"\u003erepository\u003c/a\u003e with changed name, so CexCore repository is now reserved for version 2.0.0 and above.\n\n# CEX.IO account\n\nTo work with this API library you need to have **valid** and **verified** cex.io account.\n\nFor start, under your account select **Profile**\n\n\u003cimg src=\"https://i.imgur.com/fuIpxqs.png\" alt=\"\"\u003e\u003c/img\u003e\n\nUnder **API** tab, mark all 5 boxes under **PERMISSIONS** and click on **Generate Key**\n\n\u003cimg src=\"https://i.imgur.com/iDwvS1d.png\" alt=\"\"\u003e\u003c/img\u003e\n\nIn order to give your developer account full access you need to enable all boxes under **PERMISSIONS**.\n\nWhen your key is generated, write somewhere your **User ID**, **Key** and **Secret** before you clik on **Activate**. When you click on **Activate** your **Secret** will become hidden and you will need to delete this key and generate new if you forgot to write those 3 things down before you activated your key.\n\nYou will need those 3 information if you want to work with CexCore library.\n\nEntire source is available in this repository and you can check that I am not sending your sensitive data anywhere.\n\n# Where to place credentials in your project\n\nCreate **appsettings.json** file if you already don't have it in your project. Store your cex.io sensitive information there.\n\n**IMPORTANT!**: Make sure your **appsettings.json** have next setting:\n\n- **Copy to Output Directory**: \"Copy always\"\n\nSteps to use that **appsettings.json** file:\n\n1. Install NuGet package:\n\n```\ninstall-package Microsoft.Extensions.Configuration.Json\n```\n\n2. Call that **appsettings.json** from your code:\n\n    2.1. Use **IConfiguration**:\n\n```csharp\nIConfiguration configuration = new ConfigurationBuilder()\n    .AddJsonFile(\"appsettings.json\", optional:true, reloadOnChange:true)\n    .Build();\n```\n\nIn first parameter of **AddJsonFile** method, make sure you have included relative path to that json file.\n\n2.2. Make sure you pass **IConfiguration** to whatever place you need. Package by itself doesn't include any constructor with **IConfiguration**, because I don't want to force\nanyone to use **IConfiguration** (and **appsettings.json**) if they don't want to.\n\n2.3. Get any of needed value from **appsettings.json** by using **IConfiguration**:\n\n```csharp\nvar value = _configuration.GetSection(\"cexCredentials\")\n    .GetSection(\"userId\")\n    .Value;\n```\n\n**IMPORTANT**: I have used code above with example string values. Instead of \"cexCredentials\" you can name your JSON object whatever you like\nand same goes with value \"userId\" (key in JSON object).\n\nYou will pass those _configuration values in constructor of any object that requires your credentials.\n\n# Exceptions\n\nCexCore provides several exceptions in the package:\n\n1. **UserIdNotProvidedException** -\u003e You will see this exception if you don't provide user id.\n2. **ApiKeyNotProvidedException** -\u003e You will see this exception if you don't provide api key.\n3. **ApiSecretNotProvidedException** -\u003e You will see this exception if you don't provide api secret.\n4. **CexCollectionException** -\u003e You will see this exception if your collection is empty or null.\n5. **CexNullException** -\u003e You will see this exception if response contains unwanted null in some property.\n\n# Issues\n\nIf you find any issues regarding code or documentation, please open a new issue on [CexCore issues](https://github.com/Ryukote/CexCore/issues)\n\nIf you are openning issue for documentation, please include in title \"[Documentation]\" prefix.\n\n# Public methods\n\ncex.io provides public API that doesn't require your credentials.\n**CexCore** package covers them under **CexCore.Data** namespace under **Public** class. In this part of documentation, you will find how to use methods under that class. Note that every return type under both **Public** and **Account** class is **Tuple** with first parameter being **HttpStatusCode** and second parameter being appropriate object representing data from the response.\n\n## Currency limits\n\n```csharp\nvar currencyLimits = await new Public().GetCurrencyLimitsAsync();\n```\n\nReturn type of this method is **Tuple\u003cHttpStatusCode, CurrencyLimitsResponse\u003e**\n\n## Ticker\n\n```csharp\nusing static CexCore.Common.Symbols;\n```\n\n```csharp\nvar ticker = await new CexCore.Data.Public().GetTickerAsync(CryptoCurrency.BTC, Fiat.USD);\n```\n\nReturn type of this method is **Tuple\u003cHttpStatusCode, TickerResponse\u003e**\n\n## Ticker for all pairs by market\n\n```csharp\nusing static CexCore.Common.Symbols;\n```\n\n```csharp\nList\u003cCryptoCurrency\u003e listOfSymbols = new List\u003cCryptoCurrency\u003e();\nList\u003cFiat\u003e listOfFiat = new List\u003cFiat\u003e();\n\nlistOfSymbols.Add(Symbols.CryptoCurrency.BTC);\n\nlistOfFiat.Add(Symbols.Fiat.EUR);\n\nvar response = await new Public().GetTickersForPairsByMarketAsync(listOfSymbols, listOfFiat);\n```\n\nReturn type of this method is **Tuple\u003cHttpStatusCode, TickerForPairsResponse\u003e**\n\n## Last price\n\n```csharp\nusing static CexCore.Common.Symbols;\n```\n\n```csharp\nvar lastPrice = await new Public().GetLastPriceAsync(CryptoCurrency.BTC.ToString(), Fiat.EUR.ToString());\n```\n\nReturn type of this method is **Tuple\u003cHttpStatusCode, LastPriceResponse\u003e**\n\n## Last prices for given markets\n\n```csharp\nusing static CexCore.Common.Symbols;\n```\n\n```csharp\nList\u003cCryptoCurrency\u003e listOfSymbols = new List\u003cCryptoCurrency\u003e();\nList\u003cFiat\u003e listOfFiat = new List\u003cFiat\u003e();\n\nlistOfSymbols.Add(CryptoCurrency.BTC);\n\nlistOfFiat.Add(Fiat.EUR);\n\nvar tickerByMarket = await new Public().GetTickersForPairsByMarketAsync(listOfSymbols, listOfFiat);\n```\n\nReturn type of this method is **Tuple\u003cHttpStatusCode, TickersForPairsResponse\u003e**\n\n## Convert\n\n```csharp\nusing static CexCore.Common.Symbols;\n```\n\n```csharp\nvar converter = new Converter()\n{\n    Amount = \"1\"\n};\n\nvar convertedAmount = await new Public().GetConvertedAmount(\nCryptoCurrency.BTG.ToString(), CryptoCurrency.BTC.ToString(), converter);\n```\n\nReturn type of this method is **Tuple\u003cHttpStatusCode, Converter\u003e**\n\n## Order book\n\n```csharp\nusing static CexCore.Common.Symbols;\n```\n\n```csharp\nvar orderBook = new OrderBookRequest()\n{\n    Symbol1 = CryptoCurrency.BTC.ToString(),\n    Symbol2 = Fiat.USD.ToString(),\n    Depth = 1\n};\n\nvar orderBook = await new CexCore.Data.Public().GetOrderBook(orderBook);\n```\n\nReturn type of this method is **Tuple\u003cHttpStatusCode, OrderBookResponse\u003e**\n\n## Trade history\n\n```csharp\nusing static CexCore.Common.Symbols;\n```\n\n```csharp\nvar tradeHistory = new TradeHistoryRequest()\n{\n    Symbol1 = \"BTC\",\n    Symbol2 = \"USD\",\n    Since = 1000\n};\n\nvar trade = await new Public().GetTradeHistory(tradeHistory);\n```\n\nReturn type of this method is **Tuple\u003cHttpStatusCode, TradeHistoryResponse\u003e**\n\n# Private/Account methods\n\ncex.io provides private API that require your credentials.\n**CexCore** package covers them under **CexCore.Data** namespace under **Account** class. In this part of documentation, you will find how to use methods under that class. Note that every return type under both **Public** and **Account** class is **Tuple** with first parameter being **HttpStatusCode** and second parameter being appropriate object representing data from the response.\n\n## Account balance\n\n```csharp\nvar accountBalance = new AccountBalanceRequest(userId, apiKey, apiSecret);\n\nvar account = new Account();\n\nvar balance = await account.GetAccountBalanceAsync(accountBalance);\n```\n\nReturn type of this method is **Tuple\u003cHttpStatusCode, AccountBalanceResponse\u003e**\n\n## Open orders\n\n```csharp\nvar baseRequest = new BaseRequest(userId, apiKey, apiSecret);\n\nvar openOrders = await new Account().GetOpenOrdersAsync(baseRequest);\n```\n\nReturn type of this method is **Tuple\u003cHttpStatusCode, OpenOrdersResponse\u003e**\n\n## Open orders by pair\n\n```csharp\nvar baseRequest = new BaseRequest(userId, apiKey, apiSecret);\n\nvar openOrdersByPair = await new Account().GetOpenOrdersByPairAşync(\"BTC\", \"USD\", baseRequest);\n```\n\nReturn type of this method is **Tuple\u003cHttpStatusCode, OpenOrdersResponse\u003e**\n\n## Active order status\n\n```csharp\nvar activeOrderStatus = new ActiveOrderStatusRequest(userId, apiKey, apiSecret);\n\nList\u003cstring\u003e list = new List\u003cstring\u003e();\nlist.Add(\"8550492\");\nlist.Add(\"8550495\");\n\nactiveOrderStatus.OrdersList = list.ToArray();\n\nvar activeOrders = await new Account().GetActiveOrderStatusAşync(activeOrderStatus);\n```\n\nReturn type of this method is **Tuple\u003cHttpStatusCode, ActiveOrderStatusResponse\u003e**\n\n## Cancel order\n\n```csharp\nvar cancelOrderRequest = new CancelOrderRequest(userId, apiKey, apiSecret);\n\ncancelOrderRequest.Id = 12379128;\n\nvar cancelOrder = await new Account().CancelOrderAşync(cancelOrderRequest);\n```\n\nReturn type of this method is **Tuple\u003cHttpStatusCode, CancelOrderResponse\u003e**\n\n## Cancel all orders\n\n```csharp\nvar baseRequest = new BaseRequest(userId, apiKey, apiSecret);\n\nvar cancelAllOrders = await new Account().CancelOrdersForGivenPairAşync(\"BTC\", \"USD\", baseRequest);\n```\n\nReturn type of this method is **Tuple\u003cHttpStatusCode, CancelAllOrdersForGivenPairResponse\u003e**\n\n## Place order\n\nLimit order:\n\n```csharp\nvar placeOrderRequest = new PlaceOrderRequest(userId, apiKey, apiSecret)\n{\n    Type = \"buy\",\n    Amount = 12,\n    Price = 1155.67m\n};\n\nvar placeOrder = await new Account().PlaceOrderAşync(\"BTC\", \"USD\", placeOrderRequest);\n```\n\nMarket order:\n\n```csharp\nvar placeOrderRequest = new PlaceOrderRequest(userId, apiKey, apiSecret)\n{\n    Type = \"buy\",\n    Amount = 12,\n    OrderType = \"market\"\n};\n\nvar placeOrder = await new Account().PlaceOrderAşync(\"BTC\", \"USD\", placeOrderRequest);\n```\n\nReturn type of this method is **Tuple\u003cHttpStatusCode, PlaceOrderResponse\u003e**\n\n## Cryptocurreny address\n\n```csharp\nvar cryptoAddressRequest = new CryptoAddressRequest(userId, apiKey, apiSecret)\n{\n    Currency = \"BTC\"\n};\n\nvar address = await new Account().GetCryptoAddressAşync(cryptoAddressRequest);\n```\n\nReturn type of this method is **Tuple\u003cHttpStatusCode, CryptoAddressResponse\u003e**\n\n## My fee\n\n```csharp\nvar request = new BaseRequest(userId, apiKey, apiSecret);\n\nvar fee = await new CexCore.Data.Account().GetMyFeeAşync(request);\n```\n\nReturn type of this method is **Tuple\u003cHttpStatusCode, GetMyFeeResponse\u003e**\n\n## Cancel replace order\n\n```csharp\nvar cancelReplaceOrderRequest = new CancelReplaceOrderRequest(userId, apiKey, apiSecret)\n{\n    Type = \"buy\"\n};\n\nvar cancel = await new Account().CancelReplaceOrderAsync(\"BTC\", \"USD\", cancelReplaceOrderRequest);\n```\n\nReturn type of this method is **Tuple\u003cHttpStatusCode, CancelReplaceOrderResponse\u003e**\n\n## Open position\n\n```csharp\nvar request = new OpenPositionOrderRequest(userId, apiKey, apiSecret)\n{\n    Symbol = \"BTC\",\n    MSymbol = \"BTC\"\n};\n\nvar openPosition = await new Account().OpenPositionAsync(\"BTC\", \"USD\", request);\n```\n\nReturn type of this method is **Tuple\u003cHttpStatusCode, OpenPositionOrderResponse\u003e**\n\n## Close position\n\n```csharp\nvar request = new ClosePositionRequest(userId, apiKey, apiSecret)\n{\n    Id = 1290312\n};\n\nvar closePosition = await new Account().ClosePositionAsync(\"BTC\", \"USD\", request);\n```\n\nReturn type of this method is **Tuple\u003cHttpStatusCode, ClosePositionResponse\u003e**\n","funding_links":["paypal.me/ryukote"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryukote%2Fcexcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryukote%2Fcexcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryukote%2Fcexcore/lists"}