gemini-api-node
gemini-api-node copied to clipboard
Trouble Constructing WebSockets
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!
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.