Skip to content
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.
/ Coinzo.Net Public archive

Open Source .Net Wrapper for the coinzo.com Rest Api and Websockets Api

License

Notifications You must be signed in to change notification settings

burakoner/Coinzo.Net

Repository files navigation

Icon Coinzo.Net

A .Net wrapper for the Coinzo API as described on Coinzo, including all features the API provides using clear and readable objects.

If you think something is broken, something is missing or have any questions, please open an Issue

CryptoExchange.Net

Implementation is build upon the CryptoExchange.Net library, make sure to also check out the documentation on that: docs

My CryptoExchange.Net implementations:


OKEx

Chiliz

BitMax

BtcTurk

Paribu

Thodex

Coinzo

Tatum

JKorf CryptoExchange.Net implementations:


Binance

Bitfinex

Bittrex

CoinEx

Huobi

Kraken

Kucoin

Implementations from third parties:


Bitmex

Exante

HitBTC

Liquid

LiveCoin

Switcheo

Donations

Donations are greatly appreciated and a motivation to keep improving.

BTC: 33WbRKqt7wXARVdAJSu1G1x3QnbyPtZ2bH
ETH: 0x65b02db9b67b73f5f1e983ae10796f91ded57b64

Installation

Nuget version Nuget downloads Available on Nuget.

PM> Install-Package Coinzo.Net

To get started with Coinzo.Net first you will need to get the library itself. The easiest way to do this is to install the package into your project using NuGet. Using Visual Studio this can be done in two ways.

Using the package manager

In Visual Studio right click on your solution and select 'Manage NuGet Packages for solution...'. A screen will appear which initially shows the currently installed packages. In the top bit select 'Browse'. This will let you download net package from the NuGet server. In the search box type 'Coinzo.Net' and hit enter. The Coinzo.Net package should come up in the results. After selecting the package you can then on the right hand side select in which projects in your solution the package should install. After you've selected all project you wish to install and use Coinzo.Net in hit 'Install' and the package will be downloaded and added to you projects.

Using the package manager console

In Visual Studio in the top menu select 'Tools' -> 'NuGet Package Manager' -> 'Package Manager Console'. This should open up a command line interface. On top of the interface there is a dropdown menu where you can select the Default Project. This is the project that Coinzo.Net will be installed in. After selecting the correct project type Install-Package Coinzo.Net in the command line interface. This should install the latest version of the package in your project.

After doing either of above steps you should now be ready to actually start using Coinzo.Net.

Getting started

After installing it's time to actually use it. To get started we have to add the Coinzo.Net namespace: using Coinzo.Net;.

Coinzo.Net provides two clients to interact with the Coinzo API. The CoinzoClient provides all rest API calls. The CoinzoSocketClient provides functions to interact with the websocket provided by the Coinzo API. Both clients are disposable and as such can be used in a usingstatement.

Rest Api Examples

Public Endpoints

CoinzoClient api = new CoinzoClient();

var tickers = api.GetTickers("BTC-TRY");
var orderbook = api.GetOrderBook("BTC-TRY");
var trades = api.GetTrades("BTC-TRY");

Private Endpoints

CoinzoClient api = new CoinzoClient();
api.SetApiCredentials("XXXXXXXX-API-KEY-XXXXXXXX", "XXXXXXXX-API-SECRET-XXXXXXXX");

var usage = api.GetUsage();
var balances = api.GetBalances();
var place_order = api.PlaceOrder("CNZ-TRY", 100, CoinzoOrderSide.Sell, CoinzoOrderType.Limit, 0.40m);
var order_status = api.GetOrderStatus(359420493762035717);
var cancel_order = api.CancelOrder(359420493762035717);
var cancel_all_orders = api.CancelAllOrders();
var orders = api.GetOrders();
var fills = api.GetFills();
var address = api.GetDepositAddress("BTC");
var deposits = api.GetDepositHistory();
var withdraw = api.Withdraw("ETH", "0x65b02db9b67b73f5f1e983ae10796f91ded57b64", 1.15m);
var withdrawals = api.GetWithdrawHistory();

Websocket Api Examples

The Coinzo.Net socket client provides several socket endpoint to which can be subscribed.

Core » Public Feeds

var ws = new CoinzoSocketClient();

// Trades
var ws01 = ws.SubscribeToTrades("BTC-TRY", (data) =>
{
    if (data != null)
    {
        Console.WriteLine($"Trade Update >> {data.Pair} >> TID:{data.TradeId} OID:{data.OrderId} A:{data.Amount}");
    }
});

// Ticker
var ws02 = ws.SubscribeToTicker("BTC-TRY", (data) =>
{
    if (data != null)
    {
        Console.WriteLine($"Ticker Update >> {data.Pair} >> C:{data.Change} CP:{data.ChangePercent} O:{data.Open} H:{data.High} L:{data.Low} C:{data.Close} V:{data.Volume}");
    }
});

// Candles
var ws03 = ws.SubscribeToCandles("BTC-TRY", CoinzoPeriod.OneHour, (data) =>
{
    if (data != null)
    {
        Console.WriteLine($"Candle Update >> {data.Pair} >> C:{data.Period} O:{data.Open} H:{data.High} L:{data.Low} C:{data.Close} V:{data.Volume}");
    }
});

// OrderBook
var ws04 = ws.SubscribeToOrderBook("BTC-TRY", (data) =>
{
    if (data != null)
    {
        Console.WriteLine($"Book Total Update >> {data.Pair} >> A:{data.Amount} V:{data.Value}");
    }
}, (data) =>
{
    if (data != null)
    {
        Console.WriteLine($"Book Entry Update >> {data.Pair} >> A:{data.Amount} C:{data.Count} OID:{data.OrderId}");
    }
});

// Unsubscribe
var uns = ws.Unsubscribe(ws01.Data);

Release Notes

  • Version 2.5.0 - 18 Sep 2021

    • Synced with CryptoExchange.Net v4.1.0
  • Version 2.1.0 - 31 Mar 2021

    • Updated dependencies
  • Version 2.0.1 - 01 Feb 2021

    • Updated CryptoExchange.Net to 3.6.0
  • Version 2.0.0 - 17 Jan 2021

    • All methods are virtual now. You can customize methods by overriding.
    • Fixed several minor bugs
  • Version 1.2.8 - 12 Jan 2021

    • Updated CryptoExchange.Net to 3.5.0
  • Version 1.0.0 - 02 Jan 2021

    • First Release

About

Open Source .Net Wrapper for the coinzo.com Rest Api and Websockets Api

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages