-
Notifications
You must be signed in to change notification settings - Fork 134
Bitfinex Auth calls fail #97
Comments
Hey @Razorbob, Cheers, |
Hello @nlsdfnbch , I wrote a short script for authenticated Rest and WSS calls in python for apiv2 to assure that the keys are correct - so no issue there, but strangely I got the same error when I tried with v1. Maybe a bitfinex problem? Liebe Grüße, |
@Razorbob , As long as the return code isn't a 5XX status code, it appears to be an issue with my code, unfortunately. |
@nlsdfnbch, I can send you the codesnipped for v2 from my own Script - but it is nothing special. I will post it after I return. Liebe Grüße |
Oh and i will try bitex v2, when i have Time again. |
Hey @Razorbob, Running this (Bitex 1.2.1):
works without issue for me. |
Hey @nlsdfnbch, Can you try doing an ask or Bid? |
Ah, I just noticed the error |
Hello @nlsdfnbch
Instead with a quick and dirty script
I am getting fine results - I gave the key full access to everything. So I srsly don't know, sorry Regards |
Imports
execute the methode with:
|
Hey @Razorbob , Also, just to clarify - the client you're using accesses the REST API (not the websocket, like you are in your code), just to make sure we're on the same page. Thanks! |
Hey @nlsdfnbch,
which was simply structured like this (I think this was your Documentation of Bitex):
The second error is constantly showing, if i call it like this: As for the example code I posted, it was just some quick test if the keys work and since v2 REST API has no place bid or ask functionality, even for authenticated requests, I had to code up a websocket call. |
And I missclicked, sorry didn't want to close the issue. |
@Razorbob, v2 REST isn't supported by bitex 1.2.x anyway. Alright, since somethings' amiss, try running this:
Keep the
|
@nlsdfnbch Here is the Log:
I tried it out with my api keys as well, also yields a 200 Regards |
Hm. Then this issue is resolved, no? Did you try the other methods as well? |
@nlsdfnbch I tried this :
with that error :
|
That smells familiar. I will look into this first thing tomorrow morning. |
Ok, so I've had a similar issue in Since I took the bitfinex doc nonce as a reference, I doubt this is the cause for this error. In the meantime, can you confirm that this happens everytime you try to call it ? or just sporadically? |
@nlsdfnbch - I still have have the same issue after upgrading to latest update from production. Below is the code I am executing and have attached the logs from bitex.api.REST import BitfinexREST
k = BitfinexREST()
k.load_key('bitfinex.txt') # loads key and secret from given file;
status = k.query('POST', 'orders', authenticate=True)# query an authenticated end point;
print(status.text) |
Hm. I cannot replicate this error.
calling |
How are you able to call Bitfinex.orders() ? Do you see anything wrong with the code I posted above. DEBUG:urllib3.connectionpool:https://api.bitfinex.com:443 "POST /v1/orders HTTP/1.1" 200 None is what you get when you send a request. I have 400 instead of 200. Is it something to do with that ? |
Code To use the interface object, do this: from bitex import Bitfinex
c = Bitfinex(key="BAEtHJu3ze6hBN26R8ArWSA5Gawb39IGtOcB4WHRWJ5",
secret="X7bP4NZHgf7JU6UPfzrHqujkgh4TdgBVD17dBEyUz86")
print(c.orders().json()) # returns [] You can call any other supported method (see the source code for more on this). Your code isn't wrong - it just uses the low-level API objects, instead of the high-level and more user-friendly interface objects. |
@nlsdfnbch - When I use your key as displayed above, it works. Probably there is an issue with my account key. I will try again with new set of key and secret. Thanks |
@nlsdfnbch - I still have the same error {Nonce is too small'}. Not sure what's going wrong. I have the following nonce() function. Should the multiplier be 1000000 instead of 100000 |
@pchandra-uchicago , |
@nlsdfnbch - I tried your lib for bitfinex to post order. I was always getting 400 with message {Nonce is too small'}. I looked up a bit and found the currect nonce needs to be multiplied by a factor(20 worked for me).
Seems this issue is there with official bitfinex node api as well(but they allow us to pass custom nonce generator) |
@abb152, where did you find this information? Their API documentation uses a unix timestamp with millisecond resolution (which is what the library currently employs). Unfortunately Bitfinex hasn't answered any of my tickets regarding this issue, which makes it quite frustrating to fix. I'll add multiplication by factor 2. @pchandra-uchicago, @Razorbob , let me know if this solves the issue. It certainly wouldn't be the ideal solution, but I guess I'll just have to roll with it. |
@nlsdfnbch askmike/gekko#595 Here a guy mentioned this:
The nonce i generated was around 15XXXXXXXXXXX so i thought of multiplying with a factor and it worked |
I do not know if it will be related to this but I have seen an error in interfaces\bitfinex.py. You have to delete a hyphen in "type" so that the orders are correctly executed. The correct is 'type': 'exchange limit'} without a hyphen |
@Cloniko , thanks for the pointer! I fixed this on |
Not sure if this is the best place to put this, but I was getting a similar issue. It turned out to be a function in the bitfinex.py interfaces module. basically I had to change:
` @return_api_response(fmt.order)
The size and price parameters needed to be cast to strings in the place_order function. This was already done in ask, just missing in bid. Could be a separate issue? |
It's not an issue with the library per se. On dev, we no longer convert to However, adding this conversion would require less reading of API documentation for lib users - this can be both a good and bad thing. So I'm currently undecided how to handle this. But thank you for pointing this out! |
Agreed, maybe just make sure the bid and ask methods are aligned then, as one converts to string and the other doesnt |
@Razorbob
The value of req['request'] is "0/action" in this case, but should be "/0/action" to get a correct "data". This works for me, but I don't know whether it works in your case. |
Hello, just wanted to point out, that bitfinex auth request fail.
ERROR:bitex.utils:return_api_response: HTTPError for url https://api.bitfinex.com/v1/order/new Traceback (most recent call last): File "C:\Users\xxx\AppData\Local\Programs\Python\Python36-32\lib\site-packages\bitex\utils.py", line 40, in wrapper r.raise_for_status() File "C:\Users\xxx\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\models.py", line 935, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.bitfinex.com/v1/order/new {'message': 'Invalid X-BFX-SIGNATURE.'}
Regards
The text was updated successfully, but these errors were encountered: