Closed henningms closed 6 years ago
Hi, I'm not sure why that would happen. It's working for me.
Could you maybe provide me with an ApiKey/secret that is no longer active and wasn't working? Make sure it is no longer active. I can then check if there are some differences when encoding them compared to my own.
Hmm, weird.
Revoked API key: Key: gXJWyEY53IwPk425jytbAGRsyw7NPvLkM5LCdA2o4eM Secret: TtXWNOzAyC3tUTlkYhW8UgqZkF857Eyej9JYKvKU2si
I don't really see anything wrong. Can you put log verbosity on debug and share the logging you get?
2018.04.16 12:05:13:597 | Info | Loglevel set to Debug
2018.04.16 12:05:16:163 | Debug | Sending signed request to https://api.bitfinex.com/v2/auth/r/orders/tBTCUSD/hist
2018.04.16 12:05:16:806 | Warning | Server returned an error: ["error",10100,"apikey: invalid"]
That's what I get when logging debug, so not a lot more. So you can retrieve order history with your api key(s)? Weird.
(This is with an active key)
I'm sorry, I actually get nonce: small error when using the checked out code. I modified the nonce a bit when I first started testing.
Although changing the nonce to become higher result in the apikey invalid error so yeah. No luck there hmm.
I can retrieve it with my keys yes. Maybe it has something to do with localization. What culture and timezone is your computer in?
Nonce: small indicates a nonce that is smaller than a previously provided one. Nonce should always be higher than the ones before, so if you sent a high nonce earlier you'll need to wait till that time is passed or you'll have to use a higher nonce from now on.
I'm in Norway which is UTC+2 right now.
Not sure what's happening, but I figured out why my own POST attempt failed. I forgot the / before API in the signature string.
Your own post attempt?
I've tried to write my own little snippet for retrieving orders history. Unable to get it to work I tried your library, but I seemed to get the same error. I'll try to debug using your library now that I got my own code working.
I see. Please let me know if you find anything. Hard to debug on this side if nothing is breaking ;)
Have you managed to find out why your own snippet is working but the lib doesn't? Would be great if I could fix it.
Hi, no, I will do a diff of the two requests later today!
Figured out. It has to do with the nonce apparently.
Could you test for me on your end if you replace the nonce generation from
private string nonce => Math.Round((DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalMilliseconds * 10).ToString(CultureInfo.InvariantCulture);
to this one:
private string nonce => ((long)((DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalMilliseconds * 1000)).ToString();
and see if it works fine on your end? Using the original code I either get a nonce too small or a nonce invalid due to the string becoming "1.543435663+E9".
Seems to work fine for me, I've changed it to in the latest version being pushed now. Thanks for your help on this!
I have same issue when call GetWalletsAsync().
Because of postParametersPosition = PostParameters.InUri, WriteParamBody can not be called.
This has been fixed in the latest version again.
Hi there,
I've been trying your library to see if I could retrieve orders history etc because I've been struggling to do so myself but I get APIKey Invalid error.
Do you know why this occurs? Tried generating new api keys and testing them as well to no luck.