Skip to content

dursuntokgoz/Paribu.Net

Repository files navigation

Icon Paribu.Net

A .Net wrapper for the Paribu API, 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

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 Paribu.Net

To get started with Paribu.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 'Paribu.Net' and hit enter. The Paribu.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 Paribu.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 Paribu.Net will be installed in. After selecting the correct project type Install-Package Paribu.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 Paribu.Net.

Getting started

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

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

Rest Api Examples

Public Endpoints

ParibuClient api = new ParibuClient();

/* Initials Data */
var p01 = api.GetInitials();
var p02 = api.GetBanners();
var p03 = api.GetDisplayGroups();
var p04 = api.GetExchangeConfig();
var p05 = api.GetCurrencies();
var p06 = api.GetMarkets();
var p07 = api.GetInitialTickers();

/* Ticker Data */
var p11 = api.GetTickers();

/* Market Data */
var p21 = api.GetMarketData("btc-tl");
var p22 = api.GetCandles("btc-tl");
var p23 = api.GetOrderBook("btc-tl");
var p24 = api.GetTrades("btc-tl");

Websocket Api Examples

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

Core » Public Feeds

var ws = new ParibuSocketClient();
ws.SetPusherApplicationId("a68d528f48f652c94c88");

var sub01 = ws.SubscribeToTickers((data) =>
{
    if (data != null)
    {
        Console.WriteLine($"Ticker State >> {data.Pair} " +
            (data.Open.HasValue ? $"O:{data.Open} " : "") +
            (data.High.HasValue ? $"H:{data.High} " : "") +
            (data.Low.HasValue ? $"L:{data.Low} " : "") +
            (data.Close.HasValue ? $"C:{data.Close} " : "") +
            (data.Volume.HasValue ? $"V:{data.Volume} " : "") +
            (data.Change.HasValue ? $"CH:{data.Change} " : "") +
            (data.ChangePercent.HasValue ? $"CP:{data.ChangePercent} " : "") +
            (data.Average24H.HasValue ? $"Avg:{data.Average24H} " : "") +
            (data.VolumeQuote.HasValue ? $"G:{data.VolumeQuote} " : "") +
            (data.Bid.HasValue ? $"Bid:{data.Bid} " : "") +
            (data.Ask.HasValue ? $"Ask:{data.Ask} " : "") +
            (data.EBid.HasValue ? $"EBid:{data.EBid} " : "") +
            (data.EAsk.HasValue ? $"EAsk:{data.EAsk} " : "")
            );
    }
}, (data) =>
{
    if (data != null)
    {
        Console.WriteLine($"Ticker Prices >> {data.Pair} C:{data.Prices.Count()} P:{string.Join(',', data.Prices)}");
    }
});

// Order Book & Trades
var sub02 = ws.SubscribeToMarketData("btc-tl", (data) =>
{
    if (data != null)
    {
        Console.WriteLine($"Book Update >> {data.Pair} " +
            $"AsksToAdd:{data.AsksToAdd.Count} " +
            $"BidsToAdd:{data.BidsToAdd.Count} " +
            $"AsksToRemove:{data.AsksToRemove.Count} " +
            $"BidsToRemove:{data.BidsToRemove.Count} "
            );
    }
}, (data) =>
{
    if (data != null)
    {
        Console.WriteLine($"New Trade >> {data.Pair} T:{data.Timestamp} P:{data.Price} A:{data.Amount} S:{data.Side}");
    }
});

// Unsubscribe
_ = ws.Unsubscribe(sub02.Data);

Release Notes*

  • Version 2.0.1 - 01 Feb 2021

    • Fixed some minor bugs
    • 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.9 - 16 Jan 2021

    • Fixed some minor bugs
  • Version 1.2.8 - 12 Jan 2021

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

    • First Release

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages