-
Notifications
You must be signed in to change notification settings - Fork 63
Description
// Using the provided example code (which worked for me last week),
// this results in "Key/Secret Pair Failed".
// Anyone else having this problem, or is it just me?
// (Yes, I have included a real key/secret, but it is to a new trial account with no exchange keys.
// But I get the same error with my paid subscription account. And coinigy support hasn't
// answered my ticket yet, after almost 4 days)
var socketCluster = require('socketcluster-client');
var api_credentials =
{
"apiKey" : "77c6ba0a9f264d497fef1fd298719dce",
"apiSecret" : "e4759419caae402dfc5930ff1c23e065"
}
var options = {
hostname : "sc-02.coinigy.com",
port : "443",
secure : "true"
};
console.log(options);
var SCsocket = socketCluster.connect(options);
SCsocket.on('connect', function (status) {
console.log(status);
SCsocket.on('error', function (err) {
console.log(err);
});
SCsocket.emit("auth", api_credentials, function (err, token) {
if (!err && token) {
var scChannel = SCsocket.subscribe("TRADE-OK--BTC--CNY");
console.log(scChannel);
scChannel.watch(function (data) {
console.log(data);
});
SCsocket.emit("exchanges", null, function (err, data) {
if (!err) {
console.log(data);
} else {
console.log(err)
}
});
SCsocket.emit("channels", "OK", function (err, data) {
if (!err) {
console.log(data);
} else {
console.log(err)
}
});
} else {
console.log(err)
}
});
});