Skip to content

Instantly share code, notes, and snippets.

@KolevDarko
Last active October 25, 2018 13:55
Show Gist options
  • Save KolevDarko/9e515bc88dffc68de3409f5aee3f64c9 to your computer and use it in GitHub Desktop.
Save KolevDarko/9e515bc88dffc68de3409f5aee3f64c9 to your computer and use it in GitHub Desktop.
// Install with: > npm install bitcoinaverage
const ba = require('bitcoinaverage');
var pub = '<your public key>';
var secret = '<your secret key>';
var wsClient = ba.websocketClient(pub, secret);
wsClient.connectToTickerWebsocketV2('global', ['ETHUSD', 'BCHUSD', 'LTCUSD', 'ETCUSD'], function(response) {
console.log(response.data.global);
}, function(error){
console.log(error)
}, function(){
console.log("websocket closed");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment