-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No WebSocket Response #296
Comments
hi @dsconsole283 the websocket seems to be working on my end. Here is an example snippet you can try. You should fill in the authenticator with your sandbox credentials and use the readme if you need some help with that. (https://github.com/dougdellolio/coinbasepro-csharp#how-to-use) Example code: public class Program
{
public static void Main(string[] args)
{
//fill this in with your own authenticator
var authenticator = new Authenticator(...);
//create the CoinbasePro client using the sandbox
var coinbaseProClient = new CoinbaseProClient(authenticator, true);
//subscribe to the ticker channel type
var productTypes = new List<string> { "BTC-USD" };
var channels = new List<ChannelType> { ChannelType.Full };
var webSocket = coinbaseProClient.WebSocket;
webSocket.Start(productTypes, channels);
webSocket.OnDoneReceived += (sender, e) =>
{
Print(e);
};
Console.ReadKey();
}
private static void Print(WebfeedEventArgs<Done> webfeedEventArgs)
{
Console.WriteLine("OrderId = " + webfeedEventArgs.LastOrder.OrderId);
Console.WriteLine("Price = " + webfeedEventArgs.LastOrder.Price);
Console.WriteLine("Reason = " + webfeedEventArgs.LastOrder.Reason);
Console.WriteLine("Remaining Size = " + webfeedEventArgs.LastOrder.RemainingSize);
Console.WriteLine("Side = " + webfeedEventArgs.LastOrder.Side);
Console.WriteLine("==============");
}
} |
Thank you so much! I'll give it a try. It's strange because my code is similar except for the subscriber method.. I basically just cemented the understanding of events today, so I have some refining to do. Thanks again! PS I'm looking for a C# friend/mentor if anyone sees this and is generous enough to lend their time! |
Hey @dsconsole283 you seem like a right ol' chum. I can mentor you in the world of programming. I am, as they say, an expert. A Grand Champ in programming if you will. So just let me know. |
As the library changed in anyway? It was working for several years and all of a sudden, i am not getting any websocket information for ticker. Here is the code, Was working before...
I am not getting any callbacks to WebSocket_OnTickerReceived anymore. Why is that? I am not using any authenticator. |
Hello!
I just want to preface by letting you know that I am not very experienced in any of this...
Hopefully this isn't user error, but I can't seem to get a response from any event available with the websocket. I have received bid/ask information using the REST API (
var result = await client.ProductsService.GetProductTickerAsync("ADA-USD");
), but the websocket status only ever says "connecting" and never invokes any event. I guess my actual question is: has anything changed or are there any known issues as to why this may not be working? Or is this most likely an error on my part? Thanks for any help!The text was updated successfully, but these errors were encountered: