gemini-api-node icon indicating copy to clipboard operation
gemini-api-node copied to clipboard

Trouble Constructing WebSockets

Open droconnel22 opened this issue 6 years ago • 1 comments

I am trying to do a naive update based on the ReadMe, but I am having trouble moving it to consume updates from the initial open.

My code via a es6 module:

let ops = { key:'', secret:'', sandbox: true };

self.__geminiWebSocket = new GeminiAPI.WebsocketClient(ops);
self.__geminiWebSocket.openMarketSocket(symbol, () => 
      console.log('opened');
      this.__geminiWebSocket.addMarketMessageListener((data) => {          
       
        console.log(data); // works
       
      });

// doesn't work :(

                       self.__geminiWebSocket.addMarketListener('trade', (data) =>{
                                      var count =0;
                                     console.log('more stuff');
                                        console.log(data);
                                console.log(count++);
      });

Thank you!

droconnel22 avatar Oct 04 '17 22:10 droconnel22

I'm currently refurbishing this package, the major version of ws is jumping from 2 to 7, and this WebSocket API wrapper may well experience a breaking API change. I'll make sure I test WebSockets well when the new version lands. I'll leave this issue open for now.

mjesuele avatar Aug 01 '20 16:08 mjesuele