question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

KrakenOrderbookOptions error messages

See original GitHub issue

Code (this is basicly from the examples): KrakenSymbolOrderBook orderBook = new KrakenSymbolOrderBook("XXBTZEUR", 1, new KrakenOrderBookOptions(20));

Gives an error message: CS1503 Argument 1: cannot convert from ‘int’ to ‘Kraken.Net.Interfaces.IKrakenSocketClient’

When i change it like this:

var client = new KrakenSocketClient(options);
KrakenSymbolOrderBook orderBook = new KrakenSymbolOrderBook("XXBTZEUR", 1, new KrakenOrderBookOptions(client));

The error is gone But now when connecting using the following:

 var startResult = await orderBook.StartAsync();

            if (!startResult.Success)
            {
                Console.WriteLine("Error starting order book synchronization: " + startResult.Error);
               return;
            }

It stops, because startResult.Error is: {3: Server error: Subscription depth not supported}

Which makes sense because a client is not a depth 😃 Is this an issue, or a user error ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JKorfcommented, Sep 11, 2019

The websocket connection works based on events. So when you’re calling SubscribeToTickerUpdates you connect to a stream and when data is received on that stream you get an update. To handle the update you’ll have to pass an update handler to the subscribe method. This is what the data => {} bit is. Between the {} you’ll have to handle the data. What to do with it is obviously up to you, but having a console application this will simply write the price of the latest tick to the console:

client.SubscribeToTickerUpdates("XBT/EUR", data => { 
      Console.WriteLine(data.Market + " last trade price: " + data.Data.LastTrade.Price);
});
0reactions
JKorfcommented, Sep 11, 2019

Yup that’s fine. (You could shorthand it by writing client.SubscribeToTickerUpdates("XBT/EUR", Ticker);, which is the same)

Read more comments on GitHub >

github_iconTop Results From Across the Web

API error messages
Most API requests are completed successfully, but sometimes things go wrong and an error message is returned instead of the expected response.
Read more >
Possible Trading Errors and how to resolve them
Occasionally, you may see an error when connecting an exchange or executing an order, please read on to learn more & resolve your...
Read more >
node.js - How to maintain a valid order book in kraken ...
I'm sending my code below. I'd like help to solve this issue. const websocket = require('ws'); const ...
Read more >
cryptofeed
Cryptocurrency Exchange Websocket Data Feed Handler.
Read more >
GoCryptoTrader package Kraken
GoCryptoTrader package Kraken. Build Status Software License GoDoc Coverage Status Go Report Card. This kraken package is part of the GoCryptoTrader ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found