craysiii / binance

API Wrapper for the Binance cryptocurrency exchange written in Ruby.
MIT License
97 stars 79 forks source link

Client connection issue #25

Closed mchalise closed 6 years ago

mchalise commented 6 years ago

Binance::Client::REST.new(token, secret)

I don't know why but it's not working for some Binance API keys. But if the same key is used using CURL it works. Is there any fault in GEM? Output:

{"code"=>-2015, "msg"=>"Invalid API-key, IP, or permissions for action."}

craysiii commented 6 years ago

Is it only for certain API keys? Could you provide more code for context?

mchalise commented 6 years ago

yes. For certain API keys. Some are working and some are not using this gem. And if I take that same not working key and use it from other wrappers like python or normal CURL it works. I don't know what's the matter. @craysiii

mchalise commented 6 years ago

About code you requested.

client = Binance::Client::REST.new(
        api_key: 'some api key',
        secret_key: 'some secret key'
     )
client.account_info

should give me account detail. Instead its giving me

{"code"=>-2015, "msg"=>"Invalid API-key, IP, or permissions for action."}

craysiii commented 6 years ago

Hmm. Very interesting. Not much I could do without taking a closer look at the HTTP requests and responses, and being that it would include sensitive information, I both think that wouldn't be doable.

I would check to ensure that you're typing the API and secret key correctly, that the keys do have the proper permissions set, and that somehow your IP isn't being changed by a proxy/vpn or something.

By the way, which version of the gem are you using?