Giter Site home page Giter Site logo

bitmex-client-websocket's Introduction

Logo

Bitmex websocket API client Build Status NuGet version

This is a C# implementation of the Bitmex websocket API found here:

https://www.bitmex.com/app/wsAPI

License:

Apache License 2.0

Features

  • instalation via NuGet (Bitmex.Client.Websocket)
  • public and authenticated API
  • targeting .NET Standard 2.0 (.NET Core, Linux/MacOS compatible)
  • reactive extensions (Rx.NET)
  • integrated logging (Serilog)

Usage

var exitEvent = new ManualResetEvent(false);
var url = Bitmex.ApiWebsocketUrl;

using (var communicator = new BitmexWebsocketCommunicator(url))
{
    using (var client = new BitmexWebsocketClient(communicator))
    {
        client.Streams.InfoStream.Subscribe(info =>
        {
            Console.WriteLine($"Info received, reconnection happened.")
            client.Send(new PingRequest()).Wait();
        });

        client.Streams.PongStream.Subscribe(pong =>
        {
            Console.WriteLine($"Pong received!")
            exitEvent.Set();
        });

        await communicator.Start();

        exitEvent.WaitOne(TimeSpan.FromSeconds(30));
    }
}

More usage examples:

  • integration tests (link)
  • console sample (link)

API coverage

PUBLIC Covered
Info
Ping-Pong
Errors
Subscribe
Unsubscribe
Announcement
Chat
Connected
Funding
Instrument
Insurance
Liquidation
Orderbook L2
Orderbook L10
Public notifications
Quote
Quote bin 1m
Quote bin 5m
Quote bin 1h
Quote bin 1d
Settlement
Trade
Trade bin 1m
Trade bin 5m
Trade bin 1h
Trade bin 1d
AUTHENTICATED Covered
Affilate
Execution
Order
Margin
Position
Private notifications
Transact
Wallet

Pull Requests are welcome!

Donations gratefully accepted.

  • Bitcoin: 1HfxKZhvm68qK3gE8bJAdDBWkcZ2AFs9pw
  • Litecoin: LftdENE8DTbLpV6RZLKLdzYzVU82E6dz4W
  • Ethereum: 0xb9637c56b307f24372cdcebd208c0679d4e48a47

bitmex-client-websocket's People

Contributors

marfusios avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.