Coinigy / api

Coinigy API Examples
162 stars 65 forks source link

"Key/Secret Pair Failed", but key+secret is correct #34

Open freeideas opened 6 years ago

freeideas commented 6 years ago

// 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)
    }
});

});

robborden commented 6 years ago

The websocket API is currently disabled due to excessive load being placed on the platform by people using the API improperly in order to bypass channel-limit restrictions. We've been forced to temporarily suspend the service until we're able to implement a way to prevent people from abusing it and causing issues with the platform. We expect it to be back online within the next couple of weeks.

sacOO7 commented 6 years ago

Hi @robborden any updates on this?

robborden commented 6 years ago

Hi, thanks for asking. The websocket API is available again, however you must be a Coinigy CryptoFeed subscriber to access it now. You may upgrade your subscription here: https://www.coinigy.com/subscription/renew

sacOO7 commented 6 years ago

Hi @robborden, I am currently the main author of all socketcluster clients. I am planning to write sample code in every language [ Java, Python, Golang, Swift, DotNet, C, Ruby (coming up...)] to create connection with coinigy api. I will probably host it on github gists. Sample python code can be found here https://gist.github.com/sacOO7/3a0040b1e7e53a5c68d37a3347fafde2. There are plenty of developers currently asking for way to connect to coinigy websocket server-api. I think it will be really helpful for them to basic idea to use the api. I am not sure if I need to purchase subscription with coinigy to test all those codes. But it will be helpful if you can provide any guest credentials that will be helpful for testing... (If you can ....). My gittter id is https://gitter.im/sacOO7. Also, if you need any official support for clients, we can talk about it 👍 .

sacOO7 commented 6 years ago

Hi @robborden , any updates on above?

sacOO7 commented 5 years ago

HI @freeideas , you can find java code here https://gist.github.com/sacOO7/a3fc817dfc5c85cf21ec96f09869fdfc