Coder Social home page Coder Social logo

cduvall / kraken-wsapi-dotnet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from m4cx/kraken-wsapi-dotnet

0.0 0.0 0.0 1.84 MB

C# / .NET Standard Client for connecting to the public kraken.com WebSocket API

License: MIT License

JavaScript 0.06% C# 99.94%

kraken-wsapi-dotnet's Introduction

master develop nuget
Build Status Build Status Stable

kraken-wsapi-dotnet

C# / .NET Standard Client for connecting to the public kraken.com WebSocket API

API Documentation

See the official documentation fur further information https://www.kraken.com/features/websocket-api

Getting started

Installing it in your project environment

Get the current version from NuGet Gallery using the Package Manager / .NET CLI

PM> Install-Package Kraken.WebSockets # Package Manager
> dotnet add package Kraken.WebSockets # .NET CLI

For detailed information on the installing of pre-release versions please refer to the NuGet Gallery itself.

Create a connection and listen for events

Creating a connection is pretty easy but will also be improved in the future. But for now just do it like this:

var uri = "wss://ws-sandbox.kraken.com";
var serializer = new KrakenMessageSerializer();
kraken = new KrakenWebSocket(uri, serializer);

var client = new KrakenApiClient(kraken, serializer);

client.SystemStatusChanged += (sender, e) => Console.WriteLine($"System status changed");
client.SubscriptionStatusChanged += (sender, e) => Console.WriteLine($"Subscription status changed"); ;
client.TickerReceived += (sender, e) => Console.WriteLine($"Ticker received");
client.OhlcReceived += (sender, e) => Console.WriteLine($"Ohlc received");
client.TradeReceived += (sender, e) => Console.WriteLine($"Trade received");
client.SpreadReceived += (sender, e) => Console.WriteLine($"Spread received");
client.BookSnapshotReceived += (sender, e) => Console.WriteLine($"BookSnapshot received");
client.BookUpdateReceived += (sender, e) => Console.WriteLine($"BookUpdate received");
await kraken.ConnectAsync();

You can also find a running example in the repository.

Support

If you like the stuff I do, please don't hesitate to support my actions by donating me a coffee!

Buy me a coffeeBuy me a coffee

-Me

kraken-wsapi-dotnet's People

Contributors

m4cx 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.