krijnsent / crypto_vba

An Excel/VBA project to communicate with various cryptocurrency exchanges APIs
MIT License
155 stars 54 forks source link

Kraken Error - EAPI:Invalid nonce #24

Closed Pi-Rr closed 6 years ago

Pi-Rr commented 6 years ago

Opening a new tickets for Kraken as the private balance download is not working consistently. Sometime running the macro works perfectly, and sometime the Kraken Balance table return the following error: "EAPI:Invalid nonce".

I cannot figure out why it is happening, but if you wait and try again a bit later it works again. Not a critical issue therefore, but I wanted to flag it.

Thanks again for sharing your work!

krijnsent commented 6 years ago

Hi Pi-Rr, probably some invalid characters in the Nonce, I'll have to make sure that you always get "numbers only" (e.g. with Binance I had issue with a space and a dot popping up). Will work on the nonce generator.

Pi-Rr commented 6 years ago

Super, thank you!

yvesbk commented 6 years ago

Hi ! Many thanks for writting this wonderfull code :-)

I have a problem to put an order to Kraken: the call of the method "AddOrder" return the error "EAPI:Invalid nonce", while the method "Balance works fine:

?PrivateKraken("AddOrder", apikey_kraken, secretkey_kraken, "?pair=XETHZEUR?type=sell?ordertype=market?volume=1") {"error":["EAPI:Invalid nonce"]}

?PrivateKraken("Balance", apikey_kraken, secretkey_kraken) {"error":[],"result":{"ZUSD":"0.1795",....

Do I have bad formatted the parameters for the AddOrder ? Or an other issue ?

Thanks in advance !

Yves

yvesbk commented 6 years ago

Tried with & instead of ? and still the same problem:

?pair=XETHZEUR&type=sell&ordertype=limit&price=800&volume=1

yvesbk commented 6 years ago

Found ! ok without a ? a the beginning and with a & at the end:

pair=XETHZEUR&type=sell&ordertype=limit&price=800&volume=1&

krijnsent commented 6 years ago

Hi, I just updated the version with a separate nonce function, hopefully this will solve this issue.

yvesbk commented 6 years ago

Thank you very much !

Pi-Rr commented 6 years ago

Thank you! It seems to be working all right now, I am closing the issue.